diff --git a/.nant/local.include b/.nant/local.include new file mode 100644 index 0000000000..97c0c0fb56 --- /dev/null +++ b/.nant/local.include @@ -0,0 +1,351 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/BUILDING.txt b/BUILDING.txt index 972fe4696c..90a36fbded 100644 --- a/BUILDING.txt +++ b/BUILDING.txt @@ -1,4 +1,4 @@ -=== Building OpenSim === +==== Building OpenSim ==== === Building on Windows === diff --git a/CONTRIBUTORS.txt b/CONTRIBUTORS.txt index 24432446c8..38343a4bbc 100644 --- a/CONTRIBUTORS.txt +++ b/CONTRIBUTORS.txt @@ -167,6 +167,7 @@ This software uses components from the following developers: * GlynnTucker.Cache (http://gtcache.sourceforge.net/) * NDesk.Options 0.2.1 (http://www.ndesk.org/Options) * Json.NET 3.5 Release 6. The binary used is actually Newtonsoft.Json.Net20.dll for Mono 2.4 compatability (http://james.newtonking.com/projects/json-net.aspx) +* zlib.net for C# 1.0.4 (http://www.componentace.com/zlib_.NET.htm) Some plugins are based on Cable Beach Cable Beach is Copyright (c) 2008 Intel Corporation diff --git a/OpenSim/ApplicationPlugins/LoadRegions/LoadRegionsPlugin.cs b/OpenSim/ApplicationPlugins/LoadRegions/LoadRegionsPlugin.cs index 1e85a22c69..b16f46cd6b 100644 --- a/OpenSim/ApplicationPlugins/LoadRegions/LoadRegionsPlugin.cs +++ b/OpenSim/ApplicationPlugins/LoadRegions/LoadRegionsPlugin.cs @@ -122,7 +122,9 @@ namespace OpenSim.ApplicationPlugins.LoadRegions m_log.Debug("[LOADREGIONS]: Creating Region: " + regionsToLoad[i].RegionName + " (ThreadID: " + Thread.CurrentThread.ManagedThreadId.ToString() + ")"); + m_openSim.PopulateRegionEstateInfo(regionsToLoad[i]); m_openSim.CreateRegion(regionsToLoad[i], true, out scene); + regionsToLoad[i].EstateSettings.Save(); if (scene != null) { m_newRegionCreatedHandler = OnNewRegionCreated; diff --git a/OpenSim/ApplicationPlugins/RemoteController/RemoteAdminPlugin.cs b/OpenSim/ApplicationPlugins/RemoteController/RemoteAdminPlugin.cs index e57aaa08f7..c09252a971 100644 --- a/OpenSim/ApplicationPlugins/RemoteController/RemoteAdminPlugin.cs +++ b/OpenSim/ApplicationPlugins/RemoteController/RemoteAdminPlugin.cs @@ -58,12 +58,12 @@ namespace OpenSim.ApplicationPlugins.RemoteController { private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); - private static bool daload = false; - private static Object rslock = new Object(); - private static Object SOLock = new Object(); + private static bool m_defaultAvatarsLoaded = false; + private static Object m_requestLock = new Object(); + private static Object m_saveOarLock = new Object(); - private OpenSimBase m_app; - private IHttpServer m_httpd; + private OpenSimBase m_application; + private IHttpServer m_httpServer; private IConfig m_config; private IConfigSource m_configSource; private string m_requiredPassword = String.Empty; @@ -115,8 +115,10 @@ namespace OpenSim.ApplicationPlugins.RemoteController m_requiredPassword = m_config.GetString("access_password", String.Empty); int port = m_config.GetInt("port", 0); - m_app = openSim; - m_httpd = MainServer.GetHttpServer((uint)port); + m_application = openSim; + string bind_ip_address = m_config.GetString("bind_ip_address", "0.0.0.0"); + IPAddress ipaddr = IPAddress.Parse(bind_ip_address); + m_httpServer = MainServer.GetHttpServer((uint)port,ipaddr); Dictionary availableMethods = new Dictionary(); availableMethods["admin_create_region"] = XmlRpcCreateRegionMethod; @@ -160,14 +162,14 @@ namespace OpenSim.ApplicationPlugins.RemoteController { foreach (string method in availableMethods.Keys) { - m_httpd.AddXmlRPCHandler(method, availableMethods[method], false); + m_httpServer.AddXmlRPCHandler(method, availableMethods[method], false); } } else { foreach (string enabledMethod in enabledMethods.Split('|')) { - m_httpd.AddXmlRPCHandler(enabledMethod, availableMethods[enabledMethod]); + m_httpServer.AddXmlRPCHandler(enabledMethod, availableMethods[enabledMethod]); } } } @@ -180,7 +182,7 @@ namespace OpenSim.ApplicationPlugins.RemoteController public void PostInitialise() { - if (!createDefaultAvatars()) + if (!CreateDefaultAvatars()) { m_log.Info("[RADMIN]: Default avatars not loaded"); } @@ -196,7 +198,7 @@ namespace OpenSim.ApplicationPlugins.RemoteController Hashtable requestData = (Hashtable) request.Params[0]; m_log.Info("[RADMIN]: Request to restart Region."); - checkStringParameters(request, new string[] {"password", "regionID"}); + CheckStringParameters(request, new string[] {"password", "regionID"}); if (m_requiredPassword != String.Empty && (!requestData.Contains("password") || (string) requestData["password"] != m_requiredPassword)) @@ -212,7 +214,7 @@ namespace OpenSim.ApplicationPlugins.RemoteController Scene rebootedScene; - if (!m_app.SceneManager.TryGetScene(regionID, out rebootedScene)) + if (!m_application.SceneManager.TryGetScene(regionID, out rebootedScene)) throw new Exception("region not found"); responseData["rebooting"] = true; @@ -245,7 +247,7 @@ namespace OpenSim.ApplicationPlugins.RemoteController { Hashtable requestData = (Hashtable) request.Params[0]; - checkStringParameters(request, new string[] {"password", "message"}); + CheckStringParameters(request, new string[] {"password", "message"}); if (m_requiredPassword != String.Empty && (!requestData.Contains("password") || (string) requestData["password"] != m_requiredPassword)) @@ -258,7 +260,7 @@ namespace OpenSim.ApplicationPlugins.RemoteController responseData["success"] = true; response.Value = responseData; - m_app.SceneManager.ForEachScene( + m_application.SceneManager.ForEachScene( delegate(Scene scene) { IDialogModule dialogModule = scene.RequestModuleInterface(); @@ -299,7 +301,7 @@ namespace OpenSim.ApplicationPlugins.RemoteController // k, (string)requestData[k], ((string)requestData[k]).Length); // } - checkStringParameters(request, new string[] {"password", "filename", "regionid"}); + CheckStringParameters(request, new string[] {"password", "filename", "regionid"}); if (m_requiredPassword != String.Empty && (!requestData.Contains("password") || (string) requestData["password"] != m_requiredPassword)) @@ -313,7 +315,7 @@ namespace OpenSim.ApplicationPlugins.RemoteController Scene region = null; - if (!m_app.SceneManager.TryGetScene(regionID, out region)) + if (!m_application.SceneManager.TryGetScene(regionID, out region)) throw new Exception("1: unable to get a scene with that name"); ITerrainModule terrainModule = region.RequestModuleInterface(); @@ -387,7 +389,7 @@ namespace OpenSim.ApplicationPlugins.RemoteController message = "Region is going down now."; } - m_app.SceneManager.ForEachScene( + m_application.SceneManager.ForEachScene( delegate(Scene scene) { IDialogModule dialogModule = scene.RequestModuleInterface(); @@ -422,7 +424,7 @@ namespace OpenSim.ApplicationPlugins.RemoteController private void shutdownTimer_Elapsed(object sender, ElapsedEventArgs e) { - m_app.Shutdown(); + m_application.Shutdown(); } /// @@ -444,12 +446,14 @@ namespace OpenSim.ApplicationPlugins.RemoteController /// desired region X coordinate (integer) /// region_y /// desired region Y coordinate (integer) - /// region_master_first - /// firstname of region master - /// region_master_last - /// lastname of region master - /// region_master_uuid - /// explicit UUID to use for master avatar (optional) + /// estate_owner_first + /// firstname of estate owner (formerly region master) + /// (required if new estate is being created, optional otherwise) + /// estate_owner_last + /// lastname of estate owner (formerly region master) + /// (required if new estate is being created, optional otherwise) + /// estate_owner_uuid + /// explicit UUID to use for estate owner (optional) /// listen_ip /// internal IP address (dotted quad) /// listen_port @@ -465,6 +469,12 @@ namespace OpenSim.ApplicationPlugins.RemoteController /// enable_voice /// if true, enable voice on all parcels, /// ('true' or 'false') (optional, default: false) + /// estate_name + /// the name of the estate to join (or to create if it doesn't + /// already exist) + /// region_file + /// The name of the file to persist the region specifications to. + /// If omitted, the region_file_template setting from OpenSim.ini will be used. (optional) /// /// /// XmlRpcCreateRegionMethod returns @@ -489,7 +499,7 @@ namespace OpenSim.ApplicationPlugins.RemoteController XmlRpcResponse response = new XmlRpcResponse(); Hashtable responseData = new Hashtable(); - lock (rslock) + lock (m_requestLock) { int m_regionLimit = m_config.GetInt("region_limit", 0); bool m_enableVoiceForNewRegions = m_config.GetBoolean("create_region_enable_voice", false); @@ -499,22 +509,21 @@ namespace OpenSim.ApplicationPlugins.RemoteController { Hashtable requestData = (Hashtable) request.Params[0]; - checkStringParameters(request, new string[] + CheckStringParameters(request, new string[] { "password", "region_name", - "region_master_first", "region_master_last", - "region_master_password", - "listen_ip", "external_address" + "listen_ip", "external_address", + "estate_name" }); - checkIntegerParams(request, new string[] {"region_x", "region_y", "listen_port"}); + CheckIntegerParams(request, new string[] {"region_x", "region_y", "listen_port"}); // check password if (!String.IsNullOrEmpty(m_requiredPassword) && (string) requestData["password"] != m_requiredPassword) throw new Exception("wrong password"); // check whether we still have space left (iff we are using limits) - if (m_regionLimit != 0 && m_app.SceneManager.Scenes.Count >= m_regionLimit) + if (m_regionLimit != 0 && m_application.SceneManager.Scenes.Count >= m_regionLimit) throw new Exception(String.Format("cannot instantiate new region, server capacity {0} already reached; delete regions first", m_regionLimit)); // extract or generate region ID now @@ -524,7 +533,7 @@ namespace OpenSim.ApplicationPlugins.RemoteController !String.IsNullOrEmpty((string) requestData["region_id"])) { regionID = (UUID) (string) requestData["region_id"]; - if (m_app.SceneManager.TryGetScene(regionID, out scene)) + if (m_application.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, @@ -547,13 +556,13 @@ namespace OpenSim.ApplicationPlugins.RemoteController // check for collisions: region name, region UUID, // region location - if (m_app.SceneManager.TryGetScene(region.RegionName, out scene)) + if (m_application.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)); - if (m_app.SceneManager.TryGetScene(region.RegionLocX, region.RegionLocY, out scene)) + if (m_application.SceneManager.TryGetScene(region.RegionLocX, region.RegionLocY, out scene)) throw new Exception( String.Format("region location <{0},{1}> already in use by region {2}, UUID {3}, <{4},{5}>", region.RegionLocX, region.RegionLocY, @@ -565,7 +574,7 @@ namespace OpenSim.ApplicationPlugins.RemoteController region.InternalEndPoint.Port = Convert.ToInt32(requestData["listen_port"]); if (0 == region.InternalEndPoint.Port) throw new Exception("listen_port is 0"); - if (m_app.SceneManager.TryGetScene(region.InternalEndPoint, out scene)) + if (m_application.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}>", @@ -576,22 +585,10 @@ namespace OpenSim.ApplicationPlugins.RemoteController region.ExternalHostName = (string) requestData["external_address"]; - string masterFirst = (string) requestData["region_master_first"]; - string masterLast = (string) requestData["region_master_last"]; - string masterPassword = (string) requestData["region_master_password"]; - - UUID userID = UUID.Zero; - if (requestData.ContainsKey("region_master_uuid")) - { - // ok, client wants us to use an explicit UUID - // regardless of what the avatar name provided - userID = new UUID((string) requestData["estate_owner_uuid"]); - } - bool persist = Convert.ToBoolean((string) requestData["persist"]); if (persist) { - // default place for region XML files is in the + // default place for region configuration files is in the // Regions directory of the config dir (aka /bin) string regionConfigPath = Path.Combine(Util.configDir(), "Regions"); try @@ -604,49 +601,112 @@ namespace OpenSim.ApplicationPlugins.RemoteController { // No INI setting recorded. } - string regionXmlPath = Path.Combine(regionConfigPath, + + string regionIniPath; + + if (requestData.Contains("region_file")) + { + // Make sure that the file to be created is in a subdirectory of the region storage directory. + string requestedFilePath = Path.Combine(regionConfigPath, (string) requestData["region_file"]); + string requestedDirectory = Path.GetDirectoryName(Path.GetFullPath(requestedFilePath)); + if (requestedDirectory.StartsWith(Path.GetFullPath(regionConfigPath))) + regionIniPath = requestedFilePath; + else + throw new Exception("Invalid location for region file."); + } + else + { + regionIniPath = Path.Combine(regionConfigPath, String.Format( m_config.GetString("region_file_template", - "{0}x{1}-{2}.xml"), + "{0}x{1}-{2}.ini"), region.RegionLocX.ToString(), region.RegionLocY.ToString(), regionID.ToString(), region.InternalEndPoint.Port.ToString(), region.RegionName.Replace(" ", "_").Replace(":", "_"). Replace("/", "_"))); + } + m_log.DebugFormat("[RADMIN] CreateRegion: persisting region {0} to {1}", - region.RegionID, regionXmlPath); - region.SaveRegionToFile("dynamic region", regionXmlPath); + region.RegionID, regionIniPath); + region.SaveRegionToFile("dynamic region", regionIniPath); } else { region.Persistent = false; } + + // Set the estate + + // Check for an existing estate + List estateIDs = m_application.EstateDataService.GetEstates((string) requestData["estate_name"]); + if (estateIDs.Count < 1) + { + UUID userID = UUID.Zero; + if (requestData.ContainsKey("estate_owner_uuid")) + { + // ok, client wants us to use an explicit UUID + // regardless of what the avatar name provided + userID = new UUID((string) requestData["estate_owner_uuid"]); + } + else if (requestData.ContainsKey("estate_owner_first") & requestData.ContainsKey("estate_owner_last")) + { + // We need to look up the UUID for the avatar with the provided name. + string ownerFirst = (string) requestData["estate_owner_first"]; + string ownerLast = (string) requestData["estate_owner_last"]; + + Scene currentOrFirst = m_application.SceneManager.CurrentOrFirstScene; + IUserAccountService accountService = currentOrFirst.UserAccountService; + UserAccount user = accountService.GetUserAccount(currentOrFirst.RegionInfo.ScopeID, + ownerFirst, ownerLast); + userID = user.PrincipalID; + } + else + { + throw new Exception("Estate owner details not provided."); + } + + // Create a new estate with the name provided + region.EstateSettings = m_application.EstateDataService.LoadEstateSettings(region.RegionID, true); + region.EstateSettings.EstateName = (string) requestData["estate_name"]; + region.EstateSettings.EstateOwner = userID; + // Persistence does not seem to effect the need to save a new estate + region.EstateSettings.Save(); + } + else + { + int estateID = estateIDs[0]; + + region.EstateSettings = m_application.EstateDataService.LoadEstateSettings(estateID); + + if (!m_application.EstateDataService.LinkRegion(region.RegionID, estateID)) + throw new Exception("Failed to join estate."); + } + // Create the region and perform any initial initialization - IScene newscene; - m_app.CreateRegion(region, out newscene); + IScene newScene; + m_application.CreateRegion(region, out newScene); // If an access specification was provided, use it. // Otherwise accept the default. - newscene.RegionInfo.EstateSettings.PublicAccess = getBoolean(requestData, "public", m_publicAccess); - newscene.RegionInfo.EstateSettings.EstateOwner = userID; - if (persist) - newscene.RegionInfo.EstateSettings.Save(); + newScene.RegionInfo.EstateSettings.PublicAccess = GetBoolean(requestData, "public", m_publicAccess); + newScene.RegionInfo.EstateSettings.Save(); // enable voice on newly created region if // requested by either the XmlRpc request or the // configuration - if (getBoolean(requestData, "enable_voice", m_enableVoiceForNewRegions)) + if (GetBoolean(requestData, "enable_voice", m_enableVoiceForNewRegions)) { - List parcels = ((Scene)newscene).LandChannel.AllParcels(); + List parcels = ((Scene)newScene).LandChannel.AllParcels(); foreach (ILandObject parcel in parcels) { parcel.LandData.Flags |= (uint) ParcelFlags.AllowVoiceChat; parcel.LandData.Flags |= (uint) ParcelFlags.UseEstateVoiceChan; - ((Scene)newscene).LandChannel.UpdateLandObject(parcel.LandData.LocalID, parcel.LandData); + ((Scene)newScene).LandChannel.UpdateLandObject(parcel.LandData.LocalID, parcel.LandData); } } @@ -704,19 +764,19 @@ namespace OpenSim.ApplicationPlugins.RemoteController XmlRpcResponse response = new XmlRpcResponse(); Hashtable responseData = new Hashtable(); - lock (rslock) + lock (m_requestLock) { try { Hashtable requestData = (Hashtable) request.Params[0]; - checkStringParameters(request, new string[] {"password", "region_name"}); + CheckStringParameters(request, new string[] {"password", "region_name"}); Scene scene = null; string regionName = (string) requestData["region_name"]; - if (!m_app.SceneManager.TryGetScene(regionName, out scene)) + if (!m_application.SceneManager.TryGetScene(regionName, out scene)) throw new Exception(String.Format("region \"{0}\" does not exist", regionName)); - m_app.RemoveRegion(scene, true); + m_application.RemoveRegion(scene, true); responseData["success"] = true; responseData["region_name"] = regionName; @@ -774,22 +834,22 @@ namespace OpenSim.ApplicationPlugins.RemoteController Hashtable responseData = new Hashtable(); Scene scene = null; - lock (rslock) + lock (m_requestLock) { try { Hashtable requestData = (Hashtable) request.Params[0]; - checkStringParameters(request, new string[] {"password"}); + CheckStringParameters(request, new string[] {"password"}); if (requestData.ContainsKey("region_id") && !String.IsNullOrEmpty((string) requestData["region_id"])) { // Region specified by UUID UUID regionID = (UUID) (string) requestData["region_id"]; - if (!m_app.SceneManager.TryGetScene(regionID, out scene)) + if (!m_application.SceneManager.TryGetScene(regionID, out scene)) throw new Exception(String.Format("region \"{0}\" does not exist", regionID)); - m_app.CloseRegion(scene); + m_application.CloseRegion(scene); responseData["success"] = true; responseData["region_id"] = regionID; @@ -802,10 +862,10 @@ namespace OpenSim.ApplicationPlugins.RemoteController // Region specified by name string regionName = (string) requestData["region_name"]; - if (!m_app.SceneManager.TryGetScene(regionName, out scene)) + if (!m_application.SceneManager.TryGetScene(regionName, out scene)) throw new Exception(String.Format("region \"{0}\" does not exist", regionName)); - m_app.CloseRegion(scene); + m_application.CloseRegion(scene); responseData["success"] = true; responseData["region_name"] = regionName; @@ -869,27 +929,27 @@ namespace OpenSim.ApplicationPlugins.RemoteController XmlRpcResponse response = new XmlRpcResponse(); Hashtable responseData = new Hashtable(); - lock (rslock) + lock (m_requestLock) { try { Hashtable requestData = (Hashtable) request.Params[0]; - checkStringParameters(request, new string[] {"password", "region_name"}); + CheckStringParameters(request, new string[] {"password", "region_name"}); Scene scene = null; string regionName = (string) requestData["region_name"]; - if (!m_app.SceneManager.TryGetScene(regionName, out scene)) + if (!m_application.SceneManager.TryGetScene(regionName, out scene)) throw new Exception(String.Format("region \"{0}\" does not exist", regionName)); // Modify access scene.RegionInfo.EstateSettings.PublicAccess = - getBoolean(requestData,"public", scene.RegionInfo.EstateSettings.PublicAccess); + GetBoolean(requestData,"public", scene.RegionInfo.EstateSettings.PublicAccess); if (scene.RegionInfo.Persistent) scene.RegionInfo.EstateSettings.Save(); if (requestData.ContainsKey("enable_voice")) { - bool enableVoice = getBoolean(requestData, "enable_voice", true); + bool enableVoice = GetBoolean(requestData, "enable_voice", true); List parcels = ((Scene)scene).LandChannel.AllParcels(); foreach (ILandObject parcel in parcels) @@ -976,66 +1036,66 @@ namespace OpenSim.ApplicationPlugins.RemoteController XmlRpcResponse response = new XmlRpcResponse(); Hashtable responseData = new Hashtable(); - lock (rslock) + lock (m_requestLock) { try { Hashtable requestData = (Hashtable) request.Params[0]; // check completeness - checkStringParameters(request, new string[] + CheckStringParameters(request, new string[] { "password", "user_firstname", "user_lastname", "user_password", }); - checkIntegerParams(request, new string[] {"start_region_x", "start_region_y"}); + CheckIntegerParams(request, new string[] {"start_region_x", "start_region_y"}); // check password if (!String.IsNullOrEmpty(m_requiredPassword) && (string) requestData["password"] != m_requiredPassword) throw new Exception("wrong password"); // do the job - string firstname = (string) requestData["user_firstname"]; - string lastname = (string) requestData["user_lastname"]; - string passwd = (string) requestData["user_password"]; + string firstName = (string) requestData["user_firstname"]; + string lastName = (string) requestData["user_lastname"]; + string password = (string) requestData["user_password"]; - uint regX = Convert.ToUInt32((Int32) requestData["start_region_x"]); - uint regY = Convert.ToUInt32((Int32) requestData["start_region_y"]); + uint regionXLocation = Convert.ToUInt32((Int32) requestData["start_region_x"]); + uint regionYLocation = Convert.ToUInt32((Int32) requestData["start_region_y"]); string email = ""; // empty string for email if (requestData.Contains("user_email")) email = (string)requestData["user_email"]; - Scene scene = m_app.SceneManager.CurrentOrFirstScene; + Scene scene = m_application.SceneManager.CurrentOrFirstScene; UUID scopeID = scene.RegionInfo.ScopeID; - UserAccount account = CreateUser(scopeID, firstname, lastname, passwd, email); + UserAccount account = CreateUser(scopeID, firstName, lastName, password, email); if (null == account) throw new Exception(String.Format("failed to create new user {0} {1}", - firstname, lastname)); + firstName, lastName)); // Set home position GridRegion home = scene.GridService.GetRegionByPosition(scopeID, - (int)(regX * Constants.RegionSize), (int)(regY * Constants.RegionSize)); + (int)(regionXLocation * Constants.RegionSize), (int)(regionYLocation * Constants.RegionSize)); if (null == home) { - m_log.WarnFormat("[RADMIN]: Unable to set home region for newly created user account {0} {1}", firstname, lastname); + m_log.WarnFormat("[RADMIN]: Unable to set home region for newly created user account {0} {1}", firstName, lastName); } else { scene.GridUserService.SetHome(account.PrincipalID.ToString(), home.RegionID, new Vector3(128, 128, 0), new Vector3(0, 1, 0)); - m_log.DebugFormat("[RADMIN]: Set home region {0} for updated user account {1} {2}", home.RegionID, firstname, lastname); + m_log.DebugFormat("[RADMIN]: Set home region {0} for updated user account {1} {2}", home.RegionID, firstName, lastName); } // Establish the avatar's initial appearance - updateUserAppearance(responseData, requestData, account.PrincipalID); + UpdateUserAppearance(responseData, requestData, account.PrincipalID); responseData["success"] = true; responseData["avatar_uuid"] = account.PrincipalID.ToString(); response.Value = responseData; - m_log.InfoFormat("[RADMIN]: CreateUser: User {0} {1} created, UUID {2}", firstname, lastname, account.PrincipalID); + m_log.InfoFormat("[RADMIN]: CreateUser: User {0} {1} created, UUID {2}", firstName, lastName, account.PrincipalID); } catch (Exception e) { @@ -1099,17 +1159,17 @@ namespace OpenSim.ApplicationPlugins.RemoteController Hashtable requestData = (Hashtable) request.Params[0]; // check completeness - checkStringParameters(request, new string[] {"password", "user_firstname", "user_lastname"}); + CheckStringParameters(request, new string[] {"password", "user_firstname", "user_lastname"}); - string firstname = (string) requestData["user_firstname"]; - string lastname = (string) requestData["user_lastname"]; + string firstName = (string) requestData["user_firstname"]; + string lastName = (string) requestData["user_lastname"]; - responseData["user_firstname"] = firstname; - responseData["user_lastname"] = lastname; + responseData["user_firstname"] = firstName; + responseData["user_lastname"] = lastName; - UUID scopeID = m_app.SceneManager.CurrentOrFirstScene.RegionInfo.ScopeID; + UUID scopeID = m_application.SceneManager.CurrentOrFirstScene.RegionInfo.ScopeID; - UserAccount account = m_app.SceneManager.CurrentOrFirstScene.UserAccountService.GetUserAccount(scopeID, firstname, lastname); + UserAccount account = m_application.SceneManager.CurrentOrFirstScene.UserAccountService.GetUserAccount(scopeID, firstName, lastName); if (null == account) { @@ -1118,9 +1178,9 @@ namespace OpenSim.ApplicationPlugins.RemoteController } else { - GridUserInfo guinfo = m_app.SceneManager.CurrentOrFirstScene.GridUserService.GetGridUserInfo(account.PrincipalID.ToString()); - if (guinfo != null) - responseData["lastlogin"] = guinfo.Login; + GridUserInfo userInfo = m_application.SceneManager.CurrentOrFirstScene.GridUserService.GetGridUserInfo(account.PrincipalID.ToString()); + if (userInfo != null) + responseData["lastlogin"] = userInfo.Login; else responseData["lastlogin"] = 0; @@ -1197,14 +1257,14 @@ namespace OpenSim.ApplicationPlugins.RemoteController XmlRpcResponse response = new XmlRpcResponse(); Hashtable responseData = new Hashtable(); - lock (rslock) + lock (m_requestLock) { try { Hashtable requestData = (Hashtable) request.Params[0]; // check completeness - checkStringParameters(request, new string[] { + CheckStringParameters(request, new string[] { "password", "user_firstname", "user_lastname"}); @@ -1213,12 +1273,12 @@ namespace OpenSim.ApplicationPlugins.RemoteController (string) requestData["password"] != m_requiredPassword) throw new Exception("wrong password"); // do the job - string firstname = (string) requestData["user_firstname"]; - string lastname = (string) requestData["user_lastname"]; + string firstName = (string) requestData["user_firstname"]; + string lastName = (string) requestData["user_lastname"]; - string passwd = String.Empty; - uint? regX = null; - uint? regY = null; + string password = String.Empty; + uint? regionXLocation = null; + uint? regionYLocation = null; // uint? ulaX = null; // uint? ulaY = null; // uint? ulaZ = null; @@ -1228,11 +1288,11 @@ namespace OpenSim.ApplicationPlugins.RemoteController // string aboutFirstLive = String.Empty; // string aboutAvatar = String.Empty; - if (requestData.ContainsKey("user_password")) passwd = (string) requestData["user_password"]; + if (requestData.ContainsKey("user_password")) password = (string) requestData["user_password"]; if (requestData.ContainsKey("start_region_x")) - regX = Convert.ToUInt32((Int32) requestData["start_region_x"]); + regionXLocation = Convert.ToUInt32((Int32) requestData["start_region_x"]); if (requestData.ContainsKey("start_region_y")) - regY = Convert.ToUInt32((Int32) requestData["start_region_y"]); + regionYLocation = Convert.ToUInt32((Int32) requestData["start_region_y"]); // if (requestData.ContainsKey("start_lookat_x")) // ulaX = Convert.ToUInt32((Int32) requestData["start_lookat_x"]); @@ -1252,17 +1312,17 @@ namespace OpenSim.ApplicationPlugins.RemoteController // if (requestData.ContainsKey("about_virtual_world")) // aboutAvatar = (string)requestData["about_virtual_world"]; - Scene scene = m_app.SceneManager.CurrentOrFirstScene; + Scene scene = m_application.SceneManager.CurrentOrFirstScene; UUID scopeID = scene.RegionInfo.ScopeID; - UserAccount account = scene.UserAccountService.GetUserAccount(scopeID, firstname, lastname); + UserAccount account = scene.UserAccountService.GetUserAccount(scopeID, firstName, lastName); if (null == account) - throw new Exception(String.Format("avatar {0} {1} does not exist", firstname, lastname)); + throw new Exception(String.Format("avatar {0} {1} does not exist", firstName, lastName)); - if (!String.IsNullOrEmpty(passwd)) + if (!String.IsNullOrEmpty(password)) { - m_log.DebugFormat("[RADMIN]: UpdateUserAccount: updating password for avatar {0} {1}", firstname, lastname); - ChangeUserPassword(firstname, lastname, passwd); + m_log.DebugFormat("[RADMIN]: UpdateUserAccount: updating password for avatar {0} {1}", firstName, lastName); + ChangeUserPassword(firstName, lastName, password); } // if (null != usaX) userProfile.HomeLocationX = (uint) usaX; @@ -1278,21 +1338,21 @@ namespace OpenSim.ApplicationPlugins.RemoteController // Set home position - if ((null != regX) && (null != regY)) + if ((null != regionXLocation) && (null != regionYLocation)) { GridRegion home = scene.GridService.GetRegionByPosition(scopeID, - (int)(regX * Constants.RegionSize), (int)(regY * Constants.RegionSize)); + (int)(regionXLocation * Constants.RegionSize), (int)(regionYLocation * Constants.RegionSize)); if (null == home) { - m_log.WarnFormat("[RADMIN]: Unable to set home region for updated user account {0} {1}", firstname, lastname); + m_log.WarnFormat("[RADMIN]: Unable to set home region for updated user account {0} {1}", firstName, lastName); } else { scene.GridUserService.SetHome(account.PrincipalID.ToString(), home.RegionID, new Vector3(128, 128, 0), new Vector3(0, 1, 0)); - m_log.DebugFormat("[RADMIN]: Set home region {0} for updated user account {1} {2}", home.RegionID, firstname, lastname); + m_log.DebugFormat("[RADMIN]: Set home region {0} for updated user account {1} {2}", home.RegionID, firstName, lastName); } } // User has been created. Now establish gender and appearance. - updateUserAppearance(responseData, requestData, account.PrincipalID); + UpdateUserAppearance(responseData, requestData, account.PrincipalID); responseData["success"] = true; responseData["avatar_uuid"] = account.PrincipalID.ToString(); @@ -1300,7 +1360,7 @@ namespace OpenSim.ApplicationPlugins.RemoteController response.Value = responseData; m_log.InfoFormat("[RADMIN]: UpdateUserAccount: account for user {0} {1} updated, UUID {2}", - firstname, lastname, + firstName, lastName, account.PrincipalID); } catch (Exception e) @@ -1328,13 +1388,13 @@ namespace OpenSim.ApplicationPlugins.RemoteController /// This should probably get moved into somewhere more core eventually. /// - private void updateUserAppearance(Hashtable responseData, Hashtable requestData, UUID userid) + private void UpdateUserAppearance(Hashtable responseData, Hashtable requestData, UUID userid) { m_log.DebugFormat("[RADMIN] updateUserAppearance"); - string dmale = m_config.GetString("default_male", "Default Male"); - string dfemale = m_config.GetString("default_female", "Default Female"); - string dneut = m_config.GetString("default_female", "Default Default"); + string defaultMale = m_config.GetString("default_male", "Default Male"); + string defaultFemale = m_config.GetString("default_female", "Default Female"); + string defaultNeutral = m_config.GetString("default_female", "Default Default"); string model = String.Empty; // Has a gender preference been supplied? @@ -1345,16 +1405,16 @@ namespace OpenSim.ApplicationPlugins.RemoteController { case "m" : case "male" : - model = dmale; + model = defaultMale; break; case "f" : case "female" : - model = dfemale; + model = defaultFemale; break; case "n" : case "neutral" : default : - model = dneut; + model = defaultNeutral; break; } } @@ -1376,19 +1436,19 @@ namespace OpenSim.ApplicationPlugins.RemoteController m_log.DebugFormat("[RADMIN] Setting appearance for avatar {0}, using model <{1}>", userid, model); - string[] nomens = model.Split(); - if (nomens.Length != 2) + string[] modelSpecifiers = model.Split(); + if (modelSpecifiers.Length != 2) { m_log.WarnFormat("[RADMIN] User appearance not set for {0}. Invalid model name : <{1}>", userid, model); - // nomens = dmodel.Split(); + // modelSpecifiers = dmodel.Split(); return; } - Scene scene = m_app.SceneManager.CurrentOrFirstScene; + Scene scene = m_application.SceneManager.CurrentOrFirstScene; UUID scopeID = scene.RegionInfo.ScopeID; - UserAccount mprof = scene.UserAccountService.GetUserAccount(scopeID, nomens[0], nomens[1]); + UserAccount modelProfile = scene.UserAccountService.GetUserAccount(scopeID, modelSpecifiers[0], modelSpecifiers[1]); - if (mprof == null) + if (modelProfile == null) { m_log.WarnFormat("[RADMIN] Requested model ({0}) not found. Appearance unchanged", model); return; @@ -1398,7 +1458,7 @@ namespace OpenSim.ApplicationPlugins.RemoteController // actual asset ids, however to complete the magic we need to populate the inventory with the // assets in question. - establishAppearance(userid, mprof.PrincipalID); + EstablishAppearance(userid, modelProfile.PrincipalID); m_log.DebugFormat("[RADMIN] Finished setting appearance for avatar {0}, using model {1}", userid, model); @@ -1410,17 +1470,14 @@ namespace OpenSim.ApplicationPlugins.RemoteController /// is known to exist, as is the target avatar. /// - private void establishAppearance(UUID dest, UUID srca) + private void EstablishAppearance(UUID destination, UUID source) { - m_log.DebugFormat("[RADMIN] Initializing inventory for {0} from {1}", dest, srca); - Scene scene = m_app.SceneManager.CurrentOrFirstScene; - AvatarAppearance ava = null; - AvatarData avatar = scene.AvatarService.GetAvatar(srca); - if (avatar != null) - ava = avatar.ToAvatarAppearance(srca); + m_log.DebugFormat("[RADMIN] Initializing inventory for {0} from {1}", destination, source); + Scene scene = m_application.SceneManager.CurrentOrFirstScene; // If the model has no associated appearance we're done. - if (ava == null) + AvatarAppearance avatarAppearance = scene.AvatarService.GetAppearance(source); + if (avatarAppearance == null) return; // Simple appearance copy or copy Clothing and Bodyparts folders? @@ -1431,15 +1488,14 @@ namespace OpenSim.ApplicationPlugins.RemoteController // Simple copy of wearables and appearance update try { - copyWearablesAndAttachments(dest, srca, ava); + CopyWearablesAndAttachments(destination, source, avatarAppearance); - AvatarData adata = new AvatarData(ava); - scene.AvatarService.SetAvatar(dest, adata); + scene.AvatarService.SetAppearance(destination, avatarAppearance); } catch (Exception e) { m_log.WarnFormat("[RADMIN] Error transferring appearance for {0} : {1}", - dest, e.Message); + destination, e.Message); } return; @@ -1448,30 +1504,29 @@ namespace OpenSim.ApplicationPlugins.RemoteController // Copy Clothing and Bodypart folders and appearance update try { - Dictionary imap = new Dictionary(); - copyInventoryFolders(dest, srca, AssetType.Clothing, imap, ava); - copyInventoryFolders(dest, srca, AssetType.Bodypart, imap, ava); + Dictionary inventoryMap = new Dictionary(); + CopyInventoryFolders(destination, source, AssetType.Clothing, inventoryMap, avatarAppearance); + CopyInventoryFolders(destination, source, AssetType.Bodypart, inventoryMap, avatarAppearance); - AvatarWearable[] wearables = ava.Wearables; + AvatarWearable[] wearables = avatarAppearance.Wearables; for (int i=0; i - private void copyWearablesAndAttachments(UUID dest, UUID srca, AvatarAppearance ava) + private void CopyWearablesAndAttachments(UUID destination, UUID source, AvatarAppearance avatarAppearance) { - IInventoryService iserv = m_app.SceneManager.CurrentOrFirstScene.InventoryService; + IInventoryService inventoryService = m_application.SceneManager.CurrentOrFirstScene.InventoryService; // Get Clothing folder of receiver - InventoryFolderBase dstf = iserv.GetFolderForType(dest, AssetType.Clothing); + InventoryFolderBase destinationFolder = inventoryService.GetFolderForType(destination, AssetType.Clothing); - if (dstf == null) + if (destinationFolder == null) throw new Exception("Cannot locate folder(s)"); // Missing destination folder? This should *never* be the case - if (dstf.Type != (short)AssetType.Clothing) + if (destinationFolder.Type != (short)AssetType.Clothing) { - dstf = new InventoryFolderBase(); - dstf.ID = UUID.Random(); - dstf.Name = "Clothing"; - dstf.Owner = dest; - dstf.Type = (short)AssetType.Clothing; - dstf.ParentID = iserv.GetRootFolder(dest).ID; - dstf.Version = 1; - iserv.AddFolder(dstf); // store base record - m_log.ErrorFormat("[RADMIN] Created folder for destination {0}", srca); + destinationFolder = new InventoryFolderBase(); + + destinationFolder.ID = UUID.Random(); + destinationFolder.Name = "Clothing"; + destinationFolder.Owner = destination; + destinationFolder.Type = (short)AssetType.Clothing; + destinationFolder.ParentID = inventoryService.GetRootFolder(destination).ID; + destinationFolder.Version = 1; + inventoryService.AddFolder(destinationFolder); // store base record + m_log.ErrorFormat("[RADMIN] Created folder for destination {0}", source); } // Wearables - AvatarWearable[] wearables = ava.Wearables; + AvatarWearable[] wearables = avatarAppearance.Wearables; AvatarWearable wearable; for (int i=0; i attachments = ava.GetAttachmentDictionary(); + List attachments = avatarAppearance.GetAttachments(); - foreach (KeyValuePair kvp in attachments) + foreach (AvatarAttachment attachment in attachments) { - int attachpoint = kvp.Key; - UUID itemID = kvp.Value[0]; + int attachpoint = attachment.AttachPoint; + UUID itemID = attachment.ItemID; if (itemID != UUID.Zero) { // Get inventory item and copy it - InventoryItemBase item = new InventoryItemBase(itemID, srca); - item = iserv.GetItem(item); + InventoryItemBase item = new InventoryItemBase(itemID, source); + item = inventoryService.GetItem(item); if (item != null) { - InventoryItemBase dsti = new InventoryItemBase(UUID.Random(), dest); - dsti.Name = item.Name; - dsti.Description = item.Description; - dsti.InvType = item.InvType; - dsti.CreatorId = item.CreatorId; - dsti.CreatorIdAsUuid = item.CreatorIdAsUuid; - dsti.NextPermissions = item.NextPermissions; - dsti.CurrentPermissions = item.CurrentPermissions; - dsti.BasePermissions = item.BasePermissions; - dsti.EveryOnePermissions = item.EveryOnePermissions; - dsti.GroupPermissions = item.GroupPermissions; - dsti.AssetType = item.AssetType; - dsti.AssetID = item.AssetID; - dsti.GroupID = item.GroupID; - dsti.GroupOwned = item.GroupOwned; - dsti.SalePrice = item.SalePrice; - dsti.SaleType = item.SaleType; - dsti.Flags = item.Flags; - dsti.CreationDate = item.CreationDate; - dsti.Folder = dstf.ID; + InventoryItemBase destinationItem = new InventoryItemBase(UUID.Random(), destination); + destinationItem.Name = item.Name; + destinationItem.Description = item.Description; + destinationItem.InvType = item.InvType; + destinationItem.CreatorId = item.CreatorId; + destinationItem.CreatorIdAsUuid = item.CreatorIdAsUuid; + destinationItem.CreatorData = item.CreatorData; + destinationItem.NextPermissions = item.NextPermissions; + destinationItem.CurrentPermissions = item.CurrentPermissions; + destinationItem.BasePermissions = item.BasePermissions; + destinationItem.EveryOnePermissions = item.EveryOnePermissions; + destinationItem.GroupPermissions = item.GroupPermissions; + destinationItem.AssetType = item.AssetType; + destinationItem.AssetID = item.AssetID; + destinationItem.GroupID = item.GroupID; + destinationItem.GroupOwned = item.GroupOwned; + destinationItem.SalePrice = item.SalePrice; + destinationItem.SaleType = item.SaleType; + destinationItem.Flags = item.Flags; + destinationItem.CreationDate = item.CreationDate; + destinationItem.Folder = destinationFolder.ID; - iserv.AddItem(dsti); - m_log.DebugFormat("[RADMIN] Added item {0} to folder {1}", dsti.ID, dstf.ID); + m_application.SceneManager.CurrentOrFirstScene.AddInventoryItem(destinationItem); + m_log.DebugFormat("[RADMIN]: Added item {0} to folder {1}", destinationItem.ID, destinationFolder.ID); // Attach item - ava.SetAttachment(attachpoint, dsti.ID, dsti.AssetID); - m_log.DebugFormat("[RADMIN] Attached {0}", dsti.ID); + avatarAppearance.SetAttachment(attachpoint, destinationItem.ID, destinationItem.AssetID); + m_log.DebugFormat("[RADMIN]: Attached {0}", destinationItem.ID); } else { - m_log.WarnFormat("[RADMIN] Error transferring {0} to folder {1}", itemID, dstf.ID); + m_log.WarnFormat("[RADMIN]: Error transferring {0} to folder {1}", itemID, destinationFolder.ID); } } } @@ -1618,101 +1675,102 @@ namespace OpenSim.ApplicationPlugins.RemoteController /// copies of Clothing and Bodyparts inventory folders and attaches worn attachments /// - private void copyInventoryFolders(UUID dest, UUID srca, AssetType assettype, Dictionary imap, - AvatarAppearance ava) + private void CopyInventoryFolders(UUID destination, UUID source, AssetType assetType, Dictionary inventoryMap, + AvatarAppearance avatarAppearance) { - IInventoryService iserv = m_app.SceneManager.CurrentOrFirstScene.InventoryService; + IInventoryService inventoryService = m_application.SceneManager.CurrentOrFirstScene.InventoryService; - InventoryFolderBase srcf = iserv.GetFolderForType(srca, assettype); - InventoryFolderBase dstf = iserv.GetFolderForType(dest, assettype); + InventoryFolderBase sourceFolder = inventoryService.GetFolderForType(source, assetType); + InventoryFolderBase destinationFolder = inventoryService.GetFolderForType(destination, assetType); - if (srcf == null || dstf == null) + if (sourceFolder == null || destinationFolder == null) throw new Exception("Cannot locate folder(s)"); // Missing source folder? This should *never* be the case - if (srcf.Type != (short)assettype) + if (sourceFolder.Type != (short)assetType) { - srcf = new InventoryFolderBase(); - srcf.ID = UUID.Random(); - if (assettype == AssetType.Clothing) { - srcf.Name = "Clothing"; + sourceFolder = new InventoryFolderBase(); + sourceFolder.ID = UUID.Random(); + if (assetType == AssetType.Clothing) { + sourceFolder.Name = "Clothing"; } else { - srcf.Name = "Body Parts"; + sourceFolder.Name = "Body Parts"; } - srcf.Owner = srca; - srcf.Type = (short)assettype; - srcf.ParentID = iserv.GetRootFolder(srca).ID; - srcf.Version = 1; - iserv.AddFolder(srcf); // store base record - m_log.ErrorFormat("[RADMIN] Created folder for source {0}", srca); + sourceFolder.Owner = source; + sourceFolder.Type = (short)assetType; + sourceFolder.ParentID = inventoryService.GetRootFolder(source).ID; + sourceFolder.Version = 1; + inventoryService.AddFolder(sourceFolder); // store base record + m_log.ErrorFormat("[RADMIN] Created folder for source {0}", source); } // Missing destination folder? This should *never* be the case - if (dstf.Type != (short)assettype) + if (destinationFolder.Type != (short)assetType) { - dstf = new InventoryFolderBase(); - dstf.ID = UUID.Random(); - dstf.Name = assettype.ToString(); - dstf.Owner = dest; - dstf.Type = (short)assettype; - dstf.ParentID = iserv.GetRootFolder(dest).ID; - dstf.Version = 1; - iserv.AddFolder(dstf); // store base record - m_log.ErrorFormat("[RADMIN] Created folder for destination {0}", srca); + destinationFolder = new InventoryFolderBase(); + destinationFolder.ID = UUID.Random(); + destinationFolder.Name = assetType.ToString(); + destinationFolder.Owner = destination; + destinationFolder.Type = (short)assetType; + destinationFolder.ParentID = inventoryService.GetRootFolder(destination).ID; + destinationFolder.Version = 1; + inventoryService.AddFolder(destinationFolder); // store base record + m_log.ErrorFormat("[RADMIN] Created folder for destination {0}", source); } - InventoryFolderBase efolder; - List folders = iserv.GetFolderContent(srca, srcf.ID).Folders; + InventoryFolderBase extraFolder; + List folders = inventoryService.GetFolderContent(source, sourceFolder.ID).Folders; foreach (InventoryFolderBase folder in folders) { - efolder = new InventoryFolderBase(); - efolder.ID = UUID.Random(); - efolder.Name = folder.Name; - efolder.Owner = dest; - efolder.Type = folder.Type; - efolder.Version = folder.Version; - efolder.ParentID = dstf.ID; - iserv.AddFolder(efolder); + extraFolder = new InventoryFolderBase(); + extraFolder.ID = UUID.Random(); + extraFolder.Name = folder.Name; + extraFolder.Owner = destination; + extraFolder.Type = folder.Type; + extraFolder.Version = folder.Version; + extraFolder.ParentID = destinationFolder.ID; + inventoryService.AddFolder(extraFolder); - m_log.DebugFormat("[RADMIN] Added folder {0} to folder {1}", efolder.ID, srcf.ID); + m_log.DebugFormat("[RADMIN] Added folder {0} to folder {1}", extraFolder.ID, sourceFolder.ID); - List items = iserv.GetFolderContent(srca, folder.ID).Items; + List items = inventoryService.GetFolderContent(source, folder.ID).Items; foreach (InventoryItemBase item in items) { - InventoryItemBase dsti = new InventoryItemBase(UUID.Random(), dest); - dsti.Name = item.Name; - dsti.Description = item.Description; - dsti.InvType = item.InvType; - dsti.CreatorId = item.CreatorId; - dsti.CreatorIdAsUuid = item.CreatorIdAsUuid; - dsti.NextPermissions = item.NextPermissions; - dsti.CurrentPermissions = item.CurrentPermissions; - dsti.BasePermissions = item.BasePermissions; - dsti.EveryOnePermissions = item.EveryOnePermissions; - dsti.GroupPermissions = item.GroupPermissions; - dsti.AssetType = item.AssetType; - dsti.AssetID = item.AssetID; - dsti.GroupID = item.GroupID; - dsti.GroupOwned = item.GroupOwned; - dsti.SalePrice = item.SalePrice; - dsti.SaleType = item.SaleType; - dsti.Flags = item.Flags; - dsti.CreationDate = item.CreationDate; - dsti.Folder = efolder.ID; + InventoryItemBase destinationItem = new InventoryItemBase(UUID.Random(), destination); + destinationItem.Name = item.Name; + destinationItem.Description = item.Description; + destinationItem.InvType = item.InvType; + destinationItem.CreatorId = item.CreatorId; + destinationItem.CreatorIdAsUuid = item.CreatorIdAsUuid; + destinationItem.CreatorData = item.CreatorData; + destinationItem.NextPermissions = item.NextPermissions; + destinationItem.CurrentPermissions = item.CurrentPermissions; + destinationItem.BasePermissions = item.BasePermissions; + destinationItem.EveryOnePermissions = item.EveryOnePermissions; + destinationItem.GroupPermissions = item.GroupPermissions; + destinationItem.AssetType = item.AssetType; + destinationItem.AssetID = item.AssetID; + destinationItem.GroupID = item.GroupID; + destinationItem.GroupOwned = item.GroupOwned; + destinationItem.SalePrice = item.SalePrice; + destinationItem.SaleType = item.SaleType; + destinationItem.Flags = item.Flags; + destinationItem.CreationDate = item.CreationDate; + destinationItem.Folder = extraFolder.ID; - iserv.AddItem(dsti); - imap.Add(item.ID, dsti.ID); - m_log.DebugFormat("[RADMIN] Added item {0} to folder {1}", dsti.ID, efolder.ID); + m_application.SceneManager.CurrentOrFirstScene.AddInventoryItem(destinationItem); + inventoryMap.Add(item.ID, destinationItem.ID); + m_log.DebugFormat("[RADMIN]: Added item {0} to folder {1}", destinationItem.ID, extraFolder.ID); // Attach item, if original is attached - int attachpoint = ava.GetAttachpoint(item.ID); + int attachpoint = avatarAppearance.GetAttachpoint(item.ID); if (attachpoint != 0) { - ava.SetAttachment(attachpoint, dsti.ID, dsti.AssetID); - m_log.DebugFormat("[RADMIN] Attached {0}", dsti.ID); + avatarAppearance.SetAttachment(attachpoint, destinationItem.ID, destinationItem.AssetID); + m_log.DebugFormat("[RADMIN]: Attached {0}", destinationItem.ID); } } } @@ -1728,63 +1786,62 @@ namespace OpenSim.ApplicationPlugins.RemoteController /// other outfits are provided to allow "real" avatars a way to easily change their outfits. /// - private bool createDefaultAvatars() + private bool CreateDefaultAvatars() { // Only load once - - if (daload) + if (m_defaultAvatarsLoaded) { return false; } m_log.DebugFormat("[RADMIN] Creating default avatar entries"); - daload = true; + m_defaultAvatarsLoaded = true; // Load processing starts here... try { - string dafn = null; + string defaultAppearanceFileName = null; //m_config may be null if RemoteAdmin configuration secition is missing or disabled in OpenSim.ini if (m_config != null) { - dafn = m_config.GetString("default_appearance", "default_appearance.xml"); + defaultAppearanceFileName = m_config.GetString("default_appearance", "default_appearance.xml"); } - if (File.Exists(dafn)) + if (File.Exists(defaultAppearanceFileName)) { XmlDocument doc = new XmlDocument(); string name = "*unknown*"; string email = "anon@anon"; - uint regX = 1000; - uint regY = 1000; - string passwd = UUID.Random().ToString(); // No requirement to sign-in. + uint regionXLocation = 1000; + uint regionYLocation = 1000; + string password = UUID.Random().ToString(); // No requirement to sign-in. UUID ID = UUID.Zero; - AvatarAppearance mava; + AvatarAppearance avatarAppearance; XmlNodeList avatars; XmlNodeList assets; XmlNode perms = null; bool include = false; bool select = false; - Scene scene = m_app.SceneManager.CurrentOrFirstScene; - IInventoryService iserv = scene.InventoryService; - IAssetService aserv = scene.AssetService; + Scene scene = m_application.SceneManager.CurrentOrFirstScene; + IInventoryService inventoryService = scene.InventoryService; + IAssetService assetService = scene.AssetService; - doc.LoadXml(File.ReadAllText(dafn)); + doc.LoadXml(File.ReadAllText(defaultAppearanceFileName)); // Load up any included assets. Duplicates will be ignored assets = doc.GetElementsByTagName("RequiredAsset"); - foreach (XmlNode asset in assets) + foreach (XmlNode assetNode in assets) { - AssetBase rass = new AssetBase(UUID.Random(), GetStringAttribute(asset, "name", ""), SByte.Parse(GetStringAttribute(asset, "type", "")), UUID.Zero.ToString()); - rass.Description = GetStringAttribute(asset,"desc",""); - rass.Local = Boolean.Parse(GetStringAttribute(asset,"local","")); - rass.Temporary = Boolean.Parse(GetStringAttribute(asset,"temporary","")); - rass.Data = Convert.FromBase64String(asset.InnerText); - aserv.Store(rass); + AssetBase asset = new AssetBase(UUID.Random(), GetStringAttribute(assetNode, "name", ""), SByte.Parse(GetStringAttribute(assetNode, "type", "")), UUID.Zero.ToString()); + asset.Description = GetStringAttribute(assetNode,"desc",""); + asset.Local = Boolean.Parse(GetStringAttribute(assetNode,"local","")); + asset.Temporary = Boolean.Parse(GetStringAttribute(assetNode,"temporary","")); + asset.Data = Convert.FromBase64String(assetNode.InnerText); + assetService.Store(asset); } avatars = doc.GetElementsByTagName("Avatar"); @@ -1803,19 +1860,19 @@ namespace OpenSim.ApplicationPlugins.RemoteController // Only the name value is mandatory name = GetStringAttribute(avatar,"name",name); email = GetStringAttribute(avatar,"email",email); - regX = GetUnsignedAttribute(avatar,"regx",regX); - regY = GetUnsignedAttribute(avatar,"regy",regY); - passwd = GetStringAttribute(avatar,"password",passwd); + regionXLocation = GetUnsignedAttribute(avatar,"regx",regionXLocation); + regionYLocation = GetUnsignedAttribute(avatar,"regy",regionYLocation); + password = GetStringAttribute(avatar,"password",password); - string[] nomens = name.Split(); + string[] names = name.Split(); UUID scopeID = scene.RegionInfo.ScopeID; - UserAccount account = scene.UserAccountService.GetUserAccount(scopeID, nomens[0], nomens[1]); + UserAccount account = scene.UserAccountService.GetUserAccount(scopeID, names[0], names[1]); if (null == account) { - account = CreateUser(scopeID, nomens[0], nomens[1], passwd, email); + account = CreateUser(scopeID, names[0], names[1], password, email); if (null == account) { - m_log.ErrorFormat("[RADMIN] Avatar {0} {1} was not created", nomens[0], nomens[1]); + m_log.ErrorFormat("[RADMIN] Avatar {0} {1} was not created", names[0], names[1]); return false; } } @@ -1823,12 +1880,12 @@ namespace OpenSim.ApplicationPlugins.RemoteController // Set home position GridRegion home = scene.GridService.GetRegionByPosition(scopeID, - (int)(regX * Constants.RegionSize), (int)(regY * Constants.RegionSize)); + (int)(regionXLocation * Constants.RegionSize), (int)(regionYLocation * Constants.RegionSize)); if (null == home) { - m_log.WarnFormat("[RADMIN]: Unable to set home region for newly created user account {0} {1}", nomens[0], nomens[1]); + m_log.WarnFormat("[RADMIN]: Unable to set home region for newly created user account {0} {1}", names[0], names[1]); } else { scene.GridUserService.SetHome(account.PrincipalID.ToString(), home.RegionID, new Vector3(128, 128, 0), new Vector3(0, 1, 0)); - m_log.DebugFormat("[RADMIN]: Set home region {0} for updated user account {1} {2}", home.RegionID, nomens[0], nomens[1]); + m_log.DebugFormat("[RADMIN]: Set home region {0} for updated user account {1} {2}", home.RegionID, names[0], names[1]); } ID = account.PrincipalID; @@ -1850,13 +1907,11 @@ namespace OpenSim.ApplicationPlugins.RemoteController if (include) { // Setup for appearance processing - AvatarData adata = scene.AvatarService.GetAvatar(ID); - if (adata != null) - mava = adata.ToAvatarAppearance(ID); - else - mava = new AvatarAppearance(); + avatarAppearance = scene.AvatarService.GetAppearance(ID); + if (avatarAppearance == null) + avatarAppearance = new AvatarAppearance(); - AvatarWearable[] wearables = mava.Wearables; + AvatarWearable[] wearables = avatarAppearance.Wearables; for (int i=0; i folders = iserv.GetFolderContent(ID, cfolder.ID).Folders; - efolder = null; + List folders = inventoryService.GetFolderContent(ID, clothingFolder.ID).Folders; + extraFolder = null; foreach (InventoryFolderBase folder in folders) { - if (folder.Name == oname) + if (folder.Name == outfitName) { - efolder = folder; + extraFolder = folder; break; } } // Otherwise, we must create the folder. - if (efolder == null) + if (extraFolder == null) { - m_log.DebugFormat("[RADMIN] Creating outfit folder {0} for {1}", oname, name); - efolder = new InventoryFolderBase(); - efolder.ID = UUID.Random(); - efolder.Name = oname; - efolder.Owner = ID; - efolder.Type = (short)AssetType.Clothing; - efolder.Version = 1; - efolder.ParentID = cfolder.ID; - iserv.AddFolder(efolder); - m_log.DebugFormat("[RADMIN] Adding outfile folder {0} to folder {1}", efolder.ID, cfolder.ID); + m_log.DebugFormat("[RADMIN] Creating outfit folder {0} for {1}", outfitName, name); + extraFolder = new InventoryFolderBase(); + extraFolder.ID = UUID.Random(); + extraFolder.Name = outfitName; + extraFolder.Owner = ID; + extraFolder.Type = (short)AssetType.Clothing; + extraFolder.Version = 1; + extraFolder.ParentID = clothingFolder.ID; + inventoryService.AddFolder(extraFolder); + m_log.DebugFormat("[RADMIN] Adding outfile folder {0} to folder {1}", extraFolder.ID, clothingFolder.ID); } // Now get the pieces that make up the outfit @@ -1950,55 +2005,56 @@ namespace OpenSim.ApplicationPlugins.RemoteController } } - InventoryItemBase iitem = null; + InventoryItemBase inventoryItem = null; // Check if asset is in inventory already - iitem = null; - List iitems = iserv.GetFolderContent(ID, efolder.ID).Items; + inventoryItem = null; + List inventoryItems = inventoryService.GetFolderContent(ID, extraFolder.ID).Items; - foreach (InventoryItemBase litem in iitems) + foreach (InventoryItemBase listItem in inventoryItems) { - if (litem.AssetID == assetid) + if (listItem.AssetID == assetid) { - iitem = litem; + inventoryItem = listItem; break; } } // Create inventory item - if (iitem == null) + if (inventoryItem == null) { - iitem = new InventoryItemBase(UUID.Random(), ID); - iitem.Name = GetStringAttribute(item,"name",""); - iitem.Description = GetStringAttribute(item,"desc",""); - iitem.InvType = GetIntegerAttribute(item,"invtype",-1); - iitem.CreatorId = GetStringAttribute(item,"creatorid",""); - iitem.CreatorIdAsUuid = (UUID)GetStringAttribute(item,"creatoruuid",""); - iitem.NextPermissions = GetUnsignedAttribute(perms,"next",0x7fffffff); - iitem.CurrentPermissions = GetUnsignedAttribute(perms,"current",0x7fffffff); - iitem.BasePermissions = GetUnsignedAttribute(perms,"base",0x7fffffff); - iitem.EveryOnePermissions = GetUnsignedAttribute(perms,"everyone",0x7fffffff); - iitem.GroupPermissions = GetUnsignedAttribute(perms,"group",0x7fffffff); - iitem.AssetType = GetIntegerAttribute(item,"assettype",-1); - iitem.AssetID = assetid; // associated asset - iitem.GroupID = (UUID)GetStringAttribute(item,"groupid",""); - iitem.GroupOwned = (GetStringAttribute(item,"groupowned","false") == "true"); - iitem.SalePrice = GetIntegerAttribute(item,"saleprice",0); - iitem.SaleType = (byte)GetIntegerAttribute(item,"saletype",0); - iitem.Flags = GetUnsignedAttribute(item,"flags",0); - iitem.CreationDate = GetIntegerAttribute(item,"creationdate",Util.UnixTimeSinceEpoch()); - iitem.Folder = efolder.ID; // Parent folder + inventoryItem = new InventoryItemBase(UUID.Random(), ID); + inventoryItem.Name = GetStringAttribute(item,"name",""); + inventoryItem.Description = GetStringAttribute(item,"desc",""); + inventoryItem.InvType = GetIntegerAttribute(item,"invtype",-1); + inventoryItem.CreatorId = GetStringAttribute(item,"creatorid",""); + inventoryItem.CreatorIdAsUuid = (UUID)GetStringAttribute(item,"creatoruuid",""); + inventoryItem.CreatorData = GetStringAttribute(item, "creatordata", ""); + inventoryItem.NextPermissions = GetUnsignedAttribute(perms, "next", 0x7fffffff); + inventoryItem.CurrentPermissions = GetUnsignedAttribute(perms,"current",0x7fffffff); + inventoryItem.BasePermissions = GetUnsignedAttribute(perms,"base",0x7fffffff); + inventoryItem.EveryOnePermissions = GetUnsignedAttribute(perms,"everyone",0x7fffffff); + inventoryItem.GroupPermissions = GetUnsignedAttribute(perms,"group",0x7fffffff); + inventoryItem.AssetType = GetIntegerAttribute(item,"assettype",-1); + inventoryItem.AssetID = assetid; // associated asset + inventoryItem.GroupID = (UUID)GetStringAttribute(item,"groupid",""); + inventoryItem.GroupOwned = (GetStringAttribute(item,"groupowned","false") == "true"); + inventoryItem.SalePrice = GetIntegerAttribute(item,"saleprice",0); + inventoryItem.SaleType = (byte)GetIntegerAttribute(item,"saletype",0); + inventoryItem.Flags = GetUnsignedAttribute(item,"flags",0); + inventoryItem.CreationDate = GetIntegerAttribute(item,"creationdate",Util.UnixTimeSinceEpoch()); + inventoryItem.Folder = extraFolder.ID; // Parent folder - iserv.AddItem(iitem); - m_log.DebugFormat("[RADMIN] Added item {0} to folder {1}", iitem.ID, efolder.ID); + m_application.SceneManager.CurrentOrFirstScene.AddInventoryItem(inventoryItem); + m_log.DebugFormat("[RADMIN] Added item {0} to folder {1}", inventoryItem.ID, extraFolder.ID); } // Attach item, if attachpoint is specified int attachpoint = GetIntegerAttribute(item,"attachpoint",0); if (attachpoint != 0) { - mava.SetAttachment(attachpoint, iitem.ID, iitem.AssetID); - m_log.DebugFormat("[RADMIN] Attached {0}", iitem.ID); + avatarAppearance.SetAttachment(attachpoint, inventoryItem.ID, inventoryItem.AssetID); + m_log.DebugFormat("[RADMIN] Attached {0}", inventoryItem.ID); } // Record whether or not the item is to be initially worn @@ -2006,20 +2062,18 @@ namespace OpenSim.ApplicationPlugins.RemoteController { if (select && (GetStringAttribute(item, "wear", "false") == "true")) { - mava.Wearables[iitem.Flags].ItemID = iitem.ID; - mava.Wearables[iitem.Flags].AssetID = iitem.AssetID; + avatarAppearance.Wearables[inventoryItem.Flags].Wear(inventoryItem.ID, inventoryItem.AssetID); } } catch (Exception e) { - m_log.WarnFormat("[RADMIN] Error wearing item {0} : {1}", iitem.ID, e.Message); + m_log.WarnFormat("[RADMIN] Error wearing item {0} : {1}", inventoryItem.ID, e.Message); } } // foreach item in outfit - m_log.DebugFormat("[RADMIN] Outfit {0} load completed", oname); + m_log.DebugFormat("[RADMIN] Outfit {0} load completed", outfitName); } // foreach outfit m_log.DebugFormat("[RADMIN] Inventory update complete for {0}", name); - AvatarData adata2 = new AvatarData(mava); - scene.AvatarService.SetAvatar(ID, adata2); + scene.AvatarService.SetAppearance(ID, avatarAppearance); } catch (Exception e) { @@ -2086,19 +2140,19 @@ namespace OpenSim.ApplicationPlugins.RemoteController XmlRpcResponse response = new XmlRpcResponse(); Hashtable responseData = new Hashtable(); - lock (rslock) + lock (m_requestLock) { try { Hashtable requestData = (Hashtable) request.Params[0]; // check completeness - foreach (string p in new string[] {"password", "filename"}) + foreach (string parameter in new string[] {"password", "filename"}) { - 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")); + if (!requestData.Contains(parameter)) + throw new Exception(String.Format("missing parameter {0}", parameter)); + if (String.IsNullOrEmpty((string) requestData[parameter])) + throw new Exception(String.Format("parameter {0} is empty", parameter)); } // check password @@ -2110,13 +2164,13 @@ namespace OpenSim.ApplicationPlugins.RemoteController if (requestData.Contains("region_uuid")) { UUID region_uuid = (UUID) (string) requestData["region_uuid"]; - if (!m_app.SceneManager.TryGetScene(region_uuid, out scene)) + if (!m_application.SceneManager.TryGetScene(region_uuid, out scene)) throw new Exception(String.Format("failed to switch to region {0}", region_uuid.ToString())); } else if (requestData.Contains("region_name")) { string region_name = (string) requestData["region_name"]; - if (!m_app.SceneManager.TryGetScene(region_name, out scene)) + if (!m_application.SceneManager.TryGetScene(region_name, out scene)) throw new Exception(String.Format("failed to switch to region {0}", region_name)); } else throw new Exception("neither region_name nor region_uuid given"); @@ -2210,13 +2264,13 @@ namespace OpenSim.ApplicationPlugins.RemoteController if (requestData.Contains("region_uuid")) { UUID region_uuid = (UUID) (string) requestData["region_uuid"]; - if (!m_app.SceneManager.TryGetScene(region_uuid, out scene)) + if (!m_application.SceneManager.TryGetScene(region_uuid, out scene)) throw new Exception(String.Format("failed to switch to region {0}", region_uuid.ToString())); } else if (requestData.Contains("region_name")) { string region_name = (string) requestData["region_name"]; - if (!m_app.SceneManager.TryGetScene(region_name, out scene)) + if (!m_application.SceneManager.TryGetScene(region_name, out scene)) throw new Exception(String.Format("failed to switch to region {0}", region_name)); } else throw new Exception("neither region_name nor region_uuid given"); @@ -2226,8 +2280,8 @@ namespace OpenSim.ApplicationPlugins.RemoteController if (archiver != null) { scene.EventManager.OnOarFileSaved += RemoteAdminOarSaveCompleted; - archiver.ArchiveRegion(filename); - lock (SOLock) Monitor.Wait(SOLock,5000); + archiver.ArchiveRegion(filename, new Dictionary()); + lock (m_saveOarLock) Monitor.Wait(m_saveOarLock,5000); scene.EventManager.OnOarFileSaved -= RemoteAdminOarSaveCompleted; } else @@ -2255,7 +2309,7 @@ namespace OpenSim.ApplicationPlugins.RemoteController private void RemoteAdminOarSaveCompleted(Guid uuid, string name) { m_log.DebugFormat("[RADMIN] File processing complete for {0}", name); - lock (SOLock) Monitor.Pulse(SOLock); + lock (m_saveOarLock) Monitor.Pulse(m_saveOarLock); } public XmlRpcResponse XmlRpcLoadXMLMethod(XmlRpcRequest request, IPEndPoint remoteClient) @@ -2267,7 +2321,7 @@ namespace OpenSim.ApplicationPlugins.RemoteController XmlRpcResponse response = new XmlRpcResponse(); Hashtable responseData = new Hashtable(); - lock (rslock) + lock (m_requestLock) { try { @@ -2290,14 +2344,14 @@ namespace OpenSim.ApplicationPlugins.RemoteController if (requestData.Contains("region_uuid")) { UUID region_uuid = (UUID) (string) requestData["region_uuid"]; - if (!m_app.SceneManager.TrySetCurrentScene(region_uuid)) + if (!m_application.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_application.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); } @@ -2314,11 +2368,11 @@ namespace OpenSim.ApplicationPlugins.RemoteController switch (xml_version) { case "1": - m_app.SceneManager.LoadCurrentSceneFromXml(filename, true, new Vector3(0, 0, 0)); + m_application.SceneManager.LoadCurrentSceneFromXml(filename, true, new Vector3(0, 0, 0)); break; case "2": - m_app.SceneManager.LoadCurrentSceneFromXml2(filename); + m_application.SceneManager.LoadCurrentSceneFromXml2(filename); break; default: @@ -2375,14 +2429,14 @@ namespace OpenSim.ApplicationPlugins.RemoteController if (requestData.Contains("region_uuid")) { UUID region_uuid = (UUID) (string) requestData["region_uuid"]; - if (!m_app.SceneManager.TrySetCurrentScene(region_uuid)) + if (!m_application.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_application.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); } @@ -2399,11 +2453,11 @@ namespace OpenSim.ApplicationPlugins.RemoteController switch (xml_version) { case "1": - m_app.SceneManager.SaveCurrentSceneToXml(filename); + m_application.SceneManager.SaveCurrentSceneToXml(filename); break; case "2": - m_app.SceneManager.SaveCurrentSceneToXml2(filename); + m_application.SceneManager.SaveCurrentSceneToXml2(filename); break; default: @@ -2454,21 +2508,21 @@ namespace OpenSim.ApplicationPlugins.RemoteController if (requestData.Contains("region_uuid")) { UUID region_uuid = (UUID) (string) requestData["region_uuid"]; - if (!m_app.SceneManager.TrySetCurrentScene(region_uuid)) + if (!m_application.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_application.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); } else throw new Exception("neither region_name nor region_uuid given"); - Scene s = m_app.SceneManager.CurrentScene; - int health = s.GetHealth(); + Scene scene = m_application.SceneManager.CurrentScene; + int health = scene.GetHealth(); responseData["health"] = health; response.Value = responseData; @@ -2551,23 +2605,23 @@ namespace OpenSim.ApplicationPlugins.RemoteController if (requestData.Contains("region_uuid")) { UUID region_uuid = (UUID) (string) requestData["region_uuid"]; - if (!m_app.SceneManager.TrySetCurrentScene(region_uuid)) + if (!m_application.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_application.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); } else throw new Exception("neither region_name nor region_uuid given"); - Scene s = m_app.SceneManager.CurrentScene; - s.RegionInfo.EstateSettings.EstateAccess = new UUID[]{}; - if (s.RegionInfo.Persistent) - s.RegionInfo.EstateSettings.Save(); + Scene scene = m_application.SceneManager.CurrentScene; + scene.RegionInfo.EstateSettings.EstateAccess = new UUID[]{}; + if (scene.RegionInfo.Persistent) + scene.RegionInfo.EstateSettings.Save(); } catch (Exception e) { @@ -2608,26 +2662,26 @@ namespace OpenSim.ApplicationPlugins.RemoteController if (requestData.Contains("region_uuid")) { UUID region_uuid = (UUID) (string) requestData["region_uuid"]; - if (!m_app.SceneManager.TrySetCurrentScene(region_uuid)) + if (!m_application.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_application.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); } else throw new Exception("neither region_name nor region_uuid given"); - int addk = 0; + int addedUsers = 0; if (requestData.Contains("users")) { - UUID scopeID = m_app.SceneManager.CurrentOrFirstScene.RegionInfo.ScopeID; - IUserAccountService userService = m_app.SceneManager.CurrentOrFirstScene.UserAccountService; - Scene s = m_app.SceneManager.CurrentScene; + UUID scopeID = m_application.SceneManager.CurrentOrFirstScene.RegionInfo.ScopeID; + IUserAccountService userService = m_application.SceneManager.CurrentOrFirstScene.UserAccountService; + Scene scene = m_application.SceneManager.CurrentScene; Hashtable users = (Hashtable) requestData["users"]; List uuids = new List(); foreach (string name in users.Values) @@ -2637,24 +2691,24 @@ namespace OpenSim.ApplicationPlugins.RemoteController if (account != null) { uuids.Add(account.PrincipalID); - m_log.DebugFormat("[RADMIN] adding \"{0}\" to ACL for \"{1}\"", name, s.RegionInfo.RegionName); + m_log.DebugFormat("[RADMIN] adding \"{0}\" to ACL for \"{1}\"", name, scene.RegionInfo.RegionName); } } - List acl = new List(s.RegionInfo.EstateSettings.EstateAccess); + List accessControlList = new List(scene.RegionInfo.EstateSettings.EstateAccess); foreach (UUID uuid in uuids) { - if (!acl.Contains(uuid)) + if (!accessControlList.Contains(uuid)) { - acl.Add(uuid); - addk++; + accessControlList.Add(uuid); + addedUsers++; } } - s.RegionInfo.EstateSettings.EstateAccess = acl.ToArray(); - if (s.RegionInfo.Persistent) - s.RegionInfo.EstateSettings.Save(); + scene.RegionInfo.EstateSettings.EstateAccess = accessControlList.ToArray(); + if (scene.RegionInfo.Persistent) + scene.RegionInfo.EstateSettings.Save(); } - responseData["added"] = addk; + responseData["added"] = addedUsers; } catch (Exception e) { @@ -2695,27 +2749,27 @@ namespace OpenSim.ApplicationPlugins.RemoteController if (requestData.Contains("region_uuid")) { UUID region_uuid = (UUID) (string) requestData["region_uuid"]; - if (!m_app.SceneManager.TrySetCurrentScene(region_uuid)) + if (!m_application.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_application.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); } else throw new Exception("neither region_name nor region_uuid given"); - int remk = 0; + int removedUsers = 0; if (requestData.Contains("users")) { - UUID scopeID = m_app.SceneManager.CurrentOrFirstScene.RegionInfo.ScopeID; - IUserAccountService userService = m_app.SceneManager.CurrentOrFirstScene.UserAccountService; - //UserProfileCacheService ups = m_app.CommunicationsManager.UserProfileCacheService; - Scene s = m_app.SceneManager.CurrentScene; + UUID scopeID = m_application.SceneManager.CurrentOrFirstScene.RegionInfo.ScopeID; + IUserAccountService userService = m_application.SceneManager.CurrentOrFirstScene.UserAccountService; + //UserProfileCacheService ups = m_application.CommunicationsManager.UserProfileCacheService; + Scene scene = m_application.SceneManager.CurrentScene; Hashtable users = (Hashtable) requestData["users"]; List uuids = new List(); foreach (string name in users.Values) @@ -2727,21 +2781,21 @@ namespace OpenSim.ApplicationPlugins.RemoteController uuids.Add(account.PrincipalID); } } - List acl = new List(s.RegionInfo.EstateSettings.EstateAccess); + List accessControlList = new List(scene.RegionInfo.EstateSettings.EstateAccess); foreach (UUID uuid in uuids) { - if (acl.Contains(uuid)) + if (accessControlList.Contains(uuid)) { - acl.Remove(uuid); - remk++; + accessControlList.Remove(uuid); + removedUsers++; } } - s.RegionInfo.EstateSettings.EstateAccess = acl.ToArray(); - if (s.RegionInfo.Persistent) - s.RegionInfo.EstateSettings.Save(); + scene.RegionInfo.EstateSettings.EstateAccess = accessControlList.ToArray(); + if (scene.RegionInfo.Persistent) + scene.RegionInfo.EstateSettings.Save(); } - responseData["removed"] = remk; + responseData["removed"] = removedUsers; } catch (Exception e) { @@ -2782,27 +2836,27 @@ namespace OpenSim.ApplicationPlugins.RemoteController if (requestData.Contains("region_uuid")) { UUID region_uuid = (UUID) (string) requestData["region_uuid"]; - if (!m_app.SceneManager.TrySetCurrentScene(region_uuid)) + if (!m_application.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_application.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); } else throw new Exception("neither region_name nor region_uuid given"); - Scene s = m_app.SceneManager.CurrentScene; - UUID[] acl = s.RegionInfo.EstateSettings.EstateAccess; + Scene scene = m_application.SceneManager.CurrentScene; + UUID[] accessControlList = scene.RegionInfo.EstateSettings.EstateAccess; Hashtable users = new Hashtable(); - foreach (UUID user in acl) + foreach (UUID user in accessControlList) { - UUID scopeID = m_app.SceneManager.CurrentOrFirstScene.RegionInfo.ScopeID; - UserAccount account = m_app.SceneManager.CurrentOrFirstScene.UserAccountService.GetUserAccount(scopeID, user); + UUID scopeID = m_application.SceneManager.CurrentOrFirstScene.RegionInfo.ScopeID; + UserAccount account = m_application.SceneManager.CurrentOrFirstScene.UserAccountService.GetUserAccount(scopeID, user); if (account != null) { users[user.ToString()] = account.FirstName + " " + account.LastName; @@ -2827,29 +2881,29 @@ namespace OpenSim.ApplicationPlugins.RemoteController return response; } - private static void checkStringParameters(XmlRpcRequest request, string[] param) + private static void CheckStringParameters(XmlRpcRequest request, string[] param) { Hashtable requestData = (Hashtable) request.Params[0]; - foreach (string p in param) + foreach (string parameter in param) { - 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)); + if (!requestData.Contains(parameter)) + throw new Exception(String.Format("missing string parameter {0}", parameter)); + if (String.IsNullOrEmpty((string) requestData[parameter])) + throw new Exception(String.Format("parameter {0} is empty", parameter)); } } - private static void checkIntegerParams(XmlRpcRequest request, string[] param) + private static void CheckIntegerParams(XmlRpcRequest request, string[] param) { Hashtable requestData = (Hashtable) request.Params[0]; - foreach (string p in param) + foreach (string parameter in param) { - if (!requestData.Contains(p)) - throw new Exception(String.Format("missing integer parameter {0}", p)); + if (!requestData.Contains(parameter)) + throw new Exception(String.Format("missing integer parameter {0}", parameter)); } } - private bool getBoolean(Hashtable requestData, string tag, bool defv) + private bool GetBoolean(Hashtable requestData, string tag, bool defaultValue) { // If an access value has been provided, apply it. if (requestData.Contains(tag)) @@ -2865,29 +2919,29 @@ namespace OpenSim.ApplicationPlugins.RemoteController case "0" : return false; default : - return defv; + return defaultValue; } } else - return defv; + return defaultValue; } - private int GetIntegerAttribute(XmlNode node, string attr, int dv) + private int GetIntegerAttribute(XmlNode node, string attribute, int defaultValue) { - try { return Convert.ToInt32(node.Attributes[attr].Value); } catch{} - return dv; + try { return Convert.ToInt32(node.Attributes[attribute].Value); } catch{} + return defaultValue; } - private uint GetUnsignedAttribute(XmlNode node, string attr, uint dv) + private uint GetUnsignedAttribute(XmlNode node, string attribute, uint defaultValue) { - try { return Convert.ToUInt32(node.Attributes[attr].Value); } catch{} - return dv; + try { return Convert.ToUInt32(node.Attributes[attribute].Value); } catch{} + return defaultValue; } - private string GetStringAttribute(XmlNode node, string attr, string dv) + private string GetStringAttribute(XmlNode node, string attribute, string defaultValue) { - try { return node.Attributes[attr].Value; } catch{} - return dv; + try { return node.Attributes[attribute].Value; } catch{} + return defaultValue; } public void Dispose() @@ -2904,14 +2958,14 @@ namespace OpenSim.ApplicationPlugins.RemoteController /// private UserAccount CreateUser(UUID scopeID, string firstName, string lastName, string password, string email) { - Scene scene = m_app.SceneManager.CurrentOrFirstScene; - IUserAccountService m_UserAccountService = scene.UserAccountService; - IGridService m_GridService = scene.GridService; - IAuthenticationService m_AuthenticationService = scene.AuthenticationService; - IGridUserService m_GridUserService = scene.GridUserService; - IInventoryService m_InventoryService = scene.InventoryService; + Scene scene = m_application.SceneManager.CurrentOrFirstScene; + IUserAccountService userAccountService = scene.UserAccountService; + IGridService gridService = scene.GridService; + IAuthenticationService authenticationService = scene.AuthenticationService; + IGridUserService gridUserService = scene.GridUserService; + IInventoryService inventoryService = scene.InventoryService; - UserAccount account = m_UserAccountService.GetUserAccount(scopeID, firstName, lastName); + UserAccount account = userAccountService.GetUserAccount(scopeID, firstName, lastName); if (null == account) { account = new UserAccount(scopeID, firstName, lastName, email); @@ -2924,26 +2978,26 @@ namespace OpenSim.ApplicationPlugins.RemoteController account.ServiceURLs["AssetServerURI"] = string.Empty; } - if (m_UserAccountService.StoreUserAccount(account)) + if (userAccountService.StoreUserAccount(account)) { bool success; - if (m_AuthenticationService != null) + if (authenticationService != null) { - success = m_AuthenticationService.SetPassword(account.PrincipalID, password); + success = authenticationService.SetPassword(account.PrincipalID, password); if (!success) m_log.WarnFormat("[RADMIN]: Unable to set password for account {0} {1}.", firstName, lastName); } GridRegion home = null; - if (m_GridService != null) + if (gridService != null) { - List defaultRegions = m_GridService.GetDefaultRegions(UUID.Zero); + List defaultRegions = gridService.GetDefaultRegions(UUID.Zero); if (defaultRegions != null && defaultRegions.Count >= 1) home = defaultRegions[0]; - if (m_GridUserService != null && home != null) - m_GridUserService.SetHome(account.PrincipalID.ToString(), home.RegionID, new Vector3(128, 128, 0), new Vector3(0, 1, 0)); + if (gridUserService != null && home != null) + gridUserService.SetHome(account.PrincipalID.ToString(), home.RegionID, new Vector3(128, 128, 0), new Vector3(0, 1, 0)); else m_log.WarnFormat("[RADMIN]: Unable to set home for account {0} {1}.", firstName, lastName); @@ -2952,9 +3006,9 @@ namespace OpenSim.ApplicationPlugins.RemoteController m_log.WarnFormat("[RADMIN]: Unable to retrieve home region for account {0} {1}.", firstName, lastName); - if (m_InventoryService != null) + if (inventoryService != null) { - success = m_InventoryService.CreateUserInventory(account.PrincipalID); + success = inventoryService.CreateUserInventory(account.PrincipalID); if (!success) m_log.WarnFormat("[RADMIN]: Unable to create inventory for account {0} {1}.", firstName, lastName); @@ -2981,16 +3035,16 @@ namespace OpenSim.ApplicationPlugins.RemoteController /// private bool ChangeUserPassword(string firstName, string lastName, string password) { - Scene scene = m_app.SceneManager.CurrentOrFirstScene; - IUserAccountService m_UserAccountService = scene.UserAccountService; - IAuthenticationService m_AuthenticationService = scene.AuthenticationService; + Scene scene = m_application.SceneManager.CurrentOrFirstScene; + IUserAccountService userAccountService = scene.UserAccountService; + IAuthenticationService authenticationService = scene.AuthenticationService; - UserAccount account = m_UserAccountService.GetUserAccount(UUID.Zero, firstName, lastName); + UserAccount account = userAccountService.GetUserAccount(UUID.Zero, firstName, lastName); if (null != account) { bool success = false; - if (m_AuthenticationService != null) - success = m_AuthenticationService.SetPassword(account.PrincipalID, password); + if (authenticationService != null) + success = authenticationService.SetPassword(account.PrincipalID, password); if (!success) { m_log.WarnFormat("[RADMIN]: Unable to set password for account {0} {1}.", firstName, lastName); diff --git a/OpenSim/ApplicationPlugins/Rest/Inventory/RestAppearanceServices.cs b/OpenSim/ApplicationPlugins/Rest/Inventory/RestAppearanceServices.cs index 4369216b26..019ca73dd1 100644 --- a/OpenSim/ApplicationPlugins/Rest/Inventory/RestAppearanceServices.cs +++ b/OpenSim/ApplicationPlugins/Rest/Inventory/RestAppearanceServices.cs @@ -27,6 +27,7 @@ using System; using System.Collections; +using System.Collections.Generic; using System.Xml; using OpenMetaverse; using OpenSim.Framework; @@ -384,7 +385,7 @@ namespace OpenSim.ApplicationPlugins.Rest.Inventory // } // // rdata.Respond(String.Format("Appearance {0} : Normal completion", rdata.method)); -// +// // } /// @@ -449,7 +450,7 @@ namespace OpenSim.ApplicationPlugins.Rest.Inventory // rdata.userAppearance = new AvatarAppearance(); // rdata.userAppearance.Owner = old.Owner; // adata = new AvatarData(rdata.userAppearance); -// +// // Rest.AvatarServices.SetAvatar(rdata.userProfile.ID, adata); // // rdata.Complete(); @@ -498,6 +499,7 @@ namespace OpenSim.ApplicationPlugins.Rest.Inventory indata = true; } break; +/* case "Body" : if (xml.MoveToAttribute("Item")) { @@ -654,6 +656,7 @@ namespace OpenSim.ApplicationPlugins.Rest.Inventory indata = true; } break; +*/ case "Attachment" : { @@ -748,6 +751,7 @@ namespace OpenSim.ApplicationPlugins.Rest.Inventory rdata.writer.WriteAttributeString("Owner", rdata.userAppearance.Owner.ToString()); rdata.writer.WriteAttributeString("Serial", rdata.userAppearance.Serial.ToString()); +/* FormatPart(rdata, "Body", rdata.userAppearance.BodyItem, rdata.userAppearance.BodyAsset); FormatPart(rdata, "Skin", rdata.userAppearance.SkinItem, rdata.userAppearance.SkinAsset); FormatPart(rdata, "Hair", rdata.userAppearance.HairItem, rdata.userAppearance.HairAsset); @@ -764,26 +768,20 @@ namespace OpenSim.ApplicationPlugins.Rest.Inventory FormatPart(rdata, "UnderShirt", rdata.userAppearance.UnderShirtItem, rdata.userAppearance.UnderShirtAsset); FormatPart(rdata, "UnderPants", rdata.userAppearance.UnderPantsItem, rdata.userAppearance.UnderPantsAsset); +*/ + Rest.Log.DebugFormat("{0} FormatUserAppearance: Formatting attachments", MsgId); - Hashtable attachments = rdata.userAppearance.GetAttachments(); - - if (attachments != null) + rdata.writer.WriteStartElement("Attachments"); + List attachments = rdata.userAppearance.GetAttachments(); + foreach (AvatarAttachment attach in attachments) { - - Rest.Log.DebugFormat("{0} FormatUserAppearance: Formatting attachments", MsgId); - - rdata.writer.WriteStartElement("Attachments"); - for (int i = 0; i < attachments.Count; i++) - { - Hashtable attachment = attachments[i] as Hashtable; - rdata.writer.WriteStartElement("Attachment"); - rdata.writer.WriteAttributeString("AtPoint", i.ToString()); - rdata.writer.WriteAttributeString("Item", (string) attachment["item"]); - rdata.writer.WriteAttributeString("Asset", (string) attachment["asset"]); - rdata.writer.WriteEndElement(); - } + rdata.writer.WriteStartElement("Attachment"); + rdata.writer.WriteAttributeString("AtPoint", attach.AttachPoint.ToString()); + rdata.writer.WriteAttributeString("Item", attach.ItemID.ToString()); + rdata.writer.WriteAttributeString("Asset", attach.AssetID.ToString()); rdata.writer.WriteEndElement(); } + rdata.writer.WriteEndElement(); Primitive.TextureEntry texture = rdata.userAppearance.Texture; diff --git a/OpenSim/ApplicationPlugins/Rest/Inventory/RestInventoryServices.cs b/OpenSim/ApplicationPlugins/Rest/Inventory/RestInventoryServices.cs index a4135dbaed..c3cf08c18d 100644 --- a/OpenSim/ApplicationPlugins/Rest/Inventory/RestInventoryServices.cs +++ b/OpenSim/ApplicationPlugins/Rest/Inventory/RestInventoryServices.cs @@ -1295,6 +1295,7 @@ namespace OpenSim.ApplicationPlugins.Rest.Inventory rdata.writer.WriteAttributeString("folder", String.Empty, i.Folder.ToString()); rdata.writer.WriteAttributeString("owner", String.Empty, i.Owner.ToString()); rdata.writer.WriteAttributeString("creator", String.Empty, i.CreatorId); + rdata.writer.WriteAttributeString("creatordata", String.Empty, i.CreatorData); rdata.writer.WriteAttributeString("creationdate", String.Empty, i.CreationDate.ToString()); rdata.writer.WriteAttributeString("invtype", String.Empty, i.InvType.ToString()); rdata.writer.WriteAttributeString("assettype", String.Empty, i.AssetType.ToString()); diff --git a/OpenSim/Client/MXP/ClientStack/MXPClientView.cs b/OpenSim/Client/MXP/ClientStack/MXPClientView.cs index 9518246b49..c158c1f1fd 100644 --- a/OpenSim/Client/MXP/ClientStack/MXPClientView.cs +++ b/OpenSim/Client/MXP/ClientStack/MXPClientView.cs @@ -305,94 +305,94 @@ namespace OpenSim.Client.MXP.ClientStack #region MXP Outgoing Message Processing - private void MXPSendPrimitive(uint localID, UUID ownerID, Vector3 acc, Vector3 rvel, PrimitiveBaseShape primShape, Vector3 pos, UUID objectID, Vector3 vel, Quaternion rotation, uint flags, string text, byte[] textColor, uint parentID, byte[] particleSystem, byte clickAction, byte material, byte[] textureanim) - { - String typeName = ToOmType(primShape.PCode); - m_log.Info("[MXP ClientStack] Transmitting Primitive" + typeName); - - PerceptionEventMessage pe = new PerceptionEventMessage(); - pe.ObjectFragment.ObjectId = objectID.Guid; - - pe.ObjectFragment.ParentObjectId = Guid.Empty; - - // Resolving parent UUID. - OpenSim.Region.Framework.Scenes.Scene scene = (OpenSim.Region.Framework.Scenes.Scene)Scene; - if (scene.Entities.ContainsKey(parentID)) - { - pe.ObjectFragment.ParentObjectId = scene.Entities[parentID].UUID.Guid; - } - - pe.ObjectFragment.ObjectIndex = localID; - pe.ObjectFragment.ObjectName = typeName + " Object"; - pe.ObjectFragment.OwnerId = ownerID.Guid; - pe.ObjectFragment.TypeId = Guid.Empty; - pe.ObjectFragment.TypeName = typeName; - pe.ObjectFragment.Acceleration = ToOmVector(acc); - pe.ObjectFragment.AngularAcceleration=new MsdQuaternion4f(); - pe.ObjectFragment.AngularVelocity = ToOmQuaternion(rvel); - pe.ObjectFragment.BoundingSphereRadius = primShape.Scale.Length(); - - pe.ObjectFragment.Location = ToOmVector(pos); - - pe.ObjectFragment.Mass = 1.0f; - pe.ObjectFragment.Orientation = ToOmQuaternion(rotation); - pe.ObjectFragment.Velocity =ToOmVector(vel); - - OmSlPrimitiveExt ext = new OmSlPrimitiveExt(); - - if (!((primShape.PCode == (byte)PCode.NewTree) || (primShape.PCode == (byte)PCode.Tree) || (primShape.PCode == (byte)PCode.Grass))) - { - - ext.PathBegin = primShape.PathBegin; - ext.PathEnd = primShape.PathEnd; - ext.PathScaleX = primShape.PathScaleX; - ext.PathScaleY = primShape.PathScaleY; - ext.PathShearX = primShape.PathShearX; - ext.PathShearY = primShape.PathShearY; - ext.PathSkew = primShape.PathSkew; - ext.ProfileBegin = primShape.ProfileBegin; - ext.ProfileEnd = primShape.ProfileEnd; - ext.PathCurve = primShape.PathCurve; - ext.ProfileCurve = primShape.ProfileCurve; - ext.ProfileHollow = primShape.ProfileHollow; - ext.PathRadiusOffset = primShape.PathRadiusOffset; - ext.PathRevolutions = primShape.PathRevolutions; - ext.PathTaperX = primShape.PathTaperX; - ext.PathTaperY = primShape.PathTaperY; - ext.PathTwist = primShape.PathTwist; - ext.PathTwistBegin = primShape.PathTwistBegin; - - - } - - ext.UpdateFlags = flags; - ext.ExtraParams = primShape.ExtraParams; - ext.State = primShape.State; - ext.TextureEntry = primShape.TextureEntry; - ext.TextureAnim = textureanim; - ext.Scale = ToOmVector(primShape.Scale); - ext.Text = text; - ext.TextColor = ToOmColor(textColor); - ext.PSBlock = particleSystem; - ext.ClickAction = clickAction; - ext.Material = material; - - pe.SetExtension(ext); - - Session.Send(pe); - - if (m_objectsSynchronized != -1) - { - m_objectsSynchronized++; - - if (m_objectsToSynchronize >= m_objectsSynchronized) - { - SynchronizationEndEventMessage synchronizationEndEventMessage = new SynchronizationEndEventMessage(); - Session.Send(synchronizationEndEventMessage); - m_objectsSynchronized = -1; - } - } - } +// private void MXPSendPrimitive(uint localID, UUID ownerID, Vector3 acc, Vector3 rvel, PrimitiveBaseShape primShape, Vector3 pos, UUID objectID, Vector3 vel, Quaternion rotation, uint flags, string text, byte[] textColor, uint parentID, byte[] particleSystem, byte clickAction, byte material, byte[] textureanim) +// { +// String typeName = ToOmType(primShape.PCode); +// m_log.Info("[MXP ClientStack] Transmitting Primitive" + typeName); +// +// PerceptionEventMessage pe = new PerceptionEventMessage(); +// pe.ObjectFragment.ObjectId = objectID.Guid; +// +// pe.ObjectFragment.ParentObjectId = Guid.Empty; +// +// // Resolving parent UUID. +// OpenSim.Region.Framework.Scenes.Scene scene = (OpenSim.Region.Framework.Scenes.Scene)Scene; +// if (scene.Entities.ContainsKey(parentID)) +// { +// pe.ObjectFragment.ParentObjectId = scene.Entities[parentID].UUID.Guid; +// } +// +// pe.ObjectFragment.ObjectIndex = localID; +// pe.ObjectFragment.ObjectName = typeName + " Object"; +// pe.ObjectFragment.OwnerId = ownerID.Guid; +// pe.ObjectFragment.TypeId = Guid.Empty; +// pe.ObjectFragment.TypeName = typeName; +// pe.ObjectFragment.Acceleration = ToOmVector(acc); +// pe.ObjectFragment.AngularAcceleration=new MsdQuaternion4f(); +// pe.ObjectFragment.AngularVelocity = ToOmQuaternion(rvel); +// pe.ObjectFragment.BoundingSphereRadius = primShape.Scale.Length(); +// +// pe.ObjectFragment.Location = ToOmVector(pos); +// +// pe.ObjectFragment.Mass = 1.0f; +// pe.ObjectFragment.Orientation = ToOmQuaternion(rotation); +// pe.ObjectFragment.Velocity =ToOmVector(vel); +// +// OmSlPrimitiveExt ext = new OmSlPrimitiveExt(); +// +// if (!((primShape.PCode == (byte)PCode.NewTree) || (primShape.PCode == (byte)PCode.Tree) || (primShape.PCode == (byte)PCode.Grass))) +// { +// +// ext.PathBegin = primShape.PathBegin; +// ext.PathEnd = primShape.PathEnd; +// ext.PathScaleX = primShape.PathScaleX; +// ext.PathScaleY = primShape.PathScaleY; +// ext.PathShearX = primShape.PathShearX; +// ext.PathShearY = primShape.PathShearY; +// ext.PathSkew = primShape.PathSkew; +// ext.ProfileBegin = primShape.ProfileBegin; +// ext.ProfileEnd = primShape.ProfileEnd; +// ext.PathCurve = primShape.PathCurve; +// ext.ProfileCurve = primShape.ProfileCurve; +// ext.ProfileHollow = primShape.ProfileHollow; +// ext.PathRadiusOffset = primShape.PathRadiusOffset; +// ext.PathRevolutions = primShape.PathRevolutions; +// ext.PathTaperX = primShape.PathTaperX; +// ext.PathTaperY = primShape.PathTaperY; +// ext.PathTwist = primShape.PathTwist; +// ext.PathTwistBegin = primShape.PathTwistBegin; +// +// +// } +// +// ext.UpdateFlags = flags; +// ext.ExtraParams = primShape.ExtraParams; +// ext.State = primShape.State; +// ext.TextureEntry = primShape.TextureEntry; +// ext.TextureAnim = textureanim; +// ext.Scale = ToOmVector(primShape.Scale); +// ext.Text = text; +// ext.TextColor = ToOmColor(textColor); +// ext.PSBlock = particleSystem; +// ext.ClickAction = clickAction; +// ext.Material = material; +// +// pe.SetExtension(ext); +// +// Session.Send(pe); +// +// if (m_objectsSynchronized != -1) +// { +// m_objectsSynchronized++; +// +// if (m_objectsToSynchronize >= m_objectsSynchronized) +// { +// SynchronizationEndEventMessage synchronizationEndEventMessage = new SynchronizationEndEventMessage(); +// Session.Send(synchronizationEndEventMessage); +// m_objectsSynchronized = -1; +// } +// } +// } public void MXPSendAvatarData(string participantName, UUID ownerID, UUID parentId, UUID avatarID, uint avatarLocalID, Vector3 position, Quaternion rotation) { @@ -598,7 +598,7 @@ namespace OpenSim.Client.MXP.ClientStack public event TeleportLandmarkRequest OnTeleportLandmarkRequest; public event DeRezObject OnDeRezObject; public event Action OnRegionHandShakeReply; - public event GenericCall2 OnRequestWearables; + public event GenericCall1 OnRequestWearables; public event GenericCall1 OnCompleteMovementToRegion; public event UpdateAgent OnPreAgentUpdate; public event UpdateAgent OnAgentUpdate; @@ -869,7 +869,7 @@ namespace OpenSim.Client.MXP.ClientStack OpenSim.Region.Framework.Scenes.Scene scene=(OpenSim.Region.Framework.Scenes.Scene)Scene; AvatarAppearance appearance; scene.GetAvatarAppearance(this,out appearance); - OnSetAppearance(appearance.Texture, (byte[])appearance.VisualParams.Clone()); + OnSetAppearance(this, appearance.Texture, (byte[])appearance.VisualParams.Clone()); } public void Stop() @@ -1023,11 +1023,15 @@ namespace OpenSim.Client.MXP.ClientStack // Need to translate to MXP somehow } - public void SendTeleportLocationStart() + public void SendTeleportStart(uint flags) { // Need to translate to MXP somehow } + public void SendTeleportProgress(uint flags, string message) + { + } + public void SendMoneyBalance(UUID transaction, bool success, byte[] description, int balance) { // Need to translate to MXP somehow diff --git a/OpenSim/Client/MXP/PacketHandler/MXPPacketServer.cs b/OpenSim/Client/MXP/PacketHandler/MXPPacketServer.cs index 2098625f72..dcecb8b384 100644 --- a/OpenSim/Client/MXP/PacketHandler/MXPPacketServer.cs +++ b/OpenSim/Client/MXP/PacketHandler/MXPPacketServer.cs @@ -63,7 +63,7 @@ namespace OpenSim.Client.MXP.PacketHandler private readonly IList m_sessionsToRemove = new List(); private readonly int m_port; - private readonly bool m_accountsAuthenticate; +// private readonly bool m_accountsAuthenticate; private readonly String m_programName; private readonly byte m_programMajorVersion; @@ -76,7 +76,7 @@ namespace OpenSim.Client.MXP.PacketHandler public MXPPacketServer(int port, Dictionary scenes, bool accountsAuthenticate) { m_port = port; - m_accountsAuthenticate = accountsAuthenticate; +// m_accountsAuthenticate = accountsAuthenticate; m_scenes = scenes; @@ -491,7 +491,6 @@ namespace OpenSim.Client.MXP.PacketHandler public bool AuthoriseUser(string participantName, string password, UUID sceneId, out UserAccount account) { - UUID userId = UUID.Zero; string firstName = ""; string lastName = ""; account = null; @@ -534,9 +533,7 @@ namespace OpenSim.Client.MXP.PacketHandler agent.InventoryFolder = UUID.Zero; agent.startpos = new Vector3(0, 0, 0); // TODO Fill in region start position agent.CapsPath = "http://localhost/"; - AvatarData avatar = scene.AvatarService.GetAvatar(account.PrincipalID); - if (avatar != null) - agent.Appearance = avatar.ToAvatarAppearance(account.PrincipalID); //userService.GetUserAppearance(userProfile.ID); + agent.Appearance = scene.AvatarService.GetAppearance(account.PrincipalID); if (agent.Appearance == null) { diff --git a/OpenSim/Client/Sirikata/ClientStack/SirikataClientView.cs b/OpenSim/Client/Sirikata/ClientStack/SirikataClientView.cs deleted file mode 100644 index a97bfada4f..0000000000 --- a/OpenSim/Client/Sirikata/ClientStack/SirikataClientView.cs +++ /dev/null @@ -1,1211 +0,0 @@ -/* - * Copyright (c) Contributors, http://opensimulator.org/ - * See CONTRIBUTORS.TXT for a full list of copyright holders. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * * Neither the name of the OpenSimulator Project nor the - * names of its contributors may be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE DEVELOPERS ``AS IS'' AND ANY - * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED - * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL THE CONTRIBUTORS BE LIABLE FOR ANY - * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES - * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; - * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ - -using System; -using System.Collections.Generic; -using System.Net; -using System.Net.Sockets; -using System.Text; -using OpenMetaverse; -using OpenMetaverse.Packets; -using OpenSim.Framework; -using OpenSim.Framework.Client; - -namespace OpenSim.Client.Sirikata.ClientStack -{ - class SirikataClientView : IClientAPI, IClientCore - { - private readonly NetworkStream stream; - - public SirikataClientView(TcpClient client) - { - stream = client.GetStream(); - - sessionId = UUID.Random(); - - - // Handshake with client - string con = "SSTTCP01" + sessionId; - byte[] handshake = Util.UTF8.GetBytes(con); - - byte[] clientHandshake = new byte[2+6+36]; - - stream.Read(clientHandshake, 0, handshake.Length); - stream.Write(handshake, 0, handshake.Length - 1); // Remove null terminator (hence the -1) - } - - - #region Implementation of IClientAPI - - private Vector3 startPos; - - private UUID sessionId; - - private UUID secureSessionId; - - private UUID activeGroupId; - - private string activeGroupName; - - private ulong activeGroupPowers; - - private string firstName; - - private string lastName; - - private IScene scene; - - private int nextAnimationSequenceNumber; - - private string name; - - private bool isActive; - - private bool sendLogoutPacketWhenClosing; - - private uint circuitCode; - - private IPEndPoint remoteEndPoint; - - public Vector3 StartPos - { - get { return startPos; } - set { startPos = value; } - } - - public bool TryGet(out T iface) - { - throw new System.NotImplementedException(); - } - - public T Get() - { - throw new System.NotImplementedException(); - } - - UUID IClientCore.AgentId - { - get { throw new NotImplementedException(); } - } - - public void Disconnect(string reason) - { - throw new System.NotImplementedException(); - } - - public void Disconnect() - { - throw new System.NotImplementedException(); - } - - UUID IClientAPI.AgentId - { - get { throw new NotImplementedException(); } - } - - public UUID SessionId - { - get { return sessionId; } - } - - public UUID SecureSessionId - { - get { return secureSessionId; } - } - - public UUID ActiveGroupId - { - get { return activeGroupId; } - } - - public string ActiveGroupName - { - get { return activeGroupName; } - } - - public ulong ActiveGroupPowers - { - get { return activeGroupPowers; } - } - - public ulong GetGroupPowers(UUID groupID) - { - throw new System.NotImplementedException(); - } - - public bool IsGroupMember(UUID GroupID) - { - throw new System.NotImplementedException(); - } - - public string FirstName - { - get { return firstName; } - } - - public string LastName - { - get { return lastName; } - } - - public IScene Scene - { - get { return scene; } - } - - public int NextAnimationSequenceNumber - { - get { return nextAnimationSequenceNumber; } - } - - public string Name - { - get { return name; } - } - - public bool IsActive - { - get { return isActive; } - set { isActive = value; } - } - public bool IsLoggingOut - { - get { return false; } - set { } - } - - public bool SendLogoutPacketWhenClosing - { - set { sendLogoutPacketWhenClosing = value; } - } - - public uint MaxCoarseLocations - { - get { return 0; } - } - - public uint CircuitCode - { - get { return circuitCode; } - } - - public IPEndPoint RemoteEndPoint - { - get { return remoteEndPoint; } - } - - public event GenericMessage OnGenericMessage; - public event ImprovedInstantMessage OnInstantMessage; - public event ChatMessage OnChatFromClient; - public event ChatMessageRaw OnChatFromClientRaw; - public event TextureRequest OnRequestTexture; - public event RezObject OnRezObject; - public event ModifyTerrain OnModifyTerrain; - public event BakeTerrain OnBakeTerrain; - public event EstateChangeInfo OnEstateChangeInfo; - public event SetAppearance OnSetAppearance; - public event SetAppearanceRaw OnSetAppearanceRaw; - public event AvatarNowWearing OnAvatarNowWearing; - public event RezSingleAttachmentFromInv OnRezSingleAttachmentFromInv; - public event RezMultipleAttachmentsFromInv OnRezMultipleAttachmentsFromInv; - public event UUIDNameRequest OnDetachAttachmentIntoInv; - public event ObjectAttach OnObjectAttach; - public event ObjectDeselect OnObjectDetach; - public event ObjectDrop OnObjectDrop; - public event StartAnim OnStartAnim; - public event StopAnim OnStopAnim; - public event LinkObjects OnLinkObjects; - public event DelinkObjects OnDelinkObjects; - public event RequestMapBlocks OnRequestMapBlocks; - public event RequestMapName OnMapNameRequest; - public event TeleportLocationRequest OnTeleportLocationRequest; - public event DisconnectUser OnDisconnectUser; - public event RequestAvatarProperties OnRequestAvatarProperties; - public event SetAlwaysRun OnSetAlwaysRun; - public event TeleportLandmarkRequest OnTeleportLandmarkRequest; - public event DeRezObject OnDeRezObject; - public event Action OnRegionHandShakeReply; - public event GenericCall2 OnRequestWearables; - public event GenericCall1 OnCompleteMovementToRegion; - public event UpdateAgent OnPreAgentUpdate; - public event UpdateAgent OnAgentUpdate; - public event UpdateAgentRaw OnAgentUpdateRaw; - public event AgentRequestSit OnAgentRequestSit; - public event AgentSit OnAgentSit; - public event AvatarPickerRequest OnAvatarPickerRequest; - public event Action OnRequestAvatarsData; - public event AddNewPrim OnAddPrim; - public event FetchInventory OnAgentDataUpdateRequest; - public event TeleportLocationRequest OnSetStartLocationRequest; - public event RequestGodlikePowers OnRequestGodlikePowers; - public event GodKickUser OnGodKickUser; - public event ObjectDuplicate OnObjectDuplicate; - public event ObjectDuplicateOnRay OnObjectDuplicateOnRay; - public event GrabObject OnGrabObject; - public event DeGrabObject OnDeGrabObject; - public event MoveObject OnGrabUpdate; - public event SpinStart OnSpinStart; - public event SpinObject OnSpinUpdate; - public event SpinStop OnSpinStop; - public event UpdateShape OnUpdatePrimShape; - public event ObjectExtraParams OnUpdateExtraParams; - public event ObjectRequest OnObjectRequest; - public event ObjectSelect OnObjectSelect; - public event ObjectDeselect OnObjectDeselect; - public event GenericCall7 OnObjectDescription; - public event GenericCall7 OnObjectName; - public event GenericCall7 OnObjectClickAction; - public event GenericCall7 OnObjectMaterial; - public event RequestObjectPropertiesFamily OnRequestObjectPropertiesFamily; - public event UpdatePrimFlags OnUpdatePrimFlags; - public event UpdatePrimTexture OnUpdatePrimTexture; - public event UpdateVector OnUpdatePrimGroupPosition; - public event UpdateVector OnUpdatePrimSinglePosition; - public event UpdatePrimRotation OnUpdatePrimGroupRotation; - public event UpdatePrimSingleRotation OnUpdatePrimSingleRotation; - public event UpdatePrimSingleRotationPosition OnUpdatePrimSingleRotationPosition; - public event UpdatePrimGroupRotation OnUpdatePrimGroupMouseRotation; - public event UpdateVector OnUpdatePrimScale; - public event UpdateVector OnUpdatePrimGroupScale; - public event StatusChange OnChildAgentStatus; - public event GenericCall2 OnStopMovement; - public event Action OnRemoveAvatar; - public event ObjectPermissions OnObjectPermissions; - public event CreateNewInventoryItem OnCreateNewInventoryItem; - public event LinkInventoryItem OnLinkInventoryItem; - public event CreateInventoryFolder OnCreateNewInventoryFolder; - public event UpdateInventoryFolder OnUpdateInventoryFolder; - public event MoveInventoryFolder OnMoveInventoryFolder; - public event FetchInventoryDescendents OnFetchInventoryDescendents; - public event PurgeInventoryDescendents OnPurgeInventoryDescendents; - public event FetchInventory OnFetchInventory; - public event RequestTaskInventory OnRequestTaskInventory; - public event UpdateInventoryItem OnUpdateInventoryItem; - public event CopyInventoryItem OnCopyInventoryItem; - public event MoveInventoryItem OnMoveInventoryItem; - public event RemoveInventoryFolder OnRemoveInventoryFolder; - public event RemoveInventoryItem OnRemoveInventoryItem; - public event UDPAssetUploadRequest OnAssetUploadRequest; - public event XferReceive OnXferReceive; - public event RequestXfer OnRequestXfer; - public event ConfirmXfer OnConfirmXfer; - public event AbortXfer OnAbortXfer; - public event RezScript OnRezScript; - public event UpdateTaskInventory OnUpdateTaskInventory; - public event MoveTaskInventory OnMoveTaskItem; - public event RemoveTaskInventory OnRemoveTaskItem; - public event RequestAsset OnRequestAsset; - public event UUIDNameRequest OnNameFromUUIDRequest; - public event ParcelAccessListRequest OnParcelAccessListRequest; - public event ParcelAccessListUpdateRequest OnParcelAccessListUpdateRequest; - public event ParcelPropertiesRequest OnParcelPropertiesRequest; - public event ParcelDivideRequest OnParcelDivideRequest; - public event ParcelJoinRequest OnParcelJoinRequest; - public event ParcelPropertiesUpdateRequest OnParcelPropertiesUpdateRequest; - public event ParcelSelectObjects OnParcelSelectObjects; - public event ParcelObjectOwnerRequest OnParcelObjectOwnerRequest; - public event ParcelAbandonRequest OnParcelAbandonRequest; - public event ParcelGodForceOwner OnParcelGodForceOwner; - public event ParcelReclaim OnParcelReclaim; - public event ParcelReturnObjectsRequest OnParcelReturnObjectsRequest; - public event ParcelDeedToGroup OnParcelDeedToGroup; - public event RegionInfoRequest OnRegionInfoRequest; - public event EstateCovenantRequest OnEstateCovenantRequest; - public event FriendActionDelegate OnApproveFriendRequest; - public event FriendActionDelegate OnDenyFriendRequest; - public event FriendshipTermination OnTerminateFriendship; - public event MoneyTransferRequest OnMoneyTransferRequest; - public event EconomyDataRequest OnEconomyDataRequest; - public event MoneyBalanceRequest OnMoneyBalanceRequest; - public event UpdateAvatarProperties OnUpdateAvatarProperties; - public event ParcelBuy OnParcelBuy; - public event RequestPayPrice OnRequestPayPrice; - public event ObjectSaleInfo OnObjectSaleInfo; - public event ObjectBuy OnObjectBuy; - public event BuyObjectInventory OnBuyObjectInventory; - public event RequestTerrain OnRequestTerrain; - public event RequestTerrain OnUploadTerrain; - public event ObjectIncludeInSearch OnObjectIncludeInSearch; - public event UUIDNameRequest OnTeleportHomeRequest; - public event ScriptAnswer OnScriptAnswer; - public event AgentSit OnUndo; - public event AgentSit OnRedo; - public event LandUndo OnLandUndo; - public event ForceReleaseControls OnForceReleaseControls; - public event GodLandStatRequest OnLandStatRequest; - public event DetailedEstateDataRequest OnDetailedEstateDataRequest; - public event SetEstateFlagsRequest OnSetEstateFlagsRequest; - public event SetEstateTerrainBaseTexture OnSetEstateTerrainBaseTexture; - public event SetEstateTerrainDetailTexture OnSetEstateTerrainDetailTexture; - public event SetEstateTerrainTextureHeights OnSetEstateTerrainTextureHeights; - public event CommitEstateTerrainTextureRequest OnCommitEstateTerrainTextureRequest; - public event SetRegionTerrainSettings OnSetRegionTerrainSettings; - public event EstateRestartSimRequest OnEstateRestartSimRequest; - public event EstateChangeCovenantRequest OnEstateChangeCovenantRequest; - public event UpdateEstateAccessDeltaRequest OnUpdateEstateAccessDeltaRequest; - public event SimulatorBlueBoxMessageRequest OnSimulatorBlueBoxMessageRequest; - public event EstateBlueBoxMessageRequest OnEstateBlueBoxMessageRequest; - public event EstateDebugRegionRequest OnEstateDebugRegionRequest; - public event EstateTeleportOneUserHomeRequest OnEstateTeleportOneUserHomeRequest; - public event EstateTeleportAllUsersHomeRequest OnEstateTeleportAllUsersHomeRequest; - public event UUIDNameRequest OnUUIDGroupNameRequest; - public event RegionHandleRequest OnRegionHandleRequest; - public event ParcelInfoRequest OnParcelInfoRequest; - public event RequestObjectPropertiesFamily OnObjectGroupRequest; - public event ScriptReset OnScriptReset; - public event GetScriptRunning OnGetScriptRunning; - public event SetScriptRunning OnSetScriptRunning; - public event UpdateVector OnAutoPilotGo; - public event TerrainUnacked OnUnackedTerrain; - public event ActivateGesture OnActivateGesture; - public event DeactivateGesture OnDeactivateGesture; - public event ObjectOwner OnObjectOwner; - public event DirPlacesQuery OnDirPlacesQuery; - public event DirFindQuery OnDirFindQuery; - public event DirLandQuery OnDirLandQuery; - public event DirPopularQuery OnDirPopularQuery; - public event DirClassifiedQuery OnDirClassifiedQuery; - public event EventInfoRequest OnEventInfoRequest; - public event ParcelSetOtherCleanTime OnParcelSetOtherCleanTime; - public event MapItemRequest OnMapItemRequest; - public event OfferCallingCard OnOfferCallingCard; - public event AcceptCallingCard OnAcceptCallingCard; - public event DeclineCallingCard OnDeclineCallingCard; - public event SoundTrigger OnSoundTrigger; - public event StartLure OnStartLure; - public event TeleportLureRequest OnTeleportLureRequest; - public event NetworkStats OnNetworkStatsUpdate; - public event ClassifiedInfoRequest OnClassifiedInfoRequest; - public event ClassifiedInfoUpdate OnClassifiedInfoUpdate; - public event ClassifiedDelete OnClassifiedDelete; - public event ClassifiedDelete OnClassifiedGodDelete; - public event EventNotificationAddRequest OnEventNotificationAddRequest; - public event EventNotificationRemoveRequest OnEventNotificationRemoveRequest; - public event EventGodDelete OnEventGodDelete; - public event ParcelDwellRequest OnParcelDwellRequest; - public event UserInfoRequest OnUserInfoRequest; - public event UpdateUserInfo OnUpdateUserInfo; - public event RetrieveInstantMessages OnRetrieveInstantMessages; - public event PickDelete OnPickDelete; - public event PickGodDelete OnPickGodDelete; - public event PickInfoUpdate OnPickInfoUpdate; - public event AvatarNotesUpdate OnAvatarNotesUpdate; - public event AvatarInterestUpdate OnAvatarInterestUpdate; - public event GrantUserFriendRights OnGrantUserRights; - public event MuteListRequest OnMuteListRequest; - public event PlacesQuery OnPlacesQuery; - public event FindAgentUpdate OnFindAgent; - public event TrackAgentUpdate OnTrackAgent; - public event NewUserReport OnUserReport; - public event SaveStateHandler OnSaveState; - public event GroupAccountSummaryRequest OnGroupAccountSummaryRequest; - public event GroupAccountDetailsRequest OnGroupAccountDetailsRequest; - public event GroupAccountTransactionsRequest OnGroupAccountTransactionsRequest; - public event FreezeUserUpdate OnParcelFreezeUser; - public event EjectUserUpdate OnParcelEjectUser; - public event ParcelBuyPass OnParcelBuyPass; - public event ParcelGodMark OnParcelGodMark; - public event GroupActiveProposalsRequest OnGroupActiveProposalsRequest; - public event GroupVoteHistoryRequest OnGroupVoteHistoryRequest; - public event SimWideDeletesDelegate OnSimWideDeletes; - public event SendPostcard OnSendPostcard; - public event MuteListEntryUpdate OnUpdateMuteListEntry; - public event MuteListEntryRemove OnRemoveMuteListEntry; - public event GodlikeMessage onGodlikeMessage; - public event GodUpdateRegionInfoUpdate OnGodUpdateRegionInfoUpdate; - public void SetDebugPacketLevel(int newDebug) - { - throw new System.NotImplementedException(); - } - - public void InPacket(object NewPack) - { - throw new System.NotImplementedException(); - } - - public void ProcessInPacket(Packet NewPack) - { - throw new System.NotImplementedException(); - } - - public void Close() - { - throw new System.NotImplementedException(); - } - - public void Kick(string message) - { - throw new System.NotImplementedException(); - } - - public void Start() - { - throw new System.NotImplementedException(); - } - - public void Stop() - { - throw new System.NotImplementedException(); - } - - public void SendWearables(AvatarWearable[] wearables, int serial) - { - throw new System.NotImplementedException(); - } - - public void SendAppearance(UUID agentID, byte[] visualParams, byte[] textureEntry) - { - throw new System.NotImplementedException(); - } - - public void SendStartPingCheck(byte seq) - { - throw new System.NotImplementedException(); - } - - public void SendKillObject(ulong regionHandle, uint localID) - { - throw new System.NotImplementedException(); - } - - public void SendAnimations(UUID[] animID, int[] seqs, UUID sourceAgentId, UUID[] objectIDs) - { - throw new System.NotImplementedException(); - } - - public void SendRegionHandshake(RegionInfo regionInfo, RegionHandshakeArgs args) - { - throw new System.NotImplementedException(); - } - - public void SendChatMessage(string message, byte type, Vector3 fromPos, string fromName, UUID fromAgentID, byte source, byte audible) - { - throw new System.NotImplementedException(); - } - - public void SendInstantMessage(GridInstantMessage im) - { - throw new System.NotImplementedException(); - } - - public void SendGenericMessage(string method, List message) - { - } - - public void SendGenericMessage(string method, List message) - { - throw new System.NotImplementedException(); - } - - public void SendLayerData(float[] map) - { - throw new System.NotImplementedException(); - } - - public void SendLayerData(int px, int py, float[] map) - { - throw new System.NotImplementedException(); - } - - public void SendWindData(Vector2[] windSpeeds) - { - throw new System.NotImplementedException(); - } - - public void SendCloudData(float[] cloudCover) - { - throw new System.NotImplementedException(); - } - - public void MoveAgentIntoRegion(RegionInfo regInfo, Vector3 pos, Vector3 look) - { - throw new System.NotImplementedException(); - } - - public void InformClientOfNeighbour(ulong neighbourHandle, IPEndPoint neighbourExternalEndPoint) - { - throw new System.NotImplementedException(); - } - - public AgentCircuitData RequestClientInfo() - { - throw new System.NotImplementedException(); - } - - public void CrossRegion(ulong newRegionHandle, Vector3 pos, Vector3 lookAt, IPEndPoint newRegionExternalEndPoint, string capsURL) - { - throw new System.NotImplementedException(); - } - - public void SendMapBlock(List mapBlocks, uint flag) - { - throw new System.NotImplementedException(); - } - - public void SendLocalTeleport(Vector3 position, Vector3 lookAt, uint flags) - { - throw new System.NotImplementedException(); - } - - public void SendRegionTeleport(ulong regionHandle, byte simAccess, IPEndPoint regionExternalEndPoint, uint locationID, uint flags, string capsURL) - { - throw new System.NotImplementedException(); - } - - public void SendTeleportFailed(string reason) - { - throw new System.NotImplementedException(); - } - - public void SendTeleportLocationStart() - { - throw new System.NotImplementedException(); - } - - public void SendMoneyBalance(UUID transaction, bool success, byte[] description, int balance) - { - throw new System.NotImplementedException(); - } - - public void SendPayPrice(UUID objectID, int[] payPrice) - { - throw new System.NotImplementedException(); - } - - public void SendCoarseLocationUpdate(List users, List CoarseLocations) - { - throw new System.NotImplementedException(); - } - - public void SetChildAgentThrottle(byte[] throttle) - { - throw new System.NotImplementedException(); - } - - public void SendAvatarDataImmediate(ISceneEntity avatar) - { - throw new System.NotImplementedException(); - } - - public void SendPrimUpdate(ISceneEntity entity, PrimUpdateFlags updateFlags) - { - throw new System.NotImplementedException(); - } - - public void ReprioritizeUpdates() - { - throw new System.NotImplementedException(); - } - - public void FlushPrimUpdates() - { - throw new System.NotImplementedException(); - } - - public void SendInventoryFolderDetails(UUID ownerID, UUID folderID, List items, List folders, int version, bool fetchFolders, bool fetchItems) - { - throw new System.NotImplementedException(); - } - - public void SendInventoryItemDetails(UUID ownerID, InventoryItemBase item) - { - throw new System.NotImplementedException(); - } - - public void SendInventoryItemCreateUpdate(InventoryItemBase Item, uint callbackId) - { - throw new System.NotImplementedException(); - } - - public void SendRemoveInventoryItem(UUID itemID) - { - throw new System.NotImplementedException(); - } - - public void SendTakeControls(int controls, bool passToAgent, bool TakeControls) - { - throw new System.NotImplementedException(); - } - - public void SendTaskInventory(UUID taskID, short serial, byte[] fileName) - { - throw new System.NotImplementedException(); - } - - public void SendBulkUpdateInventory(InventoryNodeBase node) - { - throw new System.NotImplementedException(); - } - - public void SendXferPacket(ulong xferID, uint packet, byte[] data) - { - throw new System.NotImplementedException(); - } - - public void SendEconomyData(float EnergyEfficiency, int ObjectCapacity, int ObjectCount, int PriceEnergyUnit, int PriceGroupCreate, int PriceObjectClaim, float PriceObjectRent, float PriceObjectScaleFactor, int PriceParcelClaim, float PriceParcelClaimFactor, int PriceParcelRent, int PricePublicObjectDecay, int PricePublicObjectDelete, int PriceRentLight, int PriceUpload, int TeleportMinPrice, float TeleportPriceExponent) - { - throw new System.NotImplementedException(); - } - - public void SendAvatarPickerReply(AvatarPickerReplyAgentDataArgs AgentData, List Data) - { - throw new System.NotImplementedException(); - } - - public void SendAgentDataUpdate(UUID agentid, UUID activegroupid, string firstname, string lastname, ulong grouppowers, string groupname, string grouptitle) - { - throw new System.NotImplementedException(); - } - - public void SendPreLoadSound(UUID objectID, UUID ownerID, UUID soundID) - { - throw new System.NotImplementedException(); - } - - public void SendPlayAttachedSound(UUID soundID, UUID objectID, UUID ownerID, float gain, byte flags) - { - throw new System.NotImplementedException(); - } - - public void SendTriggeredSound(UUID soundID, UUID ownerID, UUID objectID, UUID parentID, ulong handle, Vector3 position, float gain) - { - throw new System.NotImplementedException(); - } - - public void SendAttachedSoundGainChange(UUID objectID, float gain) - { - throw new System.NotImplementedException(); - } - - public void SendNameReply(UUID profileId, string firstname, string lastname) - { - throw new System.NotImplementedException(); - } - - public void SendAlertMessage(string message) - { - throw new System.NotImplementedException(); - } - - public void SendAgentAlertMessage(string message, bool modal) - { - throw new System.NotImplementedException(); - } - - public void SendLoadURL(string objectname, UUID objectID, UUID ownerID, bool groupOwned, string message, string url) - { - throw new System.NotImplementedException(); - } - - public void SendDialog(string objectname, UUID objectID, string ownerFirstName, string ownerLastName, string msg, UUID textureID, int ch, string[] buttonlabels) - { - throw new System.NotImplementedException(); - } - - public bool AddMoney(int debit) - { - throw new System.NotImplementedException(); - } - - public void SendSunPos(Vector3 sunPos, Vector3 sunVel, ulong CurrentTime, uint SecondsPerSunCycle, uint SecondsPerYear, float OrbitalPosition) - { - throw new System.NotImplementedException(); - } - - public void SendViewerEffect(ViewerEffectPacket.EffectBlock[] effectBlocks) - { - throw new System.NotImplementedException(); - } - - public void SendViewerTime(int phase) - { - throw new System.NotImplementedException(); - } - - public UUID GetDefaultAnimation(string name) - { - throw new System.NotImplementedException(); - } - - public void SendAvatarProperties(UUID avatarID, string aboutText, string bornOn, byte[] charterMember, string flAbout, uint flags, UUID flImageID, UUID imageID, string profileURL, UUID partnerID) - { - throw new System.NotImplementedException(); - } - - public void SendScriptQuestion(UUID taskID, string taskName, string ownerName, UUID itemID, int question) - { - throw new System.NotImplementedException(); - } - - public void SendHealth(float health) - { - throw new System.NotImplementedException(); - } - - public void SendEstateList(UUID invoice, int code, UUID[] Data, uint estateID) - { - throw new System.NotImplementedException(); - } - - public void SendBannedUserList(UUID invoice, EstateBan[] banlist, uint estateID) - { - throw new System.NotImplementedException(); - } - - public void SendRegionInfoToEstateMenu(RegionInfoForEstateMenuArgs args) - { - throw new System.NotImplementedException(); - } - - public void SendEstateCovenantInformation(UUID covenant) - { - throw new System.NotImplementedException(); - } - - public void SendDetailedEstateData(UUID invoice, string estateName, uint estateID, uint parentEstate, uint estateFlags, uint sunPosition, UUID covenant, string abuseEmail, UUID estateOwner) - { - throw new System.NotImplementedException(); - } - - public void SendLandProperties(int sequence_id, bool snap_selection, int request_result, LandData landData, float simObjectBonusFactor, int parcelObjectCapacity, int simObjectCapacity, uint regionFlags) - { - throw new System.NotImplementedException(); - } - - public void SendLandAccessListData(List avatars, uint accessFlag, int localLandID) - { - throw new System.NotImplementedException(); - } - - public void SendForceClientSelectObjects(List objectIDs) - { - throw new System.NotImplementedException(); - } - - public void SendCameraConstraint(Vector4 ConstraintPlane) - { - throw new System.NotImplementedException(); - } - - public void SendLandObjectOwners(LandData land, List groups, Dictionary ownersAndCount) - { - throw new System.NotImplementedException(); - } - - public void SendLandParcelOverlay(byte[] data, int sequence_id) - { - throw new System.NotImplementedException(); - } - - public void SendParcelMediaCommand(uint flags, ParcelMediaCommandEnum command, float time) - { - throw new System.NotImplementedException(); - } - - public void SendParcelMediaUpdate(string mediaUrl, UUID mediaTextureID, byte autoScale, string mediaType, string mediaDesc, int mediaWidth, int mediaHeight, byte mediaLoop) - { - throw new System.NotImplementedException(); - } - - public void SendAssetUploadCompleteMessage(sbyte AssetType, bool Success, UUID AssetFullID) - { - throw new System.NotImplementedException(); - } - - public void SendConfirmXfer(ulong xferID, uint PacketID) - { - throw new System.NotImplementedException(); - } - - public void SendXferRequest(ulong XferID, short AssetType, UUID vFileID, byte FilePath, byte[] FileName) - { - throw new System.NotImplementedException(); - } - - public void SendInitiateDownload(string simFileName, string clientFileName) - { - throw new System.NotImplementedException(); - } - - public void SendImageFirstPart(ushort numParts, UUID ImageUUID, uint ImageSize, byte[] ImageData, byte imageCodec) - { - throw new System.NotImplementedException(); - } - - public void SendImageNextPart(ushort partNumber, UUID imageUuid, byte[] imageData) - { - throw new System.NotImplementedException(); - } - - public void SendImageNotFound(UUID imageid) - { - throw new System.NotImplementedException(); - } - - public void SendShutdownConnectionNotice() - { - throw new System.NotImplementedException(); - } - - public void SendSimStats(SimStats stats) - { - throw new System.NotImplementedException(); - } - - public void SendObjectPropertiesFamilyData(uint RequestFlags, UUID ObjectUUID, UUID OwnerID, UUID GroupID, uint BaseMask, uint OwnerMask, uint GroupMask, uint EveryoneMask, uint NextOwnerMask, int OwnershipCost, byte SaleType, int SalePrice, uint Category, UUID LastOwnerID, string ObjectName, string Description) - { - throw new System.NotImplementedException(); - } - - public void SendObjectPropertiesReply(UUID ItemID, ulong CreationDate, UUID CreatorUUID, UUID FolderUUID, UUID FromTaskUUID, UUID GroupUUID, short InventorySerial, UUID LastOwnerUUID, UUID ObjectUUID, UUID OwnerUUID, string TouchTitle, byte[] TextureID, string SitTitle, string ItemName, string ItemDescription, uint OwnerMask, uint NextOwnerMask, uint GroupMask, uint EveryoneMask, uint BaseMask, byte saleType, int salePrice) - { - throw new System.NotImplementedException(); - } - - public void SendAgentOffline(UUID[] agentIDs) - { - throw new System.NotImplementedException(); - } - - public void SendAgentOnline(UUID[] agentIDs) - { - throw new System.NotImplementedException(); - } - - public void SendSitResponse(UUID TargetID, Vector3 OffsetPos, Quaternion SitOrientation, bool autopilot, Vector3 CameraAtOffset, Vector3 CameraEyeOffset, bool ForceMouseLook) - { - throw new System.NotImplementedException(); - } - - public void SendAdminResponse(UUID Token, uint AdminLevel) - { - throw new System.NotImplementedException(); - } - - public void SendGroupMembership(GroupMembershipData[] GroupMembership) - { - throw new System.NotImplementedException(); - } - - public void SendGroupNameReply(UUID groupLLUID, string GroupName) - { - throw new System.NotImplementedException(); - } - - public void SendJoinGroupReply(UUID groupID, bool success) - { - throw new System.NotImplementedException(); - } - - public void SendEjectGroupMemberReply(UUID agentID, UUID groupID, bool success) - { - throw new System.NotImplementedException(); - } - - public void SendLeaveGroupReply(UUID groupID, bool success) - { - throw new System.NotImplementedException(); - } - - public void SendCreateGroupReply(UUID groupID, bool success, string message) - { - throw new System.NotImplementedException(); - } - - public void SendLandStatReply(uint reportType, uint requestFlags, uint resultCount, LandStatReportItem[] lsrpia) - { - throw new System.NotImplementedException(); - } - - public void SendScriptRunningReply(UUID objectID, UUID itemID, bool running) - { - throw new System.NotImplementedException(); - } - - public void SendAsset(AssetRequestToClient req) - { - throw new System.NotImplementedException(); - } - - public void SendTexture(AssetBase TextureAsset) - { - throw new System.NotImplementedException(); - } - - public byte[] GetThrottlesPacked(float multiplier) - { - throw new System.NotImplementedException(); - } - - public event ViewerEffectEventHandler OnViewerEffect; - public event Action OnLogout; - public event Action OnConnectionClosed; - public void SendBlueBoxMessage(UUID FromAvatarID, string FromAvatarName, string Message) - { - throw new System.NotImplementedException(); - } - - public void SendLogoutPacket() - { - throw new System.NotImplementedException(); - } - - public EndPoint GetClientEP() - { - throw new System.NotImplementedException(); - } - - public ClientInfo GetClientInfo() - { - throw new System.NotImplementedException(); - } - - public void SetClientInfo(ClientInfo info) - { - throw new System.NotImplementedException(); - } - - public void SetClientOption(string option, string value) - { - throw new System.NotImplementedException(); - } - - public string GetClientOption(string option) - { - throw new System.NotImplementedException(); - } - - public void SendSetFollowCamProperties(UUID objectID, SortedDictionary parameters) - { - throw new System.NotImplementedException(); - } - - public void SendClearFollowCamProperties(UUID objectID) - { - throw new System.NotImplementedException(); - } - - public void SendRegionHandle(UUID regoinID, ulong handle) - { - throw new System.NotImplementedException(); - } - - public void SendParcelInfo(RegionInfo info, LandData land, UUID parcelID, uint x, uint y) - { - throw new System.NotImplementedException(); - } - - public void SendScriptTeleportRequest(string objName, string simName, Vector3 pos, Vector3 lookAt) - { - throw new System.NotImplementedException(); - } - - public void SendDirPlacesReply(UUID queryID, DirPlacesReplyData[] data) - { - throw new System.NotImplementedException(); - } - - public void SendDirPeopleReply(UUID queryID, DirPeopleReplyData[] data) - { - throw new System.NotImplementedException(); - } - - public void SendDirEventsReply(UUID queryID, DirEventsReplyData[] data) - { - throw new System.NotImplementedException(); - } - - public void SendDirGroupsReply(UUID queryID, DirGroupsReplyData[] data) - { - throw new System.NotImplementedException(); - } - - public void SendDirClassifiedReply(UUID queryID, DirClassifiedReplyData[] data) - { - throw new System.NotImplementedException(); - } - - public void SendDirLandReply(UUID queryID, DirLandReplyData[] data) - { - throw new System.NotImplementedException(); - } - - public void SendDirPopularReply(UUID queryID, DirPopularReplyData[] data) - { - throw new System.NotImplementedException(); - } - - public void SendEventInfoReply(EventData info) - { - throw new System.NotImplementedException(); - } - - public void SendMapItemReply(mapItemReply[] replies, uint mapitemtype, uint flags) - { - throw new System.NotImplementedException(); - } - - public void SendAvatarGroupsReply(UUID avatarID, GroupMembershipData[] data) - { - throw new System.NotImplementedException(); - } - - public void SendOfferCallingCard(UUID srcID, UUID transactionID) - { - throw new System.NotImplementedException(); - } - - public void SendAcceptCallingCard(UUID transactionID) - { - throw new System.NotImplementedException(); - } - - public void SendDeclineCallingCard(UUID transactionID) - { - throw new System.NotImplementedException(); - } - - public void SendTerminateFriend(UUID exFriendID) - { - throw new System.NotImplementedException(); - } - - public void SendAvatarClassifiedReply(UUID targetID, UUID[] classifiedID, string[] name) - { - throw new System.NotImplementedException(); - } - - public void SendClassifiedInfoReply(UUID classifiedID, UUID creatorID, uint creationDate, uint expirationDate, uint category, string name, string description, UUID parcelID, uint parentEstate, UUID snapshotID, string simName, Vector3 globalPos, string parcelName, byte classifiedFlags, int price) - { - throw new System.NotImplementedException(); - } - - public void SendAgentDropGroup(UUID groupID) - { - throw new System.NotImplementedException(); - } - - public void RefreshGroupMembership() - { - throw new System.NotImplementedException(); - } - - public void SendAvatarNotesReply(UUID targetID, string text) - { - throw new System.NotImplementedException(); - } - - public void SendAvatarPicksReply(UUID targetID, Dictionary picks) - { - throw new System.NotImplementedException(); - } - - public void SendPickInfoReply(UUID pickID, UUID creatorID, bool topPick, UUID parcelID, string name, string desc, UUID snapshotID, string user, string originalName, string simName, Vector3 posGlobal, int sortOrder, bool enabled) - { - throw new System.NotImplementedException(); - } - - public void SendAvatarClassifiedReply(UUID targetID, Dictionary classifieds) - { - throw new System.NotImplementedException(); - } - - public void SendParcelDwellReply(int localID, UUID parcelID, float dwell) - { - throw new System.NotImplementedException(); - } - - public void SendUserInfoReply(bool imViaEmail, bool visible, string email) - { - throw new System.NotImplementedException(); - } - - public void SendUseCachedMuteList() - { - throw new System.NotImplementedException(); - } - - public void SendMuteListUpdate(string filename) - { - throw new System.NotImplementedException(); - } - - public void KillEndDone() - { - throw new System.NotImplementedException(); - } - - public bool AddGenericPacketHandler(string MethodName, GenericMessage handler) - { - throw new System.NotImplementedException(); - } - - public void SendRebakeAvatarTextures(UUID textureID) - { - throw new System.NotImplementedException(); - } - - public void SendAvatarInterestsReply(UUID avatarID, uint wantMask, string wantText, uint skillsMask, string skillsText, string languages) - { - throw new System.NotImplementedException(); - } - - public void SendGroupAccountingDetails(IClientAPI sender,UUID groupID, UUID transactionID, UUID sessionID, int amt) - { - } - - public void SendGroupAccountingSummary(IClientAPI sender,UUID groupID, uint moneyAmt, int totalTier, int usedTier) - { - } - - public void SendGroupTransactionsSummaryDetails(IClientAPI sender,UUID groupID, UUID transactionID, UUID sessionID,int amt) - { - } - - public void SendGroupVoteHistory(UUID groupID, UUID transactionID, GroupVoteHistory[] Votes) - { - } - - public void SendGroupActiveProposals(UUID groupID, UUID transactionID, GroupActiveProposals[] Proposals) - { - } - - public void SendChangeUserRights(UUID agentID, UUID friendID, int rights) - { - } - - public void SendTextBoxRequest(string message, int chatChannel, string objectname, string ownerFirstName, string ownerLastName, UUID objectId) - { - } - - public void StopFlying(ISceneEntity presence) - { - } - - #endregion - } -} diff --git a/OpenSim/Client/Sirikata/Protocol/MessageHeader.cs b/OpenSim/Client/Sirikata/Protocol/MessageHeader.cs deleted file mode 100644 index 22e10f778d..0000000000 --- a/OpenSim/Client/Sirikata/Protocol/MessageHeader.cs +++ /dev/null @@ -1,630 +0,0 @@ -// Generated by the protocol buffer compiler. DO NOT EDIT! - -using pb = global::Google.ProtocolBuffers; -using pbc = global::Google.ProtocolBuffers.Collections; -using pbd = global::Google.ProtocolBuffers.Descriptors; -using scg = global::System.Collections.Generic; -namespace Sirikata.Protocol._PBJ_Internal { - - public static partial class MessageHeader { - - #region Extension registration - public static void RegisterAllExtensions(pb::ExtensionRegistry registry) { - } - #endregion - #region Static variables - internal static pbd::MessageDescriptor internal__static_Sirikata_Protocol__PBJ_Internal_Header__Descriptor; - internal static pb::FieldAccess.FieldAccessorTable internal__static_Sirikata_Protocol__PBJ_Internal_Header__FieldAccessorTable; - #endregion - #region Descriptor - public static pbd::FileDescriptor Descriptor { - get { return descriptor; } - } - private static pbd::FileDescriptor descriptor; - - static MessageHeader() { - byte[] descriptorData = global::System.Convert.FromBase64String( - "ChNNZXNzYWdlSGVhZGVyLnByb3RvEh9TaXJpa2F0YS5Qcm90b2NvbC5fUEJK" + - "X0ludGVybmFsIooDCgZIZWFkZXISFQoNc291cmNlX29iamVjdBgBIAEoDBIT" + - "Cgtzb3VyY2VfcG9ydBgDIAEoDRIVCgxzb3VyY2Vfc3BhY2UYgAwgASgMEhoK" + - "EmRlc3RpbmF0aW9uX29iamVjdBgCIAEoDBIYChBkZXN0aW5hdGlvbl9wb3J0" + - "GAQgASgNEhoKEWRlc3RpbmF0aW9uX3NwYWNlGIEMIAEoDBIKCgJpZBgHIAEo" + - "AxIQCghyZXBseV9pZBgIIAEoAxJMCg1yZXR1cm5fc3RhdHVzGIAOIAEoDjI0" + - "LlNpcmlrYXRhLlByb3RvY29sLl9QQkpfSW50ZXJuYWwuSGVhZGVyLlJldHVy" + - "blN0YXR1cyJ/CgxSZXR1cm5TdGF0dXMSCwoHU1VDQ0VTUxAAEhMKD05FVFdP" + - "UktfRkFJTFVSRRABEhMKD1RJTUVPVVRfRkFJTFVSRRADEhIKDlBST1RPQ09M" + - "X0VSUk9SEAQSEAoMUE9SVF9GQUlMVVJFEAUSEgoOVU5LTk9XTl9PQkpFQ1QQ" + - "Bg=="); - pbd::FileDescriptor.InternalDescriptorAssigner assigner = delegate(pbd::FileDescriptor root) { - descriptor = root; - internal__static_Sirikata_Protocol__PBJ_Internal_Header__Descriptor = Descriptor.MessageTypes[0]; - internal__static_Sirikata_Protocol__PBJ_Internal_Header__FieldAccessorTable = - new pb::FieldAccess.FieldAccessorTable(internal__static_Sirikata_Protocol__PBJ_Internal_Header__Descriptor, - new string[] { "SourceObject", "SourcePort", "SourceSpace", "DestinationObject", "DestinationPort", "DestinationSpace", "Id", "ReplyId", "ReturnStatus", }); - return null; - }; - pbd::FileDescriptor.InternalBuildGeneratedFileFrom(descriptorData, - new pbd::FileDescriptor[] { - }, assigner); - } - #endregion - - } - #region Messages - public sealed partial class Header : pb::GeneratedMessage { - private static readonly Header defaultInstance = new Builder().BuildPartial(); - public static Header DefaultInstance { - get { return defaultInstance; } - } - - public override Header DefaultInstanceForType { - get { return defaultInstance; } - } - - protected override Header ThisMessage { - get { return this; } - } - - public static pbd::MessageDescriptor Descriptor { - get { return global::Sirikata.Protocol._PBJ_Internal.MessageHeader.internal__static_Sirikata_Protocol__PBJ_Internal_Header__Descriptor; } - } - - protected override pb::FieldAccess.FieldAccessorTable InternalFieldAccessors { - get { return global::Sirikata.Protocol._PBJ_Internal.MessageHeader.internal__static_Sirikata_Protocol__PBJ_Internal_Header__FieldAccessorTable; } - } - - #region Nested types - public static class Types { - public enum ReturnStatus { - SUCCESS = 0, - NETWORK_FAILURE = 1, - TIMEOUT_FAILURE = 3, - PROTOCOL_ERROR = 4, - PORT_FAILURE = 5, - UNKNOWN_OBJECT = 6, - } - - } - #endregion - - public const int SourceObjectFieldNumber = 1; - private bool hasSourceObject; - private pb::ByteString sourceObject_ = pb::ByteString.Empty; - public bool HasSourceObject { - get { return hasSourceObject; } - } - public pb::ByteString SourceObject { - get { return sourceObject_; } - } - - public const int SourcePortFieldNumber = 3; - private bool hasSourcePort; - private uint sourcePort_ = 0; - public bool HasSourcePort { - get { return hasSourcePort; } - } - [global::System.CLSCompliant(false)] - public uint SourcePort { - get { return sourcePort_; } - } - - public const int SourceSpaceFieldNumber = 1536; - private bool hasSourceSpace; - private pb::ByteString sourceSpace_ = pb::ByteString.Empty; - public bool HasSourceSpace { - get { return hasSourceSpace; } - } - public pb::ByteString SourceSpace { - get { return sourceSpace_; } - } - - public const int DestinationObjectFieldNumber = 2; - private bool hasDestinationObject; - private pb::ByteString destinationObject_ = pb::ByteString.Empty; - public bool HasDestinationObject { - get { return hasDestinationObject; } - } - public pb::ByteString DestinationObject { - get { return destinationObject_; } - } - - public const int DestinationPortFieldNumber = 4; - private bool hasDestinationPort; - private uint destinationPort_ = 0; - public bool HasDestinationPort { - get { return hasDestinationPort; } - } - [global::System.CLSCompliant(false)] - public uint DestinationPort { - get { return destinationPort_; } - } - - public const int DestinationSpaceFieldNumber = 1537; - private bool hasDestinationSpace; - private pb::ByteString destinationSpace_ = pb::ByteString.Empty; - public bool HasDestinationSpace { - get { return hasDestinationSpace; } - } - public pb::ByteString DestinationSpace { - get { return destinationSpace_; } - } - - public const int IdFieldNumber = 7; - private bool hasId; - private long id_ = 0L; - public bool HasId { - get { return hasId; } - } - public long Id { - get { return id_; } - } - - public const int ReplyIdFieldNumber = 8; - private bool hasReplyId; - private long replyId_ = 0L; - public bool HasReplyId { - get { return hasReplyId; } - } - public long ReplyId { - get { return replyId_; } - } - - public const int ReturnStatusFieldNumber = 1792; - private bool hasReturnStatus; - private global::Sirikata.Protocol._PBJ_Internal.Header.Types.ReturnStatus returnStatus_ = global::Sirikata.Protocol._PBJ_Internal.Header.Types.ReturnStatus.SUCCESS; - public bool HasReturnStatus { - get { return hasReturnStatus; } - } - public global::Sirikata.Protocol._PBJ_Internal.Header.Types.ReturnStatus ReturnStatus { - get { return returnStatus_; } - } - - public override bool IsInitialized { - get { - return true; - } - } - - public override void WriteTo(pb::CodedOutputStream output) { - if (HasSourceObject) { - output.WriteBytes(1, SourceObject); - } - if (HasDestinationObject) { - output.WriteBytes(2, DestinationObject); - } - if (HasSourcePort) { - output.WriteUInt32(3, SourcePort); - } - if (HasDestinationPort) { - output.WriteUInt32(4, DestinationPort); - } - if (HasId) { - output.WriteInt64(7, Id); - } - if (HasReplyId) { - output.WriteInt64(8, ReplyId); - } - if (HasSourceSpace) { - output.WriteBytes(1536, SourceSpace); - } - if (HasDestinationSpace) { - output.WriteBytes(1537, DestinationSpace); - } - if (HasReturnStatus) { - output.WriteEnum(1792, (int) ReturnStatus); - } - UnknownFields.WriteTo(output); - } - - private int memoizedSerializedSize = -1; - public override int SerializedSize { - get { - int size = memoizedSerializedSize; - if (size != -1) return size; - - size = 0; - if (HasSourceObject) { - size += pb::CodedOutputStream.ComputeBytesSize(1, SourceObject); - } - if (HasSourcePort) { - size += pb::CodedOutputStream.ComputeUInt32Size(3, SourcePort); - } - if (HasSourceSpace) { - size += pb::CodedOutputStream.ComputeBytesSize(1536, SourceSpace); - } - if (HasDestinationObject) { - size += pb::CodedOutputStream.ComputeBytesSize(2, DestinationObject); - } - if (HasDestinationPort) { - size += pb::CodedOutputStream.ComputeUInt32Size(4, DestinationPort); - } - if (HasDestinationSpace) { - size += pb::CodedOutputStream.ComputeBytesSize(1537, DestinationSpace); - } - if (HasId) { - size += pb::CodedOutputStream.ComputeInt64Size(7, Id); - } - if (HasReplyId) { - size += pb::CodedOutputStream.ComputeInt64Size(8, ReplyId); - } - if (HasReturnStatus) { - size += pb::CodedOutputStream.ComputeEnumSize(1792, (int) ReturnStatus); - } - size += UnknownFields.SerializedSize; - memoizedSerializedSize = size; - return size; - } - } - - public static Header ParseFrom(pb::ByteString data) { - return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); - } - public static Header ParseFrom(pb::ByteString data, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); - } - public static Header ParseFrom(byte[] data) { - return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); - } - public static Header ParseFrom(byte[] data, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); - } - public static Header ParseFrom(global::System.IO.Stream input) { - return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); - } - public static Header ParseFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); - } - public static Header ParseDelimitedFrom(global::System.IO.Stream input) { - return CreateBuilder().MergeDelimitedFrom(input).BuildParsed(); - } - public static Header ParseDelimitedFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { - return CreateBuilder().MergeDelimitedFrom(input, extensionRegistry).BuildParsed(); - } - public static Header ParseFrom(pb::CodedInputStream input) { - return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); - } - public static Header ParseFrom(pb::CodedInputStream input, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); - } - public static Builder CreateBuilder() { return new Builder(); } - public override Builder ToBuilder() { return CreateBuilder(this); } - public override Builder CreateBuilderForType() { return new Builder(); } - public static Builder CreateBuilder(Header prototype) { - return (Builder) new Builder().MergeFrom(prototype); - } - - public sealed partial class Builder : pb::GeneratedBuilder { - protected override Builder ThisBuilder { - get { return this; } - } - public Builder() {} - - Header result = new Header(); - - protected override Header MessageBeingBuilt { - get { return result; } - } - - public override Builder Clear() { - result = new Header(); - return this; - } - - public override Builder Clone() { - return new Builder().MergeFrom(result); - } - - public override pbd::MessageDescriptor DescriptorForType { - get { return global::Sirikata.Protocol._PBJ_Internal.Header.Descriptor; } - } - - public override Header DefaultInstanceForType { - get { return global::Sirikata.Protocol._PBJ_Internal.Header.DefaultInstance; } - } - - public override Header BuildPartial() { - if (result == null) { - throw new global::System.InvalidOperationException("build() has already been called on this Builder"); - } - Header returnMe = result; - result = null; - return returnMe; - } - - public override Builder MergeFrom(pb::IMessage other) { - if (other is Header) { - return MergeFrom((Header) other); - } else { - base.MergeFrom(other); - return this; - } - } - - public override Builder MergeFrom(Header other) { - if (other == global::Sirikata.Protocol._PBJ_Internal.Header.DefaultInstance) return this; - if (other.HasSourceObject) { - SourceObject = other.SourceObject; - } - if (other.HasSourcePort) { - SourcePort = other.SourcePort; - } - if (other.HasSourceSpace) { - SourceSpace = other.SourceSpace; - } - if (other.HasDestinationObject) { - DestinationObject = other.DestinationObject; - } - if (other.HasDestinationPort) { - DestinationPort = other.DestinationPort; - } - if (other.HasDestinationSpace) { - DestinationSpace = other.DestinationSpace; - } - if (other.HasId) { - Id = other.Id; - } - if (other.HasReplyId) { - ReplyId = other.ReplyId; - } - if (other.HasReturnStatus) { - ReturnStatus = other.ReturnStatus; - } - this.MergeUnknownFields(other.UnknownFields); - return this; - } - - public override Builder MergeFrom(pb::CodedInputStream input) { - return MergeFrom(input, pb::ExtensionRegistry.Empty); - } - - public override Builder MergeFrom(pb::CodedInputStream input, pb::ExtensionRegistry extensionRegistry) { - pb::UnknownFieldSet.Builder unknownFields = null; - while (true) { - uint tag = input.ReadTag(); - switch (tag) { - case 0: { - if (unknownFields != null) { - this.UnknownFields = unknownFields.Build(); - } - return this; - } - default: { - if (pb::WireFormat.IsEndGroupTag(tag)) { - if (unknownFields != null) { - this.UnknownFields = unknownFields.Build(); - } - return this; - } - if (unknownFields == null) { - unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); - } - ParseUnknownField(input, unknownFields, extensionRegistry, tag); - break; - } - case 10: { - SourceObject = input.ReadBytes(); - break; - } - case 18: { - DestinationObject = input.ReadBytes(); - break; - } - case 24: { - SourcePort = input.ReadUInt32(); - break; - } - case 32: { - DestinationPort = input.ReadUInt32(); - break; - } - case 56: { - Id = input.ReadInt64(); - break; - } - case 64: { - ReplyId = input.ReadInt64(); - break; - } - case 12290: { - SourceSpace = input.ReadBytes(); - break; - } - case 12298: { - DestinationSpace = input.ReadBytes(); - break; - } - case 14336: { - int rawValue = input.ReadEnum(); - if (!global::System.Enum.IsDefined(typeof(global::Sirikata.Protocol._PBJ_Internal.Header.Types.ReturnStatus), rawValue)) { - if (unknownFields == null) { - unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); - } - unknownFields.MergeVarintField(1792, (ulong) rawValue); - } else { - ReturnStatus = (global::Sirikata.Protocol._PBJ_Internal.Header.Types.ReturnStatus) rawValue; - } - break; - } - } - } - } - - - public bool HasSourceObject { - get { return result.HasSourceObject; } - } - public pb::ByteString SourceObject { - get { return result.SourceObject; } - set { SetSourceObject(value); } - } - public Builder SetSourceObject(pb::ByteString value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - result.hasSourceObject = true; - result.sourceObject_ = value; - return this; - } - public Builder ClearSourceObject() { - result.hasSourceObject = false; - result.sourceObject_ = pb::ByteString.Empty; - return this; - } - - public bool HasSourcePort { - get { return result.HasSourcePort; } - } - [global::System.CLSCompliant(false)] - public uint SourcePort { - get { return result.SourcePort; } - set { SetSourcePort(value); } - } - [global::System.CLSCompliant(false)] - public Builder SetSourcePort(uint value) { - result.hasSourcePort = true; - result.sourcePort_ = value; - return this; - } - public Builder ClearSourcePort() { - result.hasSourcePort = false; - result.sourcePort_ = 0; - return this; - } - - public bool HasSourceSpace { - get { return result.HasSourceSpace; } - } - public pb::ByteString SourceSpace { - get { return result.SourceSpace; } - set { SetSourceSpace(value); } - } - public Builder SetSourceSpace(pb::ByteString value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - result.hasSourceSpace = true; - result.sourceSpace_ = value; - return this; - } - public Builder ClearSourceSpace() { - result.hasSourceSpace = false; - result.sourceSpace_ = pb::ByteString.Empty; - return this; - } - - public bool HasDestinationObject { - get { return result.HasDestinationObject; } - } - public pb::ByteString DestinationObject { - get { return result.DestinationObject; } - set { SetDestinationObject(value); } - } - public Builder SetDestinationObject(pb::ByteString value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - result.hasDestinationObject = true; - result.destinationObject_ = value; - return this; - } - public Builder ClearDestinationObject() { - result.hasDestinationObject = false; - result.destinationObject_ = pb::ByteString.Empty; - return this; - } - - public bool HasDestinationPort { - get { return result.HasDestinationPort; } - } - [global::System.CLSCompliant(false)] - public uint DestinationPort { - get { return result.DestinationPort; } - set { SetDestinationPort(value); } - } - [global::System.CLSCompliant(false)] - public Builder SetDestinationPort(uint value) { - result.hasDestinationPort = true; - result.destinationPort_ = value; - return this; - } - public Builder ClearDestinationPort() { - result.hasDestinationPort = false; - result.destinationPort_ = 0; - return this; - } - - public bool HasDestinationSpace { - get { return result.HasDestinationSpace; } - } - public pb::ByteString DestinationSpace { - get { return result.DestinationSpace; } - set { SetDestinationSpace(value); } - } - public Builder SetDestinationSpace(pb::ByteString value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - result.hasDestinationSpace = true; - result.destinationSpace_ = value; - return this; - } - public Builder ClearDestinationSpace() { - result.hasDestinationSpace = false; - result.destinationSpace_ = pb::ByteString.Empty; - return this; - } - - public bool HasId { - get { return result.HasId; } - } - public long Id { - get { return result.Id; } - set { SetId(value); } - } - public Builder SetId(long value) { - result.hasId = true; - result.id_ = value; - return this; - } - public Builder ClearId() { - result.hasId = false; - result.id_ = 0L; - return this; - } - - public bool HasReplyId { - get { return result.HasReplyId; } - } - public long ReplyId { - get { return result.ReplyId; } - set { SetReplyId(value); } - } - public Builder SetReplyId(long value) { - result.hasReplyId = true; - result.replyId_ = value; - return this; - } - public Builder ClearReplyId() { - result.hasReplyId = false; - result.replyId_ = 0L; - return this; - } - - public bool HasReturnStatus { - get { return result.HasReturnStatus; } - } - public global::Sirikata.Protocol._PBJ_Internal.Header.Types.ReturnStatus ReturnStatus { - get { return result.ReturnStatus; } - set { SetReturnStatus(value); } - } - public Builder SetReturnStatus(global::Sirikata.Protocol._PBJ_Internal.Header.Types.ReturnStatus value) { - result.hasReturnStatus = true; - result.returnStatus_ = value; - return this; - } - public Builder ClearReturnStatus() { - result.hasReturnStatus = false; - result.returnStatus_ = global::Sirikata.Protocol._PBJ_Internal.Header.Types.ReturnStatus.SUCCESS; - return this; - } - } - static Header() { - object.ReferenceEquals(global::Sirikata.Protocol._PBJ_Internal.MessageHeader.Descriptor, null); - } - } - - #endregion - -} diff --git a/OpenSim/Client/Sirikata/Protocol/MessageHeader.pbj.cs b/OpenSim/Client/Sirikata/Protocol/MessageHeader.pbj.cs deleted file mode 100644 index fb4963fc93..0000000000 --- a/OpenSim/Client/Sirikata/Protocol/MessageHeader.pbj.cs +++ /dev/null @@ -1,339 +0,0 @@ -/* - * Copyright (c) Contributors, http://opensimulator.org/ - * See CONTRIBUTORS.TXT for a full list of copyright holders. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * * Neither the name of the OpenSimulator Project nor the - * names of its contributors may be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE DEVELOPERS ``AS IS'' AND ANY - * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED - * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL THE CONTRIBUTORS BE LIABLE FOR ANY - * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES - * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; - * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ - -using pbd = global::Google.ProtocolBuffers.Descriptors; -using pb = global::Google.ProtocolBuffers; -namespace Sirikata.Protocol { - public class Header : PBJ.IMessage { - protected _PBJ_Internal.Header super; - public _PBJ_Internal.Header _PBJSuper{ get { return super;} } - public Header() { - super=new _PBJ_Internal.Header(); - } - public Header(_PBJ_Internal.Header reference) { - super=reference; - } - public static Header defaultInstance= new Header (_PBJ_Internal.Header.DefaultInstance); - public static Header DefaultInstance{ - get {return defaultInstance;} - } - public static pbd.MessageDescriptor Descriptor { - get { return _PBJ_Internal.Header.Descriptor; } } - public static class Types { - public enum ReturnStatus { - SUCCESS=_PBJ_Internal.Header.Types.ReturnStatus.SUCCESS, - NETWORK_FAILURE=_PBJ_Internal.Header.Types.ReturnStatus.NETWORK_FAILURE, - TIMEOUT_FAILURE=_PBJ_Internal.Header.Types.ReturnStatus.TIMEOUT_FAILURE, - PROTOCOL_ERROR=_PBJ_Internal.Header.Types.ReturnStatus.PROTOCOL_ERROR, - PORT_FAILURE=_PBJ_Internal.Header.Types.ReturnStatus.PORT_FAILURE, - UNKNOWN_OBJECT=_PBJ_Internal.Header.Types.ReturnStatus.UNKNOWN_OBJECT - }; - } - public static bool WithinReservedFieldTagRange(int field_tag) { - return false||(field_tag>=1&&field_tag<=8)||(field_tag>=1536&&field_tag<=2560)||(field_tag>=229376&&field_tag<=294912); - } - public static bool WithinExtensionFieldTagRange(int field_tag) { - return false; - } - public const int SourceObjectFieldTag=1; - public bool HasSourceObject{ get {return super.HasSourceObject&&PBJ._PBJ.ValidateUuid(super.SourceObject);} } - public PBJ.UUID SourceObject{ get { - if (HasSourceObject) { - return PBJ._PBJ.CastUuid(super.SourceObject); - } else { - return PBJ._PBJ.CastUuid(); - } - } - } - public const int SourcePortFieldTag=3; - public bool HasSourcePort{ get {return super.HasSourcePort&&PBJ._PBJ.ValidateUint32(super.SourcePort);} } - public uint SourcePort{ get { - if (HasSourcePort) { - return PBJ._PBJ.CastUint32(super.SourcePort); - } else { - return PBJ._PBJ.CastUint32(); - } - } - } - public const int SourceSpaceFieldTag=1536; - public bool HasSourceSpace{ get {return super.HasSourceSpace&&PBJ._PBJ.ValidateUuid(super.SourceSpace);} } - public PBJ.UUID SourceSpace{ get { - if (HasSourceSpace) { - return PBJ._PBJ.CastUuid(super.SourceSpace); - } else { - return PBJ._PBJ.CastUuid(); - } - } - } - public const int DestinationObjectFieldTag=2; - public bool HasDestinationObject{ get {return super.HasDestinationObject&&PBJ._PBJ.ValidateUuid(super.DestinationObject);} } - public PBJ.UUID DestinationObject{ get { - if (HasDestinationObject) { - return PBJ._PBJ.CastUuid(super.DestinationObject); - } else { - return PBJ._PBJ.CastUuid(); - } - } - } - public const int DestinationPortFieldTag=4; - public bool HasDestinationPort{ get {return super.HasDestinationPort&&PBJ._PBJ.ValidateUint32(super.DestinationPort);} } - public uint DestinationPort{ get { - if (HasDestinationPort) { - return PBJ._PBJ.CastUint32(super.DestinationPort); - } else { - return PBJ._PBJ.CastUint32(); - } - } - } - public const int DestinationSpaceFieldTag=1537; - public bool HasDestinationSpace{ get {return super.HasDestinationSpace&&PBJ._PBJ.ValidateUuid(super.DestinationSpace);} } - public PBJ.UUID DestinationSpace{ get { - if (HasDestinationSpace) { - return PBJ._PBJ.CastUuid(super.DestinationSpace); - } else { - return PBJ._PBJ.CastUuid(); - } - } - } - public const int IdFieldTag=7; - public bool HasId{ get {return super.HasId&&PBJ._PBJ.ValidateInt64(super.Id);} } - public long Id{ get { - if (HasId) { - return PBJ._PBJ.CastInt64(super.Id); - } else { - return PBJ._PBJ.CastInt64(); - } - } - } - public const int ReplyIdFieldTag=8; - public bool HasReplyId{ get {return super.HasReplyId&&PBJ._PBJ.ValidateInt64(super.ReplyId);} } - public long ReplyId{ get { - if (HasReplyId) { - return PBJ._PBJ.CastInt64(super.ReplyId); - } else { - return PBJ._PBJ.CastInt64(); - } - } - } - public const int ReturnStatusFieldTag=1792; - public bool HasReturnStatus{ get {return super.HasReturnStatus;} } - public Types.ReturnStatus ReturnStatus{ get { - if (HasReturnStatus) { - return (Types.ReturnStatus)super.ReturnStatus; - } else { - return new Types.ReturnStatus(); - } - } - } - public override Google.ProtocolBuffers.IMessage _PBJISuper { get { return super; } } - public override PBJ.IMessage.IBuilder WeakCreateBuilderForType() { return new Builder(); } - public static Builder CreateBuilder() { return new Builder(); } - public static Builder CreateBuilder(Header prototype) { - return (Builder)new Builder().MergeFrom(prototype); - } - public static Header ParseFrom(pb::ByteString data) { - return new Header(_PBJ_Internal.Header.ParseFrom(data)); - } - public static Header ParseFrom(pb::ByteString data, pb::ExtensionRegistry er) { - return new Header(_PBJ_Internal.Header.ParseFrom(data,er)); - } - public static Header ParseFrom(byte[] data) { - return new Header(_PBJ_Internal.Header.ParseFrom(data)); - } - public static Header ParseFrom(byte[] data, pb::ExtensionRegistry er) { - return new Header(_PBJ_Internal.Header.ParseFrom(data,er)); - } - public static Header ParseFrom(global::System.IO.Stream data) { - return new Header(_PBJ_Internal.Header.ParseFrom(data)); - } - public static Header ParseFrom(global::System.IO.Stream data, pb::ExtensionRegistry er) { - return new Header(_PBJ_Internal.Header.ParseFrom(data,er)); - } - public static Header ParseFrom(pb::CodedInputStream data) { - return new Header(_PBJ_Internal.Header.ParseFrom(data)); - } - public static Header ParseFrom(pb::CodedInputStream data, pb::ExtensionRegistry er) { - return new Header(_PBJ_Internal.Header.ParseFrom(data,er)); - } - protected override bool _HasAllPBJFields{ get { - return true - ; - } } - public bool IsInitialized { get { - return super.IsInitialized&&_HasAllPBJFields; - } } - public class Builder : global::PBJ.IMessage.IBuilder{ - protected override bool _HasAllPBJFields{ get { - return true - ; - } } - public bool IsInitialized { get { - return super.IsInitialized&&_HasAllPBJFields; - } } - protected _PBJ_Internal.Header.Builder super; - public override Google.ProtocolBuffers.IBuilder _PBJISuper { get { return super; } } - public _PBJ_Internal.Header.Builder _PBJSuper{ get { return super;} } - public Builder() {super = new _PBJ_Internal.Header.Builder();} - public Builder(_PBJ_Internal.Header.Builder other) { - super=other; - } - public Builder Clone() {return new Builder(super.Clone());} - public Builder MergeFrom(Header prototype) { super.MergeFrom(prototype._PBJSuper);return this;} - public Builder Clear() {super.Clear();return this;} - public Header BuildPartial() {return new Header(super.BuildPartial());} - public Header Build() {if (_HasAllPBJFields) return new Header(super.Build());return null;} - public pbd::MessageDescriptor DescriptorForType { - get { return Header.Descriptor; } } - public Builder ClearSourceObject() { super.ClearSourceObject();return this;} - public const int SourceObjectFieldTag=1; - public bool HasSourceObject{ get {return super.HasSourceObject&&PBJ._PBJ.ValidateUuid(super.SourceObject);} } - public PBJ.UUID SourceObject{ get { - if (HasSourceObject) { - return PBJ._PBJ.CastUuid(super.SourceObject); - } else { - return PBJ._PBJ.CastUuid(); - } - } - set { - super.SourceObject=(PBJ._PBJ.Construct(value)); - } - } - public Builder ClearSourcePort() { super.ClearSourcePort();return this;} - public const int SourcePortFieldTag=3; - public bool HasSourcePort{ get {return super.HasSourcePort&&PBJ._PBJ.ValidateUint32(super.SourcePort);} } - public uint SourcePort{ get { - if (HasSourcePort) { - return PBJ._PBJ.CastUint32(super.SourcePort); - } else { - return PBJ._PBJ.CastUint32(); - } - } - set { - super.SourcePort=(PBJ._PBJ.Construct(value)); - } - } - public Builder ClearSourceSpace() { super.ClearSourceSpace();return this;} - public const int SourceSpaceFieldTag=1536; - public bool HasSourceSpace{ get {return super.HasSourceSpace&&PBJ._PBJ.ValidateUuid(super.SourceSpace);} } - public PBJ.UUID SourceSpace{ get { - if (HasSourceSpace) { - return PBJ._PBJ.CastUuid(super.SourceSpace); - } else { - return PBJ._PBJ.CastUuid(); - } - } - set { - super.SourceSpace=(PBJ._PBJ.Construct(value)); - } - } - public Builder ClearDestinationObject() { super.ClearDestinationObject();return this;} - public const int DestinationObjectFieldTag=2; - public bool HasDestinationObject{ get {return super.HasDestinationObject&&PBJ._PBJ.ValidateUuid(super.DestinationObject);} } - public PBJ.UUID DestinationObject{ get { - if (HasDestinationObject) { - return PBJ._PBJ.CastUuid(super.DestinationObject); - } else { - return PBJ._PBJ.CastUuid(); - } - } - set { - super.DestinationObject=(PBJ._PBJ.Construct(value)); - } - } - public Builder ClearDestinationPort() { super.ClearDestinationPort();return this;} - public const int DestinationPortFieldTag=4; - public bool HasDestinationPort{ get {return super.HasDestinationPort&&PBJ._PBJ.ValidateUint32(super.DestinationPort);} } - public uint DestinationPort{ get { - if (HasDestinationPort) { - return PBJ._PBJ.CastUint32(super.DestinationPort); - } else { - return PBJ._PBJ.CastUint32(); - } - } - set { - super.DestinationPort=(PBJ._PBJ.Construct(value)); - } - } - public Builder ClearDestinationSpace() { super.ClearDestinationSpace();return this;} - public const int DestinationSpaceFieldTag=1537; - public bool HasDestinationSpace{ get {return super.HasDestinationSpace&&PBJ._PBJ.ValidateUuid(super.DestinationSpace);} } - public PBJ.UUID DestinationSpace{ get { - if (HasDestinationSpace) { - return PBJ._PBJ.CastUuid(super.DestinationSpace); - } else { - return PBJ._PBJ.CastUuid(); - } - } - set { - super.DestinationSpace=(PBJ._PBJ.Construct(value)); - } - } - public Builder ClearId() { super.ClearId();return this;} - public const int IdFieldTag=7; - public bool HasId{ get {return super.HasId&&PBJ._PBJ.ValidateInt64(super.Id);} } - public long Id{ get { - if (HasId) { - return PBJ._PBJ.CastInt64(super.Id); - } else { - return PBJ._PBJ.CastInt64(); - } - } - set { - super.Id=(PBJ._PBJ.Construct(value)); - } - } - public Builder ClearReplyId() { super.ClearReplyId();return this;} - public const int ReplyIdFieldTag=8; - public bool HasReplyId{ get {return super.HasReplyId&&PBJ._PBJ.ValidateInt64(super.ReplyId);} } - public long ReplyId{ get { - if (HasReplyId) { - return PBJ._PBJ.CastInt64(super.ReplyId); - } else { - return PBJ._PBJ.CastInt64(); - } - } - set { - super.ReplyId=(PBJ._PBJ.Construct(value)); - } - } - public Builder ClearReturnStatus() { super.ClearReturnStatus();return this;} - public const int ReturnStatusFieldTag=1792; - public bool HasReturnStatus{ get {return super.HasReturnStatus;} } - public Types.ReturnStatus ReturnStatus{ get { - if (HasReturnStatus) { - return (Types.ReturnStatus)super.ReturnStatus; - } else { - return new Types.ReturnStatus(); - } - } - set { - super.ReturnStatus=((_PBJ_Internal.Header.Types.ReturnStatus)value); - } - } - } - } -} diff --git a/OpenSim/Client/Sirikata/Protocol/PBJ.cs b/OpenSim/Client/Sirikata/Protocol/PBJ.cs deleted file mode 100644 index 9b1951a6b1..0000000000 --- a/OpenSim/Client/Sirikata/Protocol/PBJ.cs +++ /dev/null @@ -1,2104 +0,0 @@ -/* - * Copyright (c) Contributors, http://opensimulator.org/ - * See CONTRIBUTORS.TXT for a full list of copyright holders. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * * Neither the name of the OpenSimulator Project nor the - * names of its contributors may be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE DEVELOPERS ``AS IS'' AND ANY - * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED - * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL THE CONTRIBUTORS BE LIABLE FOR ANY - * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES - * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; - * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ - -using System; -namespace PBJ -{ - - public class IMessage - { - public virtual Google.ProtocolBuffers.IMessage _PBJISuper { get { return null; } } - protected virtual bool _HasAllPBJFields { get { return true; } } - public void WriteTo(Google.ProtocolBuffers.CodedOutputStream output) - { - _PBJISuper.WriteTo(output); - } - public override bool Equals(object other) - { - return _PBJISuper.Equals(other); - } - public int SerializedSize { get { return _PBJISuper.SerializedSize; } } - - public override int GetHashCode() { return _PBJISuper.GetHashCode(); } - - public override string ToString() - { - return _PBJISuper.ToString(); - } - public virtual IBuilder WeakCreateBuilderForType() { return null; } - public Google.ProtocolBuffers.ByteString ToByteString() - { - return _PBJISuper.ToByteString(); - } - public byte[] ToByteArray() - { - return _PBJISuper.ToByteArray(); - } - public void WriteTo(global::System.IO.Stream output) - { - _PBJISuper.WriteTo(output); - } - // Google.ProtocolBuffers.MessageDescriptor DescriptorForType { get {return _PBJISuper.DescriptorForType;} } - public Google.ProtocolBuffers.UnknownFieldSet UnknownFields { get { return _PBJISuper.UnknownFields; } } - public class IBuilder - { - public virtual Google.ProtocolBuffers.IBuilder _PBJISuper { get { return null; } } - protected virtual bool _HasAllPBJFields { get { return true; } } - } - } - - public struct Vector2f - { - - public float x; - public float y; - - - public Vector2f(float _x, float _y) - { - x = _x; y = _y; - } - - public Vector2f(Vector2f cpy) - { - x = cpy.x; y = cpy.y; - } - - - public Vector2f Negate() - { - return new Vector2f(-x, -y); - } - - public Vector2f Add(Vector2f rhs) - { - return new Vector2f(x + rhs.x, y + rhs.y); - } - - public Vector2f Subtract(Vector2f rhs) - { - return new Vector2f(x - rhs.x, y - rhs.y); - } - - public Vector2f Multiply(Vector2f rhs) - { - return new Vector2f(x * rhs.x, y * rhs.y); - } - - public Vector2f Multiply(float s) - { - return new Vector2f(x * s, y * s); - } - - public Vector2f Divide(Vector2f rhs) - { - return new Vector2f(x / rhs.x, y / rhs.y); - } - - public Vector2f Divide(float s) - { - return new Vector2f(x / s, y / s); - } - - public float Dot(Vector2f rhs) - { - return (x * rhs.x + y * rhs.y); - } - - public void Normalize() - { - float len = Length; - if (len != 0.0) - { - x /= len; y /= len; - } - } - - public Vector2f Normalized - { - get - { - Vector2f normed = new Vector2f(this); - normed.Normalize(); - return normed; - } - } - - public float SquaredLength - { - get - { - return (x * x + y * y); - } - } - public float Length - { - get - { - return (float)Math.Sqrt(SquaredLength); - } - } - - - public override string ToString() - { - return String.Format("<{0}, {1}>", x, y); - } - - - public static Vector2f operator -(Vector2f uo) - { - return uo.Negate(); - } - - public static Vector2f operator +(Vector2f lhs, Vector2f rhs) - { - return lhs.Add(rhs); - } - - public static Vector2f operator -(Vector2f lhs, Vector2f rhs) - { - return lhs.Subtract(rhs); - } - - public static Vector2f operator *(Vector2f lhs, Vector2f rhs) - { - return lhs.Multiply(rhs); - } - - public static Vector2f operator *(Vector2f lhs, float rhs) - { - return lhs.Multiply(rhs); - } - public static Vector2f operator *(float lhs, Vector2f rhs) - { - return rhs.Multiply(lhs); - } - - public static Vector2f operator /(Vector2f lhs, Vector2f rhs) - { - return lhs.Divide(rhs); - } - - public static Vector2f operator /(Vector2f lhs, float rhs) - { - return lhs.Divide(rhs); - } - - } // struct Vector2f - - public struct Vector2d - { - - public double x; - public double y; - - - public Vector2d(double _x, double _y) - { - x = _x; y = _y; - } - - public Vector2d(Vector2d cpy) - { - x = cpy.x; y = cpy.y; - } - - - public Vector2d Negate() - { - return new Vector2d(-x, -y); - } - - public Vector2d Add(Vector2d rhs) - { - return new Vector2d(x + rhs.x, y + rhs.y); - } - - public Vector2d Subtract(Vector2d rhs) - { - return new Vector2d(x - rhs.x, y - rhs.y); - } - - public Vector2d Multiply(Vector2d rhs) - { - return new Vector2d(x * rhs.x, y * rhs.y); - } - - public Vector2d Multiply(double s) - { - return new Vector2d(x * s, y * s); - } - - public Vector2d Divide(Vector2d rhs) - { - return new Vector2d(x / rhs.x, y / rhs.y); - } - - public Vector2d Divide(double s) - { - return new Vector2d(x / s, y / s); - } - - public double Dot(Vector2d rhs) - { - return (x * rhs.x + y * rhs.y); - } - - public void Normalize() - { - double len = Length; - if (len != 0.0) - { - x /= len; y /= len; - } - } - - public Vector2d Normalized - { - get - { - Vector2d normed = new Vector2d(this); - normed.Normalize(); - return normed; - } - } - - public double SquaredLength - { - get - { - return (x * x + y * y); - } - } - public double Length - { - get - { - return Math.Sqrt(SquaredLength); - } - } - - - public override string ToString() - { - return String.Format("<{0}, {1}>", x, y); - } - - - public static Vector2d operator -(Vector2d uo) - { - return uo.Negate(); - } - - public static Vector2d operator +(Vector2d lhs, Vector2d rhs) - { - return lhs.Add(rhs); - } - - public static Vector2d operator -(Vector2d lhs, Vector2d rhs) - { - return lhs.Subtract(rhs); - } - - public static Vector2d operator *(Vector2d lhs, Vector2d rhs) - { - return lhs.Multiply(rhs); - } - - public static Vector2d operator *(Vector2d lhs, double rhs) - { - return lhs.Multiply(rhs); - } - public static Vector2d operator *(double lhs, Vector2d rhs) - { - return rhs.Multiply(lhs); - } - - public static Vector2d operator /(Vector2d lhs, Vector2d rhs) - { - return lhs.Divide(rhs); - } - - public static Vector2d operator /(Vector2d lhs, double rhs) - { - return lhs.Divide(rhs); - } - - } // struct Vector2d - - public struct Vector3f - { - - public float x; - public float y; - public float z; - - - public Vector3f(float _x, float _y, float _z) - { - x = _x; y = _y; z = _z; - } - - public Vector3f(Vector3f cpy) - { - x = cpy.x; y = cpy.y; z = cpy.z; - } - - - public Vector3f Negate() - { - return new Vector3f(-x, -y, -z); - } - - public Vector3f Add(Vector3f rhs) - { - return new Vector3f(x + rhs.x, y + rhs.y, z + rhs.z); - } - - public Vector3f Subtract(Vector3f rhs) - { - return new Vector3f(x - rhs.x, y - rhs.y, z - rhs.z); - } - - public Vector3f Multiply(Vector3f rhs) - { - return new Vector3f(x * rhs.x, y * rhs.y, z * rhs.z); - } - - public Vector3f Multiply(float s) - { - return new Vector3f(x * s, y * s, z * s); - } - - public Vector3f Divide(Vector3f rhs) - { - return new Vector3f(x / rhs.x, y / rhs.y, z / rhs.z); - } - - public Vector3f Divide(float s) - { - return new Vector3f(x / s, y / s, z / s); - } - - public float Dot(Vector3f rhs) - { - return (x * rhs.x + y * rhs.y + z * rhs.z); - } - - public Vector3f Cross(Vector3f rhs) - { - return new Vector3f(y * rhs.z - z * rhs.y, z * rhs.x - x * rhs.z, x * rhs.y - y * rhs.x); - } - - public void Normalize() - { - float len = Length; - if (len != 0.0) - { - x /= len; y /= len; z /= len; - } - } - - public Vector3f Normalized - { - get - { - Vector3f normed = new Vector3f(this); - normed.Normalize(); - return normed; - } - } - - public float SquaredLength - { - get - { - return (x * x + y * y + z * z); - } - } - public float Length - { - get - { - return (float)Math.Sqrt(SquaredLength); - } - } - - - public override string ToString() - { - return String.Format("<{0}, {1}, {2}>", x, y, z); - } - - - public static Vector3f operator -(Vector3f uo) - { - return uo.Negate(); - } - - public static Vector3f operator +(Vector3f lhs, Vector3f rhs) - { - return lhs.Add(rhs); - } - - public static Vector3f operator -(Vector3f lhs, Vector3f rhs) - { - return lhs.Subtract(rhs); - } - - public static Vector3f operator *(Vector3f lhs, Vector3f rhs) - { - return lhs.Multiply(rhs); - } - - public static Vector3f operator *(Vector3f lhs, float rhs) - { - return lhs.Multiply(rhs); - } - public static Vector3f operator *(float lhs, Vector3f rhs) - { - return rhs.Multiply(lhs); - } - - public static Vector3f operator /(Vector3f lhs, Vector3f rhs) - { - return lhs.Divide(rhs); - } - - public static Vector3f operator /(Vector3f lhs, float rhs) - { - return lhs.Divide(rhs); - } - - } // struct Vector3f - - public struct Vector3d - { - - public double x; - public double y; - public double z; - - - public Vector3d(double _x, double _y, double _z) - { - x = _x; y = _y; z = _z; - } - - public Vector3d(Vector3d cpy) - { - x = cpy.x; y = cpy.y; z = cpy.z; - } - - - public Vector3d Negate() - { - return new Vector3d(-x, -y, -z); - } - - public Vector3d Add(Vector3d rhs) - { - return new Vector3d(x + rhs.x, y + rhs.y, z + rhs.z); - } - - public Vector3d Subtract(Vector3d rhs) - { - return new Vector3d(x - rhs.x, y - rhs.y, z - rhs.z); - } - - public Vector3d Multiply(Vector3d rhs) - { - return new Vector3d(x * rhs.x, y * rhs.y, z * rhs.z); - } - - public Vector3d Multiply(double s) - { - return new Vector3d(x * s, y * s, z * s); - } - - public Vector3d Divide(Vector3d rhs) - { - return new Vector3d(x / rhs.x, y / rhs.y, z / rhs.z); - } - - public Vector3d Divide(double s) - { - return new Vector3d(x / s, y / s, z / s); - } - - public double Dot(Vector3d rhs) - { - return (x * rhs.x + y * rhs.y + z * rhs.z); - } - - public Vector3d Cross(Vector3d rhs) - { - return new Vector3d(y * rhs.z - z * rhs.y, z * rhs.x - x * rhs.z, x * rhs.y - y * rhs.x); - } - - public void Normalize() - { - double len = Length; - if (len != 0.0) - { - x /= len; y /= len; z /= len; - } - } - - public Vector3d Normalized - { - get - { - Vector3d normed = new Vector3d(this); - normed.Normalize(); - return normed; - } - } - - public double SquaredLength - { - get - { - return (x * x + y * y + z * z); - } - } - public double Length - { - get - { - return Math.Sqrt(SquaredLength); - } - } - - - public override string ToString() - { - return String.Format("<{0}, {1}, {2}>", x, y, z); - } - - - public static Vector3d operator -(Vector3d uo) - { - return uo.Negate(); - } - - public static Vector3d operator +(Vector3d lhs, Vector3d rhs) - { - return lhs.Add(rhs); - } - - public static Vector3d operator -(Vector3d lhs, Vector3d rhs) - { - return lhs.Subtract(rhs); - } - - public static Vector3d operator *(Vector3d lhs, Vector3d rhs) - { - return lhs.Multiply(rhs); - } - - public static Vector3d operator *(Vector3d lhs, double rhs) - { - return lhs.Multiply(rhs); - } - public static Vector3d operator *(double lhs, Vector3d rhs) - { - return rhs.Multiply(lhs); - } - - public static Vector3d operator /(Vector3d lhs, Vector3d rhs) - { - return lhs.Divide(rhs); - } - - public static Vector3d operator /(Vector3d lhs, double rhs) - { - return lhs.Divide(rhs); - } - - } // struct Vector3d - - public struct Quaternion - { - - public float w; - public float x; - public float y; - public float z; - - - public Quaternion(float _w, float _x, float _y, float _z) - { - w = _w; x = _x; y = _y; z = _z; - } - - public Quaternion(Quaternion cpy) - { - w = cpy.w; x = cpy.x; y = cpy.y; z = cpy.z; - } - - public static readonly Quaternion Identity = new Quaternion((float)1.0, (float)0.0, (float)0.0, (float)0.0); - - public static Quaternion FromAxisAngle(Vector3f axis, float rads) - { - float halfAngle = rads * 0.5f; - float sinHalf = (float)Math.Sin(halfAngle); - float w = (float)Math.Cos(halfAngle); - float x = sinHalf * axis.x; - float y = sinHalf * axis.y; - float z = sinHalf * axis.z; - return new Quaternion(w, x, y, z); - } - - public static Quaternion FromAxisAngle(Vector3d axis, float rads) - { - float halfAngle = rads * 0.5f; - float sinHalf = (float)Math.Sin(halfAngle); - float w = (float)Math.Cos(halfAngle); - float x = (float)(sinHalf * axis.x); - float y = (float)(sinHalf * axis.y); - float z = (float)(sinHalf * axis.z); - return new Quaternion(w, x, y, z); - } - - - public Quaternion Add(Quaternion rhs) - { - return new Quaternion(w + rhs.w, x + rhs.x, y + rhs.y, z + rhs.z); - } - - public Quaternion Subtract(Quaternion rhs) - { - return new Quaternion(w - rhs.w, x - rhs.x, y - rhs.y, z - rhs.z); - } - - public Quaternion Multiply(Quaternion rhs) - { - return new Quaternion( - w * rhs.w - x * rhs.x - y * rhs.y - z * rhs.z, - w * rhs.x + x * rhs.w + y * rhs.z - z * rhs.y, - w * rhs.y + y * rhs.w + z * rhs.x - x * rhs.z, - w * rhs.z + z * rhs.w + x * rhs.y - y * rhs.x - ); - } - - public Vector3f Multiply(Vector3f rhs) - { - Vector3f qvec = new Vector3f(x, y, z); - Vector3f uv = qvec.Cross(rhs); - Vector3f uuv = qvec.Cross(uv); - uv *= 2.0f * w; - uuv *= 2.0f; - - return rhs + uv + uuv; - } - - public Vector3d Multiply(Vector3d rhs) - { - Vector3d qvec = new Vector3d(x, y, z); - Vector3d uv = qvec.Cross(rhs); - Vector3d uuv = qvec.Cross(uv); - uv *= 2.0f * w; - uuv *= 2.0f; - - return rhs + uv + uuv; - } - - public Quaternion Multiply(float rhs) - { - return new Quaternion(w * rhs, x * rhs, y * rhs, z * rhs); - } - - public Quaternion Negate() - { - return new Quaternion(-w, -x, -y, -z); - } - - public float Dot(Quaternion rhs) - { - return (w * rhs.w + x * rhs.x + y * rhs.y + z * rhs.z); - } - - public float Norm - { - get - { - return (float)Math.Sqrt(w * w + x * x + y * y + z * z); - } - } - - public float SquareNorm - { - get - { - return (w * w + x * x + y * y + z * z); - } - } - - public void Normalize() - { - float len = SquareNorm; - if (len == 0.0) return; - float factor = 1.0f / (float)Math.Sqrt(len); - this *= factor; - } - - public Quaternion Normalized - { - get - { - Quaternion q = new Quaternion(this); - q.Normalize(); - return q; - } - } - - public Quaternion Inverse - { - get - { - float norm = SquareNorm; - if (norm > 0.0) - { - double invnorm = 1.0 / norm; - return new Quaternion((float)(w * invnorm), (float)(-x * invnorm), (float)(-y * invnorm), (float)(-z * invnorm)); - } - else - return new Quaternion((float)0.0, 0.0f, 0.0f, 0.0f); - } - } - - - public override string ToString() - { - return String.Format("<{0}, {1}, {2}, {3}>", w, x, y, z); - } - - - - public static Quaternion operator -(Quaternion uo) - { - return uo.Negate(); - } - - public static Quaternion operator +(Quaternion lhs, Quaternion rhs) - { - return lhs.Add(rhs); - } - - public static Quaternion operator -(Quaternion lhs, Quaternion rhs) - { - return lhs.Subtract(rhs); - } - - public static Vector3f operator *(Quaternion lhs, Vector3f rhs) - { - return lhs.Multiply(rhs); - } - - public static Vector3d operator *(Quaternion lhs, Vector3d rhs) - { - return lhs.Multiply(rhs); - } - - public static Quaternion operator *(Quaternion lhs, Quaternion rhs) - { - return lhs.Multiply(rhs); - } - - public static Quaternion operator *(Quaternion lhs, float rhs) - { - return lhs.Multiply(rhs); - } - - public static Quaternion operator *(float lhs, Quaternion rhs) - { - return rhs.Multiply(lhs); - } - - } // struct Quaternion - - - public struct Vector4f - { - - public float x; - public float y; - public float z; - public float w; - - - public Vector4f(float _x, float _y, float _z, float _w) - { - x = _x; y = _y; z = _z; w = _w; - } - - public Vector4f(Vector4f cpy) - { - x = cpy.x; y = cpy.y; z = cpy.z; w = cpy.w; - } - - - public Vector4f Negate() - { - return new Vector4f(-x, -y, -z, -w); - } - - public Vector4f Add(Vector4f rhs) - { - return new Vector4f(x + rhs.x, y + rhs.y, z + rhs.z, w + rhs.w); - } - - public Vector4f Subtract(Vector4f rhs) - { - return new Vector4f(x - rhs.x, y - rhs.y, z - rhs.z, w - rhs.w); - } - - public Vector4f Multiply(Vector4f rhs) - { - return new Vector4f(x * rhs.x, y * rhs.y, z * rhs.z, w * rhs.w); - } - - public Vector4f Multiply(float s) - { - return new Vector4f(x * s, y * s, z * s, w * s); - } - - public Vector4f Divide(Vector4f rhs) - { - return new Vector4f(x / rhs.x, y / rhs.y, z / rhs.z, w / rhs.w); - } - - public Vector4f Divide(float s) - { - return new Vector4f(x / s, y / s, z / s, w / s); - } - - public float Dot(Vector4f rhs) - { - return (x * rhs.x + y * rhs.y + z * rhs.z + w * rhs.w); - } - - public void Normalize() - { - float len = Length; - if (len != 0.0) - { - x /= len; y /= len; z /= len; w /= len; - } - } - - public Vector4f Normalized - { - get - { - Vector4f normed = new Vector4f(this); - normed.Normalize(); - return normed; - } - } - - public float SquaredLength - { - get - { - return (x * x + y * y + z * z + w * w); - } - } - public float Length - { - get - { - return (float)Math.Sqrt(SquaredLength); - } - } - - - public override string ToString() - { - return String.Format("<{0}, {1}, {2}, {3}>", x, y, z, w); - } - - - public static Vector4f operator -(Vector4f uo) - { - return uo.Negate(); - } - - public static Vector4f operator +(Vector4f lhs, Vector4f rhs) - { - return lhs.Add(rhs); - } - - public static Vector4f operator -(Vector4f lhs, Vector4f rhs) - { - return lhs.Subtract(rhs); - } - - public static Vector4f operator *(Vector4f lhs, Vector4f rhs) - { - return lhs.Multiply(rhs); - } - - public static Vector4f operator *(Vector4f lhs, float rhs) - { - return lhs.Multiply(rhs); - } - public static Vector4f operator *(float lhs, Vector4f rhs) - { - return rhs.Multiply(lhs); - } - - public static Vector4f operator /(Vector4f lhs, Vector4f rhs) - { - return lhs.Divide(rhs); - } - - public static Vector4f operator /(Vector4f lhs, float rhs) - { - return lhs.Divide(rhs); - } - - } // struct Vector4f - - - - public struct Vector4d - { - - public double x; - public double y; - public double z; - public double w; - - - public Vector4d(double _x, double _y, double _z, double _w) - { - x = _x; y = _y; z = _z; w = _w; - } - - public Vector4d(Vector4d cpy) - { - x = cpy.x; y = cpy.y; z = cpy.z; w = cpy.w; - } - - - public Vector4d Negate() - { - return new Vector4d(-x, -y, -z, -w); - } - - public Vector4d Add(Vector4d rhs) - { - return new Vector4d(x + rhs.x, y + rhs.y, z + rhs.z, w + rhs.w); - } - - public Vector4d Subtract(Vector4d rhs) - { - return new Vector4d(x - rhs.x, y - rhs.y, z - rhs.z, w - rhs.w); - } - - public Vector4d Multiply(Vector4d rhs) - { - return new Vector4d(x * rhs.x, y * rhs.y, z * rhs.z, w * rhs.w); - } - - public Vector4d Multiply(double s) - { - return new Vector4d(x * s, y * s, z * s, w * s); - } - - public Vector4d Divide(Vector4d rhs) - { - return new Vector4d(x / rhs.x, y / rhs.y, z / rhs.z, w / rhs.w); - } - - public Vector4d Divide(double s) - { - return new Vector4d(x / s, y / s, z / s, w / s); - } - - public double Dot(Vector4d rhs) - { - return (x * rhs.x + y * rhs.y + z * rhs.z + w * rhs.w); - } - - public void Normalize() - { - double len = Length; - if (len != 0.0) - { - x /= len; y /= len; z /= len; w /= len; - } - } - - public Vector4d Normalized - { - get - { - Vector4d normed = new Vector4d(this); - normed.Normalize(); - return normed; - } - } - - public double SquaredLength - { - get - { - return (x * x + y * y + z * z + w * w); - } - } - public double Length - { - get - { - return Math.Sqrt(SquaredLength); - } - } - - - public override string ToString() - { - return String.Format("<{0}, {1}, {2}, {3}>", x, y, z, w); - } - - - public static Vector4d operator -(Vector4d uo) - { - return uo.Negate(); - } - - public static Vector4d operator +(Vector4d lhs, Vector4d rhs) - { - return lhs.Add(rhs); - } - - public static Vector4d operator -(Vector4d lhs, Vector4d rhs) - { - return lhs.Subtract(rhs); - } - - public static Vector4d operator *(Vector4d lhs, Vector4d rhs) - { - return lhs.Multiply(rhs); - } - - public static Vector4d operator *(Vector4d lhs, double rhs) - { - return lhs.Multiply(rhs); - } - public static Vector4d operator *(double lhs, Vector4d rhs) - { - return rhs.Multiply(lhs); - } - - public static Vector4d operator /(Vector4d lhs, Vector4d rhs) - { - return lhs.Divide(rhs); - } - - public static Vector4d operator /(Vector4d lhs, double rhs) - { - return lhs.Divide(rhs); - } - - } // struct Vector4d - - - - public struct BoundingBox3f3f - { - Vector3f mMin; - Vector3f mDiag; - public BoundingBox3f3f(float minx, float miny, float minz, float diagx, float diagy, float diagz) - { - mMin.x = minx; - mMin.y = miny; - mMin.z = minz; - - mDiag.x = diagx; - mDiag.y = diagy; - mDiag.z = diagz; - } - public BoundingBox3f3f(Vector3f min, Vector3f max) - { - mMin = min; - mDiag = (max - min); - } - public BoundingBox3f3f(BoundingBox3f3f cpy, Vector3f scale) - { - mMin.x = (float)(cpy.mMin.x * scale.x); - mMin.y = (float)(cpy.mMin.y * scale.y); - mMin.z = (float)(cpy.mMin.z * scale.z); - - mDiag.x = (float)(cpy.mDiag.x * scale.x); - mDiag.y = (float)(cpy.mDiag.y * scale.y); - mDiag.z = (float)(cpy.mDiag.z * scale.z); - } - public Vector3f Min - { - get - { - return new Vector3f(mMin.x, mMin.y, mMin.z); - } - } - public Vector3f Max - { - get - { - return new Vector3f(mMin.x + mDiag.x, mMin.y + mDiag.y, mMin.z + mDiag.z); - } - } - - public Vector3f Diag - { - get - { - return new Vector3f(mDiag.x, mDiag.y, mDiag.z); - } - } - - - public override string ToString() - { - return "[" + this.Min.ToString() + " - " + this.Max.ToString() + "]"; - } - public BoundingBox3f3f Merge(BoundingBox3f3f other) - { - Vector3f thisMax = Max; - Vector3f otherMax = other.Max; - bool xless = other.mMin.x > mMin.x; - bool yless = other.mMin.y > mMin.y; - bool zless = other.mMin.z > mMin.z; - - bool xmore = otherMax.x < thisMax.x; - bool ymore = otherMax.y < thisMax.y; - bool zmore = otherMax.z < thisMax.z; - return new BoundingBox3f3f(xless ? mMin.x : other.mMin.x, - yless ? mMin.y : other.mMin.y, - zless ? mMin.z : other.mMin.z, - xmore ? (xless ? mDiag.x : otherMax.x - mMin.x) : (xless ? thisMax.x - other.mMin.x : other.mDiag.x), - ymore ? (yless ? mDiag.y : otherMax.y - mMin.y) : (yless ? thisMax.y - other.mMin.y : other.mDiag.y), - zmore ? (zless ? mDiag.z : otherMax.z - mMin.z) : (zless ? thisMax.z - other.mMin.z : other.mDiag.z)); - } - - } // struct BoundingBox - - public struct BoundingBox3d3f - { - Vector3d mMin; - Vector3f mDiag; - public BoundingBox3d3f(double minx, double miny, double minz, float diagx, float diagy, float diagz) - { - mMin.x = minx; - mMin.y = miny; - mMin.z = minz; - - mDiag.x = diagx; - mDiag.y = diagy; - mDiag.z = diagz; - } - public BoundingBox3d3f(Vector3d min, Vector3f max) - { - mMin = min; - - mDiag = new Vector3f((float)(max.x - min.x), - (float)(max.y - min.y), - (float)(max.z - min.z)); - } - public BoundingBox3d3f(BoundingBox3d3f cpy, Vector3d scale) - { - mMin.x = (double)(cpy.mMin.x * scale.x); - mMin.y = (double)(cpy.mMin.y * scale.y); - mMin.z = (double)(cpy.mMin.z * scale.z); - - mDiag.x = (float)(cpy.mDiag.x * scale.x); - mDiag.y = (float)(cpy.mDiag.y * scale.y); - mDiag.z = (float)(cpy.mDiag.z * scale.z); - } - public Vector3d Min - { - get - { - return new Vector3d(mMin.x, mMin.y, mMin.z); - } - } - public Vector3d Max - { - get - { - return new Vector3d(mMin.x + mDiag.x, mMin.y + mDiag.y, mMin.z + mDiag.z); - } - } - - public Vector3d Diag - { - get - { - return new Vector3d(mDiag.x, mDiag.y, mDiag.z); - } - } - - - public override string ToString() - { - return "[" + this.Min.ToString() + " - " + this.Max.ToString() + "]"; - } - public BoundingBox3d3f Merge(BoundingBox3d3f other) - { - Vector3d thisMax = Max; - Vector3d otherMax = other.Max; - bool xless = other.mMin.x > mMin.x; - bool yless = other.mMin.y > mMin.y; - bool zless = other.mMin.z > mMin.z; - - bool xmore = otherMax.x < thisMax.x; - bool ymore = otherMax.y < thisMax.y; - bool zmore = otherMax.z < thisMax.z; - return new BoundingBox3d3f(xless ? mMin.x : other.mMin.x, - yless ? mMin.y : other.mMin.y, - zless ? mMin.z : other.mMin.z, - (float)(xmore ? (xless ? mDiag.x : otherMax.x - mMin.x) : (xless ? thisMax.x - other.mMin.x : other.mDiag.x)), - (float)(ymore ? (yless ? mDiag.y : otherMax.y - mMin.y) : (yless ? thisMax.y - other.mMin.y : other.mDiag.y)), - (float)(zmore ? (zless ? mDiag.z : otherMax.z - mMin.z) : (zless ? thisMax.z - other.mMin.z : other.mDiag.z))); - } - - } // struct BoundingBox - - - - - public struct BoundingSphere3f - { - Vector3f mCenter; - float mRadius; - public BoundingSphere3f(float x, float y, float z, float r) - { - mCenter = new Vector3f(x, y, z); - mRadius = r; - } - public BoundingSphere3f(Vector3f center, float radius) - { - mCenter = center; - mRadius = radius; - } - public BoundingSphere3f(BoundingSphere3f cpy, float scale) - { - mCenter = cpy.mCenter; - mRadius = cpy.mRadius * scale; - } - public Vector3f Center - { - get - { - return new Vector3f(mCenter.x, mCenter.y, mCenter.z); - } - } - public float Radius - { - get - { - return mRadius; - } - } - - public override string ToString() - { - return "[" + this.Center.ToString() + " : " + this.Radius.ToString() + "]"; - } - } // struct BoundingSphere3f - - - - public struct BoundingSphere3d - { - Vector3d mCenter; - float mRadius; - public BoundingSphere3d(double x, double y, double z, float r) - { - mCenter.x = x; - mCenter.y = y; - mCenter.z = z; - mRadius = r; - } - public BoundingSphere3d(Vector3d center, float radius) - { - mCenter = center; - mRadius = radius; - } - public BoundingSphere3d(BoundingSphere3d cpy, float scale) - { - mCenter = cpy.mCenter; - mRadius = cpy.mRadius * scale; - } - public Vector3d Center - { - get - { - return new Vector3d(mCenter.x, mCenter.y, mCenter.z); - } - } - public float Radius - { - get - { - return mRadius; - } - } - - public override string ToString() - { - return "[" + this.Center.ToString() + " : " + this.Radius.ToString() + "]"; - } - } // struct BoundingSphere3f - - public struct UUID - { - ulong mLowOrderBytes; - ulong mHighOrderBytes; - - - static ulong SetUUIDlow(Google.ProtocolBuffers.ByteString data, int offset) - { - ulong LowOrderBytes = 0; - int shiftVal = 0; - for (int i = 0; i < 8; ++i) - { - ulong temp = data[i]; - LowOrderBytes |= (temp << shiftVal); - shiftVal += 8; - } - return LowOrderBytes; - } - static ulong SetUUIDhigh(Google.ProtocolBuffers.ByteString data) - { - return SetUUIDlow(data, 8); - } - static ulong SetUUIDlow(byte[] data, int offset) - { - ulong LowOrderBytes = 0; - int shiftVal = 0; - for (int i = 0; i < 8; ++i) - { - ulong temp = data[i]; - LowOrderBytes |= (temp << shiftVal); - shiftVal += 8; - } - return LowOrderBytes; - } - static ulong SetUUIDhigh(byte[] data) - { - return SetUUIDlow(data, 8); - } - public bool SetUUID(byte[] data) - { - if (data.Length == 16) - { - mLowOrderBytes = 0; - mHighOrderBytes = 0; - mLowOrderBytes = SetUUIDlow(data, 0); - mHighOrderBytes = SetUUIDlow(data, 8); - return true; - } - else - { - return false; - } - } - public byte[] GetUUID() - { - byte[] data = new byte[16]; - int shiftVal = 0; - for (int i = 0; i < 8; ++i) - { - ulong temp = 0xff; - temp = (mLowOrderBytes & (temp << shiftVal)); - temp = (temp >> shiftVal); - data[i] = (byte)temp; - shiftVal += 8; - } - shiftVal = 0; - for (int i = 8; i < 16; ++i) - { - ulong temp = 0xff; - temp = (mHighOrderBytes & (temp << shiftVal)); - temp = (temp >> shiftVal); - data[i] = (byte)temp; - shiftVal += 8; - } - return data; - } - - public static UUID Empty = new UUID(new byte[16]); - public UUID(byte[] data) - { - if (data.Length != 16) - { - throw new System.ArgumentException("UUIDs must be provided 16 bytes"); - } - mLowOrderBytes = SetUUIDlow(data, 0); - mHighOrderBytes = SetUUIDhigh(data); - } - public UUID(Google.ProtocolBuffers.ByteString data) - { - if (data.Length != 16) - { - throw new System.ArgumentException("UUIDs must be provided 16 bytes"); - } - mLowOrderBytes = SetUUIDlow(data, 0); - mHighOrderBytes = SetUUIDhigh(data); - } - - } - - - public struct SHA256 - { - ulong mLowOrderBytes; - ulong mLowMediumOrderBytes; - ulong mMediumHighOrderBytes; - ulong mHighOrderBytes; - - - static ulong SetLMH(Google.ProtocolBuffers.ByteString data, int offset) - { - ulong LowOrderBytes = 0; - int shiftVal = 0; - for (int i = 0; i < 8; ++i) - { - ulong temp = data[i]; - LowOrderBytes |= (temp << shiftVal); - shiftVal += 8; - } - return LowOrderBytes; - } - static ulong SetLow(Google.ProtocolBuffers.ByteString data) - { - return SetLMH(data, 0); - } - static ulong SetLowMedium(Google.ProtocolBuffers.ByteString data) - { - return SetLMH(data, 8); - } - static ulong SetMediumHigh(Google.ProtocolBuffers.ByteString data) - { - return SetLMH(data, 16); - } - static ulong SetHigh(Google.ProtocolBuffers.ByteString data) - { - return SetLMH(data, 24); - } - static ulong SetLMH(byte[] data, int offset) - { - ulong LowOrderBytes = 0; - int shiftVal = 0; - for (int i = 0; i < 8; ++i) - { - ulong temp = data[i]; - LowOrderBytes |= (temp << shiftVal); - shiftVal += 8; - } - return LowOrderBytes; - } - static ulong SetLow(byte[] data) - { - return SetLMH(data, 0); - } - static ulong SetLowMedium(byte[] data) - { - return SetLMH(data, 8); - } - static ulong SetMediumHigh(byte[] data) - { - return SetLMH(data, 16); - } - static ulong SetHigh(byte[] data) - { - return SetLMH(data, 24); - } - public bool SetSHA256(byte[] data) - { - if (data.Length == 32) - { - mLowOrderBytes = SetLow(data); - mLowMediumOrderBytes = SetLowMedium(data); - mMediumHighOrderBytes = SetMediumHigh(data); - mHighOrderBytes = SetHigh(data); - return true; - } - else - { - return false; - } - } - public byte[] GetBinaryData() - { - byte[] data = new byte[32]; - int shiftVal = 0; - for (int i = 0; i < 8; ++i) - { - ulong temp = 0xff; - temp = (mLowOrderBytes & (temp << shiftVal)); - temp = (temp >> shiftVal); - data[i] = (byte)temp; - shiftVal += 8; - } - shiftVal = 0; - for (int i = 8; i < 16; ++i) - { - ulong temp = 0xff; - temp = (mLowMediumOrderBytes & (temp << shiftVal)); - temp = (temp >> shiftVal); - data[i] = (byte)temp; - shiftVal += 8; - } - shiftVal = 0; - for (int i = 16; i < 24; ++i) - { - ulong temp = 0xff; - temp = (mMediumHighOrderBytes & (temp << shiftVal)); - temp = (temp >> shiftVal); - data[i] = (byte)temp; - shiftVal += 8; - } - shiftVal = 0; - for (int i = 24; i < 32; ++i) - { - ulong temp = 0xff; - temp = (mHighOrderBytes & (temp << shiftVal)); - temp = (temp >> shiftVal); - data[i] = (byte)temp; - shiftVal += 8; - } - return data; - } - - public static SHA256 Empty = new SHA256(new byte[32]); - public SHA256(byte[] data) - { - if (data.Length != 32) - { - throw new System.ArgumentException("SHA256s must be provided 32 bytes"); - } - mLowOrderBytes = SetLow(data); - mLowMediumOrderBytes = SetLowMedium(data); - mMediumHighOrderBytes = SetMediumHigh(data); - mHighOrderBytes = SetHigh(data); - } - public SHA256(Google.ProtocolBuffers.ByteString data) - { - if (data.Length != 32) - { - throw new System.ArgumentException("SHA256s must be provided 32 bytes"); - } - mLowOrderBytes = SetLow(data); - mLowMediumOrderBytes = SetLowMedium(data); - mMediumHighOrderBytes = SetMediumHigh(data); - mHighOrderBytes = SetHigh(data); - } - - } - - - - - public struct Time - { - ulong usec; - public Time(ulong usec_since_epoch) - { - usec = usec_since_epoch; - } - public ulong toMicro() - { - return usec; - } - } - public class Duration - { - long usec; - public Duration(long time_since) - { - usec = time_since; - } - public long toMicro() - { - return usec; - } - } - - class _PBJ - { - - public static bool ValidateBool(bool d) - { - return true; - } - public static bool ValidateDouble(double d) - { - return true; - } - public static bool ValidateFloat(float d) - { - return true; - } - public static bool ValidateUint64(ulong d) - { - return true; - } - public static bool ValidateUint32(uint d) - { - return true; - } - public static bool ValidateUint16(ushort d) - { - return true; - } - public static bool ValidateUint8(byte d) - { - return true; - } - public static bool ValidateInt64(long d) - { - return true; - } - public static bool ValidateInt32(int d) - { - return true; - } - public static bool ValidateInt16(short d) - { - return true; - } - public static bool ValidateInt8(sbyte d) - { - return true; - } - public static bool ValidateString(S input) - { - return true; - } - public static bool ValidateBytes(B input) - { - return true; - } - public static bool ValidateUuid(Google.ProtocolBuffers.ByteString input) - { - return input.Length == 16; - } - public static bool ValidateSha256(Google.ProtocolBuffers.ByteString input) - { - return input.Length == 32; - } - public static bool ValidateAngle(float input) - { - return input >= 0 && input <= 3.1415926536 * 2.0; - } - public static bool ValidateTime(ulong input) - { - return true; - } - public static bool ValidateDuration(long input) - { - return true; - } - public static bool ValidateFlags(ulong input, ulong verification) - { - return (input & verification) == input; - } - - - - - public static bool CastBool(bool d) - { - return d; - } - public static double CastDouble(double d) - { - return d; - } - public static float CastFloat(float d) - { - return d; - } - public static ulong CastUint64(ulong d) - { - return d; - } - public static uint CastUint32(uint d) - { - return d; - } - public static ushort CastUint16(ushort d) - { - return d; - } - public static byte CastUint8(byte d) - { - return d; - } - public static long CastInt64(long d) - { - return d; - } - public static int CastInt32(int d) - { - return d; - } - public static short CastInt16(short d) - { - return d; - } - public static sbyte CastInt8(sbyte d) - { - return d; - } - public static S CastString(S input) - { - return input; - } - public static B CastBytes(B input) - { - return input; - } - - - - public static bool CastBool() - { - return false; - } - public static double CastDouble() - { - return 0; - } - public static float CastFloat() - { - return 0; - } - public static ulong CastUint64() - { - return 0; - } - public static uint CastUint32() - { - return 0; - } - public static ushort CastUint16() - { - return 0; - } - public static byte CastUint8() - { - return 0; - } - public static long CastInt64() - { - return 0; - } - public static int CastInt32() - { - return 0; - } - public static short CastInt16() - { - return 0; - } - public static sbyte CastInt8() - { - return 0; - } - public static string CastString() - { - return ""; - } - public static Google.ProtocolBuffers.ByteString CastBytes() - { - return Google.ProtocolBuffers.ByteString.Empty; - } - - - public static ulong CastFlags(ulong data, ulong allFlagsOn) - { - return allFlagsOn & data; - } - public static ulong CastFlags(ulong allFlagsOn) - { - return 0; - } - - public static Vector3f CastNormal(float x, float y) - { - float neg = (x > 1.5f || y > 1.5f) ? -1.0f : 1.0f; - if (x > 1.5) - x -= 3; - if (y > 1.5) - y -= 3; - return new Vector3f(x, y, neg - neg * (float)Math.Sqrt(x * x + y * y)); - } - public static Vector3f CastNormal() - { - return new Vector3f(0, 1, 0); - } - - - public static Vector2f CastVector2f(float x, float y) - { - return new Vector2f(x, y); - } - public static Vector2f CastVector2f() - { - return new Vector2f(0, 0); - } - - public static Vector3f CastVector3f(float x, float y, float z) - { - return new Vector3f(x, y, z); - } - public static Vector3f CastVector3f() - { - return new Vector3f(0, 0, 0); - } - - public static Vector4f CastVector4f(float x, float y, float z, float w) - { - return new Vector4f(x, y, z, w); - } - public static Vector4f CastVector4f() - { - return new Vector4f(0, 0, 0, 0); - } - public static Vector2d CastVector2d(double x, double y) - { - return new Vector2d(x, y); - } - public static Vector2d CastVector2d() - { - return new Vector2d(0, 0); - } - - public static Vector3d CastVector3d(double x, double y, double z) - { - return new Vector3d(x, y, z); - } - public static Vector3d CastVector3d() - { - return new Vector3d(0, 0, 0); - } - - public static Vector4d CastVector4d(double x, double y, double z, double w) - { - return new Vector4d(x, y, z, w); - } - public static Vector4d CastVector4d() - { - return new Vector4d(0, 0, 0, 0); - } - - public static BoundingSphere3f CastBoundingsphere3f(float x, float y, float z, float r) - { - return new BoundingSphere3f(new Vector3f(x, y, z), r); - } - public static BoundingSphere3d CastBoundingsphere3d(double x, double y, double z, double r) - { - return new BoundingSphere3d(new Vector3d(x, y, z), (float)r); - } - - public static BoundingSphere3f CastBoundingsphere3f() - { - return new BoundingSphere3f(new Vector3f(0, 0, 0), 0); - } - public static BoundingSphere3d CastBoundingsphere3d() - { - return new BoundingSphere3d(new Vector3d(0, 0, 0), (float)0); - } - - - public static BoundingBox3f3f CastBoundingbox3f3f(float x, float y, float z, float dx, float dy, float dz) - { - return new BoundingBox3f3f(x, y, z, dx, dy, dz); - } - public static BoundingBox3d3f CastBoundingbox3d3f(double x, double y, double z, double dx, double dy, double dz) - { - return new BoundingBox3d3f(x, y, z, (float)dx, (float)dy, (float)dz); - } - - public static BoundingBox3f3f CastBoundingbox3f3f() - { - return new BoundingBox3f3f(new Vector3f(0, 0, 0), new Vector3f(0, 0, 0)); - } - public static BoundingBox3d3f CastBoundingbox3d3f() - { - return new BoundingBox3d3f(0, 0, 0, 0, 0, 0); - } - - - - public static Quaternion CastQuaternion(float x, float y, float z) - { - float neg = (x > 1.5 || y > 1.5 || z > 1.5) ? -1.0f : 1.0f; - if (x > 1.5) - x -= 3.0f; - if (y > 1.5) - y -= 3.0f; - if (z > 1.5) - z -= 3.0f; - return new Quaternion(neg - neg * (float)Math.Sqrt(x * x + y * y + z * z), x, y, z); - } - public static Quaternion CastQuaternion() - { - return new Quaternion(1, 0, 0, 0); - } - - public static UUID CastUuid(Google.ProtocolBuffers.ByteString input) - { - return new UUID(input); - } - public static SHA256 CastSha256(Google.ProtocolBuffers.ByteString input) - { - return new SHA256(input); - } - public static SHA256 CastSha256() - { - return SHA256.Empty; - } - public static UUID CastUuid() - { - return UUID.Empty; - } - - public static float CastAngle(float d) - { - return d; - } - public static float CastAngle() - { - return 0; - } - - public static Time CastTime(ulong t) - { - return new Time(t); - } - public static Time CastTime() - { - return new Time(0); - } - public static Duration CastDuration(long t) - { - return new Duration(t); - } - public static Duration CastDuration() - { - return new Duration(0); - } - - public static T Construct(T retval) - { - return retval; - } - public static long Construct(Duration d) - { - return d.toMicro(); - } - public static ulong Construct(Time t) - { - return t.toMicro(); - } - public static Google.ProtocolBuffers.ByteString Construct(UUID u) - { - byte[] data = u.GetUUID(); - Google.ProtocolBuffers.ByteString retval = Google.ProtocolBuffers.ByteString.CopyFrom(data, 0, 16); - return retval; - } - public static Google.ProtocolBuffers.ByteString Construct(SHA256 u) - { - byte[] data = u.GetBinaryData(); - Google.ProtocolBuffers.ByteString retval = Google.ProtocolBuffers.ByteString.CopyFrom(data, 0, 16); - return retval; - } - public static float[] ConstructNormal(Vector3f d) - { - return new float[] { d.x + (d.z < 0 ? 3.0f : 0.0f), d.y }; - } - public static float[] ConstructQuaternion(Quaternion d) - { - return new float[] { d.x + (d.w < 0 ? 3.0f : 0.0f), d.y, d.z }; - } - - public static float[] ConstructVector2f(Vector2f d) - { - return new float[] { d.x, d.y }; - } - public static double[] ConstructVector2d(Vector2d d) - { - return new double[] { d.x, d.y }; - } - - public static float[] ConstructVector3f(Vector3f d) - { - return new float[] { d.x, d.y, d.z }; - } - public static double[] ConstructVector3d(Vector3d d) - { - return new double[] { d.x, d.y, d.z }; - } - public static float[] ConstructVector4f(Vector4f d) - { - return new float[] { d.x, d.y, d.z, d.w }; - } - public static double[] ConstructVector4d(Vector4d d) - { - return new double[] { d.x, d.y, d.z, d.w }; - } - - - public static float[] ConstructBoundingsphere3f(BoundingSphere3f d) - { - return new float[] { d.Center.x, d.Center.y, d.Center.z, d.Radius }; - } - public static double[] ConstructBoundingsphere3d(BoundingSphere3d d) - { - return new double[] { d.Center.x, d.Center.y, d.Center.z, d.Radius }; - } - - public static float[] ConstructBoundingbox3f3f(BoundingBox3f3f d) - { - return new float[] { d.Min.x, d.Min.y, d.Min.z, d.Diag.x, d.Diag.y, d.Diag.z }; - } - public static double[] ConstructBoundingbox3d3f(BoundingBox3d3f d) - { - return new double[] { d.Min.x, d.Min.y, d.Min.z, d.Diag.x, d.Diag.y, d.Diag.z }; - } - - - } - -} diff --git a/OpenSim/Client/Sirikata/Protocol/Persistence.cs b/OpenSim/Client/Sirikata/Protocol/Persistence.cs deleted file mode 100644 index d8f8d330bb..0000000000 --- a/OpenSim/Client/Sirikata/Protocol/Persistence.cs +++ /dev/null @@ -1,3299 +0,0 @@ -// Generated by the protocol buffer compiler. DO NOT EDIT! - -using pb = global::Google.ProtocolBuffers; -using pbc = global::Google.ProtocolBuffers.Collections; -using pbd = global::Google.ProtocolBuffers.Descriptors; -using scg = global::System.Collections.Generic; -namespace Sirikata.Persistence.Protocol._PBJ_Internal { - - public static partial class Persistence { - - #region Extension registration - public static void RegisterAllExtensions(pb::ExtensionRegistry registry) { - } - #endregion - #region Static variables - internal static pbd::MessageDescriptor internal__static_Sirikata_Persistence_Protocol__PBJ_Internal_StorageKey__Descriptor; - internal static pb::FieldAccess.FieldAccessorTable internal__static_Sirikata_Persistence_Protocol__PBJ_Internal_StorageKey__FieldAccessorTable; - internal static pbd::MessageDescriptor internal__static_Sirikata_Persistence_Protocol__PBJ_Internal_StorageValue__Descriptor; - internal static pb::FieldAccess.FieldAccessorTable internal__static_Sirikata_Persistence_Protocol__PBJ_Internal_StorageValue__FieldAccessorTable; - internal static pbd::MessageDescriptor internal__static_Sirikata_Persistence_Protocol__PBJ_Internal_StorageElement__Descriptor; - internal static pb::FieldAccess.FieldAccessorTable internal__static_Sirikata_Persistence_Protocol__PBJ_Internal_StorageElement__FieldAccessorTable; - internal static pbd::MessageDescriptor internal__static_Sirikata_Persistence_Protocol__PBJ_Internal_CompareElement__Descriptor; - internal static pb::FieldAccess.FieldAccessorTable internal__static_Sirikata_Persistence_Protocol__PBJ_Internal_CompareElement__FieldAccessorTable; - internal static pbd::MessageDescriptor internal__static_Sirikata_Persistence_Protocol__PBJ_Internal_StorageSet__Descriptor; - internal static pb::FieldAccess.FieldAccessorTable internal__static_Sirikata_Persistence_Protocol__PBJ_Internal_StorageSet__FieldAccessorTable; - internal static pbd::MessageDescriptor internal__static_Sirikata_Persistence_Protocol__PBJ_Internal_ReadSet__Descriptor; - internal static pb::FieldAccess.FieldAccessorTable internal__static_Sirikata_Persistence_Protocol__PBJ_Internal_ReadSet__FieldAccessorTable; - internal static pbd::MessageDescriptor internal__static_Sirikata_Persistence_Protocol__PBJ_Internal_WriteSet__Descriptor; - internal static pb::FieldAccess.FieldAccessorTable internal__static_Sirikata_Persistence_Protocol__PBJ_Internal_WriteSet__FieldAccessorTable; - internal static pbd::MessageDescriptor internal__static_Sirikata_Persistence_Protocol__PBJ_Internal_ReadWriteSet__Descriptor; - internal static pb::FieldAccess.FieldAccessorTable internal__static_Sirikata_Persistence_Protocol__PBJ_Internal_ReadWriteSet__FieldAccessorTable; - internal static pbd::MessageDescriptor internal__static_Sirikata_Persistence_Protocol__PBJ_Internal_Minitransaction__Descriptor; - internal static pb::FieldAccess.FieldAccessorTable internal__static_Sirikata_Persistence_Protocol__PBJ_Internal_Minitransaction__FieldAccessorTable; - internal static pbd::MessageDescriptor internal__static_Sirikata_Persistence_Protocol__PBJ_Internal_Response__Descriptor; - internal static pb::FieldAccess.FieldAccessorTable internal__static_Sirikata_Persistence_Protocol__PBJ_Internal_Response__FieldAccessorTable; - #endregion - #region Descriptor - public static pbd::FileDescriptor Descriptor { - get { return descriptor; } - } - private static pbd::FileDescriptor descriptor; - - static Persistence() { - byte[] descriptorData = global::System.Convert.FromBase64String( - "ChFQZXJzaXN0ZW5jZS5wcm90bxIrU2lyaWthdGEuUGVyc2lzdGVuY2UuUHJv" + - "dG9jb2wuX1BCSl9JbnRlcm5hbCJHCgpTdG9yYWdlS2V5EhMKC29iamVjdF91" + - "dWlkGAkgASgMEhAKCGZpZWxkX2lkGAogASgEEhIKCmZpZWxkX25hbWUYCyAB" + - "KAkiHAoMU3RvcmFnZVZhbHVlEgwKBGRhdGEYDCABKAwi/gEKDlN0b3JhZ2VF" + - "bGVtZW50EhMKC29iamVjdF91dWlkGAkgASgMEhAKCGZpZWxkX2lkGAogASgE" + - "EhIKCmZpZWxkX25hbWUYCyABKAkSDAoEZGF0YRgMIAEoDBINCgVpbmRleBgN" + - "IAEoBRJfCg1yZXR1cm5fc3RhdHVzGA8gASgOMkguU2lyaWthdGEuUGVyc2lz" + - "dGVuY2UuUHJvdG9jb2wuX1BCSl9JbnRlcm5hbC5TdG9yYWdlRWxlbWVudC5S" + - "ZXR1cm5TdGF0dXMiMwoMUmV0dXJuU3RhdHVzEg8KC0tFWV9NSVNTSU5HEAQS" + - "EgoOSU5URVJOQUxfRVJST1IQBiLaAQoOQ29tcGFyZUVsZW1lbnQSEwoLb2Jq" + - "ZWN0X3V1aWQYCSABKAwSEAoIZmllbGRfaWQYCiABKAQSEgoKZmllbGRfbmFt" + - "ZRgLIAEoCRIMCgRkYXRhGAwgASgMEloKCmNvbXBhcmF0b3IYDiABKA4yRi5T" + - "aXJpa2F0YS5QZXJzaXN0ZW5jZS5Qcm90b2NvbC5fUEJKX0ludGVybmFsLkNv" + - "bXBhcmVFbGVtZW50LkNPTVBBUkFUT1IiIwoKQ09NUEFSQVRPUhIJCgVFUVVB" + - "TBAAEgoKBk5FUVVBTBABIlgKClN0b3JhZ2VTZXQSSgoFcmVhZHMYCSADKAsy" + - "Oy5TaXJpa2F0YS5QZXJzaXN0ZW5jZS5Qcm90b2NvbC5fUEJKX0ludGVybmFs" + - "LlN0b3JhZ2VFbGVtZW50IlUKB1JlYWRTZXQSSgoFcmVhZHMYCSADKAsyOy5T" + - "aXJpa2F0YS5QZXJzaXN0ZW5jZS5Qcm90b2NvbC5fUEJKX0ludGVybmFsLlN0" + - "b3JhZ2VFbGVtZW50IlcKCFdyaXRlU2V0EksKBndyaXRlcxgKIAMoCzI7LlNp" + - "cmlrYXRhLlBlcnNpc3RlbmNlLlByb3RvY29sLl9QQkpfSW50ZXJuYWwuU3Rv" + - "cmFnZUVsZW1lbnQi5gEKDFJlYWRXcml0ZVNldBJKCgVyZWFkcxgJIAMoCzI7" + - "LlNpcmlrYXRhLlBlcnNpc3RlbmNlLlByb3RvY29sLl9QQkpfSW50ZXJuYWwu" + - "U3RvcmFnZUVsZW1lbnQSSwoGd3JpdGVzGAogAygLMjsuU2lyaWthdGEuUGVy" + - "c2lzdGVuY2UuUHJvdG9jb2wuX1BCSl9JbnRlcm5hbC5TdG9yYWdlRWxlbWVu" + - "dBIPCgdvcHRpb25zGA4gASgEIiwKE1JlYWRXcml0ZVNldE9wdGlvbnMSFQoR" + - "UkVUVVJOX1JFQURfTkFNRVMQASK3AgoPTWluaXRyYW5zYWN0aW9uEkoKBXJl" + - "YWRzGAkgAygLMjsuU2lyaWthdGEuUGVyc2lzdGVuY2UuUHJvdG9jb2wuX1BC" + - "Sl9JbnRlcm5hbC5TdG9yYWdlRWxlbWVudBJLCgZ3cml0ZXMYCiADKAsyOy5T" + - "aXJpa2F0YS5QZXJzaXN0ZW5jZS5Qcm90b2NvbC5fUEJKX0ludGVybmFsLlN0" + - "b3JhZ2VFbGVtZW50Ek0KCGNvbXBhcmVzGAsgAygLMjsuU2lyaWthdGEuUGVy" + - "c2lzdGVuY2UuUHJvdG9jb2wuX1BCSl9JbnRlcm5hbC5Db21wYXJlRWxlbWVu" + - "dBIPCgdvcHRpb25zGA4gASgEIisKElRyYW5zYWN0aW9uT3B0aW9ucxIVChFS" + - "RVRVUk5fUkVBRF9OQU1FUxABIp8CCghSZXNwb25zZRJKCgVyZWFkcxgJIAMo" + - "CzI7LlNpcmlrYXRhLlBlcnNpc3RlbmNlLlByb3RvY29sLl9QQkpfSW50ZXJu" + - "YWwuU3RvcmFnZUVsZW1lbnQSWQoNcmV0dXJuX3N0YXR1cxgPIAEoDjJCLlNp" + - "cmlrYXRhLlBlcnNpc3RlbmNlLlByb3RvY29sLl9QQkpfSW50ZXJuYWwuUmVz" + - "cG9uc2UuUmV0dXJuU3RhdHVzImwKDFJldHVyblN0YXR1cxILCgdTVUNDRVNT" + - "EAASEwoPREFUQUJBU0VfTE9DS0VEEAMSDwoLS0VZX01JU1NJTkcQBBIVChFD" + - "T01QQVJJU09OX0ZBSUxFRBAFEhIKDklOVEVSTkFMX0VSUk9SEAY="); - pbd::FileDescriptor.InternalDescriptorAssigner assigner = delegate(pbd::FileDescriptor root) { - descriptor = root; - internal__static_Sirikata_Persistence_Protocol__PBJ_Internal_StorageKey__Descriptor = Descriptor.MessageTypes[0]; - internal__static_Sirikata_Persistence_Protocol__PBJ_Internal_StorageKey__FieldAccessorTable = - new pb::FieldAccess.FieldAccessorTable(internal__static_Sirikata_Persistence_Protocol__PBJ_Internal_StorageKey__Descriptor, - new string[] { "ObjectUuid", "FieldId", "FieldName", }); - internal__static_Sirikata_Persistence_Protocol__PBJ_Internal_StorageValue__Descriptor = Descriptor.MessageTypes[1]; - internal__static_Sirikata_Persistence_Protocol__PBJ_Internal_StorageValue__FieldAccessorTable = - new pb::FieldAccess.FieldAccessorTable(internal__static_Sirikata_Persistence_Protocol__PBJ_Internal_StorageValue__Descriptor, - new string[] { "Data", }); - internal__static_Sirikata_Persistence_Protocol__PBJ_Internal_StorageElement__Descriptor = Descriptor.MessageTypes[2]; - internal__static_Sirikata_Persistence_Protocol__PBJ_Internal_StorageElement__FieldAccessorTable = - new pb::FieldAccess.FieldAccessorTable(internal__static_Sirikata_Persistence_Protocol__PBJ_Internal_StorageElement__Descriptor, - new string[] { "ObjectUuid", "FieldId", "FieldName", "Data", "Index", "ReturnStatus", }); - internal__static_Sirikata_Persistence_Protocol__PBJ_Internal_CompareElement__Descriptor = Descriptor.MessageTypes[3]; - internal__static_Sirikata_Persistence_Protocol__PBJ_Internal_CompareElement__FieldAccessorTable = - new pb::FieldAccess.FieldAccessorTable(internal__static_Sirikata_Persistence_Protocol__PBJ_Internal_CompareElement__Descriptor, - new string[] { "ObjectUuid", "FieldId", "FieldName", "Data", "Comparator", }); - internal__static_Sirikata_Persistence_Protocol__PBJ_Internal_StorageSet__Descriptor = Descriptor.MessageTypes[4]; - internal__static_Sirikata_Persistence_Protocol__PBJ_Internal_StorageSet__FieldAccessorTable = - new pb::FieldAccess.FieldAccessorTable(internal__static_Sirikata_Persistence_Protocol__PBJ_Internal_StorageSet__Descriptor, - new string[] { "Reads", }); - internal__static_Sirikata_Persistence_Protocol__PBJ_Internal_ReadSet__Descriptor = Descriptor.MessageTypes[5]; - internal__static_Sirikata_Persistence_Protocol__PBJ_Internal_ReadSet__FieldAccessorTable = - new pb::FieldAccess.FieldAccessorTable(internal__static_Sirikata_Persistence_Protocol__PBJ_Internal_ReadSet__Descriptor, - new string[] { "Reads", }); - internal__static_Sirikata_Persistence_Protocol__PBJ_Internal_WriteSet__Descriptor = Descriptor.MessageTypes[6]; - internal__static_Sirikata_Persistence_Protocol__PBJ_Internal_WriteSet__FieldAccessorTable = - new pb::FieldAccess.FieldAccessorTable(internal__static_Sirikata_Persistence_Protocol__PBJ_Internal_WriteSet__Descriptor, - new string[] { "Writes", }); - internal__static_Sirikata_Persistence_Protocol__PBJ_Internal_ReadWriteSet__Descriptor = Descriptor.MessageTypes[7]; - internal__static_Sirikata_Persistence_Protocol__PBJ_Internal_ReadWriteSet__FieldAccessorTable = - new pb::FieldAccess.FieldAccessorTable(internal__static_Sirikata_Persistence_Protocol__PBJ_Internal_ReadWriteSet__Descriptor, - new string[] { "Reads", "Writes", "Options", }); - internal__static_Sirikata_Persistence_Protocol__PBJ_Internal_Minitransaction__Descriptor = Descriptor.MessageTypes[8]; - internal__static_Sirikata_Persistence_Protocol__PBJ_Internal_Minitransaction__FieldAccessorTable = - new pb::FieldAccess.FieldAccessorTable(internal__static_Sirikata_Persistence_Protocol__PBJ_Internal_Minitransaction__Descriptor, - new string[] { "Reads", "Writes", "Compares", "Options", }); - internal__static_Sirikata_Persistence_Protocol__PBJ_Internal_Response__Descriptor = Descriptor.MessageTypes[9]; - internal__static_Sirikata_Persistence_Protocol__PBJ_Internal_Response__FieldAccessorTable = - new pb::FieldAccess.FieldAccessorTable(internal__static_Sirikata_Persistence_Protocol__PBJ_Internal_Response__Descriptor, - new string[] { "Reads", "ReturnStatus", }); - return null; - }; - pbd::FileDescriptor.InternalBuildGeneratedFileFrom(descriptorData, - new pbd::FileDescriptor[] { - }, assigner); - } - #endregion - - } - #region Messages - public sealed partial class StorageKey : pb::GeneratedMessage { - private static readonly StorageKey defaultInstance = new Builder().BuildPartial(); - public static StorageKey DefaultInstance { - get { return defaultInstance; } - } - - public override StorageKey DefaultInstanceForType { - get { return defaultInstance; } - } - - protected override StorageKey ThisMessage { - get { return this; } - } - - public static pbd::MessageDescriptor Descriptor { - get { return global::Sirikata.Persistence.Protocol._PBJ_Internal.Persistence.internal__static_Sirikata_Persistence_Protocol__PBJ_Internal_StorageKey__Descriptor; } - } - - protected override pb::FieldAccess.FieldAccessorTable InternalFieldAccessors { - get { return global::Sirikata.Persistence.Protocol._PBJ_Internal.Persistence.internal__static_Sirikata_Persistence_Protocol__PBJ_Internal_StorageKey__FieldAccessorTable; } - } - - public const int ObjectUuidFieldNumber = 9; - private bool hasObjectUuid; - private pb::ByteString objectUuid_ = pb::ByteString.Empty; - public bool HasObjectUuid { - get { return hasObjectUuid; } - } - public pb::ByteString ObjectUuid { - get { return objectUuid_; } - } - - public const int FieldIdFieldNumber = 10; - private bool hasFieldId; - private ulong fieldId_ = 0UL; - public bool HasFieldId { - get { return hasFieldId; } - } - [global::System.CLSCompliant(false)] - public ulong FieldId { - get { return fieldId_; } - } - - public const int FieldNameFieldNumber = 11; - private bool hasFieldName; - private string fieldName_ = ""; - public bool HasFieldName { - get { return hasFieldName; } - } - public string FieldName { - get { return fieldName_; } - } - - public override bool IsInitialized { - get { - return true; - } - } - - public override void WriteTo(pb::CodedOutputStream output) { - if (HasObjectUuid) { - output.WriteBytes(9, ObjectUuid); - } - if (HasFieldId) { - output.WriteUInt64(10, FieldId); - } - if (HasFieldName) { - output.WriteString(11, FieldName); - } - UnknownFields.WriteTo(output); - } - - private int memoizedSerializedSize = -1; - public override int SerializedSize { - get { - int size = memoizedSerializedSize; - if (size != -1) return size; - - size = 0; - if (HasObjectUuid) { - size += pb::CodedOutputStream.ComputeBytesSize(9, ObjectUuid); - } - if (HasFieldId) { - size += pb::CodedOutputStream.ComputeUInt64Size(10, FieldId); - } - if (HasFieldName) { - size += pb::CodedOutputStream.ComputeStringSize(11, FieldName); - } - size += UnknownFields.SerializedSize; - memoizedSerializedSize = size; - return size; - } - } - - public static StorageKey ParseFrom(pb::ByteString data) { - return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); - } - public static StorageKey ParseFrom(pb::ByteString data, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); - } - public static StorageKey ParseFrom(byte[] data) { - return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); - } - public static StorageKey ParseFrom(byte[] data, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); - } - public static StorageKey ParseFrom(global::System.IO.Stream input) { - return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); - } - public static StorageKey ParseFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); - } - public static StorageKey ParseDelimitedFrom(global::System.IO.Stream input) { - return CreateBuilder().MergeDelimitedFrom(input).BuildParsed(); - } - public static StorageKey ParseDelimitedFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { - return CreateBuilder().MergeDelimitedFrom(input, extensionRegistry).BuildParsed(); - } - public static StorageKey ParseFrom(pb::CodedInputStream input) { - return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); - } - public static StorageKey ParseFrom(pb::CodedInputStream input, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); - } - public static Builder CreateBuilder() { return new Builder(); } - public override Builder ToBuilder() { return CreateBuilder(this); } - public override Builder CreateBuilderForType() { return new Builder(); } - public static Builder CreateBuilder(StorageKey prototype) { - return (Builder) new Builder().MergeFrom(prototype); - } - - public sealed partial class Builder : pb::GeneratedBuilder { - protected override Builder ThisBuilder { - get { return this; } - } - public Builder() {} - - StorageKey result = new StorageKey(); - - protected override StorageKey MessageBeingBuilt { - get { return result; } - } - - public override Builder Clear() { - result = new StorageKey(); - return this; - } - - public override Builder Clone() { - return new Builder().MergeFrom(result); - } - - public override pbd::MessageDescriptor DescriptorForType { - get { return global::Sirikata.Persistence.Protocol._PBJ_Internal.StorageKey.Descriptor; } - } - - public override StorageKey DefaultInstanceForType { - get { return global::Sirikata.Persistence.Protocol._PBJ_Internal.StorageKey.DefaultInstance; } - } - - public override StorageKey BuildPartial() { - if (result == null) { - throw new global::System.InvalidOperationException("build() has already been called on this Builder"); - } - StorageKey returnMe = result; - result = null; - return returnMe; - } - - public override Builder MergeFrom(pb::IMessage other) { - if (other is StorageKey) { - return MergeFrom((StorageKey) other); - } else { - base.MergeFrom(other); - return this; - } - } - - public override Builder MergeFrom(StorageKey other) { - if (other == global::Sirikata.Persistence.Protocol._PBJ_Internal.StorageKey.DefaultInstance) return this; - if (other.HasObjectUuid) { - ObjectUuid = other.ObjectUuid; - } - if (other.HasFieldId) { - FieldId = other.FieldId; - } - if (other.HasFieldName) { - FieldName = other.FieldName; - } - this.MergeUnknownFields(other.UnknownFields); - return this; - } - - public override Builder MergeFrom(pb::CodedInputStream input) { - return MergeFrom(input, pb::ExtensionRegistry.Empty); - } - - public override Builder MergeFrom(pb::CodedInputStream input, pb::ExtensionRegistry extensionRegistry) { - pb::UnknownFieldSet.Builder unknownFields = null; - while (true) { - uint tag = input.ReadTag(); - switch (tag) { - case 0: { - if (unknownFields != null) { - this.UnknownFields = unknownFields.Build(); - } - return this; - } - default: { - if (pb::WireFormat.IsEndGroupTag(tag)) { - if (unknownFields != null) { - this.UnknownFields = unknownFields.Build(); - } - return this; - } - if (unknownFields == null) { - unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); - } - ParseUnknownField(input, unknownFields, extensionRegistry, tag); - break; - } - case 74: { - ObjectUuid = input.ReadBytes(); - break; - } - case 80: { - FieldId = input.ReadUInt64(); - break; - } - case 90: { - FieldName = input.ReadString(); - break; - } - } - } - } - - - public bool HasObjectUuid { - get { return result.HasObjectUuid; } - } - public pb::ByteString ObjectUuid { - get { return result.ObjectUuid; } - set { SetObjectUuid(value); } - } - public Builder SetObjectUuid(pb::ByteString value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - result.hasObjectUuid = true; - result.objectUuid_ = value; - return this; - } - public Builder ClearObjectUuid() { - result.hasObjectUuid = false; - result.objectUuid_ = pb::ByteString.Empty; - return this; - } - - public bool HasFieldId { - get { return result.HasFieldId; } - } - [global::System.CLSCompliant(false)] - public ulong FieldId { - get { return result.FieldId; } - set { SetFieldId(value); } - } - [global::System.CLSCompliant(false)] - public Builder SetFieldId(ulong value) { - result.hasFieldId = true; - result.fieldId_ = value; - return this; - } - public Builder ClearFieldId() { - result.hasFieldId = false; - result.fieldId_ = 0UL; - return this; - } - - public bool HasFieldName { - get { return result.HasFieldName; } - } - public string FieldName { - get { return result.FieldName; } - set { SetFieldName(value); } - } - public Builder SetFieldName(string value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - result.hasFieldName = true; - result.fieldName_ = value; - return this; - } - public Builder ClearFieldName() { - result.hasFieldName = false; - result.fieldName_ = ""; - return this; - } - } - static StorageKey() { - object.ReferenceEquals(global::Sirikata.Persistence.Protocol._PBJ_Internal.Persistence.Descriptor, null); - } - } - - public sealed partial class StorageValue : pb::GeneratedMessage { - private static readonly StorageValue defaultInstance = new Builder().BuildPartial(); - public static StorageValue DefaultInstance { - get { return defaultInstance; } - } - - public override StorageValue DefaultInstanceForType { - get { return defaultInstance; } - } - - protected override StorageValue ThisMessage { - get { return this; } - } - - public static pbd::MessageDescriptor Descriptor { - get { return global::Sirikata.Persistence.Protocol._PBJ_Internal.Persistence.internal__static_Sirikata_Persistence_Protocol__PBJ_Internal_StorageValue__Descriptor; } - } - - protected override pb::FieldAccess.FieldAccessorTable InternalFieldAccessors { - get { return global::Sirikata.Persistence.Protocol._PBJ_Internal.Persistence.internal__static_Sirikata_Persistence_Protocol__PBJ_Internal_StorageValue__FieldAccessorTable; } - } - - public const int DataFieldNumber = 12; - private bool hasData; - private pb::ByteString data_ = pb::ByteString.Empty; - public bool HasData { - get { return hasData; } - } - public pb::ByteString Data { - get { return data_; } - } - - public override bool IsInitialized { - get { - return true; - } - } - - public override void WriteTo(pb::CodedOutputStream output) { - if (HasData) { - output.WriteBytes(12, Data); - } - UnknownFields.WriteTo(output); - } - - private int memoizedSerializedSize = -1; - public override int SerializedSize { - get { - int size = memoizedSerializedSize; - if (size != -1) return size; - - size = 0; - if (HasData) { - size += pb::CodedOutputStream.ComputeBytesSize(12, Data); - } - size += UnknownFields.SerializedSize; - memoizedSerializedSize = size; - return size; - } - } - - public static StorageValue ParseFrom(pb::ByteString data) { - return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); - } - public static StorageValue ParseFrom(pb::ByteString data, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); - } - public static StorageValue ParseFrom(byte[] data) { - return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); - } - public static StorageValue ParseFrom(byte[] data, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); - } - public static StorageValue ParseFrom(global::System.IO.Stream input) { - return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); - } - public static StorageValue ParseFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); - } - public static StorageValue ParseDelimitedFrom(global::System.IO.Stream input) { - return CreateBuilder().MergeDelimitedFrom(input).BuildParsed(); - } - public static StorageValue ParseDelimitedFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { - return CreateBuilder().MergeDelimitedFrom(input, extensionRegistry).BuildParsed(); - } - public static StorageValue ParseFrom(pb::CodedInputStream input) { - return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); - } - public static StorageValue ParseFrom(pb::CodedInputStream input, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); - } - public static Builder CreateBuilder() { return new Builder(); } - public override Builder ToBuilder() { return CreateBuilder(this); } - public override Builder CreateBuilderForType() { return new Builder(); } - public static Builder CreateBuilder(StorageValue prototype) { - return (Builder) new Builder().MergeFrom(prototype); - } - - public sealed partial class Builder : pb::GeneratedBuilder { - protected override Builder ThisBuilder { - get { return this; } - } - public Builder() {} - - StorageValue result = new StorageValue(); - - protected override StorageValue MessageBeingBuilt { - get { return result; } - } - - public override Builder Clear() { - result = new StorageValue(); - return this; - } - - public override Builder Clone() { - return new Builder().MergeFrom(result); - } - - public override pbd::MessageDescriptor DescriptorForType { - get { return global::Sirikata.Persistence.Protocol._PBJ_Internal.StorageValue.Descriptor; } - } - - public override StorageValue DefaultInstanceForType { - get { return global::Sirikata.Persistence.Protocol._PBJ_Internal.StorageValue.DefaultInstance; } - } - - public override StorageValue BuildPartial() { - if (result == null) { - throw new global::System.InvalidOperationException("build() has already been called on this Builder"); - } - StorageValue returnMe = result; - result = null; - return returnMe; - } - - public override Builder MergeFrom(pb::IMessage other) { - if (other is StorageValue) { - return MergeFrom((StorageValue) other); - } else { - base.MergeFrom(other); - return this; - } - } - - public override Builder MergeFrom(StorageValue other) { - if (other == global::Sirikata.Persistence.Protocol._PBJ_Internal.StorageValue.DefaultInstance) return this; - if (other.HasData) { - Data = other.Data; - } - this.MergeUnknownFields(other.UnknownFields); - return this; - } - - public override Builder MergeFrom(pb::CodedInputStream input) { - return MergeFrom(input, pb::ExtensionRegistry.Empty); - } - - public override Builder MergeFrom(pb::CodedInputStream input, pb::ExtensionRegistry extensionRegistry) { - pb::UnknownFieldSet.Builder unknownFields = null; - while (true) { - uint tag = input.ReadTag(); - switch (tag) { - case 0: { - if (unknownFields != null) { - this.UnknownFields = unknownFields.Build(); - } - return this; - } - default: { - if (pb::WireFormat.IsEndGroupTag(tag)) { - if (unknownFields != null) { - this.UnknownFields = unknownFields.Build(); - } - return this; - } - if (unknownFields == null) { - unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); - } - ParseUnknownField(input, unknownFields, extensionRegistry, tag); - break; - } - case 98: { - Data = input.ReadBytes(); - break; - } - } - } - } - - - public bool HasData { - get { return result.HasData; } - } - public pb::ByteString Data { - get { return result.Data; } - set { SetData(value); } - } - public Builder SetData(pb::ByteString value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - result.hasData = true; - result.data_ = value; - return this; - } - public Builder ClearData() { - result.hasData = false; - result.data_ = pb::ByteString.Empty; - return this; - } - } - static StorageValue() { - object.ReferenceEquals(global::Sirikata.Persistence.Protocol._PBJ_Internal.Persistence.Descriptor, null); - } - } - - public sealed partial class StorageElement : pb::GeneratedMessage { - private static readonly StorageElement defaultInstance = new Builder().BuildPartial(); - public static StorageElement DefaultInstance { - get { return defaultInstance; } - } - - public override StorageElement DefaultInstanceForType { - get { return defaultInstance; } - } - - protected override StorageElement ThisMessage { - get { return this; } - } - - public static pbd::MessageDescriptor Descriptor { - get { return global::Sirikata.Persistence.Protocol._PBJ_Internal.Persistence.internal__static_Sirikata_Persistence_Protocol__PBJ_Internal_StorageElement__Descriptor; } - } - - protected override pb::FieldAccess.FieldAccessorTable InternalFieldAccessors { - get { return global::Sirikata.Persistence.Protocol._PBJ_Internal.Persistence.internal__static_Sirikata_Persistence_Protocol__PBJ_Internal_StorageElement__FieldAccessorTable; } - } - - #region Nested types - public static class Types { - public enum ReturnStatus { - KEY_MISSING = 4, - INTERNAL_ERROR = 6, - } - - } - #endregion - - public const int ObjectUuidFieldNumber = 9; - private bool hasObjectUuid; - private pb::ByteString objectUuid_ = pb::ByteString.Empty; - public bool HasObjectUuid { - get { return hasObjectUuid; } - } - public pb::ByteString ObjectUuid { - get { return objectUuid_; } - } - - public const int FieldIdFieldNumber = 10; - private bool hasFieldId; - private ulong fieldId_ = 0UL; - public bool HasFieldId { - get { return hasFieldId; } - } - [global::System.CLSCompliant(false)] - public ulong FieldId { - get { return fieldId_; } - } - - public const int FieldNameFieldNumber = 11; - private bool hasFieldName; - private string fieldName_ = ""; - public bool HasFieldName { - get { return hasFieldName; } - } - public string FieldName { - get { return fieldName_; } - } - - public const int DataFieldNumber = 12; - private bool hasData; - private pb::ByteString data_ = pb::ByteString.Empty; - public bool HasData { - get { return hasData; } - } - public pb::ByteString Data { - get { return data_; } - } - - public const int IndexFieldNumber = 13; - private bool hasIndex; - private int index_ = 0; - public bool HasIndex { - get { return hasIndex; } - } - public int Index { - get { return index_; } - } - - public const int ReturnStatusFieldNumber = 15; - private bool hasReturnStatus; - private global::Sirikata.Persistence.Protocol._PBJ_Internal.StorageElement.Types.ReturnStatus returnStatus_ = global::Sirikata.Persistence.Protocol._PBJ_Internal.StorageElement.Types.ReturnStatus.KEY_MISSING; - public bool HasReturnStatus { - get { return hasReturnStatus; } - } - public global::Sirikata.Persistence.Protocol._PBJ_Internal.StorageElement.Types.ReturnStatus ReturnStatus { - get { return returnStatus_; } - } - - public override bool IsInitialized { - get { - return true; - } - } - - public override void WriteTo(pb::CodedOutputStream output) { - if (HasObjectUuid) { - output.WriteBytes(9, ObjectUuid); - } - if (HasFieldId) { - output.WriteUInt64(10, FieldId); - } - if (HasFieldName) { - output.WriteString(11, FieldName); - } - if (HasData) { - output.WriteBytes(12, Data); - } - if (HasIndex) { - output.WriteInt32(13, Index); - } - if (HasReturnStatus) { - output.WriteEnum(15, (int) ReturnStatus); - } - UnknownFields.WriteTo(output); - } - - private int memoizedSerializedSize = -1; - public override int SerializedSize { - get { - int size = memoizedSerializedSize; - if (size != -1) return size; - - size = 0; - if (HasObjectUuid) { - size += pb::CodedOutputStream.ComputeBytesSize(9, ObjectUuid); - } - if (HasFieldId) { - size += pb::CodedOutputStream.ComputeUInt64Size(10, FieldId); - } - if (HasFieldName) { - size += pb::CodedOutputStream.ComputeStringSize(11, FieldName); - } - if (HasData) { - size += pb::CodedOutputStream.ComputeBytesSize(12, Data); - } - if (HasIndex) { - size += pb::CodedOutputStream.ComputeInt32Size(13, Index); - } - if (HasReturnStatus) { - size += pb::CodedOutputStream.ComputeEnumSize(15, (int) ReturnStatus); - } - size += UnknownFields.SerializedSize; - memoizedSerializedSize = size; - return size; - } - } - - public static StorageElement ParseFrom(pb::ByteString data) { - return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); - } - public static StorageElement ParseFrom(pb::ByteString data, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); - } - public static StorageElement ParseFrom(byte[] data) { - return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); - } - public static StorageElement ParseFrom(byte[] data, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); - } - public static StorageElement ParseFrom(global::System.IO.Stream input) { - return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); - } - public static StorageElement ParseFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); - } - public static StorageElement ParseDelimitedFrom(global::System.IO.Stream input) { - return CreateBuilder().MergeDelimitedFrom(input).BuildParsed(); - } - public static StorageElement ParseDelimitedFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { - return CreateBuilder().MergeDelimitedFrom(input, extensionRegistry).BuildParsed(); - } - public static StorageElement ParseFrom(pb::CodedInputStream input) { - return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); - } - public static StorageElement ParseFrom(pb::CodedInputStream input, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); - } - public static Builder CreateBuilder() { return new Builder(); } - public override Builder ToBuilder() { return CreateBuilder(this); } - public override Builder CreateBuilderForType() { return new Builder(); } - public static Builder CreateBuilder(StorageElement prototype) { - return (Builder) new Builder().MergeFrom(prototype); - } - - public sealed partial class Builder : pb::GeneratedBuilder { - protected override Builder ThisBuilder { - get { return this; } - } - public Builder() {} - - StorageElement result = new StorageElement(); - - protected override StorageElement MessageBeingBuilt { - get { return result; } - } - - public override Builder Clear() { - result = new StorageElement(); - return this; - } - - public override Builder Clone() { - return new Builder().MergeFrom(result); - } - - public override pbd::MessageDescriptor DescriptorForType { - get { return global::Sirikata.Persistence.Protocol._PBJ_Internal.StorageElement.Descriptor; } - } - - public override StorageElement DefaultInstanceForType { - get { return global::Sirikata.Persistence.Protocol._PBJ_Internal.StorageElement.DefaultInstance; } - } - - public override StorageElement BuildPartial() { - if (result == null) { - throw new global::System.InvalidOperationException("build() has already been called on this Builder"); - } - StorageElement returnMe = result; - result = null; - return returnMe; - } - - public override Builder MergeFrom(pb::IMessage other) { - if (other is StorageElement) { - return MergeFrom((StorageElement) other); - } else { - base.MergeFrom(other); - return this; - } - } - - public override Builder MergeFrom(StorageElement other) { - if (other == global::Sirikata.Persistence.Protocol._PBJ_Internal.StorageElement.DefaultInstance) return this; - if (other.HasObjectUuid) { - ObjectUuid = other.ObjectUuid; - } - if (other.HasFieldId) { - FieldId = other.FieldId; - } - if (other.HasFieldName) { - FieldName = other.FieldName; - } - if (other.HasData) { - Data = other.Data; - } - if (other.HasIndex) { - Index = other.Index; - } - if (other.HasReturnStatus) { - ReturnStatus = other.ReturnStatus; - } - this.MergeUnknownFields(other.UnknownFields); - return this; - } - - public override Builder MergeFrom(pb::CodedInputStream input) { - return MergeFrom(input, pb::ExtensionRegistry.Empty); - } - - public override Builder MergeFrom(pb::CodedInputStream input, pb::ExtensionRegistry extensionRegistry) { - pb::UnknownFieldSet.Builder unknownFields = null; - while (true) { - uint tag = input.ReadTag(); - switch (tag) { - case 0: { - if (unknownFields != null) { - this.UnknownFields = unknownFields.Build(); - } - return this; - } - default: { - if (pb::WireFormat.IsEndGroupTag(tag)) { - if (unknownFields != null) { - this.UnknownFields = unknownFields.Build(); - } - return this; - } - if (unknownFields == null) { - unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); - } - ParseUnknownField(input, unknownFields, extensionRegistry, tag); - break; - } - case 74: { - ObjectUuid = input.ReadBytes(); - break; - } - case 80: { - FieldId = input.ReadUInt64(); - break; - } - case 90: { - FieldName = input.ReadString(); - break; - } - case 98: { - Data = input.ReadBytes(); - break; - } - case 104: { - Index = input.ReadInt32(); - break; - } - case 120: { - int rawValue = input.ReadEnum(); - if (!global::System.Enum.IsDefined(typeof(global::Sirikata.Persistence.Protocol._PBJ_Internal.StorageElement.Types.ReturnStatus), rawValue)) { - if (unknownFields == null) { - unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); - } - unknownFields.MergeVarintField(15, (ulong) rawValue); - } else { - ReturnStatus = (global::Sirikata.Persistence.Protocol._PBJ_Internal.StorageElement.Types.ReturnStatus) rawValue; - } - break; - } - } - } - } - - - public bool HasObjectUuid { - get { return result.HasObjectUuid; } - } - public pb::ByteString ObjectUuid { - get { return result.ObjectUuid; } - set { SetObjectUuid(value); } - } - public Builder SetObjectUuid(pb::ByteString value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - result.hasObjectUuid = true; - result.objectUuid_ = value; - return this; - } - public Builder ClearObjectUuid() { - result.hasObjectUuid = false; - result.objectUuid_ = pb::ByteString.Empty; - return this; - } - - public bool HasFieldId { - get { return result.HasFieldId; } - } - [global::System.CLSCompliant(false)] - public ulong FieldId { - get { return result.FieldId; } - set { SetFieldId(value); } - } - [global::System.CLSCompliant(false)] - public Builder SetFieldId(ulong value) { - result.hasFieldId = true; - result.fieldId_ = value; - return this; - } - public Builder ClearFieldId() { - result.hasFieldId = false; - result.fieldId_ = 0UL; - return this; - } - - public bool HasFieldName { - get { return result.HasFieldName; } - } - public string FieldName { - get { return result.FieldName; } - set { SetFieldName(value); } - } - public Builder SetFieldName(string value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - result.hasFieldName = true; - result.fieldName_ = value; - return this; - } - public Builder ClearFieldName() { - result.hasFieldName = false; - result.fieldName_ = ""; - return this; - } - - public bool HasData { - get { return result.HasData; } - } - public pb::ByteString Data { - get { return result.Data; } - set { SetData(value); } - } - public Builder SetData(pb::ByteString value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - result.hasData = true; - result.data_ = value; - return this; - } - public Builder ClearData() { - result.hasData = false; - result.data_ = pb::ByteString.Empty; - return this; - } - - public bool HasIndex { - get { return result.HasIndex; } - } - public int Index { - get { return result.Index; } - set { SetIndex(value); } - } - public Builder SetIndex(int value) { - result.hasIndex = true; - result.index_ = value; - return this; - } - public Builder ClearIndex() { - result.hasIndex = false; - result.index_ = 0; - return this; - } - - public bool HasReturnStatus { - get { return result.HasReturnStatus; } - } - public global::Sirikata.Persistence.Protocol._PBJ_Internal.StorageElement.Types.ReturnStatus ReturnStatus { - get { return result.ReturnStatus; } - set { SetReturnStatus(value); } - } - public Builder SetReturnStatus(global::Sirikata.Persistence.Protocol._PBJ_Internal.StorageElement.Types.ReturnStatus value) { - result.hasReturnStatus = true; - result.returnStatus_ = value; - return this; - } - public Builder ClearReturnStatus() { - result.hasReturnStatus = false; - result.returnStatus_ = global::Sirikata.Persistence.Protocol._PBJ_Internal.StorageElement.Types.ReturnStatus.KEY_MISSING; - return this; - } - } - static StorageElement() { - object.ReferenceEquals(global::Sirikata.Persistence.Protocol._PBJ_Internal.Persistence.Descriptor, null); - } - } - - public sealed partial class CompareElement : pb::GeneratedMessage { - private static readonly CompareElement defaultInstance = new Builder().BuildPartial(); - public static CompareElement DefaultInstance { - get { return defaultInstance; } - } - - public override CompareElement DefaultInstanceForType { - get { return defaultInstance; } - } - - protected override CompareElement ThisMessage { - get { return this; } - } - - public static pbd::MessageDescriptor Descriptor { - get { return global::Sirikata.Persistence.Protocol._PBJ_Internal.Persistence.internal__static_Sirikata_Persistence_Protocol__PBJ_Internal_CompareElement__Descriptor; } - } - - protected override pb::FieldAccess.FieldAccessorTable InternalFieldAccessors { - get { return global::Sirikata.Persistence.Protocol._PBJ_Internal.Persistence.internal__static_Sirikata_Persistence_Protocol__PBJ_Internal_CompareElement__FieldAccessorTable; } - } - - #region Nested types - public static class Types { - public enum COMPARATOR { - EQUAL = 0, - NEQUAL = 1, - } - - } - #endregion - - public const int ObjectUuidFieldNumber = 9; - private bool hasObjectUuid; - private pb::ByteString objectUuid_ = pb::ByteString.Empty; - public bool HasObjectUuid { - get { return hasObjectUuid; } - } - public pb::ByteString ObjectUuid { - get { return objectUuid_; } - } - - public const int FieldIdFieldNumber = 10; - private bool hasFieldId; - private ulong fieldId_ = 0UL; - public bool HasFieldId { - get { return hasFieldId; } - } - [global::System.CLSCompliant(false)] - public ulong FieldId { - get { return fieldId_; } - } - - public const int FieldNameFieldNumber = 11; - private bool hasFieldName; - private string fieldName_ = ""; - public bool HasFieldName { - get { return hasFieldName; } - } - public string FieldName { - get { return fieldName_; } - } - - public const int DataFieldNumber = 12; - private bool hasData; - private pb::ByteString data_ = pb::ByteString.Empty; - public bool HasData { - get { return hasData; } - } - public pb::ByteString Data { - get { return data_; } - } - - public const int ComparatorFieldNumber = 14; - private bool hasComparator; - private global::Sirikata.Persistence.Protocol._PBJ_Internal.CompareElement.Types.COMPARATOR comparator_ = global::Sirikata.Persistence.Protocol._PBJ_Internal.CompareElement.Types.COMPARATOR.EQUAL; - public bool HasComparator { - get { return hasComparator; } - } - public global::Sirikata.Persistence.Protocol._PBJ_Internal.CompareElement.Types.COMPARATOR Comparator { - get { return comparator_; } - } - - public override bool IsInitialized { - get { - return true; - } - } - - public override void WriteTo(pb::CodedOutputStream output) { - if (HasObjectUuid) { - output.WriteBytes(9, ObjectUuid); - } - if (HasFieldId) { - output.WriteUInt64(10, FieldId); - } - if (HasFieldName) { - output.WriteString(11, FieldName); - } - if (HasData) { - output.WriteBytes(12, Data); - } - if (HasComparator) { - output.WriteEnum(14, (int) Comparator); - } - UnknownFields.WriteTo(output); - } - - private int memoizedSerializedSize = -1; - public override int SerializedSize { - get { - int size = memoizedSerializedSize; - if (size != -1) return size; - - size = 0; - if (HasObjectUuid) { - size += pb::CodedOutputStream.ComputeBytesSize(9, ObjectUuid); - } - if (HasFieldId) { - size += pb::CodedOutputStream.ComputeUInt64Size(10, FieldId); - } - if (HasFieldName) { - size += pb::CodedOutputStream.ComputeStringSize(11, FieldName); - } - if (HasData) { - size += pb::CodedOutputStream.ComputeBytesSize(12, Data); - } - if (HasComparator) { - size += pb::CodedOutputStream.ComputeEnumSize(14, (int) Comparator); - } - size += UnknownFields.SerializedSize; - memoizedSerializedSize = size; - return size; - } - } - - public static CompareElement ParseFrom(pb::ByteString data) { - return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); - } - public static CompareElement ParseFrom(pb::ByteString data, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); - } - public static CompareElement ParseFrom(byte[] data) { - return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); - } - public static CompareElement ParseFrom(byte[] data, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); - } - public static CompareElement ParseFrom(global::System.IO.Stream input) { - return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); - } - public static CompareElement ParseFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); - } - public static CompareElement ParseDelimitedFrom(global::System.IO.Stream input) { - return CreateBuilder().MergeDelimitedFrom(input).BuildParsed(); - } - public static CompareElement ParseDelimitedFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { - return CreateBuilder().MergeDelimitedFrom(input, extensionRegistry).BuildParsed(); - } - public static CompareElement ParseFrom(pb::CodedInputStream input) { - return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); - } - public static CompareElement ParseFrom(pb::CodedInputStream input, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); - } - public static Builder CreateBuilder() { return new Builder(); } - public override Builder ToBuilder() { return CreateBuilder(this); } - public override Builder CreateBuilderForType() { return new Builder(); } - public static Builder CreateBuilder(CompareElement prototype) { - return (Builder) new Builder().MergeFrom(prototype); - } - - public sealed partial class Builder : pb::GeneratedBuilder { - protected override Builder ThisBuilder { - get { return this; } - } - public Builder() {} - - CompareElement result = new CompareElement(); - - protected override CompareElement MessageBeingBuilt { - get { return result; } - } - - public override Builder Clear() { - result = new CompareElement(); - return this; - } - - public override Builder Clone() { - return new Builder().MergeFrom(result); - } - - public override pbd::MessageDescriptor DescriptorForType { - get { return global::Sirikata.Persistence.Protocol._PBJ_Internal.CompareElement.Descriptor; } - } - - public override CompareElement DefaultInstanceForType { - get { return global::Sirikata.Persistence.Protocol._PBJ_Internal.CompareElement.DefaultInstance; } - } - - public override CompareElement BuildPartial() { - if (result == null) { - throw new global::System.InvalidOperationException("build() has already been called on this Builder"); - } - CompareElement returnMe = result; - result = null; - return returnMe; - } - - public override Builder MergeFrom(pb::IMessage other) { - if (other is CompareElement) { - return MergeFrom((CompareElement) other); - } else { - base.MergeFrom(other); - return this; - } - } - - public override Builder MergeFrom(CompareElement other) { - if (other == global::Sirikata.Persistence.Protocol._PBJ_Internal.CompareElement.DefaultInstance) return this; - if (other.HasObjectUuid) { - ObjectUuid = other.ObjectUuid; - } - if (other.HasFieldId) { - FieldId = other.FieldId; - } - if (other.HasFieldName) { - FieldName = other.FieldName; - } - if (other.HasData) { - Data = other.Data; - } - if (other.HasComparator) { - Comparator = other.Comparator; - } - this.MergeUnknownFields(other.UnknownFields); - return this; - } - - public override Builder MergeFrom(pb::CodedInputStream input) { - return MergeFrom(input, pb::ExtensionRegistry.Empty); - } - - public override Builder MergeFrom(pb::CodedInputStream input, pb::ExtensionRegistry extensionRegistry) { - pb::UnknownFieldSet.Builder unknownFields = null; - while (true) { - uint tag = input.ReadTag(); - switch (tag) { - case 0: { - if (unknownFields != null) { - this.UnknownFields = unknownFields.Build(); - } - return this; - } - default: { - if (pb::WireFormat.IsEndGroupTag(tag)) { - if (unknownFields != null) { - this.UnknownFields = unknownFields.Build(); - } - return this; - } - if (unknownFields == null) { - unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); - } - ParseUnknownField(input, unknownFields, extensionRegistry, tag); - break; - } - case 74: { - ObjectUuid = input.ReadBytes(); - break; - } - case 80: { - FieldId = input.ReadUInt64(); - break; - } - case 90: { - FieldName = input.ReadString(); - break; - } - case 98: { - Data = input.ReadBytes(); - break; - } - case 112: { - int rawValue = input.ReadEnum(); - if (!global::System.Enum.IsDefined(typeof(global::Sirikata.Persistence.Protocol._PBJ_Internal.CompareElement.Types.COMPARATOR), rawValue)) { - if (unknownFields == null) { - unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); - } - unknownFields.MergeVarintField(14, (ulong) rawValue); - } else { - Comparator = (global::Sirikata.Persistence.Protocol._PBJ_Internal.CompareElement.Types.COMPARATOR) rawValue; - } - break; - } - } - } - } - - - public bool HasObjectUuid { - get { return result.HasObjectUuid; } - } - public pb::ByteString ObjectUuid { - get { return result.ObjectUuid; } - set { SetObjectUuid(value); } - } - public Builder SetObjectUuid(pb::ByteString value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - result.hasObjectUuid = true; - result.objectUuid_ = value; - return this; - } - public Builder ClearObjectUuid() { - result.hasObjectUuid = false; - result.objectUuid_ = pb::ByteString.Empty; - return this; - } - - public bool HasFieldId { - get { return result.HasFieldId; } - } - [global::System.CLSCompliant(false)] - public ulong FieldId { - get { return result.FieldId; } - set { SetFieldId(value); } - } - [global::System.CLSCompliant(false)] - public Builder SetFieldId(ulong value) { - result.hasFieldId = true; - result.fieldId_ = value; - return this; - } - public Builder ClearFieldId() { - result.hasFieldId = false; - result.fieldId_ = 0UL; - return this; - } - - public bool HasFieldName { - get { return result.HasFieldName; } - } - public string FieldName { - get { return result.FieldName; } - set { SetFieldName(value); } - } - public Builder SetFieldName(string value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - result.hasFieldName = true; - result.fieldName_ = value; - return this; - } - public Builder ClearFieldName() { - result.hasFieldName = false; - result.fieldName_ = ""; - return this; - } - - public bool HasData { - get { return result.HasData; } - } - public pb::ByteString Data { - get { return result.Data; } - set { SetData(value); } - } - public Builder SetData(pb::ByteString value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - result.hasData = true; - result.data_ = value; - return this; - } - public Builder ClearData() { - result.hasData = false; - result.data_ = pb::ByteString.Empty; - return this; - } - - public bool HasComparator { - get { return result.HasComparator; } - } - public global::Sirikata.Persistence.Protocol._PBJ_Internal.CompareElement.Types.COMPARATOR Comparator { - get { return result.Comparator; } - set { SetComparator(value); } - } - public Builder SetComparator(global::Sirikata.Persistence.Protocol._PBJ_Internal.CompareElement.Types.COMPARATOR value) { - result.hasComparator = true; - result.comparator_ = value; - return this; - } - public Builder ClearComparator() { - result.hasComparator = false; - result.comparator_ = global::Sirikata.Persistence.Protocol._PBJ_Internal.CompareElement.Types.COMPARATOR.EQUAL; - return this; - } - } - static CompareElement() { - object.ReferenceEquals(global::Sirikata.Persistence.Protocol._PBJ_Internal.Persistence.Descriptor, null); - } - } - - public sealed partial class StorageSet : pb::GeneratedMessage { - private static readonly StorageSet defaultInstance = new Builder().BuildPartial(); - public static StorageSet DefaultInstance { - get { return defaultInstance; } - } - - public override StorageSet DefaultInstanceForType { - get { return defaultInstance; } - } - - protected override StorageSet ThisMessage { - get { return this; } - } - - public static pbd::MessageDescriptor Descriptor { - get { return global::Sirikata.Persistence.Protocol._PBJ_Internal.Persistence.internal__static_Sirikata_Persistence_Protocol__PBJ_Internal_StorageSet__Descriptor; } - } - - protected override pb::FieldAccess.FieldAccessorTable InternalFieldAccessors { - get { return global::Sirikata.Persistence.Protocol._PBJ_Internal.Persistence.internal__static_Sirikata_Persistence_Protocol__PBJ_Internal_StorageSet__FieldAccessorTable; } - } - - public const int ReadsFieldNumber = 9; - private pbc::PopsicleList reads_ = new pbc::PopsicleList(); - public scg::IList ReadsList { - get { return reads_; } - } - public int ReadsCount { - get { return reads_.Count; } - } - public global::Sirikata.Persistence.Protocol._PBJ_Internal.StorageElement GetReads(int index) { - return reads_[index]; - } - - public override bool IsInitialized { - get { - return true; - } - } - - public override void WriteTo(pb::CodedOutputStream output) { - foreach (global::Sirikata.Persistence.Protocol._PBJ_Internal.StorageElement element in ReadsList) { - output.WriteMessage(9, element); - } - UnknownFields.WriteTo(output); - } - - private int memoizedSerializedSize = -1; - public override int SerializedSize { - get { - int size = memoizedSerializedSize; - if (size != -1) return size; - - size = 0; - foreach (global::Sirikata.Persistence.Protocol._PBJ_Internal.StorageElement element in ReadsList) { - size += pb::CodedOutputStream.ComputeMessageSize(9, element); - } - size += UnknownFields.SerializedSize; - memoizedSerializedSize = size; - return size; - } - } - - public static StorageSet ParseFrom(pb::ByteString data) { - return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); - } - public static StorageSet ParseFrom(pb::ByteString data, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); - } - public static StorageSet ParseFrom(byte[] data) { - return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); - } - public static StorageSet ParseFrom(byte[] data, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); - } - public static StorageSet ParseFrom(global::System.IO.Stream input) { - return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); - } - public static StorageSet ParseFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); - } - public static StorageSet ParseDelimitedFrom(global::System.IO.Stream input) { - return CreateBuilder().MergeDelimitedFrom(input).BuildParsed(); - } - public static StorageSet ParseDelimitedFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { - return CreateBuilder().MergeDelimitedFrom(input, extensionRegistry).BuildParsed(); - } - public static StorageSet ParseFrom(pb::CodedInputStream input) { - return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); - } - public static StorageSet ParseFrom(pb::CodedInputStream input, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); - } - public static Builder CreateBuilder() { return new Builder(); } - public override Builder ToBuilder() { return CreateBuilder(this); } - public override Builder CreateBuilderForType() { return new Builder(); } - public static Builder CreateBuilder(StorageSet prototype) { - return (Builder) new Builder().MergeFrom(prototype); - } - - public sealed partial class Builder : pb::GeneratedBuilder { - protected override Builder ThisBuilder { - get { return this; } - } - public Builder() {} - - StorageSet result = new StorageSet(); - - protected override StorageSet MessageBeingBuilt { - get { return result; } - } - - public override Builder Clear() { - result = new StorageSet(); - return this; - } - - public override Builder Clone() { - return new Builder().MergeFrom(result); - } - - public override pbd::MessageDescriptor DescriptorForType { - get { return global::Sirikata.Persistence.Protocol._PBJ_Internal.StorageSet.Descriptor; } - } - - public override StorageSet DefaultInstanceForType { - get { return global::Sirikata.Persistence.Protocol._PBJ_Internal.StorageSet.DefaultInstance; } - } - - public override StorageSet BuildPartial() { - if (result == null) { - throw new global::System.InvalidOperationException("build() has already been called on this Builder"); - } - result.reads_.MakeReadOnly(); - StorageSet returnMe = result; - result = null; - return returnMe; - } - - public override Builder MergeFrom(pb::IMessage other) { - if (other is StorageSet) { - return MergeFrom((StorageSet) other); - } else { - base.MergeFrom(other); - return this; - } - } - - public override Builder MergeFrom(StorageSet other) { - if (other == global::Sirikata.Persistence.Protocol._PBJ_Internal.StorageSet.DefaultInstance) return this; - if (other.reads_.Count != 0) { - base.AddRange(other.reads_, result.reads_); - } - this.MergeUnknownFields(other.UnknownFields); - return this; - } - - public override Builder MergeFrom(pb::CodedInputStream input) { - return MergeFrom(input, pb::ExtensionRegistry.Empty); - } - - public override Builder MergeFrom(pb::CodedInputStream input, pb::ExtensionRegistry extensionRegistry) { - pb::UnknownFieldSet.Builder unknownFields = null; - while (true) { - uint tag = input.ReadTag(); - switch (tag) { - case 0: { - if (unknownFields != null) { - this.UnknownFields = unknownFields.Build(); - } - return this; - } - default: { - if (pb::WireFormat.IsEndGroupTag(tag)) { - if (unknownFields != null) { - this.UnknownFields = unknownFields.Build(); - } - return this; - } - if (unknownFields == null) { - unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); - } - ParseUnknownField(input, unknownFields, extensionRegistry, tag); - break; - } - case 74: { - global::Sirikata.Persistence.Protocol._PBJ_Internal.StorageElement.Builder subBuilder = global::Sirikata.Persistence.Protocol._PBJ_Internal.StorageElement.CreateBuilder(); - input.ReadMessage(subBuilder, extensionRegistry); - AddReads(subBuilder.BuildPartial()); - break; - } - } - } - } - - - public pbc::IPopsicleList ReadsList { - get { return result.reads_; } - } - public int ReadsCount { - get { return result.ReadsCount; } - } - public global::Sirikata.Persistence.Protocol._PBJ_Internal.StorageElement GetReads(int index) { - return result.GetReads(index); - } - public Builder SetReads(int index, global::Sirikata.Persistence.Protocol._PBJ_Internal.StorageElement value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - result.reads_[index] = value; - return this; - } - public Builder SetReads(int index, global::Sirikata.Persistence.Protocol._PBJ_Internal.StorageElement.Builder builderForValue) { - pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); - result.reads_[index] = builderForValue.Build(); - return this; - } - public Builder AddReads(global::Sirikata.Persistence.Protocol._PBJ_Internal.StorageElement value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - result.reads_.Add(value); - return this; - } - public Builder AddReads(global::Sirikata.Persistence.Protocol._PBJ_Internal.StorageElement.Builder builderForValue) { - pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); - result.reads_.Add(builderForValue.Build()); - return this; - } - public Builder AddRangeReads(scg::IEnumerable values) { - base.AddRange(values, result.reads_); - return this; - } - public Builder ClearReads() { - result.reads_.Clear(); - return this; - } - } - static StorageSet() { - object.ReferenceEquals(global::Sirikata.Persistence.Protocol._PBJ_Internal.Persistence.Descriptor, null); - } - } - - public sealed partial class ReadSet : pb::GeneratedMessage { - private static readonly ReadSet defaultInstance = new Builder().BuildPartial(); - public static ReadSet DefaultInstance { - get { return defaultInstance; } - } - - public override ReadSet DefaultInstanceForType { - get { return defaultInstance; } - } - - protected override ReadSet ThisMessage { - get { return this; } - } - - public static pbd::MessageDescriptor Descriptor { - get { return global::Sirikata.Persistence.Protocol._PBJ_Internal.Persistence.internal__static_Sirikata_Persistence_Protocol__PBJ_Internal_ReadSet__Descriptor; } - } - - protected override pb::FieldAccess.FieldAccessorTable InternalFieldAccessors { - get { return global::Sirikata.Persistence.Protocol._PBJ_Internal.Persistence.internal__static_Sirikata_Persistence_Protocol__PBJ_Internal_ReadSet__FieldAccessorTable; } - } - - public const int ReadsFieldNumber = 9; - private pbc::PopsicleList reads_ = new pbc::PopsicleList(); - public scg::IList ReadsList { - get { return reads_; } - } - public int ReadsCount { - get { return reads_.Count; } - } - public global::Sirikata.Persistence.Protocol._PBJ_Internal.StorageElement GetReads(int index) { - return reads_[index]; - } - - public override bool IsInitialized { - get { - return true; - } - } - - public override void WriteTo(pb::CodedOutputStream output) { - foreach (global::Sirikata.Persistence.Protocol._PBJ_Internal.StorageElement element in ReadsList) { - output.WriteMessage(9, element); - } - UnknownFields.WriteTo(output); - } - - private int memoizedSerializedSize = -1; - public override int SerializedSize { - get { - int size = memoizedSerializedSize; - if (size != -1) return size; - - size = 0; - foreach (global::Sirikata.Persistence.Protocol._PBJ_Internal.StorageElement element in ReadsList) { - size += pb::CodedOutputStream.ComputeMessageSize(9, element); - } - size += UnknownFields.SerializedSize; - memoizedSerializedSize = size; - return size; - } - } - - public static ReadSet ParseFrom(pb::ByteString data) { - return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); - } - public static ReadSet ParseFrom(pb::ByteString data, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); - } - public static ReadSet ParseFrom(byte[] data) { - return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); - } - public static ReadSet ParseFrom(byte[] data, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); - } - public static ReadSet ParseFrom(global::System.IO.Stream input) { - return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); - } - public static ReadSet ParseFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); - } - public static ReadSet ParseDelimitedFrom(global::System.IO.Stream input) { - return CreateBuilder().MergeDelimitedFrom(input).BuildParsed(); - } - public static ReadSet ParseDelimitedFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { - return CreateBuilder().MergeDelimitedFrom(input, extensionRegistry).BuildParsed(); - } - public static ReadSet ParseFrom(pb::CodedInputStream input) { - return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); - } - public static ReadSet ParseFrom(pb::CodedInputStream input, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); - } - public static Builder CreateBuilder() { return new Builder(); } - public override Builder ToBuilder() { return CreateBuilder(this); } - public override Builder CreateBuilderForType() { return new Builder(); } - public static Builder CreateBuilder(ReadSet prototype) { - return (Builder) new Builder().MergeFrom(prototype); - } - - public sealed partial class Builder : pb::GeneratedBuilder { - protected override Builder ThisBuilder { - get { return this; } - } - public Builder() {} - - ReadSet result = new ReadSet(); - - protected override ReadSet MessageBeingBuilt { - get { return result; } - } - - public override Builder Clear() { - result = new ReadSet(); - return this; - } - - public override Builder Clone() { - return new Builder().MergeFrom(result); - } - - public override pbd::MessageDescriptor DescriptorForType { - get { return global::Sirikata.Persistence.Protocol._PBJ_Internal.ReadSet.Descriptor; } - } - - public override ReadSet DefaultInstanceForType { - get { return global::Sirikata.Persistence.Protocol._PBJ_Internal.ReadSet.DefaultInstance; } - } - - public override ReadSet BuildPartial() { - if (result == null) { - throw new global::System.InvalidOperationException("build() has already been called on this Builder"); - } - result.reads_.MakeReadOnly(); - ReadSet returnMe = result; - result = null; - return returnMe; - } - - public override Builder MergeFrom(pb::IMessage other) { - if (other is ReadSet) { - return MergeFrom((ReadSet) other); - } else { - base.MergeFrom(other); - return this; - } - } - - public override Builder MergeFrom(ReadSet other) { - if (other == global::Sirikata.Persistence.Protocol._PBJ_Internal.ReadSet.DefaultInstance) return this; - if (other.reads_.Count != 0) { - base.AddRange(other.reads_, result.reads_); - } - this.MergeUnknownFields(other.UnknownFields); - return this; - } - - public override Builder MergeFrom(pb::CodedInputStream input) { - return MergeFrom(input, pb::ExtensionRegistry.Empty); - } - - public override Builder MergeFrom(pb::CodedInputStream input, pb::ExtensionRegistry extensionRegistry) { - pb::UnknownFieldSet.Builder unknownFields = null; - while (true) { - uint tag = input.ReadTag(); - switch (tag) { - case 0: { - if (unknownFields != null) { - this.UnknownFields = unknownFields.Build(); - } - return this; - } - default: { - if (pb::WireFormat.IsEndGroupTag(tag)) { - if (unknownFields != null) { - this.UnknownFields = unknownFields.Build(); - } - return this; - } - if (unknownFields == null) { - unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); - } - ParseUnknownField(input, unknownFields, extensionRegistry, tag); - break; - } - case 74: { - global::Sirikata.Persistence.Protocol._PBJ_Internal.StorageElement.Builder subBuilder = global::Sirikata.Persistence.Protocol._PBJ_Internal.StorageElement.CreateBuilder(); - input.ReadMessage(subBuilder, extensionRegistry); - AddReads(subBuilder.BuildPartial()); - break; - } - } - } - } - - - public pbc::IPopsicleList ReadsList { - get { return result.reads_; } - } - public int ReadsCount { - get { return result.ReadsCount; } - } - public global::Sirikata.Persistence.Protocol._PBJ_Internal.StorageElement GetReads(int index) { - return result.GetReads(index); - } - public Builder SetReads(int index, global::Sirikata.Persistence.Protocol._PBJ_Internal.StorageElement value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - result.reads_[index] = value; - return this; - } - public Builder SetReads(int index, global::Sirikata.Persistence.Protocol._PBJ_Internal.StorageElement.Builder builderForValue) { - pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); - result.reads_[index] = builderForValue.Build(); - return this; - } - public Builder AddReads(global::Sirikata.Persistence.Protocol._PBJ_Internal.StorageElement value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - result.reads_.Add(value); - return this; - } - public Builder AddReads(global::Sirikata.Persistence.Protocol._PBJ_Internal.StorageElement.Builder builderForValue) { - pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); - result.reads_.Add(builderForValue.Build()); - return this; - } - public Builder AddRangeReads(scg::IEnumerable values) { - base.AddRange(values, result.reads_); - return this; - } - public Builder ClearReads() { - result.reads_.Clear(); - return this; - } - } - static ReadSet() { - object.ReferenceEquals(global::Sirikata.Persistence.Protocol._PBJ_Internal.Persistence.Descriptor, null); - } - } - - public sealed partial class WriteSet : pb::GeneratedMessage { - private static readonly WriteSet defaultInstance = new Builder().BuildPartial(); - public static WriteSet DefaultInstance { - get { return defaultInstance; } - } - - public override WriteSet DefaultInstanceForType { - get { return defaultInstance; } - } - - protected override WriteSet ThisMessage { - get { return this; } - } - - public static pbd::MessageDescriptor Descriptor { - get { return global::Sirikata.Persistence.Protocol._PBJ_Internal.Persistence.internal__static_Sirikata_Persistence_Protocol__PBJ_Internal_WriteSet__Descriptor; } - } - - protected override pb::FieldAccess.FieldAccessorTable InternalFieldAccessors { - get { return global::Sirikata.Persistence.Protocol._PBJ_Internal.Persistence.internal__static_Sirikata_Persistence_Protocol__PBJ_Internal_WriteSet__FieldAccessorTable; } - } - - public const int WritesFieldNumber = 10; - private pbc::PopsicleList writes_ = new pbc::PopsicleList(); - public scg::IList WritesList { - get { return writes_; } - } - public int WritesCount { - get { return writes_.Count; } - } - public global::Sirikata.Persistence.Protocol._PBJ_Internal.StorageElement GetWrites(int index) { - return writes_[index]; - } - - public override bool IsInitialized { - get { - return true; - } - } - - public override void WriteTo(pb::CodedOutputStream output) { - foreach (global::Sirikata.Persistence.Protocol._PBJ_Internal.StorageElement element in WritesList) { - output.WriteMessage(10, element); - } - UnknownFields.WriteTo(output); - } - - private int memoizedSerializedSize = -1; - public override int SerializedSize { - get { - int size = memoizedSerializedSize; - if (size != -1) return size; - - size = 0; - foreach (global::Sirikata.Persistence.Protocol._PBJ_Internal.StorageElement element in WritesList) { - size += pb::CodedOutputStream.ComputeMessageSize(10, element); - } - size += UnknownFields.SerializedSize; - memoizedSerializedSize = size; - return size; - } - } - - public static WriteSet ParseFrom(pb::ByteString data) { - return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); - } - public static WriteSet ParseFrom(pb::ByteString data, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); - } - public static WriteSet ParseFrom(byte[] data) { - return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); - } - public static WriteSet ParseFrom(byte[] data, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); - } - public static WriteSet ParseFrom(global::System.IO.Stream input) { - return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); - } - public static WriteSet ParseFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); - } - public static WriteSet ParseDelimitedFrom(global::System.IO.Stream input) { - return CreateBuilder().MergeDelimitedFrom(input).BuildParsed(); - } - public static WriteSet ParseDelimitedFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { - return CreateBuilder().MergeDelimitedFrom(input, extensionRegistry).BuildParsed(); - } - public static WriteSet ParseFrom(pb::CodedInputStream input) { - return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); - } - public static WriteSet ParseFrom(pb::CodedInputStream input, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); - } - public static Builder CreateBuilder() { return new Builder(); } - public override Builder ToBuilder() { return CreateBuilder(this); } - public override Builder CreateBuilderForType() { return new Builder(); } - public static Builder CreateBuilder(WriteSet prototype) { - return (Builder) new Builder().MergeFrom(prototype); - } - - public sealed partial class Builder : pb::GeneratedBuilder { - protected override Builder ThisBuilder { - get { return this; } - } - public Builder() {} - - WriteSet result = new WriteSet(); - - protected override WriteSet MessageBeingBuilt { - get { return result; } - } - - public override Builder Clear() { - result = new WriteSet(); - return this; - } - - public override Builder Clone() { - return new Builder().MergeFrom(result); - } - - public override pbd::MessageDescriptor DescriptorForType { - get { return global::Sirikata.Persistence.Protocol._PBJ_Internal.WriteSet.Descriptor; } - } - - public override WriteSet DefaultInstanceForType { - get { return global::Sirikata.Persistence.Protocol._PBJ_Internal.WriteSet.DefaultInstance; } - } - - public override WriteSet BuildPartial() { - if (result == null) { - throw new global::System.InvalidOperationException("build() has already been called on this Builder"); - } - result.writes_.MakeReadOnly(); - WriteSet returnMe = result; - result = null; - return returnMe; - } - - public override Builder MergeFrom(pb::IMessage other) { - if (other is WriteSet) { - return MergeFrom((WriteSet) other); - } else { - base.MergeFrom(other); - return this; - } - } - - public override Builder MergeFrom(WriteSet other) { - if (other == global::Sirikata.Persistence.Protocol._PBJ_Internal.WriteSet.DefaultInstance) return this; - if (other.writes_.Count != 0) { - base.AddRange(other.writes_, result.writes_); - } - this.MergeUnknownFields(other.UnknownFields); - return this; - } - - public override Builder MergeFrom(pb::CodedInputStream input) { - return MergeFrom(input, pb::ExtensionRegistry.Empty); - } - - public override Builder MergeFrom(pb::CodedInputStream input, pb::ExtensionRegistry extensionRegistry) { - pb::UnknownFieldSet.Builder unknownFields = null; - while (true) { - uint tag = input.ReadTag(); - switch (tag) { - case 0: { - if (unknownFields != null) { - this.UnknownFields = unknownFields.Build(); - } - return this; - } - default: { - if (pb::WireFormat.IsEndGroupTag(tag)) { - if (unknownFields != null) { - this.UnknownFields = unknownFields.Build(); - } - return this; - } - if (unknownFields == null) { - unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); - } - ParseUnknownField(input, unknownFields, extensionRegistry, tag); - break; - } - case 82: { - global::Sirikata.Persistence.Protocol._PBJ_Internal.StorageElement.Builder subBuilder = global::Sirikata.Persistence.Protocol._PBJ_Internal.StorageElement.CreateBuilder(); - input.ReadMessage(subBuilder, extensionRegistry); - AddWrites(subBuilder.BuildPartial()); - break; - } - } - } - } - - - public pbc::IPopsicleList WritesList { - get { return result.writes_; } - } - public int WritesCount { - get { return result.WritesCount; } - } - public global::Sirikata.Persistence.Protocol._PBJ_Internal.StorageElement GetWrites(int index) { - return result.GetWrites(index); - } - public Builder SetWrites(int index, global::Sirikata.Persistence.Protocol._PBJ_Internal.StorageElement value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - result.writes_[index] = value; - return this; - } - public Builder SetWrites(int index, global::Sirikata.Persistence.Protocol._PBJ_Internal.StorageElement.Builder builderForValue) { - pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); - result.writes_[index] = builderForValue.Build(); - return this; - } - public Builder AddWrites(global::Sirikata.Persistence.Protocol._PBJ_Internal.StorageElement value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - result.writes_.Add(value); - return this; - } - public Builder AddWrites(global::Sirikata.Persistence.Protocol._PBJ_Internal.StorageElement.Builder builderForValue) { - pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); - result.writes_.Add(builderForValue.Build()); - return this; - } - public Builder AddRangeWrites(scg::IEnumerable values) { - base.AddRange(values, result.writes_); - return this; - } - public Builder ClearWrites() { - result.writes_.Clear(); - return this; - } - } - static WriteSet() { - object.ReferenceEquals(global::Sirikata.Persistence.Protocol._PBJ_Internal.Persistence.Descriptor, null); - } - } - - public sealed partial class ReadWriteSet : pb::GeneratedMessage { - private static readonly ReadWriteSet defaultInstance = new Builder().BuildPartial(); - public static ReadWriteSet DefaultInstance { - get { return defaultInstance; } - } - - public override ReadWriteSet DefaultInstanceForType { - get { return defaultInstance; } - } - - protected override ReadWriteSet ThisMessage { - get { return this; } - } - - public static pbd::MessageDescriptor Descriptor { - get { return global::Sirikata.Persistence.Protocol._PBJ_Internal.Persistence.internal__static_Sirikata_Persistence_Protocol__PBJ_Internal_ReadWriteSet__Descriptor; } - } - - protected override pb::FieldAccess.FieldAccessorTable InternalFieldAccessors { - get { return global::Sirikata.Persistence.Protocol._PBJ_Internal.Persistence.internal__static_Sirikata_Persistence_Protocol__PBJ_Internal_ReadWriteSet__FieldAccessorTable; } - } - - #region Nested types - public static class Types { - public enum ReadWriteSetOptions { - RETURN_READ_NAMES = 1, - } - - } - #endregion - - public const int ReadsFieldNumber = 9; - private pbc::PopsicleList reads_ = new pbc::PopsicleList(); - public scg::IList ReadsList { - get { return reads_; } - } - public int ReadsCount { - get { return reads_.Count; } - } - public global::Sirikata.Persistence.Protocol._PBJ_Internal.StorageElement GetReads(int index) { - return reads_[index]; - } - - public const int WritesFieldNumber = 10; - private pbc::PopsicleList writes_ = new pbc::PopsicleList(); - public scg::IList WritesList { - get { return writes_; } - } - public int WritesCount { - get { return writes_.Count; } - } - public global::Sirikata.Persistence.Protocol._PBJ_Internal.StorageElement GetWrites(int index) { - return writes_[index]; - } - - public const int OptionsFieldNumber = 14; - private bool hasOptions; - private ulong options_ = 0UL; - public bool HasOptions { - get { return hasOptions; } - } - [global::System.CLSCompliant(false)] - public ulong Options { - get { return options_; } - } - - public override bool IsInitialized { - get { - return true; - } - } - - public override void WriteTo(pb::CodedOutputStream output) { - foreach (global::Sirikata.Persistence.Protocol._PBJ_Internal.StorageElement element in ReadsList) { - output.WriteMessage(9, element); - } - foreach (global::Sirikata.Persistence.Protocol._PBJ_Internal.StorageElement element in WritesList) { - output.WriteMessage(10, element); - } - if (HasOptions) { - output.WriteUInt64(14, Options); - } - UnknownFields.WriteTo(output); - } - - private int memoizedSerializedSize = -1; - public override int SerializedSize { - get { - int size = memoizedSerializedSize; - if (size != -1) return size; - - size = 0; - foreach (global::Sirikata.Persistence.Protocol._PBJ_Internal.StorageElement element in ReadsList) { - size += pb::CodedOutputStream.ComputeMessageSize(9, element); - } - foreach (global::Sirikata.Persistence.Protocol._PBJ_Internal.StorageElement element in WritesList) { - size += pb::CodedOutputStream.ComputeMessageSize(10, element); - } - if (HasOptions) { - size += pb::CodedOutputStream.ComputeUInt64Size(14, Options); - } - size += UnknownFields.SerializedSize; - memoizedSerializedSize = size; - return size; - } - } - - public static ReadWriteSet ParseFrom(pb::ByteString data) { - return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); - } - public static ReadWriteSet ParseFrom(pb::ByteString data, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); - } - public static ReadWriteSet ParseFrom(byte[] data) { - return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); - } - public static ReadWriteSet ParseFrom(byte[] data, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); - } - public static ReadWriteSet ParseFrom(global::System.IO.Stream input) { - return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); - } - public static ReadWriteSet ParseFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); - } - public static ReadWriteSet ParseDelimitedFrom(global::System.IO.Stream input) { - return CreateBuilder().MergeDelimitedFrom(input).BuildParsed(); - } - public static ReadWriteSet ParseDelimitedFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { - return CreateBuilder().MergeDelimitedFrom(input, extensionRegistry).BuildParsed(); - } - public static ReadWriteSet ParseFrom(pb::CodedInputStream input) { - return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); - } - public static ReadWriteSet ParseFrom(pb::CodedInputStream input, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); - } - public static Builder CreateBuilder() { return new Builder(); } - public override Builder ToBuilder() { return CreateBuilder(this); } - public override Builder CreateBuilderForType() { return new Builder(); } - public static Builder CreateBuilder(ReadWriteSet prototype) { - return (Builder) new Builder().MergeFrom(prototype); - } - - public sealed partial class Builder : pb::GeneratedBuilder { - protected override Builder ThisBuilder { - get { return this; } - } - public Builder() {} - - ReadWriteSet result = new ReadWriteSet(); - - protected override ReadWriteSet MessageBeingBuilt { - get { return result; } - } - - public override Builder Clear() { - result = new ReadWriteSet(); - return this; - } - - public override Builder Clone() { - return new Builder().MergeFrom(result); - } - - public override pbd::MessageDescriptor DescriptorForType { - get { return global::Sirikata.Persistence.Protocol._PBJ_Internal.ReadWriteSet.Descriptor; } - } - - public override ReadWriteSet DefaultInstanceForType { - get { return global::Sirikata.Persistence.Protocol._PBJ_Internal.ReadWriteSet.DefaultInstance; } - } - - public override ReadWriteSet BuildPartial() { - if (result == null) { - throw new global::System.InvalidOperationException("build() has already been called on this Builder"); - } - result.reads_.MakeReadOnly(); - result.writes_.MakeReadOnly(); - ReadWriteSet returnMe = result; - result = null; - return returnMe; - } - - public override Builder MergeFrom(pb::IMessage other) { - if (other is ReadWriteSet) { - return MergeFrom((ReadWriteSet) other); - } else { - base.MergeFrom(other); - return this; - } - } - - public override Builder MergeFrom(ReadWriteSet other) { - if (other == global::Sirikata.Persistence.Protocol._PBJ_Internal.ReadWriteSet.DefaultInstance) return this; - if (other.reads_.Count != 0) { - base.AddRange(other.reads_, result.reads_); - } - if (other.writes_.Count != 0) { - base.AddRange(other.writes_, result.writes_); - } - if (other.HasOptions) { - Options = other.Options; - } - this.MergeUnknownFields(other.UnknownFields); - return this; - } - - public override Builder MergeFrom(pb::CodedInputStream input) { - return MergeFrom(input, pb::ExtensionRegistry.Empty); - } - - public override Builder MergeFrom(pb::CodedInputStream input, pb::ExtensionRegistry extensionRegistry) { - pb::UnknownFieldSet.Builder unknownFields = null; - while (true) { - uint tag = input.ReadTag(); - switch (tag) { - case 0: { - if (unknownFields != null) { - this.UnknownFields = unknownFields.Build(); - } - return this; - } - default: { - if (pb::WireFormat.IsEndGroupTag(tag)) { - if (unknownFields != null) { - this.UnknownFields = unknownFields.Build(); - } - return this; - } - if (unknownFields == null) { - unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); - } - ParseUnknownField(input, unknownFields, extensionRegistry, tag); - break; - } - case 74: { - global::Sirikata.Persistence.Protocol._PBJ_Internal.StorageElement.Builder subBuilder = global::Sirikata.Persistence.Protocol._PBJ_Internal.StorageElement.CreateBuilder(); - input.ReadMessage(subBuilder, extensionRegistry); - AddReads(subBuilder.BuildPartial()); - break; - } - case 82: { - global::Sirikata.Persistence.Protocol._PBJ_Internal.StorageElement.Builder subBuilder = global::Sirikata.Persistence.Protocol._PBJ_Internal.StorageElement.CreateBuilder(); - input.ReadMessage(subBuilder, extensionRegistry); - AddWrites(subBuilder.BuildPartial()); - break; - } - case 112: { - Options = input.ReadUInt64(); - break; - } - } - } - } - - - public pbc::IPopsicleList ReadsList { - get { return result.reads_; } - } - public int ReadsCount { - get { return result.ReadsCount; } - } - public global::Sirikata.Persistence.Protocol._PBJ_Internal.StorageElement GetReads(int index) { - return result.GetReads(index); - } - public Builder SetReads(int index, global::Sirikata.Persistence.Protocol._PBJ_Internal.StorageElement value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - result.reads_[index] = value; - return this; - } - public Builder SetReads(int index, global::Sirikata.Persistence.Protocol._PBJ_Internal.StorageElement.Builder builderForValue) { - pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); - result.reads_[index] = builderForValue.Build(); - return this; - } - public Builder AddReads(global::Sirikata.Persistence.Protocol._PBJ_Internal.StorageElement value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - result.reads_.Add(value); - return this; - } - public Builder AddReads(global::Sirikata.Persistence.Protocol._PBJ_Internal.StorageElement.Builder builderForValue) { - pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); - result.reads_.Add(builderForValue.Build()); - return this; - } - public Builder AddRangeReads(scg::IEnumerable values) { - base.AddRange(values, result.reads_); - return this; - } - public Builder ClearReads() { - result.reads_.Clear(); - return this; - } - - public pbc::IPopsicleList WritesList { - get { return result.writes_; } - } - public int WritesCount { - get { return result.WritesCount; } - } - public global::Sirikata.Persistence.Protocol._PBJ_Internal.StorageElement GetWrites(int index) { - return result.GetWrites(index); - } - public Builder SetWrites(int index, global::Sirikata.Persistence.Protocol._PBJ_Internal.StorageElement value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - result.writes_[index] = value; - return this; - } - public Builder SetWrites(int index, global::Sirikata.Persistence.Protocol._PBJ_Internal.StorageElement.Builder builderForValue) { - pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); - result.writes_[index] = builderForValue.Build(); - return this; - } - public Builder AddWrites(global::Sirikata.Persistence.Protocol._PBJ_Internal.StorageElement value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - result.writes_.Add(value); - return this; - } - public Builder AddWrites(global::Sirikata.Persistence.Protocol._PBJ_Internal.StorageElement.Builder builderForValue) { - pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); - result.writes_.Add(builderForValue.Build()); - return this; - } - public Builder AddRangeWrites(scg::IEnumerable values) { - base.AddRange(values, result.writes_); - return this; - } - public Builder ClearWrites() { - result.writes_.Clear(); - return this; - } - - public bool HasOptions { - get { return result.HasOptions; } - } - [global::System.CLSCompliant(false)] - public ulong Options { - get { return result.Options; } - set { SetOptions(value); } - } - [global::System.CLSCompliant(false)] - public Builder SetOptions(ulong value) { - result.hasOptions = true; - result.options_ = value; - return this; - } - public Builder ClearOptions() { - result.hasOptions = false; - result.options_ = 0UL; - return this; - } - } - static ReadWriteSet() { - object.ReferenceEquals(global::Sirikata.Persistence.Protocol._PBJ_Internal.Persistence.Descriptor, null); - } - } - - public sealed partial class Minitransaction : pb::GeneratedMessage { - private static readonly Minitransaction defaultInstance = new Builder().BuildPartial(); - public static Minitransaction DefaultInstance { - get { return defaultInstance; } - } - - public override Minitransaction DefaultInstanceForType { - get { return defaultInstance; } - } - - protected override Minitransaction ThisMessage { - get { return this; } - } - - public static pbd::MessageDescriptor Descriptor { - get { return global::Sirikata.Persistence.Protocol._PBJ_Internal.Persistence.internal__static_Sirikata_Persistence_Protocol__PBJ_Internal_Minitransaction__Descriptor; } - } - - protected override pb::FieldAccess.FieldAccessorTable InternalFieldAccessors { - get { return global::Sirikata.Persistence.Protocol._PBJ_Internal.Persistence.internal__static_Sirikata_Persistence_Protocol__PBJ_Internal_Minitransaction__FieldAccessorTable; } - } - - #region Nested types - public static class Types { - public enum TransactionOptions { - RETURN_READ_NAMES = 1, - } - - } - #endregion - - public const int ReadsFieldNumber = 9; - private pbc::PopsicleList reads_ = new pbc::PopsicleList(); - public scg::IList ReadsList { - get { return reads_; } - } - public int ReadsCount { - get { return reads_.Count; } - } - public global::Sirikata.Persistence.Protocol._PBJ_Internal.StorageElement GetReads(int index) { - return reads_[index]; - } - - public const int WritesFieldNumber = 10; - private pbc::PopsicleList writes_ = new pbc::PopsicleList(); - public scg::IList WritesList { - get { return writes_; } - } - public int WritesCount { - get { return writes_.Count; } - } - public global::Sirikata.Persistence.Protocol._PBJ_Internal.StorageElement GetWrites(int index) { - return writes_[index]; - } - - public const int ComparesFieldNumber = 11; - private pbc::PopsicleList compares_ = new pbc::PopsicleList(); - public scg::IList ComparesList { - get { return compares_; } - } - public int ComparesCount { - get { return compares_.Count; } - } - public global::Sirikata.Persistence.Protocol._PBJ_Internal.CompareElement GetCompares(int index) { - return compares_[index]; - } - - public const int OptionsFieldNumber = 14; - private bool hasOptions; - private ulong options_ = 0UL; - public bool HasOptions { - get { return hasOptions; } - } - [global::System.CLSCompliant(false)] - public ulong Options { - get { return options_; } - } - - public override bool IsInitialized { - get { - return true; - } - } - - public override void WriteTo(pb::CodedOutputStream output) { - foreach (global::Sirikata.Persistence.Protocol._PBJ_Internal.StorageElement element in ReadsList) { - output.WriteMessage(9, element); - } - foreach (global::Sirikata.Persistence.Protocol._PBJ_Internal.StorageElement element in WritesList) { - output.WriteMessage(10, element); - } - foreach (global::Sirikata.Persistence.Protocol._PBJ_Internal.CompareElement element in ComparesList) { - output.WriteMessage(11, element); - } - if (HasOptions) { - output.WriteUInt64(14, Options); - } - UnknownFields.WriteTo(output); - } - - private int memoizedSerializedSize = -1; - public override int SerializedSize { - get { - int size = memoizedSerializedSize; - if (size != -1) return size; - - size = 0; - foreach (global::Sirikata.Persistence.Protocol._PBJ_Internal.StorageElement element in ReadsList) { - size += pb::CodedOutputStream.ComputeMessageSize(9, element); - } - foreach (global::Sirikata.Persistence.Protocol._PBJ_Internal.StorageElement element in WritesList) { - size += pb::CodedOutputStream.ComputeMessageSize(10, element); - } - foreach (global::Sirikata.Persistence.Protocol._PBJ_Internal.CompareElement element in ComparesList) { - size += pb::CodedOutputStream.ComputeMessageSize(11, element); - } - if (HasOptions) { - size += pb::CodedOutputStream.ComputeUInt64Size(14, Options); - } - size += UnknownFields.SerializedSize; - memoizedSerializedSize = size; - return size; - } - } - - public static Minitransaction ParseFrom(pb::ByteString data) { - return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); - } - public static Minitransaction ParseFrom(pb::ByteString data, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); - } - public static Minitransaction ParseFrom(byte[] data) { - return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); - } - public static Minitransaction ParseFrom(byte[] data, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); - } - public static Minitransaction ParseFrom(global::System.IO.Stream input) { - return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); - } - public static Minitransaction ParseFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); - } - public static Minitransaction ParseDelimitedFrom(global::System.IO.Stream input) { - return CreateBuilder().MergeDelimitedFrom(input).BuildParsed(); - } - public static Minitransaction ParseDelimitedFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { - return CreateBuilder().MergeDelimitedFrom(input, extensionRegistry).BuildParsed(); - } - public static Minitransaction ParseFrom(pb::CodedInputStream input) { - return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); - } - public static Minitransaction ParseFrom(pb::CodedInputStream input, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); - } - public static Builder CreateBuilder() { return new Builder(); } - public override Builder ToBuilder() { return CreateBuilder(this); } - public override Builder CreateBuilderForType() { return new Builder(); } - public static Builder CreateBuilder(Minitransaction prototype) { - return (Builder) new Builder().MergeFrom(prototype); - } - - public sealed partial class Builder : pb::GeneratedBuilder { - protected override Builder ThisBuilder { - get { return this; } - } - public Builder() {} - - Minitransaction result = new Minitransaction(); - - protected override Minitransaction MessageBeingBuilt { - get { return result; } - } - - public override Builder Clear() { - result = new Minitransaction(); - return this; - } - - public override Builder Clone() { - return new Builder().MergeFrom(result); - } - - public override pbd::MessageDescriptor DescriptorForType { - get { return global::Sirikata.Persistence.Protocol._PBJ_Internal.Minitransaction.Descriptor; } - } - - public override Minitransaction DefaultInstanceForType { - get { return global::Sirikata.Persistence.Protocol._PBJ_Internal.Minitransaction.DefaultInstance; } - } - - public override Minitransaction BuildPartial() { - if (result == null) { - throw new global::System.InvalidOperationException("build() has already been called on this Builder"); - } - result.reads_.MakeReadOnly(); - result.writes_.MakeReadOnly(); - result.compares_.MakeReadOnly(); - Minitransaction returnMe = result; - result = null; - return returnMe; - } - - public override Builder MergeFrom(pb::IMessage other) { - if (other is Minitransaction) { - return MergeFrom((Minitransaction) other); - } else { - base.MergeFrom(other); - return this; - } - } - - public override Builder MergeFrom(Minitransaction other) { - if (other == global::Sirikata.Persistence.Protocol._PBJ_Internal.Minitransaction.DefaultInstance) return this; - if (other.reads_.Count != 0) { - base.AddRange(other.reads_, result.reads_); - } - if (other.writes_.Count != 0) { - base.AddRange(other.writes_, result.writes_); - } - if (other.compares_.Count != 0) { - base.AddRange(other.compares_, result.compares_); - } - if (other.HasOptions) { - Options = other.Options; - } - this.MergeUnknownFields(other.UnknownFields); - return this; - } - - public override Builder MergeFrom(pb::CodedInputStream input) { - return MergeFrom(input, pb::ExtensionRegistry.Empty); - } - - public override Builder MergeFrom(pb::CodedInputStream input, pb::ExtensionRegistry extensionRegistry) { - pb::UnknownFieldSet.Builder unknownFields = null; - while (true) { - uint tag = input.ReadTag(); - switch (tag) { - case 0: { - if (unknownFields != null) { - this.UnknownFields = unknownFields.Build(); - } - return this; - } - default: { - if (pb::WireFormat.IsEndGroupTag(tag)) { - if (unknownFields != null) { - this.UnknownFields = unknownFields.Build(); - } - return this; - } - if (unknownFields == null) { - unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); - } - ParseUnknownField(input, unknownFields, extensionRegistry, tag); - break; - } - case 74: { - global::Sirikata.Persistence.Protocol._PBJ_Internal.StorageElement.Builder subBuilder = global::Sirikata.Persistence.Protocol._PBJ_Internal.StorageElement.CreateBuilder(); - input.ReadMessage(subBuilder, extensionRegistry); - AddReads(subBuilder.BuildPartial()); - break; - } - case 82: { - global::Sirikata.Persistence.Protocol._PBJ_Internal.StorageElement.Builder subBuilder = global::Sirikata.Persistence.Protocol._PBJ_Internal.StorageElement.CreateBuilder(); - input.ReadMessage(subBuilder, extensionRegistry); - AddWrites(subBuilder.BuildPartial()); - break; - } - case 90: { - global::Sirikata.Persistence.Protocol._PBJ_Internal.CompareElement.Builder subBuilder = global::Sirikata.Persistence.Protocol._PBJ_Internal.CompareElement.CreateBuilder(); - input.ReadMessage(subBuilder, extensionRegistry); - AddCompares(subBuilder.BuildPartial()); - break; - } - case 112: { - Options = input.ReadUInt64(); - break; - } - } - } - } - - - public pbc::IPopsicleList ReadsList { - get { return result.reads_; } - } - public int ReadsCount { - get { return result.ReadsCount; } - } - public global::Sirikata.Persistence.Protocol._PBJ_Internal.StorageElement GetReads(int index) { - return result.GetReads(index); - } - public Builder SetReads(int index, global::Sirikata.Persistence.Protocol._PBJ_Internal.StorageElement value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - result.reads_[index] = value; - return this; - } - public Builder SetReads(int index, global::Sirikata.Persistence.Protocol._PBJ_Internal.StorageElement.Builder builderForValue) { - pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); - result.reads_[index] = builderForValue.Build(); - return this; - } - public Builder AddReads(global::Sirikata.Persistence.Protocol._PBJ_Internal.StorageElement value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - result.reads_.Add(value); - return this; - } - public Builder AddReads(global::Sirikata.Persistence.Protocol._PBJ_Internal.StorageElement.Builder builderForValue) { - pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); - result.reads_.Add(builderForValue.Build()); - return this; - } - public Builder AddRangeReads(scg::IEnumerable values) { - base.AddRange(values, result.reads_); - return this; - } - public Builder ClearReads() { - result.reads_.Clear(); - return this; - } - - public pbc::IPopsicleList WritesList { - get { return result.writes_; } - } - public int WritesCount { - get { return result.WritesCount; } - } - public global::Sirikata.Persistence.Protocol._PBJ_Internal.StorageElement GetWrites(int index) { - return result.GetWrites(index); - } - public Builder SetWrites(int index, global::Sirikata.Persistence.Protocol._PBJ_Internal.StorageElement value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - result.writes_[index] = value; - return this; - } - public Builder SetWrites(int index, global::Sirikata.Persistence.Protocol._PBJ_Internal.StorageElement.Builder builderForValue) { - pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); - result.writes_[index] = builderForValue.Build(); - return this; - } - public Builder AddWrites(global::Sirikata.Persistence.Protocol._PBJ_Internal.StorageElement value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - result.writes_.Add(value); - return this; - } - public Builder AddWrites(global::Sirikata.Persistence.Protocol._PBJ_Internal.StorageElement.Builder builderForValue) { - pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); - result.writes_.Add(builderForValue.Build()); - return this; - } - public Builder AddRangeWrites(scg::IEnumerable values) { - base.AddRange(values, result.writes_); - return this; - } - public Builder ClearWrites() { - result.writes_.Clear(); - return this; - } - - public pbc::IPopsicleList ComparesList { - get { return result.compares_; } - } - public int ComparesCount { - get { return result.ComparesCount; } - } - public global::Sirikata.Persistence.Protocol._PBJ_Internal.CompareElement GetCompares(int index) { - return result.GetCompares(index); - } - public Builder SetCompares(int index, global::Sirikata.Persistence.Protocol._PBJ_Internal.CompareElement value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - result.compares_[index] = value; - return this; - } - public Builder SetCompares(int index, global::Sirikata.Persistence.Protocol._PBJ_Internal.CompareElement.Builder builderForValue) { - pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); - result.compares_[index] = builderForValue.Build(); - return this; - } - public Builder AddCompares(global::Sirikata.Persistence.Protocol._PBJ_Internal.CompareElement value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - result.compares_.Add(value); - return this; - } - public Builder AddCompares(global::Sirikata.Persistence.Protocol._PBJ_Internal.CompareElement.Builder builderForValue) { - pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); - result.compares_.Add(builderForValue.Build()); - return this; - } - public Builder AddRangeCompares(scg::IEnumerable values) { - base.AddRange(values, result.compares_); - return this; - } - public Builder ClearCompares() { - result.compares_.Clear(); - return this; - } - - public bool HasOptions { - get { return result.HasOptions; } - } - [global::System.CLSCompliant(false)] - public ulong Options { - get { return result.Options; } - set { SetOptions(value); } - } - [global::System.CLSCompliant(false)] - public Builder SetOptions(ulong value) { - result.hasOptions = true; - result.options_ = value; - return this; - } - public Builder ClearOptions() { - result.hasOptions = false; - result.options_ = 0UL; - return this; - } - } - static Minitransaction() { - object.ReferenceEquals(global::Sirikata.Persistence.Protocol._PBJ_Internal.Persistence.Descriptor, null); - } - } - - public sealed partial class Response : pb::GeneratedMessage { - private static readonly Response defaultInstance = new Builder().BuildPartial(); - public static Response DefaultInstance { - get { return defaultInstance; } - } - - public override Response DefaultInstanceForType { - get { return defaultInstance; } - } - - protected override Response ThisMessage { - get { return this; } - } - - public static pbd::MessageDescriptor Descriptor { - get { return global::Sirikata.Persistence.Protocol._PBJ_Internal.Persistence.internal__static_Sirikata_Persistence_Protocol__PBJ_Internal_Response__Descriptor; } - } - - protected override pb::FieldAccess.FieldAccessorTable InternalFieldAccessors { - get { return global::Sirikata.Persistence.Protocol._PBJ_Internal.Persistence.internal__static_Sirikata_Persistence_Protocol__PBJ_Internal_Response__FieldAccessorTable; } - } - - #region Nested types - public static class Types { - public enum ReturnStatus { - SUCCESS = 0, - DATABASE_LOCKED = 3, - KEY_MISSING = 4, - COMPARISON_FAILED = 5, - INTERNAL_ERROR = 6, - } - - } - #endregion - - public const int ReadsFieldNumber = 9; - private pbc::PopsicleList reads_ = new pbc::PopsicleList(); - public scg::IList ReadsList { - get { return reads_; } - } - public int ReadsCount { - get { return reads_.Count; } - } - public global::Sirikata.Persistence.Protocol._PBJ_Internal.StorageElement GetReads(int index) { - return reads_[index]; - } - - public const int ReturnStatusFieldNumber = 15; - private bool hasReturnStatus; - private global::Sirikata.Persistence.Protocol._PBJ_Internal.Response.Types.ReturnStatus returnStatus_ = global::Sirikata.Persistence.Protocol._PBJ_Internal.Response.Types.ReturnStatus.SUCCESS; - public bool HasReturnStatus { - get { return hasReturnStatus; } - } - public global::Sirikata.Persistence.Protocol._PBJ_Internal.Response.Types.ReturnStatus ReturnStatus { - get { return returnStatus_; } - } - - public override bool IsInitialized { - get { - return true; - } - } - - public override void WriteTo(pb::CodedOutputStream output) { - foreach (global::Sirikata.Persistence.Protocol._PBJ_Internal.StorageElement element in ReadsList) { - output.WriteMessage(9, element); - } - if (HasReturnStatus) { - output.WriteEnum(15, (int) ReturnStatus); - } - UnknownFields.WriteTo(output); - } - - private int memoizedSerializedSize = -1; - public override int SerializedSize { - get { - int size = memoizedSerializedSize; - if (size != -1) return size; - - size = 0; - foreach (global::Sirikata.Persistence.Protocol._PBJ_Internal.StorageElement element in ReadsList) { - size += pb::CodedOutputStream.ComputeMessageSize(9, element); - } - if (HasReturnStatus) { - size += pb::CodedOutputStream.ComputeEnumSize(15, (int) ReturnStatus); - } - size += UnknownFields.SerializedSize; - memoizedSerializedSize = size; - return size; - } - } - - public static Response ParseFrom(pb::ByteString data) { - return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); - } - public static Response ParseFrom(pb::ByteString data, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); - } - public static Response ParseFrom(byte[] data) { - return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); - } - public static Response ParseFrom(byte[] data, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); - } - public static Response ParseFrom(global::System.IO.Stream input) { - return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); - } - public static Response ParseFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); - } - public static Response ParseDelimitedFrom(global::System.IO.Stream input) { - return CreateBuilder().MergeDelimitedFrom(input).BuildParsed(); - } - public static Response ParseDelimitedFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { - return CreateBuilder().MergeDelimitedFrom(input, extensionRegistry).BuildParsed(); - } - public static Response ParseFrom(pb::CodedInputStream input) { - return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); - } - public static Response ParseFrom(pb::CodedInputStream input, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); - } - public static Builder CreateBuilder() { return new Builder(); } - public override Builder ToBuilder() { return CreateBuilder(this); } - public override Builder CreateBuilderForType() { return new Builder(); } - public static Builder CreateBuilder(Response prototype) { - return (Builder) new Builder().MergeFrom(prototype); - } - - public sealed partial class Builder : pb::GeneratedBuilder { - protected override Builder ThisBuilder { - get { return this; } - } - public Builder() {} - - Response result = new Response(); - - protected override Response MessageBeingBuilt { - get { return result; } - } - - public override Builder Clear() { - result = new Response(); - return this; - } - - public override Builder Clone() { - return new Builder().MergeFrom(result); - } - - public override pbd::MessageDescriptor DescriptorForType { - get { return global::Sirikata.Persistence.Protocol._PBJ_Internal.Response.Descriptor; } - } - - public override Response DefaultInstanceForType { - get { return global::Sirikata.Persistence.Protocol._PBJ_Internal.Response.DefaultInstance; } - } - - public override Response BuildPartial() { - if (result == null) { - throw new global::System.InvalidOperationException("build() has already been called on this Builder"); - } - result.reads_.MakeReadOnly(); - Response returnMe = result; - result = null; - return returnMe; - } - - public override Builder MergeFrom(pb::IMessage other) { - if (other is Response) { - return MergeFrom((Response) other); - } else { - base.MergeFrom(other); - return this; - } - } - - public override Builder MergeFrom(Response other) { - if (other == global::Sirikata.Persistence.Protocol._PBJ_Internal.Response.DefaultInstance) return this; - if (other.reads_.Count != 0) { - base.AddRange(other.reads_, result.reads_); - } - if (other.HasReturnStatus) { - ReturnStatus = other.ReturnStatus; - } - this.MergeUnknownFields(other.UnknownFields); - return this; - } - - public override Builder MergeFrom(pb::CodedInputStream input) { - return MergeFrom(input, pb::ExtensionRegistry.Empty); - } - - public override Builder MergeFrom(pb::CodedInputStream input, pb::ExtensionRegistry extensionRegistry) { - pb::UnknownFieldSet.Builder unknownFields = null; - while (true) { - uint tag = input.ReadTag(); - switch (tag) { - case 0: { - if (unknownFields != null) { - this.UnknownFields = unknownFields.Build(); - } - return this; - } - default: { - if (pb::WireFormat.IsEndGroupTag(tag)) { - if (unknownFields != null) { - this.UnknownFields = unknownFields.Build(); - } - return this; - } - if (unknownFields == null) { - unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); - } - ParseUnknownField(input, unknownFields, extensionRegistry, tag); - break; - } - case 74: { - global::Sirikata.Persistence.Protocol._PBJ_Internal.StorageElement.Builder subBuilder = global::Sirikata.Persistence.Protocol._PBJ_Internal.StorageElement.CreateBuilder(); - input.ReadMessage(subBuilder, extensionRegistry); - AddReads(subBuilder.BuildPartial()); - break; - } - case 120: { - int rawValue = input.ReadEnum(); - if (!global::System.Enum.IsDefined(typeof(global::Sirikata.Persistence.Protocol._PBJ_Internal.Response.Types.ReturnStatus), rawValue)) { - if (unknownFields == null) { - unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); - } - unknownFields.MergeVarintField(15, (ulong) rawValue); - } else { - ReturnStatus = (global::Sirikata.Persistence.Protocol._PBJ_Internal.Response.Types.ReturnStatus) rawValue; - } - break; - } - } - } - } - - - public pbc::IPopsicleList ReadsList { - get { return result.reads_; } - } - public int ReadsCount { - get { return result.ReadsCount; } - } - public global::Sirikata.Persistence.Protocol._PBJ_Internal.StorageElement GetReads(int index) { - return result.GetReads(index); - } - public Builder SetReads(int index, global::Sirikata.Persistence.Protocol._PBJ_Internal.StorageElement value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - result.reads_[index] = value; - return this; - } - public Builder SetReads(int index, global::Sirikata.Persistence.Protocol._PBJ_Internal.StorageElement.Builder builderForValue) { - pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); - result.reads_[index] = builderForValue.Build(); - return this; - } - public Builder AddReads(global::Sirikata.Persistence.Protocol._PBJ_Internal.StorageElement value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - result.reads_.Add(value); - return this; - } - public Builder AddReads(global::Sirikata.Persistence.Protocol._PBJ_Internal.StorageElement.Builder builderForValue) { - pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); - result.reads_.Add(builderForValue.Build()); - return this; - } - public Builder AddRangeReads(scg::IEnumerable values) { - base.AddRange(values, result.reads_); - return this; - } - public Builder ClearReads() { - result.reads_.Clear(); - return this; - } - - public bool HasReturnStatus { - get { return result.HasReturnStatus; } - } - public global::Sirikata.Persistence.Protocol._PBJ_Internal.Response.Types.ReturnStatus ReturnStatus { - get { return result.ReturnStatus; } - set { SetReturnStatus(value); } - } - public Builder SetReturnStatus(global::Sirikata.Persistence.Protocol._PBJ_Internal.Response.Types.ReturnStatus value) { - result.hasReturnStatus = true; - result.returnStatus_ = value; - return this; - } - public Builder ClearReturnStatus() { - result.hasReturnStatus = false; - result.returnStatus_ = global::Sirikata.Persistence.Protocol._PBJ_Internal.Response.Types.ReturnStatus.SUCCESS; - return this; - } - } - static Response() { - object.ReferenceEquals(global::Sirikata.Persistence.Protocol._PBJ_Internal.Persistence.Descriptor, null); - } - } - - #endregion - -} diff --git a/OpenSim/Client/Sirikata/Protocol/Persistence.pbj.cs b/OpenSim/Client/Sirikata/Protocol/Persistence.pbj.cs deleted file mode 100644 index 196b0b9527..0000000000 --- a/OpenSim/Client/Sirikata/Protocol/Persistence.pbj.cs +++ /dev/null @@ -1,1543 +0,0 @@ -/* - * Copyright (c) Contributors, http://opensimulator.org/ - * See CONTRIBUTORS.TXT for a full list of copyright holders. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * * Neither the name of the OpenSimulator Project nor the - * names of its contributors may be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE DEVELOPERS ``AS IS'' AND ANY - * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED - * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL THE CONTRIBUTORS BE LIABLE FOR ANY - * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES - * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; - * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ - -using pbd = global::Google.ProtocolBuffers.Descriptors; -using pb = global::Google.ProtocolBuffers; -namespace Sirikata.Persistence.Protocol { - public class StorageKey : PBJ.IMessage { - protected _PBJ_Internal.StorageKey super; - public _PBJ_Internal.StorageKey _PBJSuper{ get { return super;} } - public StorageKey() { - super=new _PBJ_Internal.StorageKey(); - } - public StorageKey(_PBJ_Internal.StorageKey reference) { - super=reference; - } - public static StorageKey defaultInstance= new StorageKey (_PBJ_Internal.StorageKey.DefaultInstance); - public static StorageKey DefaultInstance{ - get {return defaultInstance;} - } - public static pbd.MessageDescriptor Descriptor { - get { return _PBJ_Internal.StorageKey.Descriptor; } } - public static class Types { - } - public static bool WithinReservedFieldTagRange(int field_tag) { - return false||(field_tag>=1&&field_tag<=8)||(field_tag>=1536&&field_tag<=2560)||(field_tag>=229376&&field_tag<=294912); - } - public static bool WithinExtensionFieldTagRange(int field_tag) { - return false; - } - public const int ObjectUuidFieldTag=9; - public bool HasObjectUuid{ get {return super.HasObjectUuid&&PBJ._PBJ.ValidateUuid(super.ObjectUuid);} } - public PBJ.UUID ObjectUuid{ get { - if (HasObjectUuid) { - return PBJ._PBJ.CastUuid(super.ObjectUuid); - } else { - return PBJ._PBJ.CastUuid(); - } - } - } - public const int FieldIdFieldTag=10; - public bool HasFieldId{ get {return super.HasFieldId&&PBJ._PBJ.ValidateUint64(super.FieldId);} } - public ulong FieldId{ get { - if (HasFieldId) { - return PBJ._PBJ.CastUint64(super.FieldId); - } else { - return PBJ._PBJ.CastUint64(); - } - } - } - public const int FieldNameFieldTag=11; - public bool HasFieldName{ get {return super.HasFieldName&&PBJ._PBJ.ValidateString(super.FieldName);} } - public string FieldName{ get { - if (HasFieldName) { - return PBJ._PBJ.CastString(super.FieldName); - } else { - return PBJ._PBJ.CastString(); - } - } - } - public override Google.ProtocolBuffers.IMessage _PBJISuper { get { return super; } } - public override PBJ.IMessage.IBuilder WeakCreateBuilderForType() { return new Builder(); } - public static Builder CreateBuilder() { return new Builder(); } - public static Builder CreateBuilder(StorageKey prototype) { - return (Builder)new Builder().MergeFrom(prototype); - } - public static StorageKey ParseFrom(pb::ByteString data) { - return new StorageKey(_PBJ_Internal.StorageKey.ParseFrom(data)); - } - public static StorageKey ParseFrom(pb::ByteString data, pb::ExtensionRegistry er) { - return new StorageKey(_PBJ_Internal.StorageKey.ParseFrom(data,er)); - } - public static StorageKey ParseFrom(byte[] data) { - return new StorageKey(_PBJ_Internal.StorageKey.ParseFrom(data)); - } - public static StorageKey ParseFrom(byte[] data, pb::ExtensionRegistry er) { - return new StorageKey(_PBJ_Internal.StorageKey.ParseFrom(data,er)); - } - public static StorageKey ParseFrom(global::System.IO.Stream data) { - return new StorageKey(_PBJ_Internal.StorageKey.ParseFrom(data)); - } - public static StorageKey ParseFrom(global::System.IO.Stream data, pb::ExtensionRegistry er) { - return new StorageKey(_PBJ_Internal.StorageKey.ParseFrom(data,er)); - } - public static StorageKey ParseFrom(pb::CodedInputStream data) { - return new StorageKey(_PBJ_Internal.StorageKey.ParseFrom(data)); - } - public static StorageKey ParseFrom(pb::CodedInputStream data, pb::ExtensionRegistry er) { - return new StorageKey(_PBJ_Internal.StorageKey.ParseFrom(data,er)); - } - protected override bool _HasAllPBJFields{ get { - return true - ; - } } - public bool IsInitialized { get { - return super.IsInitialized&&_HasAllPBJFields; - } } - public class Builder : global::PBJ.IMessage.IBuilder{ - protected override bool _HasAllPBJFields{ get { - return true - ; - } } - public bool IsInitialized { get { - return super.IsInitialized&&_HasAllPBJFields; - } } - protected _PBJ_Internal.StorageKey.Builder super; - public override Google.ProtocolBuffers.IBuilder _PBJISuper { get { return super; } } - public _PBJ_Internal.StorageKey.Builder _PBJSuper{ get { return super;} } - public Builder() {super = new _PBJ_Internal.StorageKey.Builder();} - public Builder(_PBJ_Internal.StorageKey.Builder other) { - super=other; - } - public Builder Clone() {return new Builder(super.Clone());} - public Builder MergeFrom(StorageKey prototype) { super.MergeFrom(prototype._PBJSuper);return this;} - public Builder Clear() {super.Clear();return this;} - public StorageKey BuildPartial() {return new StorageKey(super.BuildPartial());} - public StorageKey Build() {if (_HasAllPBJFields) return new StorageKey(super.Build());return null;} - public pbd::MessageDescriptor DescriptorForType { - get { return StorageKey.Descriptor; } } - public Builder ClearObjectUuid() { super.ClearObjectUuid();return this;} - public const int ObjectUuidFieldTag=9; - public bool HasObjectUuid{ get {return super.HasObjectUuid&&PBJ._PBJ.ValidateUuid(super.ObjectUuid);} } - public PBJ.UUID ObjectUuid{ get { - if (HasObjectUuid) { - return PBJ._PBJ.CastUuid(super.ObjectUuid); - } else { - return PBJ._PBJ.CastUuid(); - } - } - set { - super.ObjectUuid=(PBJ._PBJ.Construct(value)); - } - } - public Builder ClearFieldId() { super.ClearFieldId();return this;} - public const int FieldIdFieldTag=10; - public bool HasFieldId{ get {return super.HasFieldId&&PBJ._PBJ.ValidateUint64(super.FieldId);} } - public ulong FieldId{ get { - if (HasFieldId) { - return PBJ._PBJ.CastUint64(super.FieldId); - } else { - return PBJ._PBJ.CastUint64(); - } - } - set { - super.FieldId=(PBJ._PBJ.Construct(value)); - } - } - public Builder ClearFieldName() { super.ClearFieldName();return this;} - public const int FieldNameFieldTag=11; - public bool HasFieldName{ get {return super.HasFieldName&&PBJ._PBJ.ValidateString(super.FieldName);} } - public string FieldName{ get { - if (HasFieldName) { - return PBJ._PBJ.CastString(super.FieldName); - } else { - return PBJ._PBJ.CastString(); - } - } - set { - super.FieldName=(PBJ._PBJ.Construct(value)); - } - } - } - } -} -namespace Sirikata.Persistence.Protocol { - public class StorageValue : PBJ.IMessage { - protected _PBJ_Internal.StorageValue super; - public _PBJ_Internal.StorageValue _PBJSuper{ get { return super;} } - public StorageValue() { - super=new _PBJ_Internal.StorageValue(); - } - public StorageValue(_PBJ_Internal.StorageValue reference) { - super=reference; - } - public static StorageValue defaultInstance= new StorageValue (_PBJ_Internal.StorageValue.DefaultInstance); - public static StorageValue DefaultInstance{ - get {return defaultInstance;} - } - public static pbd.MessageDescriptor Descriptor { - get { return _PBJ_Internal.StorageValue.Descriptor; } } - public static class Types { - } - public static bool WithinReservedFieldTagRange(int field_tag) { - return false||(field_tag>=1&&field_tag<=8)||(field_tag>=1536&&field_tag<=2560)||(field_tag>=229376&&field_tag<=294912); - } - public static bool WithinExtensionFieldTagRange(int field_tag) { - return false; - } - public const int DataFieldTag=12; - public bool HasData{ get {return super.HasData&&PBJ._PBJ.ValidateBytes(super.Data);} } - public pb::ByteString Data{ get { - if (HasData) { - return PBJ._PBJ.CastBytes(super.Data); - } else { - return PBJ._PBJ.CastBytes(); - } - } - } - public override Google.ProtocolBuffers.IMessage _PBJISuper { get { return super; } } - public override PBJ.IMessage.IBuilder WeakCreateBuilderForType() { return new Builder(); } - public static Builder CreateBuilder() { return new Builder(); } - public static Builder CreateBuilder(StorageValue prototype) { - return (Builder)new Builder().MergeFrom(prototype); - } - public static StorageValue ParseFrom(pb::ByteString data) { - return new StorageValue(_PBJ_Internal.StorageValue.ParseFrom(data)); - } - public static StorageValue ParseFrom(pb::ByteString data, pb::ExtensionRegistry er) { - return new StorageValue(_PBJ_Internal.StorageValue.ParseFrom(data,er)); - } - public static StorageValue ParseFrom(byte[] data) { - return new StorageValue(_PBJ_Internal.StorageValue.ParseFrom(data)); - } - public static StorageValue ParseFrom(byte[] data, pb::ExtensionRegistry er) { - return new StorageValue(_PBJ_Internal.StorageValue.ParseFrom(data,er)); - } - public static StorageValue ParseFrom(global::System.IO.Stream data) { - return new StorageValue(_PBJ_Internal.StorageValue.ParseFrom(data)); - } - public static StorageValue ParseFrom(global::System.IO.Stream data, pb::ExtensionRegistry er) { - return new StorageValue(_PBJ_Internal.StorageValue.ParseFrom(data,er)); - } - public static StorageValue ParseFrom(pb::CodedInputStream data) { - return new StorageValue(_PBJ_Internal.StorageValue.ParseFrom(data)); - } - public static StorageValue ParseFrom(pb::CodedInputStream data, pb::ExtensionRegistry er) { - return new StorageValue(_PBJ_Internal.StorageValue.ParseFrom(data,er)); - } - protected override bool _HasAllPBJFields{ get { - return true - ; - } } - public bool IsInitialized { get { - return super.IsInitialized&&_HasAllPBJFields; - } } - public class Builder : global::PBJ.IMessage.IBuilder{ - protected override bool _HasAllPBJFields{ get { - return true - ; - } } - public bool IsInitialized { get { - return super.IsInitialized&&_HasAllPBJFields; - } } - protected _PBJ_Internal.StorageValue.Builder super; - public override Google.ProtocolBuffers.IBuilder _PBJISuper { get { return super; } } - public _PBJ_Internal.StorageValue.Builder _PBJSuper{ get { return super;} } - public Builder() {super = new _PBJ_Internal.StorageValue.Builder();} - public Builder(_PBJ_Internal.StorageValue.Builder other) { - super=other; - } - public Builder Clone() {return new Builder(super.Clone());} - public Builder MergeFrom(StorageValue prototype) { super.MergeFrom(prototype._PBJSuper);return this;} - public Builder Clear() {super.Clear();return this;} - public StorageValue BuildPartial() {return new StorageValue(super.BuildPartial());} - public StorageValue Build() {if (_HasAllPBJFields) return new StorageValue(super.Build());return null;} - public pbd::MessageDescriptor DescriptorForType { - get { return StorageValue.Descriptor; } } - public Builder ClearData() { super.ClearData();return this;} - public const int DataFieldTag=12; - public bool HasData{ get {return super.HasData&&PBJ._PBJ.ValidateBytes(super.Data);} } - public pb::ByteString Data{ get { - if (HasData) { - return PBJ._PBJ.CastBytes(super.Data); - } else { - return PBJ._PBJ.CastBytes(); - } - } - set { - super.Data=(PBJ._PBJ.Construct(value)); - } - } - } - } -} -namespace Sirikata.Persistence.Protocol { - public class StorageElement : PBJ.IMessage { - protected _PBJ_Internal.StorageElement super; - public _PBJ_Internal.StorageElement _PBJSuper{ get { return super;} } - public StorageElement() { - super=new _PBJ_Internal.StorageElement(); - } - public StorageElement(_PBJ_Internal.StorageElement reference) { - super=reference; - } - public static StorageElement defaultInstance= new StorageElement (_PBJ_Internal.StorageElement.DefaultInstance); - public static StorageElement DefaultInstance{ - get {return defaultInstance;} - } - public static pbd.MessageDescriptor Descriptor { - get { return _PBJ_Internal.StorageElement.Descriptor; } } - public static class Types { - public enum ReturnStatus { - KEY_MISSING=_PBJ_Internal.StorageElement.Types.ReturnStatus.KEY_MISSING, - INTERNAL_ERROR=_PBJ_Internal.StorageElement.Types.ReturnStatus.INTERNAL_ERROR - }; - } - public static bool WithinReservedFieldTagRange(int field_tag) { - return false||(field_tag>=1&&field_tag<=8)||(field_tag>=1536&&field_tag<=2560)||(field_tag>=229376&&field_tag<=294912); - } - public static bool WithinExtensionFieldTagRange(int field_tag) { - return false; - } - public const int ObjectUuidFieldTag=9; - public bool HasObjectUuid{ get {return super.HasObjectUuid&&PBJ._PBJ.ValidateUuid(super.ObjectUuid);} } - public PBJ.UUID ObjectUuid{ get { - if (HasObjectUuid) { - return PBJ._PBJ.CastUuid(super.ObjectUuid); - } else { - return PBJ._PBJ.CastUuid(); - } - } - } - public const int FieldIdFieldTag=10; - public bool HasFieldId{ get {return super.HasFieldId&&PBJ._PBJ.ValidateUint64(super.FieldId);} } - public ulong FieldId{ get { - if (HasFieldId) { - return PBJ._PBJ.CastUint64(super.FieldId); - } else { - return PBJ._PBJ.CastUint64(); - } - } - } - public const int FieldNameFieldTag=11; - public bool HasFieldName{ get {return super.HasFieldName&&PBJ._PBJ.ValidateString(super.FieldName);} } - public string FieldName{ get { - if (HasFieldName) { - return PBJ._PBJ.CastString(super.FieldName); - } else { - return PBJ._PBJ.CastString(); - } - } - } - public const int DataFieldTag=12; - public bool HasData{ get {return super.HasData&&PBJ._PBJ.ValidateBytes(super.Data);} } - public pb::ByteString Data{ get { - if (HasData) { - return PBJ._PBJ.CastBytes(super.Data); - } else { - return PBJ._PBJ.CastBytes(); - } - } - } - public const int IndexFieldTag=13; - public bool HasIndex{ get {return super.HasIndex&&PBJ._PBJ.ValidateInt32(super.Index);} } - public int Index{ get { - if (HasIndex) { - return PBJ._PBJ.CastInt32(super.Index); - } else { - return PBJ._PBJ.CastInt32(); - } - } - } - public const int ReturnStatusFieldTag=15; - public bool HasReturnStatus{ get {return super.HasReturnStatus;} } - public Types.ReturnStatus ReturnStatus{ get { - if (HasReturnStatus) { - return (Types.ReturnStatus)super.ReturnStatus; - } else { - return new Types.ReturnStatus(); - } - } - } - public override Google.ProtocolBuffers.IMessage _PBJISuper { get { return super; } } - public override PBJ.IMessage.IBuilder WeakCreateBuilderForType() { return new Builder(); } - public static Builder CreateBuilder() { return new Builder(); } - public static Builder CreateBuilder(StorageElement prototype) { - return (Builder)new Builder().MergeFrom(prototype); - } - public static StorageElement ParseFrom(pb::ByteString data) { - return new StorageElement(_PBJ_Internal.StorageElement.ParseFrom(data)); - } - public static StorageElement ParseFrom(pb::ByteString data, pb::ExtensionRegistry er) { - return new StorageElement(_PBJ_Internal.StorageElement.ParseFrom(data,er)); - } - public static StorageElement ParseFrom(byte[] data) { - return new StorageElement(_PBJ_Internal.StorageElement.ParseFrom(data)); - } - public static StorageElement ParseFrom(byte[] data, pb::ExtensionRegistry er) { - return new StorageElement(_PBJ_Internal.StorageElement.ParseFrom(data,er)); - } - public static StorageElement ParseFrom(global::System.IO.Stream data) { - return new StorageElement(_PBJ_Internal.StorageElement.ParseFrom(data)); - } - public static StorageElement ParseFrom(global::System.IO.Stream data, pb::ExtensionRegistry er) { - return new StorageElement(_PBJ_Internal.StorageElement.ParseFrom(data,er)); - } - public static StorageElement ParseFrom(pb::CodedInputStream data) { - return new StorageElement(_PBJ_Internal.StorageElement.ParseFrom(data)); - } - public static StorageElement ParseFrom(pb::CodedInputStream data, pb::ExtensionRegistry er) { - return new StorageElement(_PBJ_Internal.StorageElement.ParseFrom(data,er)); - } - protected override bool _HasAllPBJFields{ get { - return true - ; - } } - public bool IsInitialized { get { - return super.IsInitialized&&_HasAllPBJFields; - } } - public class Builder : global::PBJ.IMessage.IBuilder{ - protected override bool _HasAllPBJFields{ get { - return true - ; - } } - public bool IsInitialized { get { - return super.IsInitialized&&_HasAllPBJFields; - } } - protected _PBJ_Internal.StorageElement.Builder super; - public override Google.ProtocolBuffers.IBuilder _PBJISuper { get { return super; } } - public _PBJ_Internal.StorageElement.Builder _PBJSuper{ get { return super;} } - public Builder() {super = new _PBJ_Internal.StorageElement.Builder();} - public Builder(_PBJ_Internal.StorageElement.Builder other) { - super=other; - } - public Builder Clone() {return new Builder(super.Clone());} - public Builder MergeFrom(StorageElement prototype) { super.MergeFrom(prototype._PBJSuper);return this;} - public Builder Clear() {super.Clear();return this;} - public StorageElement BuildPartial() {return new StorageElement(super.BuildPartial());} - public StorageElement Build() {if (_HasAllPBJFields) return new StorageElement(super.Build());return null;} - public pbd::MessageDescriptor DescriptorForType { - get { return StorageElement.Descriptor; } } - public Builder ClearObjectUuid() { super.ClearObjectUuid();return this;} - public const int ObjectUuidFieldTag=9; - public bool HasObjectUuid{ get {return super.HasObjectUuid&&PBJ._PBJ.ValidateUuid(super.ObjectUuid);} } - public PBJ.UUID ObjectUuid{ get { - if (HasObjectUuid) { - return PBJ._PBJ.CastUuid(super.ObjectUuid); - } else { - return PBJ._PBJ.CastUuid(); - } - } - set { - super.ObjectUuid=(PBJ._PBJ.Construct(value)); - } - } - public Builder ClearFieldId() { super.ClearFieldId();return this;} - public const int FieldIdFieldTag=10; - public bool HasFieldId{ get {return super.HasFieldId&&PBJ._PBJ.ValidateUint64(super.FieldId);} } - public ulong FieldId{ get { - if (HasFieldId) { - return PBJ._PBJ.CastUint64(super.FieldId); - } else { - return PBJ._PBJ.CastUint64(); - } - } - set { - super.FieldId=(PBJ._PBJ.Construct(value)); - } - } - public Builder ClearFieldName() { super.ClearFieldName();return this;} - public const int FieldNameFieldTag=11; - public bool HasFieldName{ get {return super.HasFieldName&&PBJ._PBJ.ValidateString(super.FieldName);} } - public string FieldName{ get { - if (HasFieldName) { - return PBJ._PBJ.CastString(super.FieldName); - } else { - return PBJ._PBJ.CastString(); - } - } - set { - super.FieldName=(PBJ._PBJ.Construct(value)); - } - } - public Builder ClearData() { super.ClearData();return this;} - public const int DataFieldTag=12; - public bool HasData{ get {return super.HasData&&PBJ._PBJ.ValidateBytes(super.Data);} } - public pb::ByteString Data{ get { - if (HasData) { - return PBJ._PBJ.CastBytes(super.Data); - } else { - return PBJ._PBJ.CastBytes(); - } - } - set { - super.Data=(PBJ._PBJ.Construct(value)); - } - } - public Builder ClearIndex() { super.ClearIndex();return this;} - public const int IndexFieldTag=13; - public bool HasIndex{ get {return super.HasIndex&&PBJ._PBJ.ValidateInt32(super.Index);} } - public int Index{ get { - if (HasIndex) { - return PBJ._PBJ.CastInt32(super.Index); - } else { - return PBJ._PBJ.CastInt32(); - } - } - set { - super.Index=(PBJ._PBJ.Construct(value)); - } - } - public Builder ClearReturnStatus() { super.ClearReturnStatus();return this;} - public const int ReturnStatusFieldTag=15; - public bool HasReturnStatus{ get {return super.HasReturnStatus;} } - public Types.ReturnStatus ReturnStatus{ get { - if (HasReturnStatus) { - return (Types.ReturnStatus)super.ReturnStatus; - } else { - return new Types.ReturnStatus(); - } - } - set { - super.ReturnStatus=((_PBJ_Internal.StorageElement.Types.ReturnStatus)value); - } - } - } - } -} -namespace Sirikata.Persistence.Protocol { - public class CompareElement : PBJ.IMessage { - protected _PBJ_Internal.CompareElement super; - public _PBJ_Internal.CompareElement _PBJSuper{ get { return super;} } - public CompareElement() { - super=new _PBJ_Internal.CompareElement(); - } - public CompareElement(_PBJ_Internal.CompareElement reference) { - super=reference; - } - public static CompareElement defaultInstance= new CompareElement (_PBJ_Internal.CompareElement.DefaultInstance); - public static CompareElement DefaultInstance{ - get {return defaultInstance;} - } - public static pbd.MessageDescriptor Descriptor { - get { return _PBJ_Internal.CompareElement.Descriptor; } } - public static class Types { - public enum COMPARATOR { - EQUAL=_PBJ_Internal.CompareElement.Types.COMPARATOR.EQUAL, - NEQUAL=_PBJ_Internal.CompareElement.Types.COMPARATOR.NEQUAL - }; - } - public static bool WithinReservedFieldTagRange(int field_tag) { - return false||(field_tag>=1&&field_tag<=8)||(field_tag>=1536&&field_tag<=2560)||(field_tag>=229376&&field_tag<=294912); - } - public static bool WithinExtensionFieldTagRange(int field_tag) { - return false; - } - public const int ObjectUuidFieldTag=9; - public bool HasObjectUuid{ get {return super.HasObjectUuid&&PBJ._PBJ.ValidateUuid(super.ObjectUuid);} } - public PBJ.UUID ObjectUuid{ get { - if (HasObjectUuid) { - return PBJ._PBJ.CastUuid(super.ObjectUuid); - } else { - return PBJ._PBJ.CastUuid(); - } - } - } - public const int FieldIdFieldTag=10; - public bool HasFieldId{ get {return super.HasFieldId&&PBJ._PBJ.ValidateUint64(super.FieldId);} } - public ulong FieldId{ get { - if (HasFieldId) { - return PBJ._PBJ.CastUint64(super.FieldId); - } else { - return PBJ._PBJ.CastUint64(); - } - } - } - public const int FieldNameFieldTag=11; - public bool HasFieldName{ get {return super.HasFieldName&&PBJ._PBJ.ValidateString(super.FieldName);} } - public string FieldName{ get { - if (HasFieldName) { - return PBJ._PBJ.CastString(super.FieldName); - } else { - return PBJ._PBJ.CastString(); - } - } - } - public const int DataFieldTag=12; - public bool HasData{ get {return super.HasData&&PBJ._PBJ.ValidateBytes(super.Data);} } - public pb::ByteString Data{ get { - if (HasData) { - return PBJ._PBJ.CastBytes(super.Data); - } else { - return PBJ._PBJ.CastBytes(); - } - } - } - public const int ComparatorFieldTag=14; - public bool HasComparator{ get {return super.HasComparator;} } - public Types.COMPARATOR Comparator{ get { - if (HasComparator) { - return (Types.COMPARATOR)super.Comparator; - } else { - return new Types.COMPARATOR(); - } - } - } - public override Google.ProtocolBuffers.IMessage _PBJISuper { get { return super; } } - public override PBJ.IMessage.IBuilder WeakCreateBuilderForType() { return new Builder(); } - public static Builder CreateBuilder() { return new Builder(); } - public static Builder CreateBuilder(CompareElement prototype) { - return (Builder)new Builder().MergeFrom(prototype); - } - public static CompareElement ParseFrom(pb::ByteString data) { - return new CompareElement(_PBJ_Internal.CompareElement.ParseFrom(data)); - } - public static CompareElement ParseFrom(pb::ByteString data, pb::ExtensionRegistry er) { - return new CompareElement(_PBJ_Internal.CompareElement.ParseFrom(data,er)); - } - public static CompareElement ParseFrom(byte[] data) { - return new CompareElement(_PBJ_Internal.CompareElement.ParseFrom(data)); - } - public static CompareElement ParseFrom(byte[] data, pb::ExtensionRegistry er) { - return new CompareElement(_PBJ_Internal.CompareElement.ParseFrom(data,er)); - } - public static CompareElement ParseFrom(global::System.IO.Stream data) { - return new CompareElement(_PBJ_Internal.CompareElement.ParseFrom(data)); - } - public static CompareElement ParseFrom(global::System.IO.Stream data, pb::ExtensionRegistry er) { - return new CompareElement(_PBJ_Internal.CompareElement.ParseFrom(data,er)); - } - public static CompareElement ParseFrom(pb::CodedInputStream data) { - return new CompareElement(_PBJ_Internal.CompareElement.ParseFrom(data)); - } - public static CompareElement ParseFrom(pb::CodedInputStream data, pb::ExtensionRegistry er) { - return new CompareElement(_PBJ_Internal.CompareElement.ParseFrom(data,er)); - } - protected override bool _HasAllPBJFields{ get { - return true - ; - } } - public bool IsInitialized { get { - return super.IsInitialized&&_HasAllPBJFields; - } } - public class Builder : global::PBJ.IMessage.IBuilder{ - protected override bool _HasAllPBJFields{ get { - return true - ; - } } - public bool IsInitialized { get { - return super.IsInitialized&&_HasAllPBJFields; - } } - protected _PBJ_Internal.CompareElement.Builder super; - public override Google.ProtocolBuffers.IBuilder _PBJISuper { get { return super; } } - public _PBJ_Internal.CompareElement.Builder _PBJSuper{ get { return super;} } - public Builder() {super = new _PBJ_Internal.CompareElement.Builder();} - public Builder(_PBJ_Internal.CompareElement.Builder other) { - super=other; - } - public Builder Clone() {return new Builder(super.Clone());} - public Builder MergeFrom(CompareElement prototype) { super.MergeFrom(prototype._PBJSuper);return this;} - public Builder Clear() {super.Clear();return this;} - public CompareElement BuildPartial() {return new CompareElement(super.BuildPartial());} - public CompareElement Build() {if (_HasAllPBJFields) return new CompareElement(super.Build());return null;} - public pbd::MessageDescriptor DescriptorForType { - get { return CompareElement.Descriptor; } } - public Builder ClearObjectUuid() { super.ClearObjectUuid();return this;} - public const int ObjectUuidFieldTag=9; - public bool HasObjectUuid{ get {return super.HasObjectUuid&&PBJ._PBJ.ValidateUuid(super.ObjectUuid);} } - public PBJ.UUID ObjectUuid{ get { - if (HasObjectUuid) { - return PBJ._PBJ.CastUuid(super.ObjectUuid); - } else { - return PBJ._PBJ.CastUuid(); - } - } - set { - super.ObjectUuid=(PBJ._PBJ.Construct(value)); - } - } - public Builder ClearFieldId() { super.ClearFieldId();return this;} - public const int FieldIdFieldTag=10; - public bool HasFieldId{ get {return super.HasFieldId&&PBJ._PBJ.ValidateUint64(super.FieldId);} } - public ulong FieldId{ get { - if (HasFieldId) { - return PBJ._PBJ.CastUint64(super.FieldId); - } else { - return PBJ._PBJ.CastUint64(); - } - } - set { - super.FieldId=(PBJ._PBJ.Construct(value)); - } - } - public Builder ClearFieldName() { super.ClearFieldName();return this;} - public const int FieldNameFieldTag=11; - public bool HasFieldName{ get {return super.HasFieldName&&PBJ._PBJ.ValidateString(super.FieldName);} } - public string FieldName{ get { - if (HasFieldName) { - return PBJ._PBJ.CastString(super.FieldName); - } else { - return PBJ._PBJ.CastString(); - } - } - set { - super.FieldName=(PBJ._PBJ.Construct(value)); - } - } - public Builder ClearData() { super.ClearData();return this;} - public const int DataFieldTag=12; - public bool HasData{ get {return super.HasData&&PBJ._PBJ.ValidateBytes(super.Data);} } - public pb::ByteString Data{ get { - if (HasData) { - return PBJ._PBJ.CastBytes(super.Data); - } else { - return PBJ._PBJ.CastBytes(); - } - } - set { - super.Data=(PBJ._PBJ.Construct(value)); - } - } - public Builder ClearComparator() { super.ClearComparator();return this;} - public const int ComparatorFieldTag=14; - public bool HasComparator{ get {return super.HasComparator;} } - public Types.COMPARATOR Comparator{ get { - if (HasComparator) { - return (Types.COMPARATOR)super.Comparator; - } else { - return new Types.COMPARATOR(); - } - } - set { - super.Comparator=((_PBJ_Internal.CompareElement.Types.COMPARATOR)value); - } - } - } - } -} -namespace Sirikata.Persistence.Protocol { - public class StorageSet : PBJ.IMessage { - protected _PBJ_Internal.StorageSet super; - public _PBJ_Internal.StorageSet _PBJSuper{ get { return super;} } - public StorageSet() { - super=new _PBJ_Internal.StorageSet(); - } - public StorageSet(_PBJ_Internal.StorageSet reference) { - super=reference; - } - public static StorageSet defaultInstance= new StorageSet (_PBJ_Internal.StorageSet.DefaultInstance); - public static StorageSet DefaultInstance{ - get {return defaultInstance;} - } - public static pbd.MessageDescriptor Descriptor { - get { return _PBJ_Internal.StorageSet.Descriptor; } } - public static class Types { - } - public static bool WithinReservedFieldTagRange(int field_tag) { - return false||(field_tag>=1&&field_tag<=8)||(field_tag>=1536&&field_tag<=2560)||(field_tag>=229376&&field_tag<=294912); - } - public static bool WithinExtensionFieldTagRange(int field_tag) { - return false; - } - public const int ReadsFieldTag=9; - public int ReadsCount { get { return super.ReadsCount;} } - public bool HasReads(int index) {return true;} - public StorageElement Reads(int index) { - return new StorageElement(super.GetReads(index)); - } - public override Google.ProtocolBuffers.IMessage _PBJISuper { get { return super; } } - public override PBJ.IMessage.IBuilder WeakCreateBuilderForType() { return new Builder(); } - public static Builder CreateBuilder() { return new Builder(); } - public static Builder CreateBuilder(StorageSet prototype) { - return (Builder)new Builder().MergeFrom(prototype); - } - public static StorageSet ParseFrom(pb::ByteString data) { - return new StorageSet(_PBJ_Internal.StorageSet.ParseFrom(data)); - } - public static StorageSet ParseFrom(pb::ByteString data, pb::ExtensionRegistry er) { - return new StorageSet(_PBJ_Internal.StorageSet.ParseFrom(data,er)); - } - public static StorageSet ParseFrom(byte[] data) { - return new StorageSet(_PBJ_Internal.StorageSet.ParseFrom(data)); - } - public static StorageSet ParseFrom(byte[] data, pb::ExtensionRegistry er) { - return new StorageSet(_PBJ_Internal.StorageSet.ParseFrom(data,er)); - } - public static StorageSet ParseFrom(global::System.IO.Stream data) { - return new StorageSet(_PBJ_Internal.StorageSet.ParseFrom(data)); - } - public static StorageSet ParseFrom(global::System.IO.Stream data, pb::ExtensionRegistry er) { - return new StorageSet(_PBJ_Internal.StorageSet.ParseFrom(data,er)); - } - public static StorageSet ParseFrom(pb::CodedInputStream data) { - return new StorageSet(_PBJ_Internal.StorageSet.ParseFrom(data)); - } - public static StorageSet ParseFrom(pb::CodedInputStream data, pb::ExtensionRegistry er) { - return new StorageSet(_PBJ_Internal.StorageSet.ParseFrom(data,er)); - } - protected override bool _HasAllPBJFields{ get { - return true - ; - } } - public bool IsInitialized { get { - return super.IsInitialized&&_HasAllPBJFields; - } } - public class Builder : global::PBJ.IMessage.IBuilder{ - protected override bool _HasAllPBJFields{ get { - return true - ; - } } - public bool IsInitialized { get { - return super.IsInitialized&&_HasAllPBJFields; - } } - protected _PBJ_Internal.StorageSet.Builder super; - public override Google.ProtocolBuffers.IBuilder _PBJISuper { get { return super; } } - public _PBJ_Internal.StorageSet.Builder _PBJSuper{ get { return super;} } - public Builder() {super = new _PBJ_Internal.StorageSet.Builder();} - public Builder(_PBJ_Internal.StorageSet.Builder other) { - super=other; - } - public Builder Clone() {return new Builder(super.Clone());} - public Builder MergeFrom(StorageSet prototype) { super.MergeFrom(prototype._PBJSuper);return this;} - public Builder Clear() {super.Clear();return this;} - public StorageSet BuildPartial() {return new StorageSet(super.BuildPartial());} - public StorageSet Build() {if (_HasAllPBJFields) return new StorageSet(super.Build());return null;} - public pbd::MessageDescriptor DescriptorForType { - get { return StorageSet.Descriptor; } } - public Builder ClearReads() { super.ClearReads();return this;} - public Builder SetReads(int index,StorageElement value) { - super.SetReads(index,value._PBJSuper); - return this; - } - public const int ReadsFieldTag=9; - public int ReadsCount { get { return super.ReadsCount;} } - public bool HasReads(int index) {return true;} - public StorageElement Reads(int index) { - return new StorageElement(super.GetReads(index)); - } - public Builder AddReads(StorageElement value) { - super.AddReads(value._PBJSuper); - return this; - } - } - } -} -namespace Sirikata.Persistence.Protocol { - public class ReadSet : PBJ.IMessage { - protected _PBJ_Internal.ReadSet super; - public _PBJ_Internal.ReadSet _PBJSuper{ get { return super;} } - public ReadSet() { - super=new _PBJ_Internal.ReadSet(); - } - public ReadSet(_PBJ_Internal.ReadSet reference) { - super=reference; - } - public static ReadSet defaultInstance= new ReadSet (_PBJ_Internal.ReadSet.DefaultInstance); - public static ReadSet DefaultInstance{ - get {return defaultInstance;} - } - public static pbd.MessageDescriptor Descriptor { - get { return _PBJ_Internal.ReadSet.Descriptor; } } - public static class Types { - } - public static bool WithinReservedFieldTagRange(int field_tag) { - return false||(field_tag>=1&&field_tag<=8)||(field_tag>=1536&&field_tag<=2560)||(field_tag>=229376&&field_tag<=294912); - } - public static bool WithinExtensionFieldTagRange(int field_tag) { - return false; - } - public const int ReadsFieldTag=9; - public int ReadsCount { get { return super.ReadsCount;} } - public bool HasReads(int index) {return true;} - public StorageElement Reads(int index) { - return new StorageElement(super.GetReads(index)); - } - public override Google.ProtocolBuffers.IMessage _PBJISuper { get { return super; } } - public override PBJ.IMessage.IBuilder WeakCreateBuilderForType() { return new Builder(); } - public static Builder CreateBuilder() { return new Builder(); } - public static Builder CreateBuilder(ReadSet prototype) { - return (Builder)new Builder().MergeFrom(prototype); - } - public static ReadSet ParseFrom(pb::ByteString data) { - return new ReadSet(_PBJ_Internal.ReadSet.ParseFrom(data)); - } - public static ReadSet ParseFrom(pb::ByteString data, pb::ExtensionRegistry er) { - return new ReadSet(_PBJ_Internal.ReadSet.ParseFrom(data,er)); - } - public static ReadSet ParseFrom(byte[] data) { - return new ReadSet(_PBJ_Internal.ReadSet.ParseFrom(data)); - } - public static ReadSet ParseFrom(byte[] data, pb::ExtensionRegistry er) { - return new ReadSet(_PBJ_Internal.ReadSet.ParseFrom(data,er)); - } - public static ReadSet ParseFrom(global::System.IO.Stream data) { - return new ReadSet(_PBJ_Internal.ReadSet.ParseFrom(data)); - } - public static ReadSet ParseFrom(global::System.IO.Stream data, pb::ExtensionRegistry er) { - return new ReadSet(_PBJ_Internal.ReadSet.ParseFrom(data,er)); - } - public static ReadSet ParseFrom(pb::CodedInputStream data) { - return new ReadSet(_PBJ_Internal.ReadSet.ParseFrom(data)); - } - public static ReadSet ParseFrom(pb::CodedInputStream data, pb::ExtensionRegistry er) { - return new ReadSet(_PBJ_Internal.ReadSet.ParseFrom(data,er)); - } - protected override bool _HasAllPBJFields{ get { - return true - ; - } } - public bool IsInitialized { get { - return super.IsInitialized&&_HasAllPBJFields; - } } - public class Builder : global::PBJ.IMessage.IBuilder{ - protected override bool _HasAllPBJFields{ get { - return true - ; - } } - public bool IsInitialized { get { - return super.IsInitialized&&_HasAllPBJFields; - } } - protected _PBJ_Internal.ReadSet.Builder super; - public override Google.ProtocolBuffers.IBuilder _PBJISuper { get { return super; } } - public _PBJ_Internal.ReadSet.Builder _PBJSuper{ get { return super;} } - public Builder() {super = new _PBJ_Internal.ReadSet.Builder();} - public Builder(_PBJ_Internal.ReadSet.Builder other) { - super=other; - } - public Builder Clone() {return new Builder(super.Clone());} - public Builder MergeFrom(ReadSet prototype) { super.MergeFrom(prototype._PBJSuper);return this;} - public Builder Clear() {super.Clear();return this;} - public ReadSet BuildPartial() {return new ReadSet(super.BuildPartial());} - public ReadSet Build() {if (_HasAllPBJFields) return new ReadSet(super.Build());return null;} - public pbd::MessageDescriptor DescriptorForType { - get { return ReadSet.Descriptor; } } - public Builder ClearReads() { super.ClearReads();return this;} - public Builder SetReads(int index,StorageElement value) { - super.SetReads(index,value._PBJSuper); - return this; - } - public const int ReadsFieldTag=9; - public int ReadsCount { get { return super.ReadsCount;} } - public bool HasReads(int index) {return true;} - public StorageElement Reads(int index) { - return new StorageElement(super.GetReads(index)); - } - public Builder AddReads(StorageElement value) { - super.AddReads(value._PBJSuper); - return this; - } - } - } -} -namespace Sirikata.Persistence.Protocol { - public class WriteSet : PBJ.IMessage { - protected _PBJ_Internal.WriteSet super; - public _PBJ_Internal.WriteSet _PBJSuper{ get { return super;} } - public WriteSet() { - super=new _PBJ_Internal.WriteSet(); - } - public WriteSet(_PBJ_Internal.WriteSet reference) { - super=reference; - } - public static WriteSet defaultInstance= new WriteSet (_PBJ_Internal.WriteSet.DefaultInstance); - public static WriteSet DefaultInstance{ - get {return defaultInstance;} - } - public static pbd.MessageDescriptor Descriptor { - get { return _PBJ_Internal.WriteSet.Descriptor; } } - public static class Types { - } - public static bool WithinReservedFieldTagRange(int field_tag) { - return false||(field_tag>=1&&field_tag<=8)||(field_tag>=1536&&field_tag<=2560)||(field_tag>=229376&&field_tag<=294912); - } - public static bool WithinExtensionFieldTagRange(int field_tag) { - return false; - } - public const int WritesFieldTag=10; - public int WritesCount { get { return super.WritesCount;} } - public bool HasWrites(int index) {return true;} - public StorageElement Writes(int index) { - return new StorageElement(super.GetWrites(index)); - } - public override Google.ProtocolBuffers.IMessage _PBJISuper { get { return super; } } - public override PBJ.IMessage.IBuilder WeakCreateBuilderForType() { return new Builder(); } - public static Builder CreateBuilder() { return new Builder(); } - public static Builder CreateBuilder(WriteSet prototype) { - return (Builder)new Builder().MergeFrom(prototype); - } - public static WriteSet ParseFrom(pb::ByteString data) { - return new WriteSet(_PBJ_Internal.WriteSet.ParseFrom(data)); - } - public static WriteSet ParseFrom(pb::ByteString data, pb::ExtensionRegistry er) { - return new WriteSet(_PBJ_Internal.WriteSet.ParseFrom(data,er)); - } - public static WriteSet ParseFrom(byte[] data) { - return new WriteSet(_PBJ_Internal.WriteSet.ParseFrom(data)); - } - public static WriteSet ParseFrom(byte[] data, pb::ExtensionRegistry er) { - return new WriteSet(_PBJ_Internal.WriteSet.ParseFrom(data,er)); - } - public static WriteSet ParseFrom(global::System.IO.Stream data) { - return new WriteSet(_PBJ_Internal.WriteSet.ParseFrom(data)); - } - public static WriteSet ParseFrom(global::System.IO.Stream data, pb::ExtensionRegistry er) { - return new WriteSet(_PBJ_Internal.WriteSet.ParseFrom(data,er)); - } - public static WriteSet ParseFrom(pb::CodedInputStream data) { - return new WriteSet(_PBJ_Internal.WriteSet.ParseFrom(data)); - } - public static WriteSet ParseFrom(pb::CodedInputStream data, pb::ExtensionRegistry er) { - return new WriteSet(_PBJ_Internal.WriteSet.ParseFrom(data,er)); - } - protected override bool _HasAllPBJFields{ get { - return true - ; - } } - public bool IsInitialized { get { - return super.IsInitialized&&_HasAllPBJFields; - } } - public class Builder : global::PBJ.IMessage.IBuilder{ - protected override bool _HasAllPBJFields{ get { - return true - ; - } } - public bool IsInitialized { get { - return super.IsInitialized&&_HasAllPBJFields; - } } - protected _PBJ_Internal.WriteSet.Builder super; - public override Google.ProtocolBuffers.IBuilder _PBJISuper { get { return super; } } - public _PBJ_Internal.WriteSet.Builder _PBJSuper{ get { return super;} } - public Builder() {super = new _PBJ_Internal.WriteSet.Builder();} - public Builder(_PBJ_Internal.WriteSet.Builder other) { - super=other; - } - public Builder Clone() {return new Builder(super.Clone());} - public Builder MergeFrom(WriteSet prototype) { super.MergeFrom(prototype._PBJSuper);return this;} - public Builder Clear() {super.Clear();return this;} - public WriteSet BuildPartial() {return new WriteSet(super.BuildPartial());} - public WriteSet Build() {if (_HasAllPBJFields) return new WriteSet(super.Build());return null;} - public pbd::MessageDescriptor DescriptorForType { - get { return WriteSet.Descriptor; } } - public Builder ClearWrites() { super.ClearWrites();return this;} - public Builder SetWrites(int index,StorageElement value) { - super.SetWrites(index,value._PBJSuper); - return this; - } - public const int WritesFieldTag=10; - public int WritesCount { get { return super.WritesCount;} } - public bool HasWrites(int index) {return true;} - public StorageElement Writes(int index) { - return new StorageElement(super.GetWrites(index)); - } - public Builder AddWrites(StorageElement value) { - super.AddWrites(value._PBJSuper); - return this; - } - } - } -} -namespace Sirikata.Persistence.Protocol { - public class ReadWriteSet : PBJ.IMessage { - protected _PBJ_Internal.ReadWriteSet super; - public _PBJ_Internal.ReadWriteSet _PBJSuper{ get { return super;} } - public ReadWriteSet() { - super=new _PBJ_Internal.ReadWriteSet(); - } - public ReadWriteSet(_PBJ_Internal.ReadWriteSet reference) { - super=reference; - } - public static ReadWriteSet defaultInstance= new ReadWriteSet (_PBJ_Internal.ReadWriteSet.DefaultInstance); - public static ReadWriteSet DefaultInstance{ - get {return defaultInstance;} - } - public static pbd.MessageDescriptor Descriptor { - get { return _PBJ_Internal.ReadWriteSet.Descriptor; } } - public static class Types { - public enum ReadWriteSetOptions { - RETURN_READ_NAMES=_PBJ_Internal.ReadWriteSet.Types.ReadWriteSetOptions.RETURN_READ_NAMES - }; - } - public static bool WithinReservedFieldTagRange(int field_tag) { - return false||(field_tag>=1&&field_tag<=8)||(field_tag>=1536&&field_tag<=2560)||(field_tag>=229376&&field_tag<=294912); - } - public static bool WithinExtensionFieldTagRange(int field_tag) { - return false; - } - public const int ReadsFieldTag=9; - public int ReadsCount { get { return super.ReadsCount;} } - public bool HasReads(int index) {return true;} - public StorageElement Reads(int index) { - return new StorageElement(super.GetReads(index)); - } - public const int WritesFieldTag=10; - public int WritesCount { get { return super.WritesCount;} } - public bool HasWrites(int index) {return true;} - public StorageElement Writes(int index) { - return new StorageElement(super.GetWrites(index)); - } - public const int OptionsFieldTag=14; - public bool HasOptions { get { - if (!super.HasOptions) return false; - return PBJ._PBJ.ValidateFlags(super.Options,(ulong)Types.ReadWriteSetOptions.RETURN_READ_NAMES); - } } - public ulong Options{ get { - if (HasOptions) { - return (ulong)PBJ._PBJ.CastFlags(super.Options,(ulong)Types.ReadWriteSetOptions.RETURN_READ_NAMES); - } else { - return (ulong)PBJ._PBJ.CastFlags((ulong)Types.ReadWriteSetOptions.RETURN_READ_NAMES); - } - } - } - public override Google.ProtocolBuffers.IMessage _PBJISuper { get { return super; } } - public override PBJ.IMessage.IBuilder WeakCreateBuilderForType() { return new Builder(); } - public static Builder CreateBuilder() { return new Builder(); } - public static Builder CreateBuilder(ReadWriteSet prototype) { - return (Builder)new Builder().MergeFrom(prototype); - } - public static ReadWriteSet ParseFrom(pb::ByteString data) { - return new ReadWriteSet(_PBJ_Internal.ReadWriteSet.ParseFrom(data)); - } - public static ReadWriteSet ParseFrom(pb::ByteString data, pb::ExtensionRegistry er) { - return new ReadWriteSet(_PBJ_Internal.ReadWriteSet.ParseFrom(data,er)); - } - public static ReadWriteSet ParseFrom(byte[] data) { - return new ReadWriteSet(_PBJ_Internal.ReadWriteSet.ParseFrom(data)); - } - public static ReadWriteSet ParseFrom(byte[] data, pb::ExtensionRegistry er) { - return new ReadWriteSet(_PBJ_Internal.ReadWriteSet.ParseFrom(data,er)); - } - public static ReadWriteSet ParseFrom(global::System.IO.Stream data) { - return new ReadWriteSet(_PBJ_Internal.ReadWriteSet.ParseFrom(data)); - } - public static ReadWriteSet ParseFrom(global::System.IO.Stream data, pb::ExtensionRegistry er) { - return new ReadWriteSet(_PBJ_Internal.ReadWriteSet.ParseFrom(data,er)); - } - public static ReadWriteSet ParseFrom(pb::CodedInputStream data) { - return new ReadWriteSet(_PBJ_Internal.ReadWriteSet.ParseFrom(data)); - } - public static ReadWriteSet ParseFrom(pb::CodedInputStream data, pb::ExtensionRegistry er) { - return new ReadWriteSet(_PBJ_Internal.ReadWriteSet.ParseFrom(data,er)); - } - protected override bool _HasAllPBJFields{ get { - return true - ; - } } - public bool IsInitialized { get { - return super.IsInitialized&&_HasAllPBJFields; - } } - public class Builder : global::PBJ.IMessage.IBuilder{ - protected override bool _HasAllPBJFields{ get { - return true - ; - } } - public bool IsInitialized { get { - return super.IsInitialized&&_HasAllPBJFields; - } } - protected _PBJ_Internal.ReadWriteSet.Builder super; - public override Google.ProtocolBuffers.IBuilder _PBJISuper { get { return super; } } - public _PBJ_Internal.ReadWriteSet.Builder _PBJSuper{ get { return super;} } - public Builder() {super = new _PBJ_Internal.ReadWriteSet.Builder();} - public Builder(_PBJ_Internal.ReadWriteSet.Builder other) { - super=other; - } - public Builder Clone() {return new Builder(super.Clone());} - public Builder MergeFrom(ReadWriteSet prototype) { super.MergeFrom(prototype._PBJSuper);return this;} - public Builder Clear() {super.Clear();return this;} - public ReadWriteSet BuildPartial() {return new ReadWriteSet(super.BuildPartial());} - public ReadWriteSet Build() {if (_HasAllPBJFields) return new ReadWriteSet(super.Build());return null;} - public pbd::MessageDescriptor DescriptorForType { - get { return ReadWriteSet.Descriptor; } } - public Builder ClearReads() { super.ClearReads();return this;} - public Builder SetReads(int index,StorageElement value) { - super.SetReads(index,value._PBJSuper); - return this; - } - public const int ReadsFieldTag=9; - public int ReadsCount { get { return super.ReadsCount;} } - public bool HasReads(int index) {return true;} - public StorageElement Reads(int index) { - return new StorageElement(super.GetReads(index)); - } - public Builder AddReads(StorageElement value) { - super.AddReads(value._PBJSuper); - return this; - } - public Builder ClearWrites() { super.ClearWrites();return this;} - public Builder SetWrites(int index,StorageElement value) { - super.SetWrites(index,value._PBJSuper); - return this; - } - public const int WritesFieldTag=10; - public int WritesCount { get { return super.WritesCount;} } - public bool HasWrites(int index) {return true;} - public StorageElement Writes(int index) { - return new StorageElement(super.GetWrites(index)); - } - public Builder AddWrites(StorageElement value) { - super.AddWrites(value._PBJSuper); - return this; - } - public Builder ClearOptions() { super.ClearOptions();return this;} - public const int OptionsFieldTag=14; - public bool HasOptions { get { - if (!super.HasOptions) return false; - return PBJ._PBJ.ValidateFlags(super.Options,(ulong)Types.ReadWriteSetOptions.RETURN_READ_NAMES); - } } - public ulong Options{ get { - if (HasOptions) { - return (ulong)PBJ._PBJ.CastFlags(super.Options,(ulong)Types.ReadWriteSetOptions.RETURN_READ_NAMES); - } else { - return (ulong)PBJ._PBJ.CastFlags((ulong)Types.ReadWriteSetOptions.RETURN_READ_NAMES); - } - } - set { - super.Options=((value)); - } - } - } - } -} -namespace Sirikata.Persistence.Protocol { - public class Minitransaction : PBJ.IMessage { - protected _PBJ_Internal.Minitransaction super; - public _PBJ_Internal.Minitransaction _PBJSuper{ get { return super;} } - public Minitransaction() { - super=new _PBJ_Internal.Minitransaction(); - } - public Minitransaction(_PBJ_Internal.Minitransaction reference) { - super=reference; - } - public static Minitransaction defaultInstance= new Minitransaction (_PBJ_Internal.Minitransaction.DefaultInstance); - public static Minitransaction DefaultInstance{ - get {return defaultInstance;} - } - public static pbd.MessageDescriptor Descriptor { - get { return _PBJ_Internal.Minitransaction.Descriptor; } } - public static class Types { - public enum TransactionOptions { - RETURN_READ_NAMES=_PBJ_Internal.Minitransaction.Types.TransactionOptions.RETURN_READ_NAMES - }; - } - public static bool WithinReservedFieldTagRange(int field_tag) { - return false; - } - public static bool WithinExtensionFieldTagRange(int field_tag) { - return false; - } - public const int ReadsFieldTag=9; - public int ReadsCount { get { return super.ReadsCount;} } - public bool HasReads(int index) {return true;} - public StorageElement Reads(int index) { - return new StorageElement(super.GetReads(index)); - } - public const int WritesFieldTag=10; - public int WritesCount { get { return super.WritesCount;} } - public bool HasWrites(int index) {return true;} - public StorageElement Writes(int index) { - return new StorageElement(super.GetWrites(index)); - } - public const int ComparesFieldTag=11; - public int ComparesCount { get { return super.ComparesCount;} } - public bool HasCompares(int index) {return true;} - public CompareElement Compares(int index) { - return new CompareElement(super.GetCompares(index)); - } - public const int OptionsFieldTag=14; - public bool HasOptions { get { - if (!super.HasOptions) return false; - return PBJ._PBJ.ValidateFlags(super.Options,(ulong)Types.TransactionOptions.RETURN_READ_NAMES); - } } - public ulong Options{ get { - if (HasOptions) { - return (ulong)PBJ._PBJ.CastFlags(super.Options,(ulong)Types.TransactionOptions.RETURN_READ_NAMES); - } else { - return (ulong)PBJ._PBJ.CastFlags((ulong)Types.TransactionOptions.RETURN_READ_NAMES); - } - } - } - public override Google.ProtocolBuffers.IMessage _PBJISuper { get { return super; } } - public override PBJ.IMessage.IBuilder WeakCreateBuilderForType() { return new Builder(); } - public static Builder CreateBuilder() { return new Builder(); } - public static Builder CreateBuilder(Minitransaction prototype) { - return (Builder)new Builder().MergeFrom(prototype); - } - public static Minitransaction ParseFrom(pb::ByteString data) { - return new Minitransaction(_PBJ_Internal.Minitransaction.ParseFrom(data)); - } - public static Minitransaction ParseFrom(pb::ByteString data, pb::ExtensionRegistry er) { - return new Minitransaction(_PBJ_Internal.Minitransaction.ParseFrom(data,er)); - } - public static Minitransaction ParseFrom(byte[] data) { - return new Minitransaction(_PBJ_Internal.Minitransaction.ParseFrom(data)); - } - public static Minitransaction ParseFrom(byte[] data, pb::ExtensionRegistry er) { - return new Minitransaction(_PBJ_Internal.Minitransaction.ParseFrom(data,er)); - } - public static Minitransaction ParseFrom(global::System.IO.Stream data) { - return new Minitransaction(_PBJ_Internal.Minitransaction.ParseFrom(data)); - } - public static Minitransaction ParseFrom(global::System.IO.Stream data, pb::ExtensionRegistry er) { - return new Minitransaction(_PBJ_Internal.Minitransaction.ParseFrom(data,er)); - } - public static Minitransaction ParseFrom(pb::CodedInputStream data) { - return new Minitransaction(_PBJ_Internal.Minitransaction.ParseFrom(data)); - } - public static Minitransaction ParseFrom(pb::CodedInputStream data, pb::ExtensionRegistry er) { - return new Minitransaction(_PBJ_Internal.Minitransaction.ParseFrom(data,er)); - } - protected override bool _HasAllPBJFields{ get { - return true - ; - } } - public bool IsInitialized { get { - return super.IsInitialized&&_HasAllPBJFields; - } } - public class Builder : global::PBJ.IMessage.IBuilder{ - protected override bool _HasAllPBJFields{ get { - return true - ; - } } - public bool IsInitialized { get { - return super.IsInitialized&&_HasAllPBJFields; - } } - protected _PBJ_Internal.Minitransaction.Builder super; - public override Google.ProtocolBuffers.IBuilder _PBJISuper { get { return super; } } - public _PBJ_Internal.Minitransaction.Builder _PBJSuper{ get { return super;} } - public Builder() {super = new _PBJ_Internal.Minitransaction.Builder();} - public Builder(_PBJ_Internal.Minitransaction.Builder other) { - super=other; - } - public Builder Clone() {return new Builder(super.Clone());} - public Builder MergeFrom(Minitransaction prototype) { super.MergeFrom(prototype._PBJSuper);return this;} - public Builder Clear() {super.Clear();return this;} - public Minitransaction BuildPartial() {return new Minitransaction(super.BuildPartial());} - public Minitransaction Build() {if (_HasAllPBJFields) return new Minitransaction(super.Build());return null;} - public pbd::MessageDescriptor DescriptorForType { - get { return Minitransaction.Descriptor; } } - public Builder ClearReads() { super.ClearReads();return this;} - public Builder SetReads(int index,StorageElement value) { - super.SetReads(index,value._PBJSuper); - return this; - } - public const int ReadsFieldTag=9; - public int ReadsCount { get { return super.ReadsCount;} } - public bool HasReads(int index) {return true;} - public StorageElement Reads(int index) { - return new StorageElement(super.GetReads(index)); - } - public Builder AddReads(StorageElement value) { - super.AddReads(value._PBJSuper); - return this; - } - public Builder ClearWrites() { super.ClearWrites();return this;} - public Builder SetWrites(int index,StorageElement value) { - super.SetWrites(index,value._PBJSuper); - return this; - } - public const int WritesFieldTag=10; - public int WritesCount { get { return super.WritesCount;} } - public bool HasWrites(int index) {return true;} - public StorageElement Writes(int index) { - return new StorageElement(super.GetWrites(index)); - } - public Builder AddWrites(StorageElement value) { - super.AddWrites(value._PBJSuper); - return this; - } - public Builder ClearCompares() { super.ClearCompares();return this;} - public Builder SetCompares(int index,CompareElement value) { - super.SetCompares(index,value._PBJSuper); - return this; - } - public const int ComparesFieldTag=11; - public int ComparesCount { get { return super.ComparesCount;} } - public bool HasCompares(int index) {return true;} - public CompareElement Compares(int index) { - return new CompareElement(super.GetCompares(index)); - } - public Builder AddCompares(CompareElement value) { - super.AddCompares(value._PBJSuper); - return this; - } - public Builder ClearOptions() { super.ClearOptions();return this;} - public const int OptionsFieldTag=14; - public bool HasOptions { get { - if (!super.HasOptions) return false; - return PBJ._PBJ.ValidateFlags(super.Options,(ulong)Types.TransactionOptions.RETURN_READ_NAMES); - } } - public ulong Options{ get { - if (HasOptions) { - return (ulong)PBJ._PBJ.CastFlags(super.Options,(ulong)Types.TransactionOptions.RETURN_READ_NAMES); - } else { - return (ulong)PBJ._PBJ.CastFlags((ulong)Types.TransactionOptions.RETURN_READ_NAMES); - } - } - set { - super.Options=((value)); - } - } - } - } -} -namespace Sirikata.Persistence.Protocol { - public class Response : PBJ.IMessage { - protected _PBJ_Internal.Response super; - public _PBJ_Internal.Response _PBJSuper{ get { return super;} } - public Response() { - super=new _PBJ_Internal.Response(); - } - public Response(_PBJ_Internal.Response reference) { - super=reference; - } - public static Response defaultInstance= new Response (_PBJ_Internal.Response.DefaultInstance); - public static Response DefaultInstance{ - get {return defaultInstance;} - } - public static pbd.MessageDescriptor Descriptor { - get { return _PBJ_Internal.Response.Descriptor; } } - public static class Types { - public enum ReturnStatus { - SUCCESS=_PBJ_Internal.Response.Types.ReturnStatus.SUCCESS, - DATABASE_LOCKED=_PBJ_Internal.Response.Types.ReturnStatus.DATABASE_LOCKED, - KEY_MISSING=_PBJ_Internal.Response.Types.ReturnStatus.KEY_MISSING, - COMPARISON_FAILED=_PBJ_Internal.Response.Types.ReturnStatus.COMPARISON_FAILED, - INTERNAL_ERROR=_PBJ_Internal.Response.Types.ReturnStatus.INTERNAL_ERROR - }; - } - public static bool WithinReservedFieldTagRange(int field_tag) { - return false||(field_tag>=1&&field_tag<=8); - } - public static bool WithinExtensionFieldTagRange(int field_tag) { - return false; - } - public const int ReadsFieldTag=9; - public int ReadsCount { get { return super.ReadsCount;} } - public bool HasReads(int index) {return true;} - public StorageElement Reads(int index) { - return new StorageElement(super.GetReads(index)); - } - public const int ReturnStatusFieldTag=15; - public bool HasReturnStatus{ get {return super.HasReturnStatus;} } - public Types.ReturnStatus ReturnStatus{ get { - if (HasReturnStatus) { - return (Types.ReturnStatus)super.ReturnStatus; - } else { - return new Types.ReturnStatus(); - } - } - } - public override Google.ProtocolBuffers.IMessage _PBJISuper { get { return super; } } - public override PBJ.IMessage.IBuilder WeakCreateBuilderForType() { return new Builder(); } - public static Builder CreateBuilder() { return new Builder(); } - public static Builder CreateBuilder(Response prototype) { - return (Builder)new Builder().MergeFrom(prototype); - } - public static Response ParseFrom(pb::ByteString data) { - return new Response(_PBJ_Internal.Response.ParseFrom(data)); - } - public static Response ParseFrom(pb::ByteString data, pb::ExtensionRegistry er) { - return new Response(_PBJ_Internal.Response.ParseFrom(data,er)); - } - public static Response ParseFrom(byte[] data) { - return new Response(_PBJ_Internal.Response.ParseFrom(data)); - } - public static Response ParseFrom(byte[] data, pb::ExtensionRegistry er) { - return new Response(_PBJ_Internal.Response.ParseFrom(data,er)); - } - public static Response ParseFrom(global::System.IO.Stream data) { - return new Response(_PBJ_Internal.Response.ParseFrom(data)); - } - public static Response ParseFrom(global::System.IO.Stream data, pb::ExtensionRegistry er) { - return new Response(_PBJ_Internal.Response.ParseFrom(data,er)); - } - public static Response ParseFrom(pb::CodedInputStream data) { - return new Response(_PBJ_Internal.Response.ParseFrom(data)); - } - public static Response ParseFrom(pb::CodedInputStream data, pb::ExtensionRegistry er) { - return new Response(_PBJ_Internal.Response.ParseFrom(data,er)); - } - protected override bool _HasAllPBJFields{ get { - return true - ; - } } - public bool IsInitialized { get { - return super.IsInitialized&&_HasAllPBJFields; - } } - public class Builder : global::PBJ.IMessage.IBuilder{ - protected override bool _HasAllPBJFields{ get { - return true - ; - } } - public bool IsInitialized { get { - return super.IsInitialized&&_HasAllPBJFields; - } } - protected _PBJ_Internal.Response.Builder super; - public override Google.ProtocolBuffers.IBuilder _PBJISuper { get { return super; } } - public _PBJ_Internal.Response.Builder _PBJSuper{ get { return super;} } - public Builder() {super = new _PBJ_Internal.Response.Builder();} - public Builder(_PBJ_Internal.Response.Builder other) { - super=other; - } - public Builder Clone() {return new Builder(super.Clone());} - public Builder MergeFrom(Response prototype) { super.MergeFrom(prototype._PBJSuper);return this;} - public Builder Clear() {super.Clear();return this;} - public Response BuildPartial() {return new Response(super.BuildPartial());} - public Response Build() {if (_HasAllPBJFields) return new Response(super.Build());return null;} - public pbd::MessageDescriptor DescriptorForType { - get { return Response.Descriptor; } } - public Builder ClearReads() { super.ClearReads();return this;} - public Builder SetReads(int index,StorageElement value) { - super.SetReads(index,value._PBJSuper); - return this; - } - public const int ReadsFieldTag=9; - public int ReadsCount { get { return super.ReadsCount;} } - public bool HasReads(int index) {return true;} - public StorageElement Reads(int index) { - return new StorageElement(super.GetReads(index)); - } - public Builder AddReads(StorageElement value) { - super.AddReads(value._PBJSuper); - return this; - } - public Builder ClearReturnStatus() { super.ClearReturnStatus();return this;} - public const int ReturnStatusFieldTag=15; - public bool HasReturnStatus{ get {return super.HasReturnStatus;} } - public Types.ReturnStatus ReturnStatus{ get { - if (HasReturnStatus) { - return (Types.ReturnStatus)super.ReturnStatus; - } else { - return new Types.ReturnStatus(); - } - } - set { - super.ReturnStatus=((_PBJ_Internal.Response.Types.ReturnStatus)value); - } - } - } - } -} diff --git a/OpenSim/Client/Sirikata/Protocol/Physics.cs b/OpenSim/Client/Sirikata/Protocol/Physics.cs deleted file mode 100644 index a81a6fd20b..0000000000 --- a/OpenSim/Client/Sirikata/Protocol/Physics.cs +++ /dev/null @@ -1,840 +0,0 @@ -// Generated by the protocol buffer compiler. DO NOT EDIT! - -using pb = global::Google.ProtocolBuffers; -using pbc = global::Google.ProtocolBuffers.Collections; -using pbd = global::Google.ProtocolBuffers.Descriptors; -using scg = global::System.Collections.Generic; -namespace Sirikata.Physics.Protocol._PBJ_Internal { - - public static partial class Physics { - - #region Extension registration - public static void RegisterAllExtensions(pb::ExtensionRegistry registry) { - } - #endregion - #region Static variables - internal static pbd::MessageDescriptor internal__static_Sirikata_Physics_Protocol__PBJ_Internal_CollisionBegin__Descriptor; - internal static pb::FieldAccess.FieldAccessorTable internal__static_Sirikata_Physics_Protocol__PBJ_Internal_CollisionBegin__FieldAccessorTable; - internal static pbd::MessageDescriptor internal__static_Sirikata_Physics_Protocol__PBJ_Internal_CollisionEnd__Descriptor; - internal static pb::FieldAccess.FieldAccessorTable internal__static_Sirikata_Physics_Protocol__PBJ_Internal_CollisionEnd__FieldAccessorTable; - #endregion - #region Descriptor - public static pbd::FileDescriptor Descriptor { - get { return descriptor; } - } - private static pbd::FileDescriptor descriptor; - - static Physics() { - byte[] descriptorData = global::System.Convert.FromBase64String( - "Cg1QaHlzaWNzLnByb3RvEidTaXJpa2F0YS5QaHlzaWNzLlByb3RvY29sLl9Q" + - "QkpfSW50ZXJuYWwiqAEKDkNvbGxpc2lvbkJlZ2luEhEKCXRpbWVzdGFtcBgC" + - "IAEoBhIZCg10aGlzX3Bvc2l0aW9uGAMgAygBQgIQARIaCg5vdGhlcl9wb3Np" + - "dGlvbhgEIAMoAUICEAESFwoLdGhpc19ub3JtYWwYBSADKAJCAhABEhMKB2lt" + - "cHVsc2UYBiADKAJCAhABEh4KFm90aGVyX29iamVjdF9yZWZlcmVuY2UYByAB" + - "KAwiQQoMQ29sbGlzaW9uRW5kEhEKCXRpbWVzdGFtcBgCIAEoBhIeChZvdGhl" + - "cl9vYmplY3RfcmVmZXJlbmNlGAYgASgM"); - pbd::FileDescriptor.InternalDescriptorAssigner assigner = delegate(pbd::FileDescriptor root) { - descriptor = root; - internal__static_Sirikata_Physics_Protocol__PBJ_Internal_CollisionBegin__Descriptor = Descriptor.MessageTypes[0]; - internal__static_Sirikata_Physics_Protocol__PBJ_Internal_CollisionBegin__FieldAccessorTable = - new pb::FieldAccess.FieldAccessorTable(internal__static_Sirikata_Physics_Protocol__PBJ_Internal_CollisionBegin__Descriptor, - new string[] { "Timestamp", "ThisPosition", "OtherPosition", "ThisNormal", "Impulse", "OtherObjectReference", }); - internal__static_Sirikata_Physics_Protocol__PBJ_Internal_CollisionEnd__Descriptor = Descriptor.MessageTypes[1]; - internal__static_Sirikata_Physics_Protocol__PBJ_Internal_CollisionEnd__FieldAccessorTable = - new pb::FieldAccess.FieldAccessorTable(internal__static_Sirikata_Physics_Protocol__PBJ_Internal_CollisionEnd__Descriptor, - new string[] { "Timestamp", "OtherObjectReference", }); - return null; - }; - pbd::FileDescriptor.InternalBuildGeneratedFileFrom(descriptorData, - new pbd::FileDescriptor[] { - }, assigner); - } - #endregion - - } - #region Messages - public sealed partial class CollisionBegin : pb::GeneratedMessage { - private static readonly CollisionBegin defaultInstance = new Builder().BuildPartial(); - public static CollisionBegin DefaultInstance { - get { return defaultInstance; } - } - - public override CollisionBegin DefaultInstanceForType { - get { return defaultInstance; } - } - - protected override CollisionBegin ThisMessage { - get { return this; } - } - - public static pbd::MessageDescriptor Descriptor { - get { return global::Sirikata.Physics.Protocol._PBJ_Internal.Physics.internal__static_Sirikata_Physics_Protocol__PBJ_Internal_CollisionBegin__Descriptor; } - } - - protected override pb::FieldAccess.FieldAccessorTable InternalFieldAccessors { - get { return global::Sirikata.Physics.Protocol._PBJ_Internal.Physics.internal__static_Sirikata_Physics_Protocol__PBJ_Internal_CollisionBegin__FieldAccessorTable; } - } - - public const int TimestampFieldNumber = 2; - private bool hasTimestamp; - private ulong timestamp_ = 0; - public bool HasTimestamp { - get { return hasTimestamp; } - } - [global::System.CLSCompliant(false)] - public ulong Timestamp { - get { return timestamp_; } - } - - public const int ThisPositionFieldNumber = 3; - private int thisPositionMemoizedSerializedSize; - private pbc::PopsicleList thisPosition_ = new pbc::PopsicleList(); - public scg::IList ThisPositionList { - get { return pbc::Lists.AsReadOnly(thisPosition_); } - } - public int ThisPositionCount { - get { return thisPosition_.Count; } - } - public double GetThisPosition(int index) { - return thisPosition_[index]; - } - - public const int OtherPositionFieldNumber = 4; - private int otherPositionMemoizedSerializedSize; - private pbc::PopsicleList otherPosition_ = new pbc::PopsicleList(); - public scg::IList OtherPositionList { - get { return pbc::Lists.AsReadOnly(otherPosition_); } - } - public int OtherPositionCount { - get { return otherPosition_.Count; } - } - public double GetOtherPosition(int index) { - return otherPosition_[index]; - } - - public const int ThisNormalFieldNumber = 5; - private int thisNormalMemoizedSerializedSize; - private pbc::PopsicleList thisNormal_ = new pbc::PopsicleList(); - public scg::IList ThisNormalList { - get { return pbc::Lists.AsReadOnly(thisNormal_); } - } - public int ThisNormalCount { - get { return thisNormal_.Count; } - } - public float GetThisNormal(int index) { - return thisNormal_[index]; - } - - public const int ImpulseFieldNumber = 6; - private int impulseMemoizedSerializedSize; - private pbc::PopsicleList impulse_ = new pbc::PopsicleList(); - public scg::IList ImpulseList { - get { return pbc::Lists.AsReadOnly(impulse_); } - } - public int ImpulseCount { - get { return impulse_.Count; } - } - public float GetImpulse(int index) { - return impulse_[index]; - } - - public const int OtherObjectReferenceFieldNumber = 7; - private bool hasOtherObjectReference; - private pb::ByteString otherObjectReference_ = pb::ByteString.Empty; - public bool HasOtherObjectReference { - get { return hasOtherObjectReference; } - } - public pb::ByteString OtherObjectReference { - get { return otherObjectReference_; } - } - - public override bool IsInitialized { - get { - return true; - } - } - - public override void WriteTo(pb::CodedOutputStream output) { - if (HasTimestamp) { - output.WriteFixed64(2, Timestamp); - } - if (thisPosition_.Count > 0) { - output.WriteRawVarint32(26); - output.WriteRawVarint32((uint) thisPositionMemoizedSerializedSize); - foreach (double element in thisPosition_) { - output.WriteDoubleNoTag(element); - } - } - if (otherPosition_.Count > 0) { - output.WriteRawVarint32(34); - output.WriteRawVarint32((uint) otherPositionMemoizedSerializedSize); - foreach (double element in otherPosition_) { - output.WriteDoubleNoTag(element); - } - } - if (thisNormal_.Count > 0) { - output.WriteRawVarint32(42); - output.WriteRawVarint32((uint) thisNormalMemoizedSerializedSize); - foreach (float element in thisNormal_) { - output.WriteFloatNoTag(element); - } - } - if (impulse_.Count > 0) { - output.WriteRawVarint32(50); - output.WriteRawVarint32((uint) impulseMemoizedSerializedSize); - foreach (float element in impulse_) { - output.WriteFloatNoTag(element); - } - } - if (HasOtherObjectReference) { - output.WriteBytes(7, OtherObjectReference); - } - UnknownFields.WriteTo(output); - } - - private int memoizedSerializedSize = -1; - public override int SerializedSize { - get { - int size = memoizedSerializedSize; - if (size != -1) return size; - - size = 0; - if (HasTimestamp) { - size += pb::CodedOutputStream.ComputeFixed64Size(2, Timestamp); - } - { - int dataSize = 0; - dataSize = 8 * thisPosition_.Count; - size += dataSize; - if (thisPosition_.Count!=0) size += 1 + pb::CodedOutputStream.ComputeInt32SizeNoTag(dataSize); - thisPositionMemoizedSerializedSize = dataSize; - } - { - int dataSize = 0; - dataSize = 8 * otherPosition_.Count; - size += dataSize; - if (otherPosition_.Count!=0) size += 1 + pb::CodedOutputStream.ComputeInt32SizeNoTag(dataSize); - otherPositionMemoizedSerializedSize = dataSize; - } - { - int dataSize = 0; - dataSize = 4 * thisNormal_.Count; - size += dataSize; - if (thisNormal_.Count!=0) size += 1 + pb::CodedOutputStream.ComputeInt32SizeNoTag(dataSize); - thisNormalMemoizedSerializedSize = dataSize; - } - { - int dataSize = 0; - dataSize = 4 * impulse_.Count; - size += dataSize; - if (impulse_.Count!=0) size += 1 + pb::CodedOutputStream.ComputeInt32SizeNoTag(dataSize); - impulseMemoizedSerializedSize = dataSize; - } - if (HasOtherObjectReference) { - size += pb::CodedOutputStream.ComputeBytesSize(7, OtherObjectReference); - } - size += UnknownFields.SerializedSize; - memoizedSerializedSize = size; - return size; - } - } - - public static CollisionBegin ParseFrom(pb::ByteString data) { - return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); - } - public static CollisionBegin ParseFrom(pb::ByteString data, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); - } - public static CollisionBegin ParseFrom(byte[] data) { - return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); - } - public static CollisionBegin ParseFrom(byte[] data, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); - } - public static CollisionBegin ParseFrom(global::System.IO.Stream input) { - return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); - } - public static CollisionBegin ParseFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); - } - public static CollisionBegin ParseDelimitedFrom(global::System.IO.Stream input) { - return CreateBuilder().MergeDelimitedFrom(input).BuildParsed(); - } - public static CollisionBegin ParseDelimitedFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { - return CreateBuilder().MergeDelimitedFrom(input, extensionRegistry).BuildParsed(); - } - public static CollisionBegin ParseFrom(pb::CodedInputStream input) { - return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); - } - public static CollisionBegin ParseFrom(pb::CodedInputStream input, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); - } - public static Builder CreateBuilder() { return new Builder(); } - public override Builder ToBuilder() { return CreateBuilder(this); } - public override Builder CreateBuilderForType() { return new Builder(); } - public static Builder CreateBuilder(CollisionBegin prototype) { - return (Builder) new Builder().MergeFrom(prototype); - } - - public sealed partial class Builder : pb::GeneratedBuilder { - protected override Builder ThisBuilder { - get { return this; } - } - public Builder() {} - - CollisionBegin result = new CollisionBegin(); - - protected override CollisionBegin MessageBeingBuilt { - get { return result; } - } - - public override Builder Clear() { - result = new CollisionBegin(); - return this; - } - - public override Builder Clone() { - return new Builder().MergeFrom(result); - } - - public override pbd::MessageDescriptor DescriptorForType { - get { return global::Sirikata.Physics.Protocol._PBJ_Internal.CollisionBegin.Descriptor; } - } - - public override CollisionBegin DefaultInstanceForType { - get { return global::Sirikata.Physics.Protocol._PBJ_Internal.CollisionBegin.DefaultInstance; } - } - - public override CollisionBegin BuildPartial() { - if (result == null) { - throw new global::System.InvalidOperationException("build() has already been called on this Builder"); - } - result.thisPosition_.MakeReadOnly(); - result.otherPosition_.MakeReadOnly(); - result.thisNormal_.MakeReadOnly(); - result.impulse_.MakeReadOnly(); - CollisionBegin returnMe = result; - result = null; - return returnMe; - } - - public override Builder MergeFrom(pb::IMessage other) { - if (other is CollisionBegin) { - return MergeFrom((CollisionBegin) other); - } else { - base.MergeFrom(other); - return this; - } - } - - public override Builder MergeFrom(CollisionBegin other) { - if (other == global::Sirikata.Physics.Protocol._PBJ_Internal.CollisionBegin.DefaultInstance) return this; - if (other.HasTimestamp) { - Timestamp = other.Timestamp; - } - if (other.thisPosition_.Count != 0) { - base.AddRange(other.thisPosition_, result.thisPosition_); - } - if (other.otherPosition_.Count != 0) { - base.AddRange(other.otherPosition_, result.otherPosition_); - } - if (other.thisNormal_.Count != 0) { - base.AddRange(other.thisNormal_, result.thisNormal_); - } - if (other.impulse_.Count != 0) { - base.AddRange(other.impulse_, result.impulse_); - } - if (other.HasOtherObjectReference) { - OtherObjectReference = other.OtherObjectReference; - } - this.MergeUnknownFields(other.UnknownFields); - return this; - } - - public override Builder MergeFrom(pb::CodedInputStream input) { - return MergeFrom(input, pb::ExtensionRegistry.Empty); - } - - public override Builder MergeFrom(pb::CodedInputStream input, pb::ExtensionRegistry extensionRegistry) { - pb::UnknownFieldSet.Builder unknownFields = null; - while (true) { - uint tag = input.ReadTag(); - switch (tag) { - case 0: { - if (unknownFields != null) { - this.UnknownFields = unknownFields.Build(); - } - return this; - } - default: { - if (pb::WireFormat.IsEndGroupTag(tag)) { - if (unknownFields != null) { - this.UnknownFields = unknownFields.Build(); - } - return this; - } - if (unknownFields == null) { - unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); - } - ParseUnknownField(input, unknownFields, extensionRegistry, tag); - break; - } - case 17: { - Timestamp = input.ReadFixed64(); - break; - } - case 26: { - int length = input.ReadInt32(); - int limit = input.PushLimit(length); - while (!input.ReachedLimit) { - AddThisPosition(input.ReadDouble()); - } - input.PopLimit(limit); - break; - } - case 34: { - int length = input.ReadInt32(); - int limit = input.PushLimit(length); - while (!input.ReachedLimit) { - AddOtherPosition(input.ReadDouble()); - } - input.PopLimit(limit); - break; - } - case 42: { - int length = input.ReadInt32(); - int limit = input.PushLimit(length); - while (!input.ReachedLimit) { - AddThisNormal(input.ReadFloat()); - } - input.PopLimit(limit); - break; - } - case 50: { - int length = input.ReadInt32(); - int limit = input.PushLimit(length); - while (!input.ReachedLimit) { - AddImpulse(input.ReadFloat()); - } - input.PopLimit(limit); - break; - } - case 58: { - OtherObjectReference = input.ReadBytes(); - break; - } - } - } - } - - - public bool HasTimestamp { - get { return result.HasTimestamp; } - } - [global::System.CLSCompliant(false)] - public ulong Timestamp { - get { return result.Timestamp; } - set { SetTimestamp(value); } - } - [global::System.CLSCompliant(false)] - public Builder SetTimestamp(ulong value) { - result.hasTimestamp = true; - result.timestamp_ = value; - return this; - } - public Builder ClearTimestamp() { - result.hasTimestamp = false; - result.timestamp_ = 0; - return this; - } - - public pbc::IPopsicleList ThisPositionList { - get { return result.thisPosition_; } - } - public int ThisPositionCount { - get { return result.ThisPositionCount; } - } - public double GetThisPosition(int index) { - return result.GetThisPosition(index); - } - public Builder SetThisPosition(int index, double value) { - result.thisPosition_[index] = value; - return this; - } - public Builder AddThisPosition(double value) { - result.thisPosition_.Add(value); - return this; - } - public Builder AddRangeThisPosition(scg::IEnumerable values) { - base.AddRange(values, result.thisPosition_); - return this; - } - public Builder ClearThisPosition() { - result.thisPosition_.Clear(); - return this; - } - - public pbc::IPopsicleList OtherPositionList { - get { return result.otherPosition_; } - } - public int OtherPositionCount { - get { return result.OtherPositionCount; } - } - public double GetOtherPosition(int index) { - return result.GetOtherPosition(index); - } - public Builder SetOtherPosition(int index, double value) { - result.otherPosition_[index] = value; - return this; - } - public Builder AddOtherPosition(double value) { - result.otherPosition_.Add(value); - return this; - } - public Builder AddRangeOtherPosition(scg::IEnumerable values) { - base.AddRange(values, result.otherPosition_); - return this; - } - public Builder ClearOtherPosition() { - result.otherPosition_.Clear(); - return this; - } - - public pbc::IPopsicleList ThisNormalList { - get { return result.thisNormal_; } - } - public int ThisNormalCount { - get { return result.ThisNormalCount; } - } - public float GetThisNormal(int index) { - return result.GetThisNormal(index); - } - public Builder SetThisNormal(int index, float value) { - result.thisNormal_[index] = value; - return this; - } - public Builder AddThisNormal(float value) { - result.thisNormal_.Add(value); - return this; - } - public Builder AddRangeThisNormal(scg::IEnumerable values) { - base.AddRange(values, result.thisNormal_); - return this; - } - public Builder ClearThisNormal() { - result.thisNormal_.Clear(); - return this; - } - - public pbc::IPopsicleList ImpulseList { - get { return result.impulse_; } - } - public int ImpulseCount { - get { return result.ImpulseCount; } - } - public float GetImpulse(int index) { - return result.GetImpulse(index); - } - public Builder SetImpulse(int index, float value) { - result.impulse_[index] = value; - return this; - } - public Builder AddImpulse(float value) { - result.impulse_.Add(value); - return this; - } - public Builder AddRangeImpulse(scg::IEnumerable values) { - base.AddRange(values, result.impulse_); - return this; - } - public Builder ClearImpulse() { - result.impulse_.Clear(); - return this; - } - - public bool HasOtherObjectReference { - get { return result.HasOtherObjectReference; } - } - public pb::ByteString OtherObjectReference { - get { return result.OtherObjectReference; } - set { SetOtherObjectReference(value); } - } - public Builder SetOtherObjectReference(pb::ByteString value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - result.hasOtherObjectReference = true; - result.otherObjectReference_ = value; - return this; - } - public Builder ClearOtherObjectReference() { - result.hasOtherObjectReference = false; - result.otherObjectReference_ = pb::ByteString.Empty; - return this; - } - } - static CollisionBegin() { - object.ReferenceEquals(global::Sirikata.Physics.Protocol._PBJ_Internal.Physics.Descriptor, null); - } - } - - public sealed partial class CollisionEnd : pb::GeneratedMessage { - private static readonly CollisionEnd defaultInstance = new Builder().BuildPartial(); - public static CollisionEnd DefaultInstance { - get { return defaultInstance; } - } - - public override CollisionEnd DefaultInstanceForType { - get { return defaultInstance; } - } - - protected override CollisionEnd ThisMessage { - get { return this; } - } - - public static pbd::MessageDescriptor Descriptor { - get { return global::Sirikata.Physics.Protocol._PBJ_Internal.Physics.internal__static_Sirikata_Physics_Protocol__PBJ_Internal_CollisionEnd__Descriptor; } - } - - protected override pb::FieldAccess.FieldAccessorTable InternalFieldAccessors { - get { return global::Sirikata.Physics.Protocol._PBJ_Internal.Physics.internal__static_Sirikata_Physics_Protocol__PBJ_Internal_CollisionEnd__FieldAccessorTable; } - } - - public const int TimestampFieldNumber = 2; - private bool hasTimestamp; - private ulong timestamp_ = 0; - public bool HasTimestamp { - get { return hasTimestamp; } - } - [global::System.CLSCompliant(false)] - public ulong Timestamp { - get { return timestamp_; } - } - - public const int OtherObjectReferenceFieldNumber = 6; - private bool hasOtherObjectReference; - private pb::ByteString otherObjectReference_ = pb::ByteString.Empty; - public bool HasOtherObjectReference { - get { return hasOtherObjectReference; } - } - public pb::ByteString OtherObjectReference { - get { return otherObjectReference_; } - } - - public override bool IsInitialized { - get { - return true; - } - } - - public override void WriteTo(pb::CodedOutputStream output) { - if (HasTimestamp) { - output.WriteFixed64(2, Timestamp); - } - if (HasOtherObjectReference) { - output.WriteBytes(6, OtherObjectReference); - } - UnknownFields.WriteTo(output); - } - - private int memoizedSerializedSize = -1; - public override int SerializedSize { - get { - int size = memoizedSerializedSize; - if (size != -1) return size; - - size = 0; - if (HasTimestamp) { - size += pb::CodedOutputStream.ComputeFixed64Size(2, Timestamp); - } - if (HasOtherObjectReference) { - size += pb::CodedOutputStream.ComputeBytesSize(6, OtherObjectReference); - } - size += UnknownFields.SerializedSize; - memoizedSerializedSize = size; - return size; - } - } - - public static CollisionEnd ParseFrom(pb::ByteString data) { - return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); - } - public static CollisionEnd ParseFrom(pb::ByteString data, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); - } - public static CollisionEnd ParseFrom(byte[] data) { - return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); - } - public static CollisionEnd ParseFrom(byte[] data, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); - } - public static CollisionEnd ParseFrom(global::System.IO.Stream input) { - return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); - } - public static CollisionEnd ParseFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); - } - public static CollisionEnd ParseDelimitedFrom(global::System.IO.Stream input) { - return CreateBuilder().MergeDelimitedFrom(input).BuildParsed(); - } - public static CollisionEnd ParseDelimitedFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { - return CreateBuilder().MergeDelimitedFrom(input, extensionRegistry).BuildParsed(); - } - public static CollisionEnd ParseFrom(pb::CodedInputStream input) { - return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); - } - public static CollisionEnd ParseFrom(pb::CodedInputStream input, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); - } - public static Builder CreateBuilder() { return new Builder(); } - public override Builder ToBuilder() { return CreateBuilder(this); } - public override Builder CreateBuilderForType() { return new Builder(); } - public static Builder CreateBuilder(CollisionEnd prototype) { - return (Builder) new Builder().MergeFrom(prototype); - } - - public sealed partial class Builder : pb::GeneratedBuilder { - protected override Builder ThisBuilder { - get { return this; } - } - public Builder() {} - - CollisionEnd result = new CollisionEnd(); - - protected override CollisionEnd MessageBeingBuilt { - get { return result; } - } - - public override Builder Clear() { - result = new CollisionEnd(); - return this; - } - - public override Builder Clone() { - return new Builder().MergeFrom(result); - } - - public override pbd::MessageDescriptor DescriptorForType { - get { return global::Sirikata.Physics.Protocol._PBJ_Internal.CollisionEnd.Descriptor; } - } - - public override CollisionEnd DefaultInstanceForType { - get { return global::Sirikata.Physics.Protocol._PBJ_Internal.CollisionEnd.DefaultInstance; } - } - - public override CollisionEnd BuildPartial() { - if (result == null) { - throw new global::System.InvalidOperationException("build() has already been called on this Builder"); - } - CollisionEnd returnMe = result; - result = null; - return returnMe; - } - - public override Builder MergeFrom(pb::IMessage other) { - if (other is CollisionEnd) { - return MergeFrom((CollisionEnd) other); - } else { - base.MergeFrom(other); - return this; - } - } - - public override Builder MergeFrom(CollisionEnd other) { - if (other == global::Sirikata.Physics.Protocol._PBJ_Internal.CollisionEnd.DefaultInstance) return this; - if (other.HasTimestamp) { - Timestamp = other.Timestamp; - } - if (other.HasOtherObjectReference) { - OtherObjectReference = other.OtherObjectReference; - } - this.MergeUnknownFields(other.UnknownFields); - return this; - } - - public override Builder MergeFrom(pb::CodedInputStream input) { - return MergeFrom(input, pb::ExtensionRegistry.Empty); - } - - public override Builder MergeFrom(pb::CodedInputStream input, pb::ExtensionRegistry extensionRegistry) { - pb::UnknownFieldSet.Builder unknownFields = null; - while (true) { - uint tag = input.ReadTag(); - switch (tag) { - case 0: { - if (unknownFields != null) { - this.UnknownFields = unknownFields.Build(); - } - return this; - } - default: { - if (pb::WireFormat.IsEndGroupTag(tag)) { - if (unknownFields != null) { - this.UnknownFields = unknownFields.Build(); - } - return this; - } - if (unknownFields == null) { - unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); - } - ParseUnknownField(input, unknownFields, extensionRegistry, tag); - break; - } - case 17: { - Timestamp = input.ReadFixed64(); - break; - } - case 50: { - OtherObjectReference = input.ReadBytes(); - break; - } - } - } - } - - - public bool HasTimestamp { - get { return result.HasTimestamp; } - } - [global::System.CLSCompliant(false)] - public ulong Timestamp { - get { return result.Timestamp; } - set { SetTimestamp(value); } - } - [global::System.CLSCompliant(false)] - public Builder SetTimestamp(ulong value) { - result.hasTimestamp = true; - result.timestamp_ = value; - return this; - } - public Builder ClearTimestamp() { - result.hasTimestamp = false; - result.timestamp_ = 0; - return this; - } - - public bool HasOtherObjectReference { - get { return result.HasOtherObjectReference; } - } - public pb::ByteString OtherObjectReference { - get { return result.OtherObjectReference; } - set { SetOtherObjectReference(value); } - } - public Builder SetOtherObjectReference(pb::ByteString value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - result.hasOtherObjectReference = true; - result.otherObjectReference_ = value; - return this; - } - public Builder ClearOtherObjectReference() { - result.hasOtherObjectReference = false; - result.otherObjectReference_ = pb::ByteString.Empty; - return this; - } - } - static CollisionEnd() { - object.ReferenceEquals(global::Sirikata.Physics.Protocol._PBJ_Internal.Physics.Descriptor, null); - } - } - - #endregion - -} diff --git a/OpenSim/Client/Sirikata/Protocol/Physics.pbj.cs b/OpenSim/Client/Sirikata/Protocol/Physics.pbj.cs deleted file mode 100644 index 9fb5a28876..0000000000 --- a/OpenSim/Client/Sirikata/Protocol/Physics.pbj.cs +++ /dev/null @@ -1,421 +0,0 @@ -/* - * Copyright (c) Contributors, http://opensimulator.org/ - * See CONTRIBUTORS.TXT for a full list of copyright holders. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * * Neither the name of the OpenSimulator Project nor the - * names of its contributors may be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE DEVELOPERS ``AS IS'' AND ANY - * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED - * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL THE CONTRIBUTORS BE LIABLE FOR ANY - * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES - * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; - * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ - -using pbd = global::Google.ProtocolBuffers.Descriptors; -using pb = global::Google.ProtocolBuffers; -namespace Sirikata.Physics.Protocol { - public class CollisionBegin : PBJ.IMessage { - protected _PBJ_Internal.CollisionBegin super; - public _PBJ_Internal.CollisionBegin _PBJSuper{ get { return super;} } - public CollisionBegin() { - super=new _PBJ_Internal.CollisionBegin(); - } - public CollisionBegin(_PBJ_Internal.CollisionBegin reference) { - super=reference; - } - public static CollisionBegin defaultInstance= new CollisionBegin (_PBJ_Internal.CollisionBegin.DefaultInstance); - public static CollisionBegin DefaultInstance{ - get {return defaultInstance;} - } - public static pbd.MessageDescriptor Descriptor { - get { return _PBJ_Internal.CollisionBegin.Descriptor; } } - public static class Types { - } - public static bool WithinReservedFieldTagRange(int field_tag) { - return false; - } - public static bool WithinExtensionFieldTagRange(int field_tag) { - return false; - } - public const int TimestampFieldTag=2; - public bool HasTimestamp{ get {return super.HasTimestamp&&PBJ._PBJ.ValidateTime(super.Timestamp);} } - public PBJ.Time Timestamp{ get { - if (HasTimestamp) { - return PBJ._PBJ.CastTime(super.Timestamp); - } else { - return PBJ._PBJ.CastTime(); - } - } - } - public const int ThisPositionFieldTag=3; - public int ThisPositionCount { get { return super.ThisPositionCount/3;} } - public bool HasThisPosition(int index) { return true; } - public PBJ.Vector3d GetThisPosition(int index) { - if (HasThisPosition(index)) { - return PBJ._PBJ.CastVector3d(super.GetThisPosition(index*3+0),super.GetThisPosition(index*3+1),super.GetThisPosition(index*3+2)); - } else { - return PBJ._PBJ.CastVector3d(); - } - } - public const int OtherPositionFieldTag=4; - public int OtherPositionCount { get { return super.OtherPositionCount/3;} } - public bool HasOtherPosition(int index) { return true; } - public PBJ.Vector3d GetOtherPosition(int index) { - if (HasOtherPosition(index)) { - return PBJ._PBJ.CastVector3d(super.GetOtherPosition(index*3+0),super.GetOtherPosition(index*3+1),super.GetOtherPosition(index*3+2)); - } else { - return PBJ._PBJ.CastVector3d(); - } - } - public const int ThisNormalFieldTag=5; - public int ThisNormalCount { get { return super.ThisNormalCount/2;} } - public bool HasThisNormal(int index) { return true; } - public PBJ.Vector3f GetThisNormal(int index) { - if (HasThisNormal(index)) { - return PBJ._PBJ.CastNormal(super.GetThisNormal(index*2+0),super.GetThisNormal(index*2+1)); - } else { - return PBJ._PBJ.CastNormal(); - } - } - public const int ImpulseFieldTag=6; - public int ImpulseCount { get { return super.ImpulseCount;} } - public bool HasImpulse(int index) {return PBJ._PBJ.ValidateFloat(super.GetImpulse(index));} - public float Impulse(int index) { - return (float)PBJ._PBJ.CastFloat(super.GetImpulse(index)); - } - public const int OtherObjectReferenceFieldTag=7; - public bool HasOtherObjectReference{ get {return super.HasOtherObjectReference&&PBJ._PBJ.ValidateUuid(super.OtherObjectReference);} } - public PBJ.UUID OtherObjectReference{ get { - if (HasOtherObjectReference) { - return PBJ._PBJ.CastUuid(super.OtherObjectReference); - } else { - return PBJ._PBJ.CastUuid(); - } - } - } - public override Google.ProtocolBuffers.IMessage _PBJISuper { get { return super; } } - public override PBJ.IMessage.IBuilder WeakCreateBuilderForType() { return new Builder(); } - public static Builder CreateBuilder() { return new Builder(); } - public static Builder CreateBuilder(CollisionBegin prototype) { - return (Builder)new Builder().MergeFrom(prototype); - } - public static CollisionBegin ParseFrom(pb::ByteString data) { - return new CollisionBegin(_PBJ_Internal.CollisionBegin.ParseFrom(data)); - } - public static CollisionBegin ParseFrom(pb::ByteString data, pb::ExtensionRegistry er) { - return new CollisionBegin(_PBJ_Internal.CollisionBegin.ParseFrom(data,er)); - } - public static CollisionBegin ParseFrom(byte[] data) { - return new CollisionBegin(_PBJ_Internal.CollisionBegin.ParseFrom(data)); - } - public static CollisionBegin ParseFrom(byte[] data, pb::ExtensionRegistry er) { - return new CollisionBegin(_PBJ_Internal.CollisionBegin.ParseFrom(data,er)); - } - public static CollisionBegin ParseFrom(global::System.IO.Stream data) { - return new CollisionBegin(_PBJ_Internal.CollisionBegin.ParseFrom(data)); - } - public static CollisionBegin ParseFrom(global::System.IO.Stream data, pb::ExtensionRegistry er) { - return new CollisionBegin(_PBJ_Internal.CollisionBegin.ParseFrom(data,er)); - } - public static CollisionBegin ParseFrom(pb::CodedInputStream data) { - return new CollisionBegin(_PBJ_Internal.CollisionBegin.ParseFrom(data)); - } - public static CollisionBegin ParseFrom(pb::CodedInputStream data, pb::ExtensionRegistry er) { - return new CollisionBegin(_PBJ_Internal.CollisionBegin.ParseFrom(data,er)); - } - protected override bool _HasAllPBJFields{ get { - return true - ; - } } - public bool IsInitialized { get { - return super.IsInitialized&&_HasAllPBJFields; - } } - public class Builder : global::PBJ.IMessage.IBuilder{ - protected override bool _HasAllPBJFields{ get { - return true - ; - } } - public bool IsInitialized { get { - return super.IsInitialized&&_HasAllPBJFields; - } } - protected _PBJ_Internal.CollisionBegin.Builder super; - public override Google.ProtocolBuffers.IBuilder _PBJISuper { get { return super; } } - public _PBJ_Internal.CollisionBegin.Builder _PBJSuper{ get { return super;} } - public Builder() {super = new _PBJ_Internal.CollisionBegin.Builder();} - public Builder(_PBJ_Internal.CollisionBegin.Builder other) { - super=other; - } - public Builder Clone() {return new Builder(super.Clone());} - public Builder MergeFrom(CollisionBegin prototype) { super.MergeFrom(prototype._PBJSuper);return this;} - public Builder Clear() {super.Clear();return this;} - public CollisionBegin BuildPartial() {return new CollisionBegin(super.BuildPartial());} - public CollisionBegin Build() {if (_HasAllPBJFields) return new CollisionBegin(super.Build());return null;} - public pbd::MessageDescriptor DescriptorForType { - get { return CollisionBegin.Descriptor; } } - public Builder ClearTimestamp() { super.ClearTimestamp();return this;} - public const int TimestampFieldTag=2; - public bool HasTimestamp{ get {return super.HasTimestamp&&PBJ._PBJ.ValidateTime(super.Timestamp);} } - public PBJ.Time Timestamp{ get { - if (HasTimestamp) { - return PBJ._PBJ.CastTime(super.Timestamp); - } else { - return PBJ._PBJ.CastTime(); - } - } - set { - super.Timestamp=(PBJ._PBJ.Construct(value)); - } - } - public Builder ClearThisPosition() { super.ClearThisPosition();return this;} - public const int ThisPositionFieldTag=3; - public int ThisPositionCount { get { return super.ThisPositionCount/3;} } - public bool HasThisPosition(int index) { return true; } - public PBJ.Vector3d GetThisPosition(int index) { - if (HasThisPosition(index)) { - return PBJ._PBJ.CastVector3d(super.GetThisPosition(index*3+0),super.GetThisPosition(index*3+1),super.GetThisPosition(index*3+2)); - } else { - return PBJ._PBJ.CastVector3d(); - } - } - public Builder AddThisPosition(PBJ.Vector3d value) { - double[] _PBJtempArray=PBJ._PBJ.ConstructVector3d(value); - super.AddThisPosition(_PBJtempArray[0]); - super.AddThisPosition(_PBJtempArray[1]); - super.AddThisPosition(_PBJtempArray[2]); - return this; - } - public Builder SetThisPosition(int index,PBJ.Vector3d value) { - double[] _PBJtempArray=PBJ._PBJ.ConstructVector3d(value); - super.SetThisPosition(index*3+0,_PBJtempArray[0]); - super.SetThisPosition(index*3+1,_PBJtempArray[1]); - super.SetThisPosition(index*3+2,_PBJtempArray[2]); - return this; - } - public Builder ClearOtherPosition() { super.ClearOtherPosition();return this;} - public const int OtherPositionFieldTag=4; - public int OtherPositionCount { get { return super.OtherPositionCount/3;} } - public bool HasOtherPosition(int index) { return true; } - public PBJ.Vector3d GetOtherPosition(int index) { - if (HasOtherPosition(index)) { - return PBJ._PBJ.CastVector3d(super.GetOtherPosition(index*3+0),super.GetOtherPosition(index*3+1),super.GetOtherPosition(index*3+2)); - } else { - return PBJ._PBJ.CastVector3d(); - } - } - public Builder AddOtherPosition(PBJ.Vector3d value) { - double[] _PBJtempArray=PBJ._PBJ.ConstructVector3d(value); - super.AddOtherPosition(_PBJtempArray[0]); - super.AddOtherPosition(_PBJtempArray[1]); - super.AddOtherPosition(_PBJtempArray[2]); - return this; - } - public Builder SetOtherPosition(int index,PBJ.Vector3d value) { - double[] _PBJtempArray=PBJ._PBJ.ConstructVector3d(value); - super.SetOtherPosition(index*3+0,_PBJtempArray[0]); - super.SetOtherPosition(index*3+1,_PBJtempArray[1]); - super.SetOtherPosition(index*3+2,_PBJtempArray[2]); - return this; - } - public Builder ClearThisNormal() { super.ClearThisNormal();return this;} - public const int ThisNormalFieldTag=5; - public int ThisNormalCount { get { return super.ThisNormalCount/2;} } - public bool HasThisNormal(int index) { return true; } - public PBJ.Vector3f GetThisNormal(int index) { - if (HasThisNormal(index)) { - return PBJ._PBJ.CastNormal(super.GetThisNormal(index*2+0),super.GetThisNormal(index*2+1)); - } else { - return PBJ._PBJ.CastNormal(); - } - } - public Builder AddThisNormal(PBJ.Vector3f value) { - float[] _PBJtempArray=PBJ._PBJ.ConstructNormal(value); - super.AddThisNormal(_PBJtempArray[0]); - super.AddThisNormal(_PBJtempArray[1]); - return this; - } - public Builder SetThisNormal(int index,PBJ.Vector3f value) { - float[] _PBJtempArray=PBJ._PBJ.ConstructNormal(value); - super.SetThisNormal(index*2+0,_PBJtempArray[0]); - super.SetThisNormal(index*2+1,_PBJtempArray[1]); - return this; - } - public Builder ClearImpulse() { super.ClearImpulse();return this;} - public Builder SetImpulse(int index, float value) { - super.SetImpulse(index,PBJ._PBJ.Construct(value)); - return this; - } - public const int ImpulseFieldTag=6; - public int ImpulseCount { get { return super.ImpulseCount;} } - public bool HasImpulse(int index) {return PBJ._PBJ.ValidateFloat(super.GetImpulse(index));} - public float Impulse(int index) { - return (float)PBJ._PBJ.CastFloat(super.GetImpulse(index)); - } - public Builder AddImpulse(float value) { - super.AddImpulse(PBJ._PBJ.Construct(value)); - return this; - } - public Builder ClearOtherObjectReference() { super.ClearOtherObjectReference();return this;} - public const int OtherObjectReferenceFieldTag=7; - public bool HasOtherObjectReference{ get {return super.HasOtherObjectReference&&PBJ._PBJ.ValidateUuid(super.OtherObjectReference);} } - public PBJ.UUID OtherObjectReference{ get { - if (HasOtherObjectReference) { - return PBJ._PBJ.CastUuid(super.OtherObjectReference); - } else { - return PBJ._PBJ.CastUuid(); - } - } - set { - super.OtherObjectReference=(PBJ._PBJ.Construct(value)); - } - } - } - } -} -namespace Sirikata.Physics.Protocol { - public class CollisionEnd : PBJ.IMessage { - protected _PBJ_Internal.CollisionEnd super; - public _PBJ_Internal.CollisionEnd _PBJSuper{ get { return super;} } - public CollisionEnd() { - super=new _PBJ_Internal.CollisionEnd(); - } - public CollisionEnd(_PBJ_Internal.CollisionEnd reference) { - super=reference; - } - public static CollisionEnd defaultInstance= new CollisionEnd (_PBJ_Internal.CollisionEnd.DefaultInstance); - public static CollisionEnd DefaultInstance{ - get {return defaultInstance;} - } - public static pbd.MessageDescriptor Descriptor { - get { return _PBJ_Internal.CollisionEnd.Descriptor; } } - public static class Types { - } - public static bool WithinReservedFieldTagRange(int field_tag) { - return false; - } - public static bool WithinExtensionFieldTagRange(int field_tag) { - return false; - } - public const int TimestampFieldTag=2; - public bool HasTimestamp{ get {return super.HasTimestamp&&PBJ._PBJ.ValidateTime(super.Timestamp);} } - public PBJ.Time Timestamp{ get { - if (HasTimestamp) { - return PBJ._PBJ.CastTime(super.Timestamp); - } else { - return PBJ._PBJ.CastTime(); - } - } - } - public const int OtherObjectReferenceFieldTag=6; - public bool HasOtherObjectReference{ get {return super.HasOtherObjectReference&&PBJ._PBJ.ValidateUuid(super.OtherObjectReference);} } - public PBJ.UUID OtherObjectReference{ get { - if (HasOtherObjectReference) { - return PBJ._PBJ.CastUuid(super.OtherObjectReference); - } else { - return PBJ._PBJ.CastUuid(); - } - } - } - public override Google.ProtocolBuffers.IMessage _PBJISuper { get { return super; } } - public override PBJ.IMessage.IBuilder WeakCreateBuilderForType() { return new Builder(); } - public static Builder CreateBuilder() { return new Builder(); } - public static Builder CreateBuilder(CollisionEnd prototype) { - return (Builder)new Builder().MergeFrom(prototype); - } - public static CollisionEnd ParseFrom(pb::ByteString data) { - return new CollisionEnd(_PBJ_Internal.CollisionEnd.ParseFrom(data)); - } - public static CollisionEnd ParseFrom(pb::ByteString data, pb::ExtensionRegistry er) { - return new CollisionEnd(_PBJ_Internal.CollisionEnd.ParseFrom(data,er)); - } - public static CollisionEnd ParseFrom(byte[] data) { - return new CollisionEnd(_PBJ_Internal.CollisionEnd.ParseFrom(data)); - } - public static CollisionEnd ParseFrom(byte[] data, pb::ExtensionRegistry er) { - return new CollisionEnd(_PBJ_Internal.CollisionEnd.ParseFrom(data,er)); - } - public static CollisionEnd ParseFrom(global::System.IO.Stream data) { - return new CollisionEnd(_PBJ_Internal.CollisionEnd.ParseFrom(data)); - } - public static CollisionEnd ParseFrom(global::System.IO.Stream data, pb::ExtensionRegistry er) { - return new CollisionEnd(_PBJ_Internal.CollisionEnd.ParseFrom(data,er)); - } - public static CollisionEnd ParseFrom(pb::CodedInputStream data) { - return new CollisionEnd(_PBJ_Internal.CollisionEnd.ParseFrom(data)); - } - public static CollisionEnd ParseFrom(pb::CodedInputStream data, pb::ExtensionRegistry er) { - return new CollisionEnd(_PBJ_Internal.CollisionEnd.ParseFrom(data,er)); - } - protected override bool _HasAllPBJFields{ get { - return true - ; - } } - public bool IsInitialized { get { - return super.IsInitialized&&_HasAllPBJFields; - } } - public class Builder : global::PBJ.IMessage.IBuilder{ - protected override bool _HasAllPBJFields{ get { - return true - ; - } } - public bool IsInitialized { get { - return super.IsInitialized&&_HasAllPBJFields; - } } - protected _PBJ_Internal.CollisionEnd.Builder super; - public override Google.ProtocolBuffers.IBuilder _PBJISuper { get { return super; } } - public _PBJ_Internal.CollisionEnd.Builder _PBJSuper{ get { return super;} } - public Builder() {super = new _PBJ_Internal.CollisionEnd.Builder();} - public Builder(_PBJ_Internal.CollisionEnd.Builder other) { - super=other; - } - public Builder Clone() {return new Builder(super.Clone());} - public Builder MergeFrom(CollisionEnd prototype) { super.MergeFrom(prototype._PBJSuper);return this;} - public Builder Clear() {super.Clear();return this;} - public CollisionEnd BuildPartial() {return new CollisionEnd(super.BuildPartial());} - public CollisionEnd Build() {if (_HasAllPBJFields) return new CollisionEnd(super.Build());return null;} - public pbd::MessageDescriptor DescriptorForType { - get { return CollisionEnd.Descriptor; } } - public Builder ClearTimestamp() { super.ClearTimestamp();return this;} - public const int TimestampFieldTag=2; - public bool HasTimestamp{ get {return super.HasTimestamp&&PBJ._PBJ.ValidateTime(super.Timestamp);} } - public PBJ.Time Timestamp{ get { - if (HasTimestamp) { - return PBJ._PBJ.CastTime(super.Timestamp); - } else { - return PBJ._PBJ.CastTime(); - } - } - set { - super.Timestamp=(PBJ._PBJ.Construct(value)); - } - } - public Builder ClearOtherObjectReference() { super.ClearOtherObjectReference();return this;} - public const int OtherObjectReferenceFieldTag=6; - public bool HasOtherObjectReference{ get {return super.HasOtherObjectReference&&PBJ._PBJ.ValidateUuid(super.OtherObjectReference);} } - public PBJ.UUID OtherObjectReference{ get { - if (HasOtherObjectReference) { - return PBJ._PBJ.CastUuid(super.OtherObjectReference); - } else { - return PBJ._PBJ.CastUuid(); - } - } - set { - super.OtherObjectReference=(PBJ._PBJ.Construct(value)); - } - } - } - } -} diff --git a/OpenSim/Client/Sirikata/Protocol/Sirikata.cs b/OpenSim/Client/Sirikata/Protocol/Sirikata.cs deleted file mode 100644 index 928308626f..0000000000 --- a/OpenSim/Client/Sirikata/Protocol/Sirikata.cs +++ /dev/null @@ -1,8074 +0,0 @@ -// Generated by the protocol buffer compiler. DO NOT EDIT! - -using pb = global::Google.ProtocolBuffers; -using pbc = global::Google.ProtocolBuffers.Collections; -using pbd = global::Google.ProtocolBuffers.Descriptors; -using scg = global::System.Collections.Generic; -namespace Sirikata.Protocol._PBJ_Internal { - - public static partial class Sirikata { - - #region Extension registration - public static void RegisterAllExtensions(pb::ExtensionRegistry registry) { - } - #endregion - #region Static variables - internal static pbd::MessageDescriptor internal__static_Sirikata_Protocol__PBJ_Internal_MessageBody__Descriptor; - internal static pb::FieldAccess.FieldAccessorTable internal__static_Sirikata_Protocol__PBJ_Internal_MessageBody__FieldAccessorTable; - internal static pbd::MessageDescriptor internal__static_Sirikata_Protocol__PBJ_Internal_ReadOnlyMessage__Descriptor; - internal static pb::FieldAccess.FieldAccessorTable internal__static_Sirikata_Protocol__PBJ_Internal_ReadOnlyMessage__FieldAccessorTable; - internal static pbd::MessageDescriptor internal__static_Sirikata_Protocol__PBJ_Internal_SpaceServices__Descriptor; - internal static pb::FieldAccess.FieldAccessorTable internal__static_Sirikata_Protocol__PBJ_Internal_SpaceServices__FieldAccessorTable; - internal static pbd::MessageDescriptor internal__static_Sirikata_Protocol__PBJ_Internal_ObjLoc__Descriptor; - internal static pb::FieldAccess.FieldAccessorTable internal__static_Sirikata_Protocol__PBJ_Internal_ObjLoc__FieldAccessorTable; - internal static pbd::MessageDescriptor internal__static_Sirikata_Protocol__PBJ_Internal_LocRequest__Descriptor; - internal static pb::FieldAccess.FieldAccessorTable internal__static_Sirikata_Protocol__PBJ_Internal_LocRequest__FieldAccessorTable; - internal static pbd::MessageDescriptor internal__static_Sirikata_Protocol__PBJ_Internal_NewObj__Descriptor; - internal static pb::FieldAccess.FieldAccessorTable internal__static_Sirikata_Protocol__PBJ_Internal_NewObj__FieldAccessorTable; - internal static pbd::MessageDescriptor internal__static_Sirikata_Protocol__PBJ_Internal_RetObj__Descriptor; - internal static pb::FieldAccess.FieldAccessorTable internal__static_Sirikata_Protocol__PBJ_Internal_RetObj__FieldAccessorTable; - internal static pbd::MessageDescriptor internal__static_Sirikata_Protocol__PBJ_Internal_DelObj__Descriptor; - internal static pb::FieldAccess.FieldAccessorTable internal__static_Sirikata_Protocol__PBJ_Internal_DelObj__FieldAccessorTable; - internal static pbd::MessageDescriptor internal__static_Sirikata_Protocol__PBJ_Internal_NewProxQuery__Descriptor; - internal static pb::FieldAccess.FieldAccessorTable internal__static_Sirikata_Protocol__PBJ_Internal_NewProxQuery__FieldAccessorTable; - internal static pbd::MessageDescriptor internal__static_Sirikata_Protocol__PBJ_Internal_ProxCall__Descriptor; - internal static pb::FieldAccess.FieldAccessorTable internal__static_Sirikata_Protocol__PBJ_Internal_ProxCall__FieldAccessorTable; - internal static pbd::MessageDescriptor internal__static_Sirikata_Protocol__PBJ_Internal_DelProxQuery__Descriptor; - internal static pb::FieldAccess.FieldAccessorTable internal__static_Sirikata_Protocol__PBJ_Internal_DelProxQuery__FieldAccessorTable; - internal static pbd::MessageDescriptor internal__static_Sirikata_Protocol__PBJ_Internal_Vector3fProperty__Descriptor; - internal static pb::FieldAccess.FieldAccessorTable internal__static_Sirikata_Protocol__PBJ_Internal_Vector3fProperty__FieldAccessorTable; - internal static pbd::MessageDescriptor internal__static_Sirikata_Protocol__PBJ_Internal_StringProperty__Descriptor; - internal static pb::FieldAccess.FieldAccessorTable internal__static_Sirikata_Protocol__PBJ_Internal_StringProperty__FieldAccessorTable; - internal static pbd::MessageDescriptor internal__static_Sirikata_Protocol__PBJ_Internal_StringMapProperty__Descriptor; - internal static pb::FieldAccess.FieldAccessorTable internal__static_Sirikata_Protocol__PBJ_Internal_StringMapProperty__FieldAccessorTable; - internal static pbd::MessageDescriptor internal__static_Sirikata_Protocol__PBJ_Internal_PhysicalParameters__Descriptor; - internal static pb::FieldAccess.FieldAccessorTable internal__static_Sirikata_Protocol__PBJ_Internal_PhysicalParameters__FieldAccessorTable; - internal static pbd::MessageDescriptor internal__static_Sirikata_Protocol__PBJ_Internal_LightInfoProperty__Descriptor; - internal static pb::FieldAccess.FieldAccessorTable internal__static_Sirikata_Protocol__PBJ_Internal_LightInfoProperty__FieldAccessorTable; - internal static pbd::MessageDescriptor internal__static_Sirikata_Protocol__PBJ_Internal_ParentProperty__Descriptor; - internal static pb::FieldAccess.FieldAccessorTable internal__static_Sirikata_Protocol__PBJ_Internal_ParentProperty__FieldAccessorTable; - internal static pbd::MessageDescriptor internal__static_Sirikata_Protocol__PBJ_Internal_UUIDListProperty__Descriptor; - internal static pb::FieldAccess.FieldAccessorTable internal__static_Sirikata_Protocol__PBJ_Internal_UUIDListProperty__FieldAccessorTable; - internal static pbd::MessageDescriptor internal__static_Sirikata_Protocol__PBJ_Internal_ConnectToSpace__Descriptor; - internal static pb::FieldAccess.FieldAccessorTable internal__static_Sirikata_Protocol__PBJ_Internal_ConnectToSpace__FieldAccessorTable; - internal static pbd::MessageDescriptor internal__static_Sirikata_Protocol__PBJ_Internal_CreateObject__Descriptor; - internal static pb::FieldAccess.FieldAccessorTable internal__static_Sirikata_Protocol__PBJ_Internal_CreateObject__FieldAccessorTable; - #endregion - #region Descriptor - public static pbd::FileDescriptor Descriptor { - get { return descriptor; } - } - private static pbd::FileDescriptor descriptor; - - static Sirikata() { - byte[] descriptorData = global::System.Convert.FromBase64String( - "Cg5TaXJpa2F0YS5wcm90bxIfU2lyaWthdGEuUHJvdG9jb2wuX1BCSl9JbnRl" + - "cm5hbCI/CgtNZXNzYWdlQm9keRIVCg1tZXNzYWdlX25hbWVzGAkgAygJEhkK" + - "EW1lc3NhZ2VfYXJndW1lbnRzGAogAygMIroDCg9SZWFkT25seU1lc3NhZ2US" + - "FQoNc291cmNlX29iamVjdBgBIAEoDBITCgtzb3VyY2VfcG9ydBgDIAEoDRIV" + - "Cgxzb3VyY2Vfc3BhY2UYgAwgASgMEhoKEmRlc3RpbmF0aW9uX29iamVjdBgC" + - "IAEoDBIYChBkZXN0aW5hdGlvbl9wb3J0GAQgASgNEhoKEWRlc3RpbmF0aW9u" + - "X3NwYWNlGIEMIAEoDBIKCgJpZBgHIAEoAxIQCghyZXBseV9pZBgIIAEoAxJV" + - "Cg1yZXR1cm5fc3RhdHVzGIAOIAEoDjI9LlNpcmlrYXRhLlByb3RvY29sLl9Q" + - "QkpfSW50ZXJuYWwuUmVhZE9ubHlNZXNzYWdlLlJldHVyblN0YXR1cxIVCg1t" + - "ZXNzYWdlX25hbWVzGAkgAygJEhkKEW1lc3NhZ2VfYXJndW1lbnRzGAogAygM" + - "ImsKDFJldHVyblN0YXR1cxILCgdTVUNDRVNTEAASEwoPTkVUV09SS19GQUlM" + - "VVJFEAESEwoPVElNRU9VVF9GQUlMVVJFEAMSEgoOUFJPVE9DT0xfRVJST1IQ" + - "BBIQCgxQT1JUX0ZBSUxVUkUQBSLOAQoNU3BhY2VTZXJ2aWNlcxIZChFyZWdp" + - "c3RyYXRpb25fcG9ydBghIAEoDRIQCghsb2NfcG9ydBgiIAEoDRIRCglnZW9t" + - "X3BvcnQYIyABKA0SEQoJb3NlZ19wb3J0GCQgASgNEhEKCWNzZWdfcG9ydBgl" + - "IAEoDRITCgtyb3V0ZXJfcG9ydBgmIAEoDRIdChVwcmVfY29ubmVjdGlvbl9i" + - "dWZmZXIYQCABKAQSIwobbWF4X3ByZV9jb25uZWN0aW9uX21lc3NhZ2VzGEEg" + - "ASgEIsQBCgZPYmpMb2MSEQoJdGltZXN0YW1wGAIgASgGEhQKCHBvc2l0aW9u" + - "GAMgAygBQgIQARIXCgtvcmllbnRhdGlvbhgEIAMoAkICEAESFAoIdmVsb2Np" + - "dHkYBSADKAJCAhABEhsKD3JvdGF0aW9uYWxfYXhpcxgHIAMoAkICEAESFQoN" + - "YW5ndWxhcl9zcGVlZBgIIAEoAhIUCgx1cGRhdGVfZmxhZ3MYBiABKA0iGAoL" + - "VXBkYXRlRmxhZ3MSCQoFRk9SQ0UQASKFAQoKTG9jUmVxdWVzdBIYChByZXF1" + - "ZXN0ZWRfZmllbGRzGAIgASgNIl0KBkZpZWxkcxIMCghQT1NJVElPThABEg8K" + - "C09SSUVOVEFUSU9OEAISDAoIVkVMT0NJVFkQBBITCg9ST1RBVElPTkFMX0FY" + - "SVMQCBIRCg1BTkdVTEFSX1NQRUVEEBAiigEKBk5ld09iahIcChRvYmplY3Rf" + - "dXVpZF9ldmlkZW5jZRgCIAEoDBJFChRyZXF1ZXN0ZWRfb2JqZWN0X2xvYxgD" + - "IAEoCzInLlNpcmlrYXRhLlByb3RvY29sLl9QQkpfSW50ZXJuYWwuT2JqTG9j" + - "EhsKD2JvdW5kaW5nX3NwaGVyZRgEIAMoAkICEAEiegoGUmV0T2JqEhgKEG9i" + - "amVjdF9yZWZlcmVuY2UYAiABKAwSOQoIbG9jYXRpb24YAyABKAsyJy5TaXJp" + - "a2F0YS5Qcm90b2NvbC5fUEJKX0ludGVybmFsLk9iakxvYxIbCg9ib3VuZGlu" + - "Z19zcGhlcmUYBCADKAJCAhABIiIKBkRlbE9iahIYChBvYmplY3RfcmVmZXJl" + - "bmNlGAIgASgMIpoBCgxOZXdQcm94UXVlcnkSEAoIcXVlcnlfaWQYAiABKA0S" + - "EQoJc3RhdGVsZXNzGAMgASgIEhsKD3JlbGF0aXZlX2NlbnRlchgEIAMoAkIC" + - "EAESGwoPYWJzb2x1dGVfY2VudGVyGAUgAygBQgIQARISCgptYXhfcmFkaXVz" + - "GAYgASgCEhcKD21pbl9zb2xpZF9hbmdsZRgHIAEoAiLhAQoIUHJveENhbGwS" + - "EAoIcXVlcnlfaWQYAiACKA0SGAoQcHJveGltYXRlX29iamVjdBgDIAIoDBJR" + - "Cg9wcm94aW1pdHlfZXZlbnQYBCACKA4yOC5TaXJpa2F0YS5Qcm90b2NvbC5f" + - "UEJKX0ludGVybmFsLlByb3hDYWxsLlByb3hpbWl0eUV2ZW50IlYKDlByb3hp" + - "bWl0eUV2ZW50EhQKEEVYSVRFRF9QUk9YSU1JVFkQABIVChFFTlRFUkVEX1BS" + - "T1hJTUlUWRABEhcKE1NUQVRFTEVTU19QUk9YSU1JVFkQAiIgCgxEZWxQcm94" + - "UXVlcnkSEAoIcXVlcnlfaWQYAiABKA0iJQoQVmVjdG9yM2ZQcm9wZXJ0eRIR" + - "CgV2YWx1ZRgKIAMoAkICEAEiHwoOU3RyaW5nUHJvcGVydHkSDQoFdmFsdWUY" + - "CiABKAkiMQoRU3RyaW5nTWFwUHJvcGVydHkSDAoEa2V5cxgCIAMoCRIOCgZ2" + - "YWx1ZXMYAyADKAkiyQIKElBoeXNpY2FsUGFyYW1ldGVycxJGCgRtb2RlGAIg" + - "ASgOMjguU2lyaWthdGEuUHJvdG9jb2wuX1BCSl9JbnRlcm5hbC5QaHlzaWNh" + - "bFBhcmFtZXRlcnMuTW9kZRIPCgdkZW5zaXR5GAMgASgCEhAKCGZyaWN0aW9u" + - "GAQgASgCEg4KBmJvdW5jZRgFIAEoAhIQCgRodWxsGAYgAygCQgIQARITCgtj" + - "b2xsaWRlX21zZxgQIAEoDRIUCgxjb2xsaWRlX21hc2sYESABKA0SDwoHZ3Jh" + - "dml0eRgSIAEoAiJqCgRNb2RlEg8KC05PTlBIWVNJQ0FMEAASCgoGU1RBVElD" + - "EAESDgoKRFlOQU1JQ0JPWBACEhEKDURZTkFNSUNTUEhFUkUQAxITCg9EWU5B" + - "TUlDQ1lMSU5ERVIQBBINCglDSEFSQUNURVIQBSLaAwoRTGlnaHRJbmZvUHJv" + - "cGVydHkSGQoNZGlmZnVzZV9jb2xvchgDIAMoAkICEAESGgoOc3BlY3VsYXJf" + - "Y29sb3IYBCADKAJCAhABEg0KBXBvd2VyGAUgASgCEhkKDWFtYmllbnRfY29s" + - "b3IYBiADKAJCAhABEhgKDHNoYWRvd19jb2xvchgHIAMoAkICEAESEwoLbGln" + - "aHRfcmFuZ2UYCCABKAESGAoQY29uc3RhbnRfZmFsbG9mZhgJIAEoAhIWCg5s" + - "aW5lYXJfZmFsbG9mZhgKIAEoAhIZChFxdWFkcmF0aWNfZmFsbG9mZhgLIAEo" + - "AhIaChJjb25lX2lubmVyX3JhZGlhbnMYDCABKAISGgoSY29uZV9vdXRlcl9y" + - "YWRpYW5zGA0gASgCEhQKDGNvbmVfZmFsbG9mZhgOIAEoAhJLCgR0eXBlGA8g" + - "ASgOMj0uU2lyaWthdGEuUHJvdG9jb2wuX1BCSl9JbnRlcm5hbC5MaWdodElu" + - "Zm9Qcm9wZXJ0eS5MaWdodFR5cGVzEhQKDGNhc3RzX3NoYWRvdxgQIAEoCCI3" + - "CgpMaWdodFR5cGVzEgkKBVBPSU5UEAASDQoJU1BPVExJR0hUEAESDwoLRElS" + - "RUNUSU9OQUwQAiIfCg5QYXJlbnRQcm9wZXJ0eRINCgV2YWx1ZRgKIAEoDCIh" + - "ChBVVUlETGlzdFByb3BlcnR5Eg0KBXZhbHVlGAogAygMIqQBCg5Db25uZWN0" + - "VG9TcGFjZRIQCghzcGFjZV9pZBgBIAEoDBIcChRvYmplY3RfdXVpZF9ldmlk" + - "ZW5jZRgCIAEoDBJFChRyZXF1ZXN0ZWRfb2JqZWN0X2xvYxgDIAEoCzInLlNp" + - "cmlrYXRhLlByb3RvY29sLl9QQkpfSW50ZXJuYWwuT2JqTG9jEhsKD2JvdW5k" + - "aW5nX3NwaGVyZRgEIAMoAkICEAEivgIKDENyZWF0ZU9iamVjdBITCgtvYmpl" + - "Y3RfdXVpZBgBIAEoDBJJChBzcGFjZV9wcm9wZXJ0aWVzGAIgAygLMi8uU2ly" + - "aWthdGEuUHJvdG9jb2wuX1BCSl9JbnRlcm5hbC5Db25uZWN0VG9TcGFjZRIM" + - "CgRtZXNoGAMgASgJEhEKBXNjYWxlGAQgAygCQgIQARIOCgZ3ZWJ1cmwYBSAB" + - "KAkSRgoKbGlnaHRfaW5mbxgGIAEoCzIyLlNpcmlrYXRhLlByb3RvY29sLl9Q" + - "QkpfSW50ZXJuYWwuTGlnaHRJbmZvUHJvcGVydHkSDgoGY2FtZXJhGAcgASgI" + - "EkUKCHBoeXNpY2FsGAggASgLMjMuU2lyaWthdGEuUHJvdG9jb2wuX1BCSl9J" + - "bnRlcm5hbC5QaHlzaWNhbFBhcmFtZXRlcnM="); - pbd::FileDescriptor.InternalDescriptorAssigner assigner = delegate(pbd::FileDescriptor root) { - descriptor = root; - internal__static_Sirikata_Protocol__PBJ_Internal_MessageBody__Descriptor = Descriptor.MessageTypes[0]; - internal__static_Sirikata_Protocol__PBJ_Internal_MessageBody__FieldAccessorTable = - new pb::FieldAccess.FieldAccessorTable(internal__static_Sirikata_Protocol__PBJ_Internal_MessageBody__Descriptor, - new string[] { "MessageNames", "MessageArguments", }); - internal__static_Sirikata_Protocol__PBJ_Internal_ReadOnlyMessage__Descriptor = Descriptor.MessageTypes[1]; - internal__static_Sirikata_Protocol__PBJ_Internal_ReadOnlyMessage__FieldAccessorTable = - new pb::FieldAccess.FieldAccessorTable(internal__static_Sirikata_Protocol__PBJ_Internal_ReadOnlyMessage__Descriptor, - new string[] { "SourceObject", "SourcePort", "SourceSpace", "DestinationObject", "DestinationPort", "DestinationSpace", "Id", "ReplyId", "ReturnStatus", "MessageNames", "MessageArguments", }); - internal__static_Sirikata_Protocol__PBJ_Internal_SpaceServices__Descriptor = Descriptor.MessageTypes[2]; - internal__static_Sirikata_Protocol__PBJ_Internal_SpaceServices__FieldAccessorTable = - new pb::FieldAccess.FieldAccessorTable(internal__static_Sirikata_Protocol__PBJ_Internal_SpaceServices__Descriptor, - new string[] { "RegistrationPort", "LocPort", "GeomPort", "OsegPort", "CsegPort", "RouterPort", "PreConnectionBuffer", "MaxPreConnectionMessages", }); - internal__static_Sirikata_Protocol__PBJ_Internal_ObjLoc__Descriptor = Descriptor.MessageTypes[3]; - internal__static_Sirikata_Protocol__PBJ_Internal_ObjLoc__FieldAccessorTable = - new pb::FieldAccess.FieldAccessorTable(internal__static_Sirikata_Protocol__PBJ_Internal_ObjLoc__Descriptor, - new string[] { "Timestamp", "Position", "Orientation", "Velocity", "RotationalAxis", "AngularSpeed", "UpdateFlags", }); - internal__static_Sirikata_Protocol__PBJ_Internal_LocRequest__Descriptor = Descriptor.MessageTypes[4]; - internal__static_Sirikata_Protocol__PBJ_Internal_LocRequest__FieldAccessorTable = - new pb::FieldAccess.FieldAccessorTable(internal__static_Sirikata_Protocol__PBJ_Internal_LocRequest__Descriptor, - new string[] { "RequestedFields", }); - internal__static_Sirikata_Protocol__PBJ_Internal_NewObj__Descriptor = Descriptor.MessageTypes[5]; - internal__static_Sirikata_Protocol__PBJ_Internal_NewObj__FieldAccessorTable = - new pb::FieldAccess.FieldAccessorTable(internal__static_Sirikata_Protocol__PBJ_Internal_NewObj__Descriptor, - new string[] { "ObjectUuidEvidence", "RequestedObjectLoc", "BoundingSphere", }); - internal__static_Sirikata_Protocol__PBJ_Internal_RetObj__Descriptor = Descriptor.MessageTypes[6]; - internal__static_Sirikata_Protocol__PBJ_Internal_RetObj__FieldAccessorTable = - new pb::FieldAccess.FieldAccessorTable(internal__static_Sirikata_Protocol__PBJ_Internal_RetObj__Descriptor, - new string[] { "ObjectReference", "Location", "BoundingSphere", }); - internal__static_Sirikata_Protocol__PBJ_Internal_DelObj__Descriptor = Descriptor.MessageTypes[7]; - internal__static_Sirikata_Protocol__PBJ_Internal_DelObj__FieldAccessorTable = - new pb::FieldAccess.FieldAccessorTable(internal__static_Sirikata_Protocol__PBJ_Internal_DelObj__Descriptor, - new string[] { "ObjectReference", }); - internal__static_Sirikata_Protocol__PBJ_Internal_NewProxQuery__Descriptor = Descriptor.MessageTypes[8]; - internal__static_Sirikata_Protocol__PBJ_Internal_NewProxQuery__FieldAccessorTable = - new pb::FieldAccess.FieldAccessorTable(internal__static_Sirikata_Protocol__PBJ_Internal_NewProxQuery__Descriptor, - new string[] { "QueryId", "Stateless", "RelativeCenter", "AbsoluteCenter", "MaxRadius", "MinSolidAngle", }); - internal__static_Sirikata_Protocol__PBJ_Internal_ProxCall__Descriptor = Descriptor.MessageTypes[9]; - internal__static_Sirikata_Protocol__PBJ_Internal_ProxCall__FieldAccessorTable = - new pb::FieldAccess.FieldAccessorTable(internal__static_Sirikata_Protocol__PBJ_Internal_ProxCall__Descriptor, - new string[] { "QueryId", "ProximateObject", "ProximityEvent", }); - internal__static_Sirikata_Protocol__PBJ_Internal_DelProxQuery__Descriptor = Descriptor.MessageTypes[10]; - internal__static_Sirikata_Protocol__PBJ_Internal_DelProxQuery__FieldAccessorTable = - new pb::FieldAccess.FieldAccessorTable(internal__static_Sirikata_Protocol__PBJ_Internal_DelProxQuery__Descriptor, - new string[] { "QueryId", }); - internal__static_Sirikata_Protocol__PBJ_Internal_Vector3fProperty__Descriptor = Descriptor.MessageTypes[11]; - internal__static_Sirikata_Protocol__PBJ_Internal_Vector3fProperty__FieldAccessorTable = - new pb::FieldAccess.FieldAccessorTable(internal__static_Sirikata_Protocol__PBJ_Internal_Vector3fProperty__Descriptor, - new string[] { "Value", }); - internal__static_Sirikata_Protocol__PBJ_Internal_StringProperty__Descriptor = Descriptor.MessageTypes[12]; - internal__static_Sirikata_Protocol__PBJ_Internal_StringProperty__FieldAccessorTable = - new pb::FieldAccess.FieldAccessorTable(internal__static_Sirikata_Protocol__PBJ_Internal_StringProperty__Descriptor, - new string[] { "Value", }); - internal__static_Sirikata_Protocol__PBJ_Internal_StringMapProperty__Descriptor = Descriptor.MessageTypes[13]; - internal__static_Sirikata_Protocol__PBJ_Internal_StringMapProperty__FieldAccessorTable = - new pb::FieldAccess.FieldAccessorTable(internal__static_Sirikata_Protocol__PBJ_Internal_StringMapProperty__Descriptor, - new string[] { "Keys", "Values", }); - internal__static_Sirikata_Protocol__PBJ_Internal_PhysicalParameters__Descriptor = Descriptor.MessageTypes[14]; - internal__static_Sirikata_Protocol__PBJ_Internal_PhysicalParameters__FieldAccessorTable = - new pb::FieldAccess.FieldAccessorTable(internal__static_Sirikata_Protocol__PBJ_Internal_PhysicalParameters__Descriptor, - new string[] { "Mode", "Density", "Friction", "Bounce", "Hull", "CollideMsg", "CollideMask", "Gravity", }); - internal__static_Sirikata_Protocol__PBJ_Internal_LightInfoProperty__Descriptor = Descriptor.MessageTypes[15]; - internal__static_Sirikata_Protocol__PBJ_Internal_LightInfoProperty__FieldAccessorTable = - new pb::FieldAccess.FieldAccessorTable(internal__static_Sirikata_Protocol__PBJ_Internal_LightInfoProperty__Descriptor, - new string[] { "DiffuseColor", "SpecularColor", "Power", "AmbientColor", "ShadowColor", "LightRange", "ConstantFalloff", "LinearFalloff", "QuadraticFalloff", "ConeInnerRadians", "ConeOuterRadians", "ConeFalloff", "Type", "CastsShadow", }); - internal__static_Sirikata_Protocol__PBJ_Internal_ParentProperty__Descriptor = Descriptor.MessageTypes[16]; - internal__static_Sirikata_Protocol__PBJ_Internal_ParentProperty__FieldAccessorTable = - new pb::FieldAccess.FieldAccessorTable(internal__static_Sirikata_Protocol__PBJ_Internal_ParentProperty__Descriptor, - new string[] { "Value", }); - internal__static_Sirikata_Protocol__PBJ_Internal_UUIDListProperty__Descriptor = Descriptor.MessageTypes[17]; - internal__static_Sirikata_Protocol__PBJ_Internal_UUIDListProperty__FieldAccessorTable = - new pb::FieldAccess.FieldAccessorTable(internal__static_Sirikata_Protocol__PBJ_Internal_UUIDListProperty__Descriptor, - new string[] { "Value", }); - internal__static_Sirikata_Protocol__PBJ_Internal_ConnectToSpace__Descriptor = Descriptor.MessageTypes[18]; - internal__static_Sirikata_Protocol__PBJ_Internal_ConnectToSpace__FieldAccessorTable = - new pb::FieldAccess.FieldAccessorTable(internal__static_Sirikata_Protocol__PBJ_Internal_ConnectToSpace__Descriptor, - new string[] { "SpaceId", "ObjectUuidEvidence", "RequestedObjectLoc", "BoundingSphere", }); - internal__static_Sirikata_Protocol__PBJ_Internal_CreateObject__Descriptor = Descriptor.MessageTypes[19]; - internal__static_Sirikata_Protocol__PBJ_Internal_CreateObject__FieldAccessorTable = - new pb::FieldAccess.FieldAccessorTable(internal__static_Sirikata_Protocol__PBJ_Internal_CreateObject__Descriptor, - new string[] { "ObjectUuid", "SpaceProperties", "Mesh", "Scale", "Weburl", "LightInfo", "Camera", "Physical", }); - return null; - }; - pbd::FileDescriptor.InternalBuildGeneratedFileFrom(descriptorData, - new pbd::FileDescriptor[] { - }, assigner); - } - #endregion - - } - #region Messages - public sealed partial class MessageBody : pb::GeneratedMessage { - private static readonly MessageBody defaultInstance = new Builder().BuildPartial(); - public static MessageBody DefaultInstance { - get { return defaultInstance; } - } - - public override MessageBody DefaultInstanceForType { - get { return defaultInstance; } - } - - protected override MessageBody ThisMessage { - get { return this; } - } - - public static pbd::MessageDescriptor Descriptor { - get { return global::Sirikata.Protocol._PBJ_Internal.Sirikata.internal__static_Sirikata_Protocol__PBJ_Internal_MessageBody__Descriptor; } - } - - protected override pb::FieldAccess.FieldAccessorTable InternalFieldAccessors { - get { return global::Sirikata.Protocol._PBJ_Internal.Sirikata.internal__static_Sirikata_Protocol__PBJ_Internal_MessageBody__FieldAccessorTable; } - } - - public const int MessageNamesFieldNumber = 9; - private pbc::PopsicleList messageNames_ = new pbc::PopsicleList(); - public scg::IList MessageNamesList { - get { return pbc::Lists.AsReadOnly(messageNames_); } - } - public int MessageNamesCount { - get { return messageNames_.Count; } - } - public string GetMessageNames(int index) { - return messageNames_[index]; - } - - public const int MessageArgumentsFieldNumber = 10; - private pbc::PopsicleList messageArguments_ = new pbc::PopsicleList(); - public scg::IList MessageArgumentsList { - get { return pbc::Lists.AsReadOnly(messageArguments_); } - } - public int MessageArgumentsCount { - get { return messageArguments_.Count; } - } - public pb::ByteString GetMessageArguments(int index) { - return messageArguments_[index]; - } - - public override bool IsInitialized { - get { - return true; - } - } - - public override void WriteTo(pb::CodedOutputStream output) { - if (messageNames_.Count > 0) { - foreach (string element in messageNames_) { - output.WriteString(9, element); - } - } - if (messageArguments_.Count > 0) { - foreach (pb::ByteString element in messageArguments_) { - output.WriteBytes(10, element); - } - } - UnknownFields.WriteTo(output); - } - - private int memoizedSerializedSize = -1; - public override int SerializedSize { - get { - int size = memoizedSerializedSize; - if (size != -1) return size; - - size = 0; - { - int dataSize = 0; - foreach (string element in MessageNamesList) { - dataSize += pb::CodedOutputStream.ComputeStringSizeNoTag(element); - } - size += dataSize; - size += 1 * messageNames_.Count; - } - { - int dataSize = 0; - foreach (pb::ByteString element in MessageArgumentsList) { - dataSize += pb::CodedOutputStream.ComputeBytesSizeNoTag(element); - } - size += dataSize; - size += 1 * messageArguments_.Count; - } - size += UnknownFields.SerializedSize; - memoizedSerializedSize = size; - return size; - } - } - - public static MessageBody ParseFrom(pb::ByteString data) { - return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); - } - public static MessageBody ParseFrom(pb::ByteString data, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); - } - public static MessageBody ParseFrom(byte[] data) { - return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); - } - public static MessageBody ParseFrom(byte[] data, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); - } - public static MessageBody ParseFrom(global::System.IO.Stream input) { - return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); - } - public static MessageBody ParseFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); - } - public static MessageBody ParseDelimitedFrom(global::System.IO.Stream input) { - return CreateBuilder().MergeDelimitedFrom(input).BuildParsed(); - } - public static MessageBody ParseDelimitedFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { - return CreateBuilder().MergeDelimitedFrom(input, extensionRegistry).BuildParsed(); - } - public static MessageBody ParseFrom(pb::CodedInputStream input) { - return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); - } - public static MessageBody ParseFrom(pb::CodedInputStream input, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); - } - public static Builder CreateBuilder() { return new Builder(); } - public override Builder ToBuilder() { return CreateBuilder(this); } - public override Builder CreateBuilderForType() { return new Builder(); } - public static Builder CreateBuilder(MessageBody prototype) { - return (Builder) new Builder().MergeFrom(prototype); - } - - public sealed partial class Builder : pb::GeneratedBuilder { - protected override Builder ThisBuilder { - get { return this; } - } - public Builder() {} - - MessageBody result = new MessageBody(); - - protected override MessageBody MessageBeingBuilt { - get { return result; } - } - - public override Builder Clear() { - result = new MessageBody(); - return this; - } - - public override Builder Clone() { - return new Builder().MergeFrom(result); - } - - public override pbd::MessageDescriptor DescriptorForType { - get { return global::Sirikata.Protocol._PBJ_Internal.MessageBody.Descriptor; } - } - - public override MessageBody DefaultInstanceForType { - get { return global::Sirikata.Protocol._PBJ_Internal.MessageBody.DefaultInstance; } - } - - public override MessageBody BuildPartial() { - if (result == null) { - throw new global::System.InvalidOperationException("build() has already been called on this Builder"); - } - result.messageNames_.MakeReadOnly(); - result.messageArguments_.MakeReadOnly(); - MessageBody returnMe = result; - result = null; - return returnMe; - } - - public override Builder MergeFrom(pb::IMessage other) { - if (other is MessageBody) { - return MergeFrom((MessageBody) other); - } else { - base.MergeFrom(other); - return this; - } - } - - public override Builder MergeFrom(MessageBody other) { - if (other == global::Sirikata.Protocol._PBJ_Internal.MessageBody.DefaultInstance) return this; - if (other.messageNames_.Count != 0) { - base.AddRange(other.messageNames_, result.messageNames_); - } - if (other.messageArguments_.Count != 0) { - base.AddRange(other.messageArguments_, result.messageArguments_); - } - this.MergeUnknownFields(other.UnknownFields); - return this; - } - - public override Builder MergeFrom(pb::CodedInputStream input) { - return MergeFrom(input, pb::ExtensionRegistry.Empty); - } - - public override Builder MergeFrom(pb::CodedInputStream input, pb::ExtensionRegistry extensionRegistry) { - pb::UnknownFieldSet.Builder unknownFields = null; - while (true) { - uint tag = input.ReadTag(); - switch (tag) { - case 0: { - if (unknownFields != null) { - this.UnknownFields = unknownFields.Build(); - } - return this; - } - default: { - if (pb::WireFormat.IsEndGroupTag(tag)) { - if (unknownFields != null) { - this.UnknownFields = unknownFields.Build(); - } - return this; - } - if (unknownFields == null) { - unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); - } - ParseUnknownField(input, unknownFields, extensionRegistry, tag); - break; - } - case 74: { - AddMessageNames(input.ReadString()); - break; - } - case 82: { - AddMessageArguments(input.ReadBytes()); - break; - } - } - } - } - - - public pbc::IPopsicleList MessageNamesList { - get { return result.messageNames_; } - } - public int MessageNamesCount { - get { return result.MessageNamesCount; } - } - public string GetMessageNames(int index) { - return result.GetMessageNames(index); - } - public Builder SetMessageNames(int index, string value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - result.messageNames_[index] = value; - return this; - } - public Builder AddMessageNames(string value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - result.messageNames_.Add(value); - return this; - } - public Builder AddRangeMessageNames(scg::IEnumerable values) { - base.AddRange(values, result.messageNames_); - return this; - } - public Builder ClearMessageNames() { - result.messageNames_.Clear(); - return this; - } - - public pbc::IPopsicleList MessageArgumentsList { - get { return result.messageArguments_; } - } - public int MessageArgumentsCount { - get { return result.MessageArgumentsCount; } - } - public pb::ByteString GetMessageArguments(int index) { - return result.GetMessageArguments(index); - } - public Builder SetMessageArguments(int index, pb::ByteString value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - result.messageArguments_[index] = value; - return this; - } - public Builder AddMessageArguments(pb::ByteString value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - result.messageArguments_.Add(value); - return this; - } - public Builder AddRangeMessageArguments(scg::IEnumerable values) { - base.AddRange(values, result.messageArguments_); - return this; - } - public Builder ClearMessageArguments() { - result.messageArguments_.Clear(); - return this; - } - } - static MessageBody() { - object.ReferenceEquals(global::Sirikata.Protocol._PBJ_Internal.Sirikata.Descriptor, null); - } - } - - public sealed partial class ReadOnlyMessage : pb::GeneratedMessage { - private static readonly ReadOnlyMessage defaultInstance = new Builder().BuildPartial(); - public static ReadOnlyMessage DefaultInstance { - get { return defaultInstance; } - } - - public override ReadOnlyMessage DefaultInstanceForType { - get { return defaultInstance; } - } - - protected override ReadOnlyMessage ThisMessage { - get { return this; } - } - - public static pbd::MessageDescriptor Descriptor { - get { return global::Sirikata.Protocol._PBJ_Internal.Sirikata.internal__static_Sirikata_Protocol__PBJ_Internal_ReadOnlyMessage__Descriptor; } - } - - protected override pb::FieldAccess.FieldAccessorTable InternalFieldAccessors { - get { return global::Sirikata.Protocol._PBJ_Internal.Sirikata.internal__static_Sirikata_Protocol__PBJ_Internal_ReadOnlyMessage__FieldAccessorTable; } - } - - #region Nested types - public static class Types { - public enum ReturnStatus { - SUCCESS = 0, - NETWORK_FAILURE = 1, - TIMEOUT_FAILURE = 3, - PROTOCOL_ERROR = 4, - PORT_FAILURE = 5, - } - - } - #endregion - - public const int SourceObjectFieldNumber = 1; - private bool hasSourceObject; - private pb::ByteString sourceObject_ = pb::ByteString.Empty; - public bool HasSourceObject { - get { return hasSourceObject; } - } - public pb::ByteString SourceObject { - get { return sourceObject_; } - } - - public const int SourcePortFieldNumber = 3; - private bool hasSourcePort; - private uint sourcePort_ = 0; - public bool HasSourcePort { - get { return hasSourcePort; } - } - [global::System.CLSCompliant(false)] - public uint SourcePort { - get { return sourcePort_; } - } - - public const int SourceSpaceFieldNumber = 1536; - private bool hasSourceSpace; - private pb::ByteString sourceSpace_ = pb::ByteString.Empty; - public bool HasSourceSpace { - get { return hasSourceSpace; } - } - public pb::ByteString SourceSpace { - get { return sourceSpace_; } - } - - public const int DestinationObjectFieldNumber = 2; - private bool hasDestinationObject; - private pb::ByteString destinationObject_ = pb::ByteString.Empty; - public bool HasDestinationObject { - get { return hasDestinationObject; } - } - public pb::ByteString DestinationObject { - get { return destinationObject_; } - } - - public const int DestinationPortFieldNumber = 4; - private bool hasDestinationPort; - private uint destinationPort_ = 0; - public bool HasDestinationPort { - get { return hasDestinationPort; } - } - [global::System.CLSCompliant(false)] - public uint DestinationPort { - get { return destinationPort_; } - } - - public const int DestinationSpaceFieldNumber = 1537; - private bool hasDestinationSpace; - private pb::ByteString destinationSpace_ = pb::ByteString.Empty; - public bool HasDestinationSpace { - get { return hasDestinationSpace; } - } - public pb::ByteString DestinationSpace { - get { return destinationSpace_; } - } - - public const int IdFieldNumber = 7; - private bool hasId; - private long id_ = 0L; - public bool HasId { - get { return hasId; } - } - public long Id { - get { return id_; } - } - - public const int ReplyIdFieldNumber = 8; - private bool hasReplyId; - private long replyId_ = 0L; - public bool HasReplyId { - get { return hasReplyId; } - } - public long ReplyId { - get { return replyId_; } - } - - public const int ReturnStatusFieldNumber = 1792; - private bool hasReturnStatus; - private global::Sirikata.Protocol._PBJ_Internal.ReadOnlyMessage.Types.ReturnStatus returnStatus_ = global::Sirikata.Protocol._PBJ_Internal.ReadOnlyMessage.Types.ReturnStatus.SUCCESS; - public bool HasReturnStatus { - get { return hasReturnStatus; } - } - public global::Sirikata.Protocol._PBJ_Internal.ReadOnlyMessage.Types.ReturnStatus ReturnStatus { - get { return returnStatus_; } - } - - public const int MessageNamesFieldNumber = 9; - private pbc::PopsicleList messageNames_ = new pbc::PopsicleList(); - public scg::IList MessageNamesList { - get { return pbc::Lists.AsReadOnly(messageNames_); } - } - public int MessageNamesCount { - get { return messageNames_.Count; } - } - public string GetMessageNames(int index) { - return messageNames_[index]; - } - - public const int MessageArgumentsFieldNumber = 10; - private pbc::PopsicleList messageArguments_ = new pbc::PopsicleList(); - public scg::IList MessageArgumentsList { - get { return pbc::Lists.AsReadOnly(messageArguments_); } - } - public int MessageArgumentsCount { - get { return messageArguments_.Count; } - } - public pb::ByteString GetMessageArguments(int index) { - return messageArguments_[index]; - } - - public override bool IsInitialized { - get { - return true; - } - } - - public override void WriteTo(pb::CodedOutputStream output) { - if (HasSourceObject) { - output.WriteBytes(1, SourceObject); - } - if (HasDestinationObject) { - output.WriteBytes(2, DestinationObject); - } - if (HasSourcePort) { - output.WriteUInt32(3, SourcePort); - } - if (HasDestinationPort) { - output.WriteUInt32(4, DestinationPort); - } - if (HasId) { - output.WriteInt64(7, Id); - } - if (HasReplyId) { - output.WriteInt64(8, ReplyId); - } - if (messageNames_.Count > 0) { - foreach (string element in messageNames_) { - output.WriteString(9, element); - } - } - if (messageArguments_.Count > 0) { - foreach (pb::ByteString element in messageArguments_) { - output.WriteBytes(10, element); - } - } - if (HasSourceSpace) { - output.WriteBytes(1536, SourceSpace); - } - if (HasDestinationSpace) { - output.WriteBytes(1537, DestinationSpace); - } - if (HasReturnStatus) { - output.WriteEnum(1792, (int) ReturnStatus); - } - UnknownFields.WriteTo(output); - } - - private int memoizedSerializedSize = -1; - public override int SerializedSize { - get { - int size = memoizedSerializedSize; - if (size != -1) return size; - - size = 0; - if (HasSourceObject) { - size += pb::CodedOutputStream.ComputeBytesSize(1, SourceObject); - } - if (HasSourcePort) { - size += pb::CodedOutputStream.ComputeUInt32Size(3, SourcePort); - } - if (HasSourceSpace) { - size += pb::CodedOutputStream.ComputeBytesSize(1536, SourceSpace); - } - if (HasDestinationObject) { - size += pb::CodedOutputStream.ComputeBytesSize(2, DestinationObject); - } - if (HasDestinationPort) { - size += pb::CodedOutputStream.ComputeUInt32Size(4, DestinationPort); - } - if (HasDestinationSpace) { - size += pb::CodedOutputStream.ComputeBytesSize(1537, DestinationSpace); - } - if (HasId) { - size += pb::CodedOutputStream.ComputeInt64Size(7, Id); - } - if (HasReplyId) { - size += pb::CodedOutputStream.ComputeInt64Size(8, ReplyId); - } - if (HasReturnStatus) { - size += pb::CodedOutputStream.ComputeEnumSize(1792, (int) ReturnStatus); - } - { - int dataSize = 0; - foreach (string element in MessageNamesList) { - dataSize += pb::CodedOutputStream.ComputeStringSizeNoTag(element); - } - size += dataSize; - size += 1 * messageNames_.Count; - } - { - int dataSize = 0; - foreach (pb::ByteString element in MessageArgumentsList) { - dataSize += pb::CodedOutputStream.ComputeBytesSizeNoTag(element); - } - size += dataSize; - size += 1 * messageArguments_.Count; - } - size += UnknownFields.SerializedSize; - memoizedSerializedSize = size; - return size; - } - } - - public static ReadOnlyMessage ParseFrom(pb::ByteString data) { - return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); - } - public static ReadOnlyMessage ParseFrom(pb::ByteString data, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); - } - public static ReadOnlyMessage ParseFrom(byte[] data) { - return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); - } - public static ReadOnlyMessage ParseFrom(byte[] data, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); - } - public static ReadOnlyMessage ParseFrom(global::System.IO.Stream input) { - return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); - } - public static ReadOnlyMessage ParseFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); - } - public static ReadOnlyMessage ParseDelimitedFrom(global::System.IO.Stream input) { - return CreateBuilder().MergeDelimitedFrom(input).BuildParsed(); - } - public static ReadOnlyMessage ParseDelimitedFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { - return CreateBuilder().MergeDelimitedFrom(input, extensionRegistry).BuildParsed(); - } - public static ReadOnlyMessage ParseFrom(pb::CodedInputStream input) { - return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); - } - public static ReadOnlyMessage ParseFrom(pb::CodedInputStream input, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); - } - public static Builder CreateBuilder() { return new Builder(); } - public override Builder ToBuilder() { return CreateBuilder(this); } - public override Builder CreateBuilderForType() { return new Builder(); } - public static Builder CreateBuilder(ReadOnlyMessage prototype) { - return (Builder) new Builder().MergeFrom(prototype); - } - - public sealed partial class Builder : pb::GeneratedBuilder { - protected override Builder ThisBuilder { - get { return this; } - } - public Builder() {} - - ReadOnlyMessage result = new ReadOnlyMessage(); - - protected override ReadOnlyMessage MessageBeingBuilt { - get { return result; } - } - - public override Builder Clear() { - result = new ReadOnlyMessage(); - return this; - } - - public override Builder Clone() { - return new Builder().MergeFrom(result); - } - - public override pbd::MessageDescriptor DescriptorForType { - get { return global::Sirikata.Protocol._PBJ_Internal.ReadOnlyMessage.Descriptor; } - } - - public override ReadOnlyMessage DefaultInstanceForType { - get { return global::Sirikata.Protocol._PBJ_Internal.ReadOnlyMessage.DefaultInstance; } - } - - public override ReadOnlyMessage BuildPartial() { - if (result == null) { - throw new global::System.InvalidOperationException("build() has already been called on this Builder"); - } - result.messageNames_.MakeReadOnly(); - result.messageArguments_.MakeReadOnly(); - ReadOnlyMessage returnMe = result; - result = null; - return returnMe; - } - - public override Builder MergeFrom(pb::IMessage other) { - if (other is ReadOnlyMessage) { - return MergeFrom((ReadOnlyMessage) other); - } else { - base.MergeFrom(other); - return this; - } - } - - public override Builder MergeFrom(ReadOnlyMessage other) { - if (other == global::Sirikata.Protocol._PBJ_Internal.ReadOnlyMessage.DefaultInstance) return this; - if (other.HasSourceObject) { - SourceObject = other.SourceObject; - } - if (other.HasSourcePort) { - SourcePort = other.SourcePort; - } - if (other.HasSourceSpace) { - SourceSpace = other.SourceSpace; - } - if (other.HasDestinationObject) { - DestinationObject = other.DestinationObject; - } - if (other.HasDestinationPort) { - DestinationPort = other.DestinationPort; - } - if (other.HasDestinationSpace) { - DestinationSpace = other.DestinationSpace; - } - if (other.HasId) { - Id = other.Id; - } - if (other.HasReplyId) { - ReplyId = other.ReplyId; - } - if (other.HasReturnStatus) { - ReturnStatus = other.ReturnStatus; - } - if (other.messageNames_.Count != 0) { - base.AddRange(other.messageNames_, result.messageNames_); - } - if (other.messageArguments_.Count != 0) { - base.AddRange(other.messageArguments_, result.messageArguments_); - } - this.MergeUnknownFields(other.UnknownFields); - return this; - } - - public override Builder MergeFrom(pb::CodedInputStream input) { - return MergeFrom(input, pb::ExtensionRegistry.Empty); - } - - public override Builder MergeFrom(pb::CodedInputStream input, pb::ExtensionRegistry extensionRegistry) { - pb::UnknownFieldSet.Builder unknownFields = null; - while (true) { - uint tag = input.ReadTag(); - switch (tag) { - case 0: { - if (unknownFields != null) { - this.UnknownFields = unknownFields.Build(); - } - return this; - } - default: { - if (pb::WireFormat.IsEndGroupTag(tag)) { - if (unknownFields != null) { - this.UnknownFields = unknownFields.Build(); - } - return this; - } - if (unknownFields == null) { - unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); - } - ParseUnknownField(input, unknownFields, extensionRegistry, tag); - break; - } - case 10: { - SourceObject = input.ReadBytes(); - break; - } - case 18: { - DestinationObject = input.ReadBytes(); - break; - } - case 24: { - SourcePort = input.ReadUInt32(); - break; - } - case 32: { - DestinationPort = input.ReadUInt32(); - break; - } - case 56: { - Id = input.ReadInt64(); - break; - } - case 64: { - ReplyId = input.ReadInt64(); - break; - } - case 74: { - AddMessageNames(input.ReadString()); - break; - } - case 82: { - AddMessageArguments(input.ReadBytes()); - break; - } - case 12290: { - SourceSpace = input.ReadBytes(); - break; - } - case 12298: { - DestinationSpace = input.ReadBytes(); - break; - } - case 14336: { - int rawValue = input.ReadEnum(); - if (!global::System.Enum.IsDefined(typeof(global::Sirikata.Protocol._PBJ_Internal.ReadOnlyMessage.Types.ReturnStatus), rawValue)) { - if (unknownFields == null) { - unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); - } - unknownFields.MergeVarintField(1792, (ulong) rawValue); - } else { - ReturnStatus = (global::Sirikata.Protocol._PBJ_Internal.ReadOnlyMessage.Types.ReturnStatus) rawValue; - } - break; - } - } - } - } - - - public bool HasSourceObject { - get { return result.HasSourceObject; } - } - public pb::ByteString SourceObject { - get { return result.SourceObject; } - set { SetSourceObject(value); } - } - public Builder SetSourceObject(pb::ByteString value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - result.hasSourceObject = true; - result.sourceObject_ = value; - return this; - } - public Builder ClearSourceObject() { - result.hasSourceObject = false; - result.sourceObject_ = pb::ByteString.Empty; - return this; - } - - public bool HasSourcePort { - get { return result.HasSourcePort; } - } - [global::System.CLSCompliant(false)] - public uint SourcePort { - get { return result.SourcePort; } - set { SetSourcePort(value); } - } - [global::System.CLSCompliant(false)] - public Builder SetSourcePort(uint value) { - result.hasSourcePort = true; - result.sourcePort_ = value; - return this; - } - public Builder ClearSourcePort() { - result.hasSourcePort = false; - result.sourcePort_ = 0; - return this; - } - - public bool HasSourceSpace { - get { return result.HasSourceSpace; } - } - public pb::ByteString SourceSpace { - get { return result.SourceSpace; } - set { SetSourceSpace(value); } - } - public Builder SetSourceSpace(pb::ByteString value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - result.hasSourceSpace = true; - result.sourceSpace_ = value; - return this; - } - public Builder ClearSourceSpace() { - result.hasSourceSpace = false; - result.sourceSpace_ = pb::ByteString.Empty; - return this; - } - - public bool HasDestinationObject { - get { return result.HasDestinationObject; } - } - public pb::ByteString DestinationObject { - get { return result.DestinationObject; } - set { SetDestinationObject(value); } - } - public Builder SetDestinationObject(pb::ByteString value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - result.hasDestinationObject = true; - result.destinationObject_ = value; - return this; - } - public Builder ClearDestinationObject() { - result.hasDestinationObject = false; - result.destinationObject_ = pb::ByteString.Empty; - return this; - } - - public bool HasDestinationPort { - get { return result.HasDestinationPort; } - } - [global::System.CLSCompliant(false)] - public uint DestinationPort { - get { return result.DestinationPort; } - set { SetDestinationPort(value); } - } - [global::System.CLSCompliant(false)] - public Builder SetDestinationPort(uint value) { - result.hasDestinationPort = true; - result.destinationPort_ = value; - return this; - } - public Builder ClearDestinationPort() { - result.hasDestinationPort = false; - result.destinationPort_ = 0; - return this; - } - - public bool HasDestinationSpace { - get { return result.HasDestinationSpace; } - } - public pb::ByteString DestinationSpace { - get { return result.DestinationSpace; } - set { SetDestinationSpace(value); } - } - public Builder SetDestinationSpace(pb::ByteString value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - result.hasDestinationSpace = true; - result.destinationSpace_ = value; - return this; - } - public Builder ClearDestinationSpace() { - result.hasDestinationSpace = false; - result.destinationSpace_ = pb::ByteString.Empty; - return this; - } - - public bool HasId { - get { return result.HasId; } - } - public long Id { - get { return result.Id; } - set { SetId(value); } - } - public Builder SetId(long value) { - result.hasId = true; - result.id_ = value; - return this; - } - public Builder ClearId() { - result.hasId = false; - result.id_ = 0L; - return this; - } - - public bool HasReplyId { - get { return result.HasReplyId; } - } - public long ReplyId { - get { return result.ReplyId; } - set { SetReplyId(value); } - } - public Builder SetReplyId(long value) { - result.hasReplyId = true; - result.replyId_ = value; - return this; - } - public Builder ClearReplyId() { - result.hasReplyId = false; - result.replyId_ = 0L; - return this; - } - - public bool HasReturnStatus { - get { return result.HasReturnStatus; } - } - public global::Sirikata.Protocol._PBJ_Internal.ReadOnlyMessage.Types.ReturnStatus ReturnStatus { - get { return result.ReturnStatus; } - set { SetReturnStatus(value); } - } - public Builder SetReturnStatus(global::Sirikata.Protocol._PBJ_Internal.ReadOnlyMessage.Types.ReturnStatus value) { - result.hasReturnStatus = true; - result.returnStatus_ = value; - return this; - } - public Builder ClearReturnStatus() { - result.hasReturnStatus = false; - result.returnStatus_ = global::Sirikata.Protocol._PBJ_Internal.ReadOnlyMessage.Types.ReturnStatus.SUCCESS; - return this; - } - - public pbc::IPopsicleList MessageNamesList { - get { return result.messageNames_; } - } - public int MessageNamesCount { - get { return result.MessageNamesCount; } - } - public string GetMessageNames(int index) { - return result.GetMessageNames(index); - } - public Builder SetMessageNames(int index, string value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - result.messageNames_[index] = value; - return this; - } - public Builder AddMessageNames(string value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - result.messageNames_.Add(value); - return this; - } - public Builder AddRangeMessageNames(scg::IEnumerable values) { - base.AddRange(values, result.messageNames_); - return this; - } - public Builder ClearMessageNames() { - result.messageNames_.Clear(); - return this; - } - - public pbc::IPopsicleList MessageArgumentsList { - get { return result.messageArguments_; } - } - public int MessageArgumentsCount { - get { return result.MessageArgumentsCount; } - } - public pb::ByteString GetMessageArguments(int index) { - return result.GetMessageArguments(index); - } - public Builder SetMessageArguments(int index, pb::ByteString value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - result.messageArguments_[index] = value; - return this; - } - public Builder AddMessageArguments(pb::ByteString value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - result.messageArguments_.Add(value); - return this; - } - public Builder AddRangeMessageArguments(scg::IEnumerable values) { - base.AddRange(values, result.messageArguments_); - return this; - } - public Builder ClearMessageArguments() { - result.messageArguments_.Clear(); - return this; - } - } - static ReadOnlyMessage() { - object.ReferenceEquals(global::Sirikata.Protocol._PBJ_Internal.Sirikata.Descriptor, null); - } - } - - public sealed partial class SpaceServices : pb::GeneratedMessage { - private static readonly SpaceServices defaultInstance = new Builder().BuildPartial(); - public static SpaceServices DefaultInstance { - get { return defaultInstance; } - } - - public override SpaceServices DefaultInstanceForType { - get { return defaultInstance; } - } - - protected override SpaceServices ThisMessage { - get { return this; } - } - - public static pbd::MessageDescriptor Descriptor { - get { return global::Sirikata.Protocol._PBJ_Internal.Sirikata.internal__static_Sirikata_Protocol__PBJ_Internal_SpaceServices__Descriptor; } - } - - protected override pb::FieldAccess.FieldAccessorTable InternalFieldAccessors { - get { return global::Sirikata.Protocol._PBJ_Internal.Sirikata.internal__static_Sirikata_Protocol__PBJ_Internal_SpaceServices__FieldAccessorTable; } - } - - public const int RegistrationPortFieldNumber = 33; - private bool hasRegistrationPort; - private uint registrationPort_ = 0; - public bool HasRegistrationPort { - get { return hasRegistrationPort; } - } - [global::System.CLSCompliant(false)] - public uint RegistrationPort { - get { return registrationPort_; } - } - - public const int LocPortFieldNumber = 34; - private bool hasLocPort; - private uint locPort_ = 0; - public bool HasLocPort { - get { return hasLocPort; } - } - [global::System.CLSCompliant(false)] - public uint LocPort { - get { return locPort_; } - } - - public const int GeomPortFieldNumber = 35; - private bool hasGeomPort; - private uint geomPort_ = 0; - public bool HasGeomPort { - get { return hasGeomPort; } - } - [global::System.CLSCompliant(false)] - public uint GeomPort { - get { return geomPort_; } - } - - public const int OsegPortFieldNumber = 36; - private bool hasOsegPort; - private uint osegPort_ = 0; - public bool HasOsegPort { - get { return hasOsegPort; } - } - [global::System.CLSCompliant(false)] - public uint OsegPort { - get { return osegPort_; } - } - - public const int CsegPortFieldNumber = 37; - private bool hasCsegPort; - private uint csegPort_ = 0; - public bool HasCsegPort { - get { return hasCsegPort; } - } - [global::System.CLSCompliant(false)] - public uint CsegPort { - get { return csegPort_; } - } - - public const int RouterPortFieldNumber = 38; - private bool hasRouterPort; - private uint routerPort_ = 0; - public bool HasRouterPort { - get { return hasRouterPort; } - } - [global::System.CLSCompliant(false)] - public uint RouterPort { - get { return routerPort_; } - } - - public const int PreConnectionBufferFieldNumber = 64; - private bool hasPreConnectionBuffer; - private ulong preConnectionBuffer_ = 0UL; - public bool HasPreConnectionBuffer { - get { return hasPreConnectionBuffer; } - } - [global::System.CLSCompliant(false)] - public ulong PreConnectionBuffer { - get { return preConnectionBuffer_; } - } - - public const int MaxPreConnectionMessagesFieldNumber = 65; - private bool hasMaxPreConnectionMessages; - private ulong maxPreConnectionMessages_ = 0UL; - public bool HasMaxPreConnectionMessages { - get { return hasMaxPreConnectionMessages; } - } - [global::System.CLSCompliant(false)] - public ulong MaxPreConnectionMessages { - get { return maxPreConnectionMessages_; } - } - - public override bool IsInitialized { - get { - return true; - } - } - - public override void WriteTo(pb::CodedOutputStream output) { - if (HasRegistrationPort) { - output.WriteUInt32(33, RegistrationPort); - } - if (HasLocPort) { - output.WriteUInt32(34, LocPort); - } - if (HasGeomPort) { - output.WriteUInt32(35, GeomPort); - } - if (HasOsegPort) { - output.WriteUInt32(36, OsegPort); - } - if (HasCsegPort) { - output.WriteUInt32(37, CsegPort); - } - if (HasRouterPort) { - output.WriteUInt32(38, RouterPort); - } - if (HasPreConnectionBuffer) { - output.WriteUInt64(64, PreConnectionBuffer); - } - if (HasMaxPreConnectionMessages) { - output.WriteUInt64(65, MaxPreConnectionMessages); - } - UnknownFields.WriteTo(output); - } - - private int memoizedSerializedSize = -1; - public override int SerializedSize { - get { - int size = memoizedSerializedSize; - if (size != -1) return size; - - size = 0; - if (HasRegistrationPort) { - size += pb::CodedOutputStream.ComputeUInt32Size(33, RegistrationPort); - } - if (HasLocPort) { - size += pb::CodedOutputStream.ComputeUInt32Size(34, LocPort); - } - if (HasGeomPort) { - size += pb::CodedOutputStream.ComputeUInt32Size(35, GeomPort); - } - if (HasOsegPort) { - size += pb::CodedOutputStream.ComputeUInt32Size(36, OsegPort); - } - if (HasCsegPort) { - size += pb::CodedOutputStream.ComputeUInt32Size(37, CsegPort); - } - if (HasRouterPort) { - size += pb::CodedOutputStream.ComputeUInt32Size(38, RouterPort); - } - if (HasPreConnectionBuffer) { - size += pb::CodedOutputStream.ComputeUInt64Size(64, PreConnectionBuffer); - } - if (HasMaxPreConnectionMessages) { - size += pb::CodedOutputStream.ComputeUInt64Size(65, MaxPreConnectionMessages); - } - size += UnknownFields.SerializedSize; - memoizedSerializedSize = size; - return size; - } - } - - public static SpaceServices ParseFrom(pb::ByteString data) { - return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); - } - public static SpaceServices ParseFrom(pb::ByteString data, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); - } - public static SpaceServices ParseFrom(byte[] data) { - return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); - } - public static SpaceServices ParseFrom(byte[] data, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); - } - public static SpaceServices ParseFrom(global::System.IO.Stream input) { - return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); - } - public static SpaceServices ParseFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); - } - public static SpaceServices ParseDelimitedFrom(global::System.IO.Stream input) { - return CreateBuilder().MergeDelimitedFrom(input).BuildParsed(); - } - public static SpaceServices ParseDelimitedFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { - return CreateBuilder().MergeDelimitedFrom(input, extensionRegistry).BuildParsed(); - } - public static SpaceServices ParseFrom(pb::CodedInputStream input) { - return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); - } - public static SpaceServices ParseFrom(pb::CodedInputStream input, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); - } - public static Builder CreateBuilder() { return new Builder(); } - public override Builder ToBuilder() { return CreateBuilder(this); } - public override Builder CreateBuilderForType() { return new Builder(); } - public static Builder CreateBuilder(SpaceServices prototype) { - return (Builder) new Builder().MergeFrom(prototype); - } - - public sealed partial class Builder : pb::GeneratedBuilder { - protected override Builder ThisBuilder { - get { return this; } - } - public Builder() {} - - SpaceServices result = new SpaceServices(); - - protected override SpaceServices MessageBeingBuilt { - get { return result; } - } - - public override Builder Clear() { - result = new SpaceServices(); - return this; - } - - public override Builder Clone() { - return new Builder().MergeFrom(result); - } - - public override pbd::MessageDescriptor DescriptorForType { - get { return global::Sirikata.Protocol._PBJ_Internal.SpaceServices.Descriptor; } - } - - public override SpaceServices DefaultInstanceForType { - get { return global::Sirikata.Protocol._PBJ_Internal.SpaceServices.DefaultInstance; } - } - - public override SpaceServices BuildPartial() { - if (result == null) { - throw new global::System.InvalidOperationException("build() has already been called on this Builder"); - } - SpaceServices returnMe = result; - result = null; - return returnMe; - } - - public override Builder MergeFrom(pb::IMessage other) { - if (other is SpaceServices) { - return MergeFrom((SpaceServices) other); - } else { - base.MergeFrom(other); - return this; - } - } - - public override Builder MergeFrom(SpaceServices other) { - if (other == global::Sirikata.Protocol._PBJ_Internal.SpaceServices.DefaultInstance) return this; - if (other.HasRegistrationPort) { - RegistrationPort = other.RegistrationPort; - } - if (other.HasLocPort) { - LocPort = other.LocPort; - } - if (other.HasGeomPort) { - GeomPort = other.GeomPort; - } - if (other.HasOsegPort) { - OsegPort = other.OsegPort; - } - if (other.HasCsegPort) { - CsegPort = other.CsegPort; - } - if (other.HasRouterPort) { - RouterPort = other.RouterPort; - } - if (other.HasPreConnectionBuffer) { - PreConnectionBuffer = other.PreConnectionBuffer; - } - if (other.HasMaxPreConnectionMessages) { - MaxPreConnectionMessages = other.MaxPreConnectionMessages; - } - this.MergeUnknownFields(other.UnknownFields); - return this; - } - - public override Builder MergeFrom(pb::CodedInputStream input) { - return MergeFrom(input, pb::ExtensionRegistry.Empty); - } - - public override Builder MergeFrom(pb::CodedInputStream input, pb::ExtensionRegistry extensionRegistry) { - pb::UnknownFieldSet.Builder unknownFields = null; - while (true) { - uint tag = input.ReadTag(); - switch (tag) { - case 0: { - if (unknownFields != null) { - this.UnknownFields = unknownFields.Build(); - } - return this; - } - default: { - if (pb::WireFormat.IsEndGroupTag(tag)) { - if (unknownFields != null) { - this.UnknownFields = unknownFields.Build(); - } - return this; - } - if (unknownFields == null) { - unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); - } - ParseUnknownField(input, unknownFields, extensionRegistry, tag); - break; - } - case 264: { - RegistrationPort = input.ReadUInt32(); - break; - } - case 272: { - LocPort = input.ReadUInt32(); - break; - } - case 280: { - GeomPort = input.ReadUInt32(); - break; - } - case 288: { - OsegPort = input.ReadUInt32(); - break; - } - case 296: { - CsegPort = input.ReadUInt32(); - break; - } - case 304: { - RouterPort = input.ReadUInt32(); - break; - } - case 512: { - PreConnectionBuffer = input.ReadUInt64(); - break; - } - case 520: { - MaxPreConnectionMessages = input.ReadUInt64(); - break; - } - } - } - } - - - public bool HasRegistrationPort { - get { return result.HasRegistrationPort; } - } - [global::System.CLSCompliant(false)] - public uint RegistrationPort { - get { return result.RegistrationPort; } - set { SetRegistrationPort(value); } - } - [global::System.CLSCompliant(false)] - public Builder SetRegistrationPort(uint value) { - result.hasRegistrationPort = true; - result.registrationPort_ = value; - return this; - } - public Builder ClearRegistrationPort() { - result.hasRegistrationPort = false; - result.registrationPort_ = 0; - return this; - } - - public bool HasLocPort { - get { return result.HasLocPort; } - } - [global::System.CLSCompliant(false)] - public uint LocPort { - get { return result.LocPort; } - set { SetLocPort(value); } - } - [global::System.CLSCompliant(false)] - public Builder SetLocPort(uint value) { - result.hasLocPort = true; - result.locPort_ = value; - return this; - } - public Builder ClearLocPort() { - result.hasLocPort = false; - result.locPort_ = 0; - return this; - } - - public bool HasGeomPort { - get { return result.HasGeomPort; } - } - [global::System.CLSCompliant(false)] - public uint GeomPort { - get { return result.GeomPort; } - set { SetGeomPort(value); } - } - [global::System.CLSCompliant(false)] - public Builder SetGeomPort(uint value) { - result.hasGeomPort = true; - result.geomPort_ = value; - return this; - } - public Builder ClearGeomPort() { - result.hasGeomPort = false; - result.geomPort_ = 0; - return this; - } - - public bool HasOsegPort { - get { return result.HasOsegPort; } - } - [global::System.CLSCompliant(false)] - public uint OsegPort { - get { return result.OsegPort; } - set { SetOsegPort(value); } - } - [global::System.CLSCompliant(false)] - public Builder SetOsegPort(uint value) { - result.hasOsegPort = true; - result.osegPort_ = value; - return this; - } - public Builder ClearOsegPort() { - result.hasOsegPort = false; - result.osegPort_ = 0; - return this; - } - - public bool HasCsegPort { - get { return result.HasCsegPort; } - } - [global::System.CLSCompliant(false)] - public uint CsegPort { - get { return result.CsegPort; } - set { SetCsegPort(value); } - } - [global::System.CLSCompliant(false)] - public Builder SetCsegPort(uint value) { - result.hasCsegPort = true; - result.csegPort_ = value; - return this; - } - public Builder ClearCsegPort() { - result.hasCsegPort = false; - result.csegPort_ = 0; - return this; - } - - public bool HasRouterPort { - get { return result.HasRouterPort; } - } - [global::System.CLSCompliant(false)] - public uint RouterPort { - get { return result.RouterPort; } - set { SetRouterPort(value); } - } - [global::System.CLSCompliant(false)] - public Builder SetRouterPort(uint value) { - result.hasRouterPort = true; - result.routerPort_ = value; - return this; - } - public Builder ClearRouterPort() { - result.hasRouterPort = false; - result.routerPort_ = 0; - return this; - } - - public bool HasPreConnectionBuffer { - get { return result.HasPreConnectionBuffer; } - } - [global::System.CLSCompliant(false)] - public ulong PreConnectionBuffer { - get { return result.PreConnectionBuffer; } - set { SetPreConnectionBuffer(value); } - } - [global::System.CLSCompliant(false)] - public Builder SetPreConnectionBuffer(ulong value) { - result.hasPreConnectionBuffer = true; - result.preConnectionBuffer_ = value; - return this; - } - public Builder ClearPreConnectionBuffer() { - result.hasPreConnectionBuffer = false; - result.preConnectionBuffer_ = 0UL; - return this; - } - - public bool HasMaxPreConnectionMessages { - get { return result.HasMaxPreConnectionMessages; } - } - [global::System.CLSCompliant(false)] - public ulong MaxPreConnectionMessages { - get { return result.MaxPreConnectionMessages; } - set { SetMaxPreConnectionMessages(value); } - } - [global::System.CLSCompliant(false)] - public Builder SetMaxPreConnectionMessages(ulong value) { - result.hasMaxPreConnectionMessages = true; - result.maxPreConnectionMessages_ = value; - return this; - } - public Builder ClearMaxPreConnectionMessages() { - result.hasMaxPreConnectionMessages = false; - result.maxPreConnectionMessages_ = 0UL; - return this; - } - } - static SpaceServices() { - object.ReferenceEquals(global::Sirikata.Protocol._PBJ_Internal.Sirikata.Descriptor, null); - } - } - - public sealed partial class ObjLoc : pb::GeneratedMessage { - private static readonly ObjLoc defaultInstance = new Builder().BuildPartial(); - public static ObjLoc DefaultInstance { - get { return defaultInstance; } - } - - public override ObjLoc DefaultInstanceForType { - get { return defaultInstance; } - } - - protected override ObjLoc ThisMessage { - get { return this; } - } - - public static pbd::MessageDescriptor Descriptor { - get { return global::Sirikata.Protocol._PBJ_Internal.Sirikata.internal__static_Sirikata_Protocol__PBJ_Internal_ObjLoc__Descriptor; } - } - - protected override pb::FieldAccess.FieldAccessorTable InternalFieldAccessors { - get { return global::Sirikata.Protocol._PBJ_Internal.Sirikata.internal__static_Sirikata_Protocol__PBJ_Internal_ObjLoc__FieldAccessorTable; } - } - - #region Nested types - public static class Types { - public enum UpdateFlags { - FORCE = 1, - } - - } - #endregion - - public const int TimestampFieldNumber = 2; - private bool hasTimestamp; - private ulong timestamp_ = 0; - public bool HasTimestamp { - get { return hasTimestamp; } - } - [global::System.CLSCompliant(false)] - public ulong Timestamp { - get { return timestamp_; } - } - - public const int PositionFieldNumber = 3; - private int positionMemoizedSerializedSize; - private pbc::PopsicleList position_ = new pbc::PopsicleList(); - public scg::IList PositionList { - get { return pbc::Lists.AsReadOnly(position_); } - } - public int PositionCount { - get { return position_.Count; } - } - public double GetPosition(int index) { - return position_[index]; - } - - public const int OrientationFieldNumber = 4; - private int orientationMemoizedSerializedSize; - private pbc::PopsicleList orientation_ = new pbc::PopsicleList(); - public scg::IList OrientationList { - get { return pbc::Lists.AsReadOnly(orientation_); } - } - public int OrientationCount { - get { return orientation_.Count; } - } - public float GetOrientation(int index) { - return orientation_[index]; - } - - public const int VelocityFieldNumber = 5; - private int velocityMemoizedSerializedSize; - private pbc::PopsicleList velocity_ = new pbc::PopsicleList(); - public scg::IList VelocityList { - get { return pbc::Lists.AsReadOnly(velocity_); } - } - public int VelocityCount { - get { return velocity_.Count; } - } - public float GetVelocity(int index) { - return velocity_[index]; - } - - public const int RotationalAxisFieldNumber = 7; - private int rotationalAxisMemoizedSerializedSize; - private pbc::PopsicleList rotationalAxis_ = new pbc::PopsicleList(); - public scg::IList RotationalAxisList { - get { return pbc::Lists.AsReadOnly(rotationalAxis_); } - } - public int RotationalAxisCount { - get { return rotationalAxis_.Count; } - } - public float GetRotationalAxis(int index) { - return rotationalAxis_[index]; - } - - public const int AngularSpeedFieldNumber = 8; - private bool hasAngularSpeed; - private float angularSpeed_ = 0F; - public bool HasAngularSpeed { - get { return hasAngularSpeed; } - } - public float AngularSpeed { - get { return angularSpeed_; } - } - - public const int UpdateFlagsFieldNumber = 6; - private bool hasUpdateFlags; - private uint updateFlags_ = 0; - public bool HasUpdateFlags { - get { return hasUpdateFlags; } - } - [global::System.CLSCompliant(false)] - public uint UpdateFlags { - get { return updateFlags_; } - } - - public override bool IsInitialized { - get { - return true; - } - } - - public override void WriteTo(pb::CodedOutputStream output) { - if (HasTimestamp) { - output.WriteFixed64(2, Timestamp); - } - if (position_.Count > 0) { - output.WriteRawVarint32(26); - output.WriteRawVarint32((uint) positionMemoizedSerializedSize); - foreach (double element in position_) { - output.WriteDoubleNoTag(element); - } - } - if (orientation_.Count > 0) { - output.WriteRawVarint32(34); - output.WriteRawVarint32((uint) orientationMemoizedSerializedSize); - foreach (float element in orientation_) { - output.WriteFloatNoTag(element); - } - } - if (velocity_.Count > 0) { - output.WriteRawVarint32(42); - output.WriteRawVarint32((uint) velocityMemoizedSerializedSize); - foreach (float element in velocity_) { - output.WriteFloatNoTag(element); - } - } - if (HasUpdateFlags) { - output.WriteUInt32(6, UpdateFlags); - } - if (rotationalAxis_.Count > 0) { - output.WriteRawVarint32(58); - output.WriteRawVarint32((uint) rotationalAxisMemoizedSerializedSize); - foreach (float element in rotationalAxis_) { - output.WriteFloatNoTag(element); - } - } - if (HasAngularSpeed) { - output.WriteFloat(8, AngularSpeed); - } - UnknownFields.WriteTo(output); - } - - private int memoizedSerializedSize = -1; - public override int SerializedSize { - get { - int size = memoizedSerializedSize; - if (size != -1) return size; - - size = 0; - if (HasTimestamp) { - size += pb::CodedOutputStream.ComputeFixed64Size(2, Timestamp); - } - { - int dataSize = 0; - dataSize = 8 * position_.Count; - size += dataSize; - if (position_.Count!=0) size += 1 + pb::CodedOutputStream.ComputeInt32SizeNoTag(dataSize); - positionMemoizedSerializedSize = dataSize; - } - { - int dataSize = 0; - dataSize = 4 * orientation_.Count; - size += dataSize; - if (orientation_.Count!=0) size += 1 + pb::CodedOutputStream.ComputeInt32SizeNoTag(dataSize); - orientationMemoizedSerializedSize = dataSize; - } - { - int dataSize = 0; - dataSize = 4 * velocity_.Count; - size += dataSize; - if (velocity_.Count!=0) size += 1 + pb::CodedOutputStream.ComputeInt32SizeNoTag(dataSize); - velocityMemoizedSerializedSize = dataSize; - } - { - int dataSize = 0; - dataSize = 4 * rotationalAxis_.Count; - size += dataSize; - if (rotationalAxis_.Count!=0) size += 1 + pb::CodedOutputStream.ComputeInt32SizeNoTag(dataSize); - rotationalAxisMemoizedSerializedSize = dataSize; - } - if (HasAngularSpeed) { - size += pb::CodedOutputStream.ComputeFloatSize(8, AngularSpeed); - } - if (HasUpdateFlags) { - size += pb::CodedOutputStream.ComputeUInt32Size(6, UpdateFlags); - } - size += UnknownFields.SerializedSize; - memoizedSerializedSize = size; - return size; - } - } - - public static ObjLoc ParseFrom(pb::ByteString data) { - return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); - } - public static ObjLoc ParseFrom(pb::ByteString data, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); - } - public static ObjLoc ParseFrom(byte[] data) { - return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); - } - public static ObjLoc ParseFrom(byte[] data, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); - } - public static ObjLoc ParseFrom(global::System.IO.Stream input) { - return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); - } - public static ObjLoc ParseFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); - } - public static ObjLoc ParseDelimitedFrom(global::System.IO.Stream input) { - return CreateBuilder().MergeDelimitedFrom(input).BuildParsed(); - } - public static ObjLoc ParseDelimitedFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { - return CreateBuilder().MergeDelimitedFrom(input, extensionRegistry).BuildParsed(); - } - public static ObjLoc ParseFrom(pb::CodedInputStream input) { - return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); - } - public static ObjLoc ParseFrom(pb::CodedInputStream input, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); - } - public static Builder CreateBuilder() { return new Builder(); } - public override Builder ToBuilder() { return CreateBuilder(this); } - public override Builder CreateBuilderForType() { return new Builder(); } - public static Builder CreateBuilder(ObjLoc prototype) { - return (Builder) new Builder().MergeFrom(prototype); - } - - public sealed partial class Builder : pb::GeneratedBuilder { - protected override Builder ThisBuilder { - get { return this; } - } - public Builder() {} - - ObjLoc result = new ObjLoc(); - - protected override ObjLoc MessageBeingBuilt { - get { return result; } - } - - public override Builder Clear() { - result = new ObjLoc(); - return this; - } - - public override Builder Clone() { - return new Builder().MergeFrom(result); - } - - public override pbd::MessageDescriptor DescriptorForType { - get { return global::Sirikata.Protocol._PBJ_Internal.ObjLoc.Descriptor; } - } - - public override ObjLoc DefaultInstanceForType { - get { return global::Sirikata.Protocol._PBJ_Internal.ObjLoc.DefaultInstance; } - } - - public override ObjLoc BuildPartial() { - if (result == null) { - throw new global::System.InvalidOperationException("build() has already been called on this Builder"); - } - result.position_.MakeReadOnly(); - result.orientation_.MakeReadOnly(); - result.velocity_.MakeReadOnly(); - result.rotationalAxis_.MakeReadOnly(); - ObjLoc returnMe = result; - result = null; - return returnMe; - } - - public override Builder MergeFrom(pb::IMessage other) { - if (other is ObjLoc) { - return MergeFrom((ObjLoc) other); - } else { - base.MergeFrom(other); - return this; - } - } - - public override Builder MergeFrom(ObjLoc other) { - if (other == global::Sirikata.Protocol._PBJ_Internal.ObjLoc.DefaultInstance) return this; - if (other.HasTimestamp) { - Timestamp = other.Timestamp; - } - if (other.position_.Count != 0) { - base.AddRange(other.position_, result.position_); - } - if (other.orientation_.Count != 0) { - base.AddRange(other.orientation_, result.orientation_); - } - if (other.velocity_.Count != 0) { - base.AddRange(other.velocity_, result.velocity_); - } - if (other.rotationalAxis_.Count != 0) { - base.AddRange(other.rotationalAxis_, result.rotationalAxis_); - } - if (other.HasAngularSpeed) { - AngularSpeed = other.AngularSpeed; - } - if (other.HasUpdateFlags) { - UpdateFlags = other.UpdateFlags; - } - this.MergeUnknownFields(other.UnknownFields); - return this; - } - - public override Builder MergeFrom(pb::CodedInputStream input) { - return MergeFrom(input, pb::ExtensionRegistry.Empty); - } - - public override Builder MergeFrom(pb::CodedInputStream input, pb::ExtensionRegistry extensionRegistry) { - pb::UnknownFieldSet.Builder unknownFields = null; - while (true) { - uint tag = input.ReadTag(); - switch (tag) { - case 0: { - if (unknownFields != null) { - this.UnknownFields = unknownFields.Build(); - } - return this; - } - default: { - if (pb::WireFormat.IsEndGroupTag(tag)) { - if (unknownFields != null) { - this.UnknownFields = unknownFields.Build(); - } - return this; - } - if (unknownFields == null) { - unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); - } - ParseUnknownField(input, unknownFields, extensionRegistry, tag); - break; - } - case 17: { - Timestamp = input.ReadFixed64(); - break; - } - case 26: { - int length = input.ReadInt32(); - int limit = input.PushLimit(length); - while (!input.ReachedLimit) { - AddPosition(input.ReadDouble()); - } - input.PopLimit(limit); - break; - } - case 34: { - int length = input.ReadInt32(); - int limit = input.PushLimit(length); - while (!input.ReachedLimit) { - AddOrientation(input.ReadFloat()); - } - input.PopLimit(limit); - break; - } - case 42: { - int length = input.ReadInt32(); - int limit = input.PushLimit(length); - while (!input.ReachedLimit) { - AddVelocity(input.ReadFloat()); - } - input.PopLimit(limit); - break; - } - case 48: { - UpdateFlags = input.ReadUInt32(); - break; - } - case 58: { - int length = input.ReadInt32(); - int limit = input.PushLimit(length); - while (!input.ReachedLimit) { - AddRotationalAxis(input.ReadFloat()); - } - input.PopLimit(limit); - break; - } - case 69: { - AngularSpeed = input.ReadFloat(); - break; - } - } - } - } - - - public bool HasTimestamp { - get { return result.HasTimestamp; } - } - [global::System.CLSCompliant(false)] - public ulong Timestamp { - get { return result.Timestamp; } - set { SetTimestamp(value); } - } - [global::System.CLSCompliant(false)] - public Builder SetTimestamp(ulong value) { - result.hasTimestamp = true; - result.timestamp_ = value; - return this; - } - public Builder ClearTimestamp() { - result.hasTimestamp = false; - result.timestamp_ = 0; - return this; - } - - public pbc::IPopsicleList PositionList { - get { return result.position_; } - } - public int PositionCount { - get { return result.PositionCount; } - } - public double GetPosition(int index) { - return result.GetPosition(index); - } - public Builder SetPosition(int index, double value) { - result.position_[index] = value; - return this; - } - public Builder AddPosition(double value) { - result.position_.Add(value); - return this; - } - public Builder AddRangePosition(scg::IEnumerable values) { - base.AddRange(values, result.position_); - return this; - } - public Builder ClearPosition() { - result.position_.Clear(); - return this; - } - - public pbc::IPopsicleList OrientationList { - get { return result.orientation_; } - } - public int OrientationCount { - get { return result.OrientationCount; } - } - public float GetOrientation(int index) { - return result.GetOrientation(index); - } - public Builder SetOrientation(int index, float value) { - result.orientation_[index] = value; - return this; - } - public Builder AddOrientation(float value) { - result.orientation_.Add(value); - return this; - } - public Builder AddRangeOrientation(scg::IEnumerable values) { - base.AddRange(values, result.orientation_); - return this; - } - public Builder ClearOrientation() { - result.orientation_.Clear(); - return this; - } - - public pbc::IPopsicleList VelocityList { - get { return result.velocity_; } - } - public int VelocityCount { - get { return result.VelocityCount; } - } - public float GetVelocity(int index) { - return result.GetVelocity(index); - } - public Builder SetVelocity(int index, float value) { - result.velocity_[index] = value; - return this; - } - public Builder AddVelocity(float value) { - result.velocity_.Add(value); - return this; - } - public Builder AddRangeVelocity(scg::IEnumerable values) { - base.AddRange(values, result.velocity_); - return this; - } - public Builder ClearVelocity() { - result.velocity_.Clear(); - return this; - } - - public pbc::IPopsicleList RotationalAxisList { - get { return result.rotationalAxis_; } - } - public int RotationalAxisCount { - get { return result.RotationalAxisCount; } - } - public float GetRotationalAxis(int index) { - return result.GetRotationalAxis(index); - } - public Builder SetRotationalAxis(int index, float value) { - result.rotationalAxis_[index] = value; - return this; - } - public Builder AddRotationalAxis(float value) { - result.rotationalAxis_.Add(value); - return this; - } - public Builder AddRangeRotationalAxis(scg::IEnumerable values) { - base.AddRange(values, result.rotationalAxis_); - return this; - } - public Builder ClearRotationalAxis() { - result.rotationalAxis_.Clear(); - return this; - } - - public bool HasAngularSpeed { - get { return result.HasAngularSpeed; } - } - public float AngularSpeed { - get { return result.AngularSpeed; } - set { SetAngularSpeed(value); } - } - public Builder SetAngularSpeed(float value) { - result.hasAngularSpeed = true; - result.angularSpeed_ = value; - return this; - } - public Builder ClearAngularSpeed() { - result.hasAngularSpeed = false; - result.angularSpeed_ = 0F; - return this; - } - - public bool HasUpdateFlags { - get { return result.HasUpdateFlags; } - } - [global::System.CLSCompliant(false)] - public uint UpdateFlags { - get { return result.UpdateFlags; } - set { SetUpdateFlags(value); } - } - [global::System.CLSCompliant(false)] - public Builder SetUpdateFlags(uint value) { - result.hasUpdateFlags = true; - result.updateFlags_ = value; - return this; - } - public Builder ClearUpdateFlags() { - result.hasUpdateFlags = false; - result.updateFlags_ = 0; - return this; - } - } - static ObjLoc() { - object.ReferenceEquals(global::Sirikata.Protocol._PBJ_Internal.Sirikata.Descriptor, null); - } - } - - public sealed partial class LocRequest : pb::GeneratedMessage { - private static readonly LocRequest defaultInstance = new Builder().BuildPartial(); - public static LocRequest DefaultInstance { - get { return defaultInstance; } - } - - public override LocRequest DefaultInstanceForType { - get { return defaultInstance; } - } - - protected override LocRequest ThisMessage { - get { return this; } - } - - public static pbd::MessageDescriptor Descriptor { - get { return global::Sirikata.Protocol._PBJ_Internal.Sirikata.internal__static_Sirikata_Protocol__PBJ_Internal_LocRequest__Descriptor; } - } - - protected override pb::FieldAccess.FieldAccessorTable InternalFieldAccessors { - get { return global::Sirikata.Protocol._PBJ_Internal.Sirikata.internal__static_Sirikata_Protocol__PBJ_Internal_LocRequest__FieldAccessorTable; } - } - - #region Nested types - public static class Types { - public enum Fields { - POSITION = 1, - ORIENTATION = 2, - VELOCITY = 4, - ROTATIONAL_AXIS = 8, - ANGULAR_SPEED = 16, - } - - } - #endregion - - public const int RequestedFieldsFieldNumber = 2; - private bool hasRequestedFields; - private uint requestedFields_ = 0; - public bool HasRequestedFields { - get { return hasRequestedFields; } - } - [global::System.CLSCompliant(false)] - public uint RequestedFields { - get { return requestedFields_; } - } - - public override bool IsInitialized { - get { - return true; - } - } - - public override void WriteTo(pb::CodedOutputStream output) { - if (HasRequestedFields) { - output.WriteUInt32(2, RequestedFields); - } - UnknownFields.WriteTo(output); - } - - private int memoizedSerializedSize = -1; - public override int SerializedSize { - get { - int size = memoizedSerializedSize; - if (size != -1) return size; - - size = 0; - if (HasRequestedFields) { - size += pb::CodedOutputStream.ComputeUInt32Size(2, RequestedFields); - } - size += UnknownFields.SerializedSize; - memoizedSerializedSize = size; - return size; - } - } - - public static LocRequest ParseFrom(pb::ByteString data) { - return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); - } - public static LocRequest ParseFrom(pb::ByteString data, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); - } - public static LocRequest ParseFrom(byte[] data) { - return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); - } - public static LocRequest ParseFrom(byte[] data, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); - } - public static LocRequest ParseFrom(global::System.IO.Stream input) { - return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); - } - public static LocRequest ParseFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); - } - public static LocRequest ParseDelimitedFrom(global::System.IO.Stream input) { - return CreateBuilder().MergeDelimitedFrom(input).BuildParsed(); - } - public static LocRequest ParseDelimitedFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { - return CreateBuilder().MergeDelimitedFrom(input, extensionRegistry).BuildParsed(); - } - public static LocRequest ParseFrom(pb::CodedInputStream input) { - return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); - } - public static LocRequest ParseFrom(pb::CodedInputStream input, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); - } - public static Builder CreateBuilder() { return new Builder(); } - public override Builder ToBuilder() { return CreateBuilder(this); } - public override Builder CreateBuilderForType() { return new Builder(); } - public static Builder CreateBuilder(LocRequest prototype) { - return (Builder) new Builder().MergeFrom(prototype); - } - - public sealed partial class Builder : pb::GeneratedBuilder { - protected override Builder ThisBuilder { - get { return this; } - } - public Builder() {} - - LocRequest result = new LocRequest(); - - protected override LocRequest MessageBeingBuilt { - get { return result; } - } - - public override Builder Clear() { - result = new LocRequest(); - return this; - } - - public override Builder Clone() { - return new Builder().MergeFrom(result); - } - - public override pbd::MessageDescriptor DescriptorForType { - get { return global::Sirikata.Protocol._PBJ_Internal.LocRequest.Descriptor; } - } - - public override LocRequest DefaultInstanceForType { - get { return global::Sirikata.Protocol._PBJ_Internal.LocRequest.DefaultInstance; } - } - - public override LocRequest BuildPartial() { - if (result == null) { - throw new global::System.InvalidOperationException("build() has already been called on this Builder"); - } - LocRequest returnMe = result; - result = null; - return returnMe; - } - - public override Builder MergeFrom(pb::IMessage other) { - if (other is LocRequest) { - return MergeFrom((LocRequest) other); - } else { - base.MergeFrom(other); - return this; - } - } - - public override Builder MergeFrom(LocRequest other) { - if (other == global::Sirikata.Protocol._PBJ_Internal.LocRequest.DefaultInstance) return this; - if (other.HasRequestedFields) { - RequestedFields = other.RequestedFields; - } - this.MergeUnknownFields(other.UnknownFields); - return this; - } - - public override Builder MergeFrom(pb::CodedInputStream input) { - return MergeFrom(input, pb::ExtensionRegistry.Empty); - } - - public override Builder MergeFrom(pb::CodedInputStream input, pb::ExtensionRegistry extensionRegistry) { - pb::UnknownFieldSet.Builder unknownFields = null; - while (true) { - uint tag = input.ReadTag(); - switch (tag) { - case 0: { - if (unknownFields != null) { - this.UnknownFields = unknownFields.Build(); - } - return this; - } - default: { - if (pb::WireFormat.IsEndGroupTag(tag)) { - if (unknownFields != null) { - this.UnknownFields = unknownFields.Build(); - } - return this; - } - if (unknownFields == null) { - unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); - } - ParseUnknownField(input, unknownFields, extensionRegistry, tag); - break; - } - case 16: { - RequestedFields = input.ReadUInt32(); - break; - } - } - } - } - - - public bool HasRequestedFields { - get { return result.HasRequestedFields; } - } - [global::System.CLSCompliant(false)] - public uint RequestedFields { - get { return result.RequestedFields; } - set { SetRequestedFields(value); } - } - [global::System.CLSCompliant(false)] - public Builder SetRequestedFields(uint value) { - result.hasRequestedFields = true; - result.requestedFields_ = value; - return this; - } - public Builder ClearRequestedFields() { - result.hasRequestedFields = false; - result.requestedFields_ = 0; - return this; - } - } - static LocRequest() { - object.ReferenceEquals(global::Sirikata.Protocol._PBJ_Internal.Sirikata.Descriptor, null); - } - } - - public sealed partial class NewObj : pb::GeneratedMessage { - private static readonly NewObj defaultInstance = new Builder().BuildPartial(); - public static NewObj DefaultInstance { - get { return defaultInstance; } - } - - public override NewObj DefaultInstanceForType { - get { return defaultInstance; } - } - - protected override NewObj ThisMessage { - get { return this; } - } - - public static pbd::MessageDescriptor Descriptor { - get { return global::Sirikata.Protocol._PBJ_Internal.Sirikata.internal__static_Sirikata_Protocol__PBJ_Internal_NewObj__Descriptor; } - } - - protected override pb::FieldAccess.FieldAccessorTable InternalFieldAccessors { - get { return global::Sirikata.Protocol._PBJ_Internal.Sirikata.internal__static_Sirikata_Protocol__PBJ_Internal_NewObj__FieldAccessorTable; } - } - - public const int ObjectUuidEvidenceFieldNumber = 2; - private bool hasObjectUuidEvidence; - private pb::ByteString objectUuidEvidence_ = pb::ByteString.Empty; - public bool HasObjectUuidEvidence { - get { return hasObjectUuidEvidence; } - } - public pb::ByteString ObjectUuidEvidence { - get { return objectUuidEvidence_; } - } - - public const int RequestedObjectLocFieldNumber = 3; - private bool hasRequestedObjectLoc; - private global::Sirikata.Protocol._PBJ_Internal.ObjLoc requestedObjectLoc_ = global::Sirikata.Protocol._PBJ_Internal.ObjLoc.DefaultInstance; - public bool HasRequestedObjectLoc { - get { return hasRequestedObjectLoc; } - } - public global::Sirikata.Protocol._PBJ_Internal.ObjLoc RequestedObjectLoc { - get { return requestedObjectLoc_; } - } - - public const int BoundingSphereFieldNumber = 4; - private int boundingSphereMemoizedSerializedSize; - private pbc::PopsicleList boundingSphere_ = new pbc::PopsicleList(); - public scg::IList BoundingSphereList { - get { return pbc::Lists.AsReadOnly(boundingSphere_); } - } - public int BoundingSphereCount { - get { return boundingSphere_.Count; } - } - public float GetBoundingSphere(int index) { - return boundingSphere_[index]; - } - - public override bool IsInitialized { - get { - return true; - } - } - - public override void WriteTo(pb::CodedOutputStream output) { - if (HasObjectUuidEvidence) { - output.WriteBytes(2, ObjectUuidEvidence); - } - if (HasRequestedObjectLoc) { - output.WriteMessage(3, RequestedObjectLoc); - } - if (boundingSphere_.Count > 0) { - output.WriteRawVarint32(34); - output.WriteRawVarint32((uint) boundingSphereMemoizedSerializedSize); - foreach (float element in boundingSphere_) { - output.WriteFloatNoTag(element); - } - } - UnknownFields.WriteTo(output); - } - - private int memoizedSerializedSize = -1; - public override int SerializedSize { - get { - int size = memoizedSerializedSize; - if (size != -1) return size; - - size = 0; - if (HasObjectUuidEvidence) { - size += pb::CodedOutputStream.ComputeBytesSize(2, ObjectUuidEvidence); - } - if (HasRequestedObjectLoc) { - size += pb::CodedOutputStream.ComputeMessageSize(3, RequestedObjectLoc); - } - { - int dataSize = 0; - dataSize = 4 * boundingSphere_.Count; - size += dataSize; - if (boundingSphere_.Count!=0) size += 1 + pb::CodedOutputStream.ComputeInt32SizeNoTag(dataSize); - boundingSphereMemoizedSerializedSize = dataSize; - } - size += UnknownFields.SerializedSize; - memoizedSerializedSize = size; - return size; - } - } - - public static NewObj ParseFrom(pb::ByteString data) { - return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); - } - public static NewObj ParseFrom(pb::ByteString data, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); - } - public static NewObj ParseFrom(byte[] data) { - return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); - } - public static NewObj ParseFrom(byte[] data, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); - } - public static NewObj ParseFrom(global::System.IO.Stream input) { - return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); - } - public static NewObj ParseFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); - } - public static NewObj ParseDelimitedFrom(global::System.IO.Stream input) { - return CreateBuilder().MergeDelimitedFrom(input).BuildParsed(); - } - public static NewObj ParseDelimitedFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { - return CreateBuilder().MergeDelimitedFrom(input, extensionRegistry).BuildParsed(); - } - public static NewObj ParseFrom(pb::CodedInputStream input) { - return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); - } - public static NewObj ParseFrom(pb::CodedInputStream input, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); - } - public static Builder CreateBuilder() { return new Builder(); } - public override Builder ToBuilder() { return CreateBuilder(this); } - public override Builder CreateBuilderForType() { return new Builder(); } - public static Builder CreateBuilder(NewObj prototype) { - return (Builder) new Builder().MergeFrom(prototype); - } - - public sealed partial class Builder : pb::GeneratedBuilder { - protected override Builder ThisBuilder { - get { return this; } - } - public Builder() {} - - NewObj result = new NewObj(); - - protected override NewObj MessageBeingBuilt { - get { return result; } - } - - public override Builder Clear() { - result = new NewObj(); - return this; - } - - public override Builder Clone() { - return new Builder().MergeFrom(result); - } - - public override pbd::MessageDescriptor DescriptorForType { - get { return global::Sirikata.Protocol._PBJ_Internal.NewObj.Descriptor; } - } - - public override NewObj DefaultInstanceForType { - get { return global::Sirikata.Protocol._PBJ_Internal.NewObj.DefaultInstance; } - } - - public override NewObj BuildPartial() { - if (result == null) { - throw new global::System.InvalidOperationException("build() has already been called on this Builder"); - } - result.boundingSphere_.MakeReadOnly(); - NewObj returnMe = result; - result = null; - return returnMe; - } - - public override Builder MergeFrom(pb::IMessage other) { - if (other is NewObj) { - return MergeFrom((NewObj) other); - } else { - base.MergeFrom(other); - return this; - } - } - - public override Builder MergeFrom(NewObj other) { - if (other == global::Sirikata.Protocol._PBJ_Internal.NewObj.DefaultInstance) return this; - if (other.HasObjectUuidEvidence) { - ObjectUuidEvidence = other.ObjectUuidEvidence; - } - if (other.HasRequestedObjectLoc) { - MergeRequestedObjectLoc(other.RequestedObjectLoc); - } - if (other.boundingSphere_.Count != 0) { - base.AddRange(other.boundingSphere_, result.boundingSphere_); - } - this.MergeUnknownFields(other.UnknownFields); - return this; - } - - public override Builder MergeFrom(pb::CodedInputStream input) { - return MergeFrom(input, pb::ExtensionRegistry.Empty); - } - - public override Builder MergeFrom(pb::CodedInputStream input, pb::ExtensionRegistry extensionRegistry) { - pb::UnknownFieldSet.Builder unknownFields = null; - while (true) { - uint tag = input.ReadTag(); - switch (tag) { - case 0: { - if (unknownFields != null) { - this.UnknownFields = unknownFields.Build(); - } - return this; - } - default: { - if (pb::WireFormat.IsEndGroupTag(tag)) { - if (unknownFields != null) { - this.UnknownFields = unknownFields.Build(); - } - return this; - } - if (unknownFields == null) { - unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); - } - ParseUnknownField(input, unknownFields, extensionRegistry, tag); - break; - } - case 18: { - ObjectUuidEvidence = input.ReadBytes(); - break; - } - case 26: { - global::Sirikata.Protocol._PBJ_Internal.ObjLoc.Builder subBuilder = global::Sirikata.Protocol._PBJ_Internal.ObjLoc.CreateBuilder(); - if (HasRequestedObjectLoc) { - subBuilder.MergeFrom(RequestedObjectLoc); - } - input.ReadMessage(subBuilder, extensionRegistry); - RequestedObjectLoc = subBuilder.BuildPartial(); - break; - } - case 34: { - int length = input.ReadInt32(); - int limit = input.PushLimit(length); - while (!input.ReachedLimit) { - AddBoundingSphere(input.ReadFloat()); - } - input.PopLimit(limit); - break; - } - } - } - } - - - public bool HasObjectUuidEvidence { - get { return result.HasObjectUuidEvidence; } - } - public pb::ByteString ObjectUuidEvidence { - get { return result.ObjectUuidEvidence; } - set { SetObjectUuidEvidence(value); } - } - public Builder SetObjectUuidEvidence(pb::ByteString value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - result.hasObjectUuidEvidence = true; - result.objectUuidEvidence_ = value; - return this; - } - public Builder ClearObjectUuidEvidence() { - result.hasObjectUuidEvidence = false; - result.objectUuidEvidence_ = pb::ByteString.Empty; - return this; - } - - public bool HasRequestedObjectLoc { - get { return result.HasRequestedObjectLoc; } - } - public global::Sirikata.Protocol._PBJ_Internal.ObjLoc RequestedObjectLoc { - get { return result.RequestedObjectLoc; } - set { SetRequestedObjectLoc(value); } - } - public Builder SetRequestedObjectLoc(global::Sirikata.Protocol._PBJ_Internal.ObjLoc value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - result.hasRequestedObjectLoc = true; - result.requestedObjectLoc_ = value; - return this; - } - public Builder SetRequestedObjectLoc(global::Sirikata.Protocol._PBJ_Internal.ObjLoc.Builder builderForValue) { - pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); - result.hasRequestedObjectLoc = true; - result.requestedObjectLoc_ = builderForValue.Build(); - return this; - } - public Builder MergeRequestedObjectLoc(global::Sirikata.Protocol._PBJ_Internal.ObjLoc value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - if (result.HasRequestedObjectLoc && - result.requestedObjectLoc_ != global::Sirikata.Protocol._PBJ_Internal.ObjLoc.DefaultInstance) { - result.requestedObjectLoc_ = global::Sirikata.Protocol._PBJ_Internal.ObjLoc.CreateBuilder(result.requestedObjectLoc_).MergeFrom(value).BuildPartial(); - } else { - result.requestedObjectLoc_ = value; - } - result.hasRequestedObjectLoc = true; - return this; - } - public Builder ClearRequestedObjectLoc() { - result.hasRequestedObjectLoc = false; - result.requestedObjectLoc_ = global::Sirikata.Protocol._PBJ_Internal.ObjLoc.DefaultInstance; - return this; - } - - public pbc::IPopsicleList BoundingSphereList { - get { return result.boundingSphere_; } - } - public int BoundingSphereCount { - get { return result.BoundingSphereCount; } - } - public float GetBoundingSphere(int index) { - return result.GetBoundingSphere(index); - } - public Builder SetBoundingSphere(int index, float value) { - result.boundingSphere_[index] = value; - return this; - } - public Builder AddBoundingSphere(float value) { - result.boundingSphere_.Add(value); - return this; - } - public Builder AddRangeBoundingSphere(scg::IEnumerable values) { - base.AddRange(values, result.boundingSphere_); - return this; - } - public Builder ClearBoundingSphere() { - result.boundingSphere_.Clear(); - return this; - } - } - static NewObj() { - object.ReferenceEquals(global::Sirikata.Protocol._PBJ_Internal.Sirikata.Descriptor, null); - } - } - - public sealed partial class RetObj : pb::GeneratedMessage { - private static readonly RetObj defaultInstance = new Builder().BuildPartial(); - public static RetObj DefaultInstance { - get { return defaultInstance; } - } - - public override RetObj DefaultInstanceForType { - get { return defaultInstance; } - } - - protected override RetObj ThisMessage { - get { return this; } - } - - public static pbd::MessageDescriptor Descriptor { - get { return global::Sirikata.Protocol._PBJ_Internal.Sirikata.internal__static_Sirikata_Protocol__PBJ_Internal_RetObj__Descriptor; } - } - - protected override pb::FieldAccess.FieldAccessorTable InternalFieldAccessors { - get { return global::Sirikata.Protocol._PBJ_Internal.Sirikata.internal__static_Sirikata_Protocol__PBJ_Internal_RetObj__FieldAccessorTable; } - } - - public const int ObjectReferenceFieldNumber = 2; - private bool hasObjectReference; - private pb::ByteString objectReference_ = pb::ByteString.Empty; - public bool HasObjectReference { - get { return hasObjectReference; } - } - public pb::ByteString ObjectReference { - get { return objectReference_; } - } - - public const int LocationFieldNumber = 3; - private bool hasLocation; - private global::Sirikata.Protocol._PBJ_Internal.ObjLoc location_ = global::Sirikata.Protocol._PBJ_Internal.ObjLoc.DefaultInstance; - public bool HasLocation { - get { return hasLocation; } - } - public global::Sirikata.Protocol._PBJ_Internal.ObjLoc Location { - get { return location_; } - } - - public const int BoundingSphereFieldNumber = 4; - private int boundingSphereMemoizedSerializedSize; - private pbc::PopsicleList boundingSphere_ = new pbc::PopsicleList(); - public scg::IList BoundingSphereList { - get { return pbc::Lists.AsReadOnly(boundingSphere_); } - } - public int BoundingSphereCount { - get { return boundingSphere_.Count; } - } - public float GetBoundingSphere(int index) { - return boundingSphere_[index]; - } - - public override bool IsInitialized { - get { - return true; - } - } - - public override void WriteTo(pb::CodedOutputStream output) { - if (HasObjectReference) { - output.WriteBytes(2, ObjectReference); - } - if (HasLocation) { - output.WriteMessage(3, Location); - } - if (boundingSphere_.Count > 0) { - output.WriteRawVarint32(34); - output.WriteRawVarint32((uint) boundingSphereMemoizedSerializedSize); - foreach (float element in boundingSphere_) { - output.WriteFloatNoTag(element); - } - } - UnknownFields.WriteTo(output); - } - - private int memoizedSerializedSize = -1; - public override int SerializedSize { - get { - int size = memoizedSerializedSize; - if (size != -1) return size; - - size = 0; - if (HasObjectReference) { - size += pb::CodedOutputStream.ComputeBytesSize(2, ObjectReference); - } - if (HasLocation) { - size += pb::CodedOutputStream.ComputeMessageSize(3, Location); - } - { - int dataSize = 0; - dataSize = 4 * boundingSphere_.Count; - size += dataSize; - if (boundingSphere_.Count!=0) size += 1 + pb::CodedOutputStream.ComputeInt32SizeNoTag(dataSize); - boundingSphereMemoizedSerializedSize = dataSize; - } - size += UnknownFields.SerializedSize; - memoizedSerializedSize = size; - return size; - } - } - - public static RetObj ParseFrom(pb::ByteString data) { - return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); - } - public static RetObj ParseFrom(pb::ByteString data, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); - } - public static RetObj ParseFrom(byte[] data) { - return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); - } - public static RetObj ParseFrom(byte[] data, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); - } - public static RetObj ParseFrom(global::System.IO.Stream input) { - return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); - } - public static RetObj ParseFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); - } - public static RetObj ParseDelimitedFrom(global::System.IO.Stream input) { - return CreateBuilder().MergeDelimitedFrom(input).BuildParsed(); - } - public static RetObj ParseDelimitedFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { - return CreateBuilder().MergeDelimitedFrom(input, extensionRegistry).BuildParsed(); - } - public static RetObj ParseFrom(pb::CodedInputStream input) { - return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); - } - public static RetObj ParseFrom(pb::CodedInputStream input, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); - } - public static Builder CreateBuilder() { return new Builder(); } - public override Builder ToBuilder() { return CreateBuilder(this); } - public override Builder CreateBuilderForType() { return new Builder(); } - public static Builder CreateBuilder(RetObj prototype) { - return (Builder) new Builder().MergeFrom(prototype); - } - - public sealed partial class Builder : pb::GeneratedBuilder { - protected override Builder ThisBuilder { - get { return this; } - } - public Builder() {} - - RetObj result = new RetObj(); - - protected override RetObj MessageBeingBuilt { - get { return result; } - } - - public override Builder Clear() { - result = new RetObj(); - return this; - } - - public override Builder Clone() { - return new Builder().MergeFrom(result); - } - - public override pbd::MessageDescriptor DescriptorForType { - get { return global::Sirikata.Protocol._PBJ_Internal.RetObj.Descriptor; } - } - - public override RetObj DefaultInstanceForType { - get { return global::Sirikata.Protocol._PBJ_Internal.RetObj.DefaultInstance; } - } - - public override RetObj BuildPartial() { - if (result == null) { - throw new global::System.InvalidOperationException("build() has already been called on this Builder"); - } - result.boundingSphere_.MakeReadOnly(); - RetObj returnMe = result; - result = null; - return returnMe; - } - - public override Builder MergeFrom(pb::IMessage other) { - if (other is RetObj) { - return MergeFrom((RetObj) other); - } else { - base.MergeFrom(other); - return this; - } - } - - public override Builder MergeFrom(RetObj other) { - if (other == global::Sirikata.Protocol._PBJ_Internal.RetObj.DefaultInstance) return this; - if (other.HasObjectReference) { - ObjectReference = other.ObjectReference; - } - if (other.HasLocation) { - MergeLocation(other.Location); - } - if (other.boundingSphere_.Count != 0) { - base.AddRange(other.boundingSphere_, result.boundingSphere_); - } - this.MergeUnknownFields(other.UnknownFields); - return this; - } - - public override Builder MergeFrom(pb::CodedInputStream input) { - return MergeFrom(input, pb::ExtensionRegistry.Empty); - } - - public override Builder MergeFrom(pb::CodedInputStream input, pb::ExtensionRegistry extensionRegistry) { - pb::UnknownFieldSet.Builder unknownFields = null; - while (true) { - uint tag = input.ReadTag(); - switch (tag) { - case 0: { - if (unknownFields != null) { - this.UnknownFields = unknownFields.Build(); - } - return this; - } - default: { - if (pb::WireFormat.IsEndGroupTag(tag)) { - if (unknownFields != null) { - this.UnknownFields = unknownFields.Build(); - } - return this; - } - if (unknownFields == null) { - unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); - } - ParseUnknownField(input, unknownFields, extensionRegistry, tag); - break; - } - case 18: { - ObjectReference = input.ReadBytes(); - break; - } - case 26: { - global::Sirikata.Protocol._PBJ_Internal.ObjLoc.Builder subBuilder = global::Sirikata.Protocol._PBJ_Internal.ObjLoc.CreateBuilder(); - if (HasLocation) { - subBuilder.MergeFrom(Location); - } - input.ReadMessage(subBuilder, extensionRegistry); - Location = subBuilder.BuildPartial(); - break; - } - case 34: { - int length = input.ReadInt32(); - int limit = input.PushLimit(length); - while (!input.ReachedLimit) { - AddBoundingSphere(input.ReadFloat()); - } - input.PopLimit(limit); - break; - } - } - } - } - - - public bool HasObjectReference { - get { return result.HasObjectReference; } - } - public pb::ByteString ObjectReference { - get { return result.ObjectReference; } - set { SetObjectReference(value); } - } - public Builder SetObjectReference(pb::ByteString value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - result.hasObjectReference = true; - result.objectReference_ = value; - return this; - } - public Builder ClearObjectReference() { - result.hasObjectReference = false; - result.objectReference_ = pb::ByteString.Empty; - return this; - } - - public bool HasLocation { - get { return result.HasLocation; } - } - public global::Sirikata.Protocol._PBJ_Internal.ObjLoc Location { - get { return result.Location; } - set { SetLocation(value); } - } - public Builder SetLocation(global::Sirikata.Protocol._PBJ_Internal.ObjLoc value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - result.hasLocation = true; - result.location_ = value; - return this; - } - public Builder SetLocation(global::Sirikata.Protocol._PBJ_Internal.ObjLoc.Builder builderForValue) { - pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); - result.hasLocation = true; - result.location_ = builderForValue.Build(); - return this; - } - public Builder MergeLocation(global::Sirikata.Protocol._PBJ_Internal.ObjLoc value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - if (result.HasLocation && - result.location_ != global::Sirikata.Protocol._PBJ_Internal.ObjLoc.DefaultInstance) { - result.location_ = global::Sirikata.Protocol._PBJ_Internal.ObjLoc.CreateBuilder(result.location_).MergeFrom(value).BuildPartial(); - } else { - result.location_ = value; - } - result.hasLocation = true; - return this; - } - public Builder ClearLocation() { - result.hasLocation = false; - result.location_ = global::Sirikata.Protocol._PBJ_Internal.ObjLoc.DefaultInstance; - return this; - } - - public pbc::IPopsicleList BoundingSphereList { - get { return result.boundingSphere_; } - } - public int BoundingSphereCount { - get { return result.BoundingSphereCount; } - } - public float GetBoundingSphere(int index) { - return result.GetBoundingSphere(index); - } - public Builder SetBoundingSphere(int index, float value) { - result.boundingSphere_[index] = value; - return this; - } - public Builder AddBoundingSphere(float value) { - result.boundingSphere_.Add(value); - return this; - } - public Builder AddRangeBoundingSphere(scg::IEnumerable values) { - base.AddRange(values, result.boundingSphere_); - return this; - } - public Builder ClearBoundingSphere() { - result.boundingSphere_.Clear(); - return this; - } - } - static RetObj() { - object.ReferenceEquals(global::Sirikata.Protocol._PBJ_Internal.Sirikata.Descriptor, null); - } - } - - public sealed partial class DelObj : pb::GeneratedMessage { - private static readonly DelObj defaultInstance = new Builder().BuildPartial(); - public static DelObj DefaultInstance { - get { return defaultInstance; } - } - - public override DelObj DefaultInstanceForType { - get { return defaultInstance; } - } - - protected override DelObj ThisMessage { - get { return this; } - } - - public static pbd::MessageDescriptor Descriptor { - get { return global::Sirikata.Protocol._PBJ_Internal.Sirikata.internal__static_Sirikata_Protocol__PBJ_Internal_DelObj__Descriptor; } - } - - protected override pb::FieldAccess.FieldAccessorTable InternalFieldAccessors { - get { return global::Sirikata.Protocol._PBJ_Internal.Sirikata.internal__static_Sirikata_Protocol__PBJ_Internal_DelObj__FieldAccessorTable; } - } - - public const int ObjectReferenceFieldNumber = 2; - private bool hasObjectReference; - private pb::ByteString objectReference_ = pb::ByteString.Empty; - public bool HasObjectReference { - get { return hasObjectReference; } - } - public pb::ByteString ObjectReference { - get { return objectReference_; } - } - - public override bool IsInitialized { - get { - return true; - } - } - - public override void WriteTo(pb::CodedOutputStream output) { - if (HasObjectReference) { - output.WriteBytes(2, ObjectReference); - } - UnknownFields.WriteTo(output); - } - - private int memoizedSerializedSize = -1; - public override int SerializedSize { - get { - int size = memoizedSerializedSize; - if (size != -1) return size; - - size = 0; - if (HasObjectReference) { - size += pb::CodedOutputStream.ComputeBytesSize(2, ObjectReference); - } - size += UnknownFields.SerializedSize; - memoizedSerializedSize = size; - return size; - } - } - - public static DelObj ParseFrom(pb::ByteString data) { - return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); - } - public static DelObj ParseFrom(pb::ByteString data, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); - } - public static DelObj ParseFrom(byte[] data) { - return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); - } - public static DelObj ParseFrom(byte[] data, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); - } - public static DelObj ParseFrom(global::System.IO.Stream input) { - return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); - } - public static DelObj ParseFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); - } - public static DelObj ParseDelimitedFrom(global::System.IO.Stream input) { - return CreateBuilder().MergeDelimitedFrom(input).BuildParsed(); - } - public static DelObj ParseDelimitedFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { - return CreateBuilder().MergeDelimitedFrom(input, extensionRegistry).BuildParsed(); - } - public static DelObj ParseFrom(pb::CodedInputStream input) { - return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); - } - public static DelObj ParseFrom(pb::CodedInputStream input, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); - } - public static Builder CreateBuilder() { return new Builder(); } - public override Builder ToBuilder() { return CreateBuilder(this); } - public override Builder CreateBuilderForType() { return new Builder(); } - public static Builder CreateBuilder(DelObj prototype) { - return (Builder) new Builder().MergeFrom(prototype); - } - - public sealed partial class Builder : pb::GeneratedBuilder { - protected override Builder ThisBuilder { - get { return this; } - } - public Builder() {} - - DelObj result = new DelObj(); - - protected override DelObj MessageBeingBuilt { - get { return result; } - } - - public override Builder Clear() { - result = new DelObj(); - return this; - } - - public override Builder Clone() { - return new Builder().MergeFrom(result); - } - - public override pbd::MessageDescriptor DescriptorForType { - get { return global::Sirikata.Protocol._PBJ_Internal.DelObj.Descriptor; } - } - - public override DelObj DefaultInstanceForType { - get { return global::Sirikata.Protocol._PBJ_Internal.DelObj.DefaultInstance; } - } - - public override DelObj BuildPartial() { - if (result == null) { - throw new global::System.InvalidOperationException("build() has already been called on this Builder"); - } - DelObj returnMe = result; - result = null; - return returnMe; - } - - public override Builder MergeFrom(pb::IMessage other) { - if (other is DelObj) { - return MergeFrom((DelObj) other); - } else { - base.MergeFrom(other); - return this; - } - } - - public override Builder MergeFrom(DelObj other) { - if (other == global::Sirikata.Protocol._PBJ_Internal.DelObj.DefaultInstance) return this; - if (other.HasObjectReference) { - ObjectReference = other.ObjectReference; - } - this.MergeUnknownFields(other.UnknownFields); - return this; - } - - public override Builder MergeFrom(pb::CodedInputStream input) { - return MergeFrom(input, pb::ExtensionRegistry.Empty); - } - - public override Builder MergeFrom(pb::CodedInputStream input, pb::ExtensionRegistry extensionRegistry) { - pb::UnknownFieldSet.Builder unknownFields = null; - while (true) { - uint tag = input.ReadTag(); - switch (tag) { - case 0: { - if (unknownFields != null) { - this.UnknownFields = unknownFields.Build(); - } - return this; - } - default: { - if (pb::WireFormat.IsEndGroupTag(tag)) { - if (unknownFields != null) { - this.UnknownFields = unknownFields.Build(); - } - return this; - } - if (unknownFields == null) { - unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); - } - ParseUnknownField(input, unknownFields, extensionRegistry, tag); - break; - } - case 18: { - ObjectReference = input.ReadBytes(); - break; - } - } - } - } - - - public bool HasObjectReference { - get { return result.HasObjectReference; } - } - public pb::ByteString ObjectReference { - get { return result.ObjectReference; } - set { SetObjectReference(value); } - } - public Builder SetObjectReference(pb::ByteString value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - result.hasObjectReference = true; - result.objectReference_ = value; - return this; - } - public Builder ClearObjectReference() { - result.hasObjectReference = false; - result.objectReference_ = pb::ByteString.Empty; - return this; - } - } - static DelObj() { - object.ReferenceEquals(global::Sirikata.Protocol._PBJ_Internal.Sirikata.Descriptor, null); - } - } - - public sealed partial class NewProxQuery : pb::GeneratedMessage { - private static readonly NewProxQuery defaultInstance = new Builder().BuildPartial(); - public static NewProxQuery DefaultInstance { - get { return defaultInstance; } - } - - public override NewProxQuery DefaultInstanceForType { - get { return defaultInstance; } - } - - protected override NewProxQuery ThisMessage { - get { return this; } - } - - public static pbd::MessageDescriptor Descriptor { - get { return global::Sirikata.Protocol._PBJ_Internal.Sirikata.internal__static_Sirikata_Protocol__PBJ_Internal_NewProxQuery__Descriptor; } - } - - protected override pb::FieldAccess.FieldAccessorTable InternalFieldAccessors { - get { return global::Sirikata.Protocol._PBJ_Internal.Sirikata.internal__static_Sirikata_Protocol__PBJ_Internal_NewProxQuery__FieldAccessorTable; } - } - - public const int QueryIdFieldNumber = 2; - private bool hasQueryId; - private uint queryId_ = 0; - public bool HasQueryId { - get { return hasQueryId; } - } - [global::System.CLSCompliant(false)] - public uint QueryId { - get { return queryId_; } - } - - public const int StatelessFieldNumber = 3; - private bool hasStateless; - private bool stateless_ = false; - public bool HasStateless { - get { return hasStateless; } - } - public bool Stateless { - get { return stateless_; } - } - - public const int RelativeCenterFieldNumber = 4; - private int relativeCenterMemoizedSerializedSize; - private pbc::PopsicleList relativeCenter_ = new pbc::PopsicleList(); - public scg::IList RelativeCenterList { - get { return pbc::Lists.AsReadOnly(relativeCenter_); } - } - public int RelativeCenterCount { - get { return relativeCenter_.Count; } - } - public float GetRelativeCenter(int index) { - return relativeCenter_[index]; - } - - public const int AbsoluteCenterFieldNumber = 5; - private int absoluteCenterMemoizedSerializedSize; - private pbc::PopsicleList absoluteCenter_ = new pbc::PopsicleList(); - public scg::IList AbsoluteCenterList { - get { return pbc::Lists.AsReadOnly(absoluteCenter_); } - } - public int AbsoluteCenterCount { - get { return absoluteCenter_.Count; } - } - public double GetAbsoluteCenter(int index) { - return absoluteCenter_[index]; - } - - public const int MaxRadiusFieldNumber = 6; - private bool hasMaxRadius; - private float maxRadius_ = 0F; - public bool HasMaxRadius { - get { return hasMaxRadius; } - } - public float MaxRadius { - get { return maxRadius_; } - } - - public const int MinSolidAngleFieldNumber = 7; - private bool hasMinSolidAngle; - private float minSolidAngle_ = 0F; - public bool HasMinSolidAngle { - get { return hasMinSolidAngle; } - } - public float MinSolidAngle { - get { return minSolidAngle_; } - } - - public override bool IsInitialized { - get { - return true; - } - } - - public override void WriteTo(pb::CodedOutputStream output) { - if (HasQueryId) { - output.WriteUInt32(2, QueryId); - } - if (HasStateless) { - output.WriteBool(3, Stateless); - } - if (relativeCenter_.Count > 0) { - output.WriteRawVarint32(34); - output.WriteRawVarint32((uint) relativeCenterMemoizedSerializedSize); - foreach (float element in relativeCenter_) { - output.WriteFloatNoTag(element); - } - } - if (absoluteCenter_.Count > 0) { - output.WriteRawVarint32(42); - output.WriteRawVarint32((uint) absoluteCenterMemoizedSerializedSize); - foreach (double element in absoluteCenter_) { - output.WriteDoubleNoTag(element); - } - } - if (HasMaxRadius) { - output.WriteFloat(6, MaxRadius); - } - if (HasMinSolidAngle) { - output.WriteFloat(7, MinSolidAngle); - } - UnknownFields.WriteTo(output); - } - - private int memoizedSerializedSize = -1; - public override int SerializedSize { - get { - int size = memoizedSerializedSize; - if (size != -1) return size; - - size = 0; - if (HasQueryId) { - size += pb::CodedOutputStream.ComputeUInt32Size(2, QueryId); - } - if (HasStateless) { - size += pb::CodedOutputStream.ComputeBoolSize(3, Stateless); - } - { - int dataSize = 0; - dataSize = 4 * relativeCenter_.Count; - size += dataSize; - if (relativeCenter_.Count!=0) size += 1 + pb::CodedOutputStream.ComputeInt32SizeNoTag(dataSize); - relativeCenterMemoizedSerializedSize = dataSize; - } - { - int dataSize = 0; - dataSize = 8 * absoluteCenter_.Count; - size += dataSize; - if (absoluteCenter_.Count!=0) size += 1 + pb::CodedOutputStream.ComputeInt32SizeNoTag(dataSize); - absoluteCenterMemoizedSerializedSize = dataSize; - } - if (HasMaxRadius) { - size += pb::CodedOutputStream.ComputeFloatSize(6, MaxRadius); - } - if (HasMinSolidAngle) { - size += pb::CodedOutputStream.ComputeFloatSize(7, MinSolidAngle); - } - size += UnknownFields.SerializedSize; - memoizedSerializedSize = size; - return size; - } - } - - public static NewProxQuery ParseFrom(pb::ByteString data) { - return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); - } - public static NewProxQuery ParseFrom(pb::ByteString data, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); - } - public static NewProxQuery ParseFrom(byte[] data) { - return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); - } - public static NewProxQuery ParseFrom(byte[] data, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); - } - public static NewProxQuery ParseFrom(global::System.IO.Stream input) { - return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); - } - public static NewProxQuery ParseFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); - } - public static NewProxQuery ParseDelimitedFrom(global::System.IO.Stream input) { - return CreateBuilder().MergeDelimitedFrom(input).BuildParsed(); - } - public static NewProxQuery ParseDelimitedFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { - return CreateBuilder().MergeDelimitedFrom(input, extensionRegistry).BuildParsed(); - } - public static NewProxQuery ParseFrom(pb::CodedInputStream input) { - return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); - } - public static NewProxQuery ParseFrom(pb::CodedInputStream input, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); - } - public static Builder CreateBuilder() { return new Builder(); } - public override Builder ToBuilder() { return CreateBuilder(this); } - public override Builder CreateBuilderForType() { return new Builder(); } - public static Builder CreateBuilder(NewProxQuery prototype) { - return (Builder) new Builder().MergeFrom(prototype); - } - - public sealed partial class Builder : pb::GeneratedBuilder { - protected override Builder ThisBuilder { - get { return this; } - } - public Builder() {} - - NewProxQuery result = new NewProxQuery(); - - protected override NewProxQuery MessageBeingBuilt { - get { return result; } - } - - public override Builder Clear() { - result = new NewProxQuery(); - return this; - } - - public override Builder Clone() { - return new Builder().MergeFrom(result); - } - - public override pbd::MessageDescriptor DescriptorForType { - get { return global::Sirikata.Protocol._PBJ_Internal.NewProxQuery.Descriptor; } - } - - public override NewProxQuery DefaultInstanceForType { - get { return global::Sirikata.Protocol._PBJ_Internal.NewProxQuery.DefaultInstance; } - } - - public override NewProxQuery BuildPartial() { - if (result == null) { - throw new global::System.InvalidOperationException("build() has already been called on this Builder"); - } - result.relativeCenter_.MakeReadOnly(); - result.absoluteCenter_.MakeReadOnly(); - NewProxQuery returnMe = result; - result = null; - return returnMe; - } - - public override Builder MergeFrom(pb::IMessage other) { - if (other is NewProxQuery) { - return MergeFrom((NewProxQuery) other); - } else { - base.MergeFrom(other); - return this; - } - } - - public override Builder MergeFrom(NewProxQuery other) { - if (other == global::Sirikata.Protocol._PBJ_Internal.NewProxQuery.DefaultInstance) return this; - if (other.HasQueryId) { - QueryId = other.QueryId; - } - if (other.HasStateless) { - Stateless = other.Stateless; - } - if (other.relativeCenter_.Count != 0) { - base.AddRange(other.relativeCenter_, result.relativeCenter_); - } - if (other.absoluteCenter_.Count != 0) { - base.AddRange(other.absoluteCenter_, result.absoluteCenter_); - } - if (other.HasMaxRadius) { - MaxRadius = other.MaxRadius; - } - if (other.HasMinSolidAngle) { - MinSolidAngle = other.MinSolidAngle; - } - this.MergeUnknownFields(other.UnknownFields); - return this; - } - - public override Builder MergeFrom(pb::CodedInputStream input) { - return MergeFrom(input, pb::ExtensionRegistry.Empty); - } - - public override Builder MergeFrom(pb::CodedInputStream input, pb::ExtensionRegistry extensionRegistry) { - pb::UnknownFieldSet.Builder unknownFields = null; - while (true) { - uint tag = input.ReadTag(); - switch (tag) { - case 0: { - if (unknownFields != null) { - this.UnknownFields = unknownFields.Build(); - } - return this; - } - default: { - if (pb::WireFormat.IsEndGroupTag(tag)) { - if (unknownFields != null) { - this.UnknownFields = unknownFields.Build(); - } - return this; - } - if (unknownFields == null) { - unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); - } - ParseUnknownField(input, unknownFields, extensionRegistry, tag); - break; - } - case 16: { - QueryId = input.ReadUInt32(); - break; - } - case 24: { - Stateless = input.ReadBool(); - break; - } - case 34: { - int length = input.ReadInt32(); - int limit = input.PushLimit(length); - while (!input.ReachedLimit) { - AddRelativeCenter(input.ReadFloat()); - } - input.PopLimit(limit); - break; - } - case 42: { - int length = input.ReadInt32(); - int limit = input.PushLimit(length); - while (!input.ReachedLimit) { - AddAbsoluteCenter(input.ReadDouble()); - } - input.PopLimit(limit); - break; - } - case 53: { - MaxRadius = input.ReadFloat(); - break; - } - case 61: { - MinSolidAngle = input.ReadFloat(); - break; - } - } - } - } - - - public bool HasQueryId { - get { return result.HasQueryId; } - } - [global::System.CLSCompliant(false)] - public uint QueryId { - get { return result.QueryId; } - set { SetQueryId(value); } - } - [global::System.CLSCompliant(false)] - public Builder SetQueryId(uint value) { - result.hasQueryId = true; - result.queryId_ = value; - return this; - } - public Builder ClearQueryId() { - result.hasQueryId = false; - result.queryId_ = 0; - return this; - } - - public bool HasStateless { - get { return result.HasStateless; } - } - public bool Stateless { - get { return result.Stateless; } - set { SetStateless(value); } - } - public Builder SetStateless(bool value) { - result.hasStateless = true; - result.stateless_ = value; - return this; - } - public Builder ClearStateless() { - result.hasStateless = false; - result.stateless_ = false; - return this; - } - - public pbc::IPopsicleList RelativeCenterList { - get { return result.relativeCenter_; } - } - public int RelativeCenterCount { - get { return result.RelativeCenterCount; } - } - public float GetRelativeCenter(int index) { - return result.GetRelativeCenter(index); - } - public Builder SetRelativeCenter(int index, float value) { - result.relativeCenter_[index] = value; - return this; - } - public Builder AddRelativeCenter(float value) { - result.relativeCenter_.Add(value); - return this; - } - public Builder AddRangeRelativeCenter(scg::IEnumerable values) { - base.AddRange(values, result.relativeCenter_); - return this; - } - public Builder ClearRelativeCenter() { - result.relativeCenter_.Clear(); - return this; - } - - public pbc::IPopsicleList AbsoluteCenterList { - get { return result.absoluteCenter_; } - } - public int AbsoluteCenterCount { - get { return result.AbsoluteCenterCount; } - } - public double GetAbsoluteCenter(int index) { - return result.GetAbsoluteCenter(index); - } - public Builder SetAbsoluteCenter(int index, double value) { - result.absoluteCenter_[index] = value; - return this; - } - public Builder AddAbsoluteCenter(double value) { - result.absoluteCenter_.Add(value); - return this; - } - public Builder AddRangeAbsoluteCenter(scg::IEnumerable values) { - base.AddRange(values, result.absoluteCenter_); - return this; - } - public Builder ClearAbsoluteCenter() { - result.absoluteCenter_.Clear(); - return this; - } - - public bool HasMaxRadius { - get { return result.HasMaxRadius; } - } - public float MaxRadius { - get { return result.MaxRadius; } - set { SetMaxRadius(value); } - } - public Builder SetMaxRadius(float value) { - result.hasMaxRadius = true; - result.maxRadius_ = value; - return this; - } - public Builder ClearMaxRadius() { - result.hasMaxRadius = false; - result.maxRadius_ = 0F; - return this; - } - - public bool HasMinSolidAngle { - get { return result.HasMinSolidAngle; } - } - public float MinSolidAngle { - get { return result.MinSolidAngle; } - set { SetMinSolidAngle(value); } - } - public Builder SetMinSolidAngle(float value) { - result.hasMinSolidAngle = true; - result.minSolidAngle_ = value; - return this; - } - public Builder ClearMinSolidAngle() { - result.hasMinSolidAngle = false; - result.minSolidAngle_ = 0F; - return this; - } - } - static NewProxQuery() { - object.ReferenceEquals(global::Sirikata.Protocol._PBJ_Internal.Sirikata.Descriptor, null); - } - } - - public sealed partial class ProxCall : pb::GeneratedMessage { - private static readonly ProxCall defaultInstance = new Builder().BuildPartial(); - public static ProxCall DefaultInstance { - get { return defaultInstance; } - } - - public override ProxCall DefaultInstanceForType { - get { return defaultInstance; } - } - - protected override ProxCall ThisMessage { - get { return this; } - } - - public static pbd::MessageDescriptor Descriptor { - get { return global::Sirikata.Protocol._PBJ_Internal.Sirikata.internal__static_Sirikata_Protocol__PBJ_Internal_ProxCall__Descriptor; } - } - - protected override pb::FieldAccess.FieldAccessorTable InternalFieldAccessors { - get { return global::Sirikata.Protocol._PBJ_Internal.Sirikata.internal__static_Sirikata_Protocol__PBJ_Internal_ProxCall__FieldAccessorTable; } - } - - #region Nested types - public static class Types { - public enum ProximityEvent { - EXITED_PROXIMITY = 0, - ENTERED_PROXIMITY = 1, - STATELESS_PROXIMITY = 2, - } - - } - #endregion - - public const int QueryIdFieldNumber = 2; - private bool hasQueryId; - private uint queryId_ = 0; - public bool HasQueryId { - get { return hasQueryId; } - } - [global::System.CLSCompliant(false)] - public uint QueryId { - get { return queryId_; } - } - - public const int ProximateObjectFieldNumber = 3; - private bool hasProximateObject; - private pb::ByteString proximateObject_ = pb::ByteString.Empty; - public bool HasProximateObject { - get { return hasProximateObject; } - } - public pb::ByteString ProximateObject { - get { return proximateObject_; } - } - - public const int ProximityEventFieldNumber = 4; - private bool hasProximityEvent; - private global::Sirikata.Protocol._PBJ_Internal.ProxCall.Types.ProximityEvent proximityEvent_ = global::Sirikata.Protocol._PBJ_Internal.ProxCall.Types.ProximityEvent.EXITED_PROXIMITY; - public bool HasProximityEvent { - get { return hasProximityEvent; } - } - public global::Sirikata.Protocol._PBJ_Internal.ProxCall.Types.ProximityEvent ProximityEvent { - get { return proximityEvent_; } - } - - public override bool IsInitialized { - get { - if (!hasQueryId) return false; - if (!hasProximateObject) return false; - if (!hasProximityEvent) return false; - return true; - } - } - - public override void WriteTo(pb::CodedOutputStream output) { - if (HasQueryId) { - output.WriteUInt32(2, QueryId); - } - if (HasProximateObject) { - output.WriteBytes(3, ProximateObject); - } - if (HasProximityEvent) { - output.WriteEnum(4, (int) ProximityEvent); - } - UnknownFields.WriteTo(output); - } - - private int memoizedSerializedSize = -1; - public override int SerializedSize { - get { - int size = memoizedSerializedSize; - if (size != -1) return size; - - size = 0; - if (HasQueryId) { - size += pb::CodedOutputStream.ComputeUInt32Size(2, QueryId); - } - if (HasProximateObject) { - size += pb::CodedOutputStream.ComputeBytesSize(3, ProximateObject); - } - if (HasProximityEvent) { - size += pb::CodedOutputStream.ComputeEnumSize(4, (int) ProximityEvent); - } - size += UnknownFields.SerializedSize; - memoizedSerializedSize = size; - return size; - } - } - - public static ProxCall ParseFrom(pb::ByteString data) { - return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); - } - public static ProxCall ParseFrom(pb::ByteString data, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); - } - public static ProxCall ParseFrom(byte[] data) { - return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); - } - public static ProxCall ParseFrom(byte[] data, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); - } - public static ProxCall ParseFrom(global::System.IO.Stream input) { - return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); - } - public static ProxCall ParseFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); - } - public static ProxCall ParseDelimitedFrom(global::System.IO.Stream input) { - return CreateBuilder().MergeDelimitedFrom(input).BuildParsed(); - } - public static ProxCall ParseDelimitedFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { - return CreateBuilder().MergeDelimitedFrom(input, extensionRegistry).BuildParsed(); - } - public static ProxCall ParseFrom(pb::CodedInputStream input) { - return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); - } - public static ProxCall ParseFrom(pb::CodedInputStream input, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); - } - public static Builder CreateBuilder() { return new Builder(); } - public override Builder ToBuilder() { return CreateBuilder(this); } - public override Builder CreateBuilderForType() { return new Builder(); } - public static Builder CreateBuilder(ProxCall prototype) { - return (Builder) new Builder().MergeFrom(prototype); - } - - public sealed partial class Builder : pb::GeneratedBuilder { - protected override Builder ThisBuilder { - get { return this; } - } - public Builder() {} - - ProxCall result = new ProxCall(); - - protected override ProxCall MessageBeingBuilt { - get { return result; } - } - - public override Builder Clear() { - result = new ProxCall(); - return this; - } - - public override Builder Clone() { - return new Builder().MergeFrom(result); - } - - public override pbd::MessageDescriptor DescriptorForType { - get { return global::Sirikata.Protocol._PBJ_Internal.ProxCall.Descriptor; } - } - - public override ProxCall DefaultInstanceForType { - get { return global::Sirikata.Protocol._PBJ_Internal.ProxCall.DefaultInstance; } - } - - public override ProxCall BuildPartial() { - if (result == null) { - throw new global::System.InvalidOperationException("build() has already been called on this Builder"); - } - ProxCall returnMe = result; - result = null; - return returnMe; - } - - public override Builder MergeFrom(pb::IMessage other) { - if (other is ProxCall) { - return MergeFrom((ProxCall) other); - } else { - base.MergeFrom(other); - return this; - } - } - - public override Builder MergeFrom(ProxCall other) { - if (other == global::Sirikata.Protocol._PBJ_Internal.ProxCall.DefaultInstance) return this; - if (other.HasQueryId) { - QueryId = other.QueryId; - } - if (other.HasProximateObject) { - ProximateObject = other.ProximateObject; - } - if (other.HasProximityEvent) { - ProximityEvent = other.ProximityEvent; - } - this.MergeUnknownFields(other.UnknownFields); - return this; - } - - public override Builder MergeFrom(pb::CodedInputStream input) { - return MergeFrom(input, pb::ExtensionRegistry.Empty); - } - - public override Builder MergeFrom(pb::CodedInputStream input, pb::ExtensionRegistry extensionRegistry) { - pb::UnknownFieldSet.Builder unknownFields = null; - while (true) { - uint tag = input.ReadTag(); - switch (tag) { - case 0: { - if (unknownFields != null) { - this.UnknownFields = unknownFields.Build(); - } - return this; - } - default: { - if (pb::WireFormat.IsEndGroupTag(tag)) { - if (unknownFields != null) { - this.UnknownFields = unknownFields.Build(); - } - return this; - } - if (unknownFields == null) { - unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); - } - ParseUnknownField(input, unknownFields, extensionRegistry, tag); - break; - } - case 16: { - QueryId = input.ReadUInt32(); - break; - } - case 26: { - ProximateObject = input.ReadBytes(); - break; - } - case 32: { - int rawValue = input.ReadEnum(); - if (!global::System.Enum.IsDefined(typeof(global::Sirikata.Protocol._PBJ_Internal.ProxCall.Types.ProximityEvent), rawValue)) { - if (unknownFields == null) { - unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); - } - unknownFields.MergeVarintField(4, (ulong) rawValue); - } else { - ProximityEvent = (global::Sirikata.Protocol._PBJ_Internal.ProxCall.Types.ProximityEvent) rawValue; - } - break; - } - } - } - } - - - public bool HasQueryId { - get { return result.HasQueryId; } - } - [global::System.CLSCompliant(false)] - public uint QueryId { - get { return result.QueryId; } - set { SetQueryId(value); } - } - [global::System.CLSCompliant(false)] - public Builder SetQueryId(uint value) { - result.hasQueryId = true; - result.queryId_ = value; - return this; - } - public Builder ClearQueryId() { - result.hasQueryId = false; - result.queryId_ = 0; - return this; - } - - public bool HasProximateObject { - get { return result.HasProximateObject; } - } - public pb::ByteString ProximateObject { - get { return result.ProximateObject; } - set { SetProximateObject(value); } - } - public Builder SetProximateObject(pb::ByteString value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - result.hasProximateObject = true; - result.proximateObject_ = value; - return this; - } - public Builder ClearProximateObject() { - result.hasProximateObject = false; - result.proximateObject_ = pb::ByteString.Empty; - return this; - } - - public bool HasProximityEvent { - get { return result.HasProximityEvent; } - } - public global::Sirikata.Protocol._PBJ_Internal.ProxCall.Types.ProximityEvent ProximityEvent { - get { return result.ProximityEvent; } - set { SetProximityEvent(value); } - } - public Builder SetProximityEvent(global::Sirikata.Protocol._PBJ_Internal.ProxCall.Types.ProximityEvent value) { - result.hasProximityEvent = true; - result.proximityEvent_ = value; - return this; - } - public Builder ClearProximityEvent() { - result.hasProximityEvent = false; - result.proximityEvent_ = global::Sirikata.Protocol._PBJ_Internal.ProxCall.Types.ProximityEvent.EXITED_PROXIMITY; - return this; - } - } - static ProxCall() { - object.ReferenceEquals(global::Sirikata.Protocol._PBJ_Internal.Sirikata.Descriptor, null); - } - } - - public sealed partial class DelProxQuery : pb::GeneratedMessage { - private static readonly DelProxQuery defaultInstance = new Builder().BuildPartial(); - public static DelProxQuery DefaultInstance { - get { return defaultInstance; } - } - - public override DelProxQuery DefaultInstanceForType { - get { return defaultInstance; } - } - - protected override DelProxQuery ThisMessage { - get { return this; } - } - - public static pbd::MessageDescriptor Descriptor { - get { return global::Sirikata.Protocol._PBJ_Internal.Sirikata.internal__static_Sirikata_Protocol__PBJ_Internal_DelProxQuery__Descriptor; } - } - - protected override pb::FieldAccess.FieldAccessorTable InternalFieldAccessors { - get { return global::Sirikata.Protocol._PBJ_Internal.Sirikata.internal__static_Sirikata_Protocol__PBJ_Internal_DelProxQuery__FieldAccessorTable; } - } - - public const int QueryIdFieldNumber = 2; - private bool hasQueryId; - private uint queryId_ = 0; - public bool HasQueryId { - get { return hasQueryId; } - } - [global::System.CLSCompliant(false)] - public uint QueryId { - get { return queryId_; } - } - - public override bool IsInitialized { - get { - return true; - } - } - - public override void WriteTo(pb::CodedOutputStream output) { - if (HasQueryId) { - output.WriteUInt32(2, QueryId); - } - UnknownFields.WriteTo(output); - } - - private int memoizedSerializedSize = -1; - public override int SerializedSize { - get { - int size = memoizedSerializedSize; - if (size != -1) return size; - - size = 0; - if (HasQueryId) { - size += pb::CodedOutputStream.ComputeUInt32Size(2, QueryId); - } - size += UnknownFields.SerializedSize; - memoizedSerializedSize = size; - return size; - } - } - - public static DelProxQuery ParseFrom(pb::ByteString data) { - return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); - } - public static DelProxQuery ParseFrom(pb::ByteString data, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); - } - public static DelProxQuery ParseFrom(byte[] data) { - return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); - } - public static DelProxQuery ParseFrom(byte[] data, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); - } - public static DelProxQuery ParseFrom(global::System.IO.Stream input) { - return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); - } - public static DelProxQuery ParseFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); - } - public static DelProxQuery ParseDelimitedFrom(global::System.IO.Stream input) { - return CreateBuilder().MergeDelimitedFrom(input).BuildParsed(); - } - public static DelProxQuery ParseDelimitedFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { - return CreateBuilder().MergeDelimitedFrom(input, extensionRegistry).BuildParsed(); - } - public static DelProxQuery ParseFrom(pb::CodedInputStream input) { - return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); - } - public static DelProxQuery ParseFrom(pb::CodedInputStream input, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); - } - public static Builder CreateBuilder() { return new Builder(); } - public override Builder ToBuilder() { return CreateBuilder(this); } - public override Builder CreateBuilderForType() { return new Builder(); } - public static Builder CreateBuilder(DelProxQuery prototype) { - return (Builder) new Builder().MergeFrom(prototype); - } - - public sealed partial class Builder : pb::GeneratedBuilder { - protected override Builder ThisBuilder { - get { return this; } - } - public Builder() {} - - DelProxQuery result = new DelProxQuery(); - - protected override DelProxQuery MessageBeingBuilt { - get { return result; } - } - - public override Builder Clear() { - result = new DelProxQuery(); - return this; - } - - public override Builder Clone() { - return new Builder().MergeFrom(result); - } - - public override pbd::MessageDescriptor DescriptorForType { - get { return global::Sirikata.Protocol._PBJ_Internal.DelProxQuery.Descriptor; } - } - - public override DelProxQuery DefaultInstanceForType { - get { return global::Sirikata.Protocol._PBJ_Internal.DelProxQuery.DefaultInstance; } - } - - public override DelProxQuery BuildPartial() { - if (result == null) { - throw new global::System.InvalidOperationException("build() has already been called on this Builder"); - } - DelProxQuery returnMe = result; - result = null; - return returnMe; - } - - public override Builder MergeFrom(pb::IMessage other) { - if (other is DelProxQuery) { - return MergeFrom((DelProxQuery) other); - } else { - base.MergeFrom(other); - return this; - } - } - - public override Builder MergeFrom(DelProxQuery other) { - if (other == global::Sirikata.Protocol._PBJ_Internal.DelProxQuery.DefaultInstance) return this; - if (other.HasQueryId) { - QueryId = other.QueryId; - } - this.MergeUnknownFields(other.UnknownFields); - return this; - } - - public override Builder MergeFrom(pb::CodedInputStream input) { - return MergeFrom(input, pb::ExtensionRegistry.Empty); - } - - public override Builder MergeFrom(pb::CodedInputStream input, pb::ExtensionRegistry extensionRegistry) { - pb::UnknownFieldSet.Builder unknownFields = null; - while (true) { - uint tag = input.ReadTag(); - switch (tag) { - case 0: { - if (unknownFields != null) { - this.UnknownFields = unknownFields.Build(); - } - return this; - } - default: { - if (pb::WireFormat.IsEndGroupTag(tag)) { - if (unknownFields != null) { - this.UnknownFields = unknownFields.Build(); - } - return this; - } - if (unknownFields == null) { - unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); - } - ParseUnknownField(input, unknownFields, extensionRegistry, tag); - break; - } - case 16: { - QueryId = input.ReadUInt32(); - break; - } - } - } - } - - - public bool HasQueryId { - get { return result.HasQueryId; } - } - [global::System.CLSCompliant(false)] - public uint QueryId { - get { return result.QueryId; } - set { SetQueryId(value); } - } - [global::System.CLSCompliant(false)] - public Builder SetQueryId(uint value) { - result.hasQueryId = true; - result.queryId_ = value; - return this; - } - public Builder ClearQueryId() { - result.hasQueryId = false; - result.queryId_ = 0; - return this; - } - } - static DelProxQuery() { - object.ReferenceEquals(global::Sirikata.Protocol._PBJ_Internal.Sirikata.Descriptor, null); - } - } - - public sealed partial class Vector3fProperty : pb::GeneratedMessage { - private static readonly Vector3fProperty defaultInstance = new Builder().BuildPartial(); - public static Vector3fProperty DefaultInstance { - get { return defaultInstance; } - } - - public override Vector3fProperty DefaultInstanceForType { - get { return defaultInstance; } - } - - protected override Vector3fProperty ThisMessage { - get { return this; } - } - - public static pbd::MessageDescriptor Descriptor { - get { return global::Sirikata.Protocol._PBJ_Internal.Sirikata.internal__static_Sirikata_Protocol__PBJ_Internal_Vector3fProperty__Descriptor; } - } - - protected override pb::FieldAccess.FieldAccessorTable InternalFieldAccessors { - get { return global::Sirikata.Protocol._PBJ_Internal.Sirikata.internal__static_Sirikata_Protocol__PBJ_Internal_Vector3fProperty__FieldAccessorTable; } - } - - public const int ValueFieldNumber = 10; - private int valueMemoizedSerializedSize; - private pbc::PopsicleList value_ = new pbc::PopsicleList(); - public scg::IList ValueList { - get { return pbc::Lists.AsReadOnly(value_); } - } - public int ValueCount { - get { return value_.Count; } - } - public float GetValue(int index) { - return value_[index]; - } - - public override bool IsInitialized { - get { - return true; - } - } - - public override void WriteTo(pb::CodedOutputStream output) { - if (value_.Count > 0) { - output.WriteRawVarint32(82); - output.WriteRawVarint32((uint) valueMemoizedSerializedSize); - foreach (float element in value_) { - output.WriteFloatNoTag(element); - } - } - UnknownFields.WriteTo(output); - } - - private int memoizedSerializedSize = -1; - public override int SerializedSize { - get { - int size = memoizedSerializedSize; - if (size != -1) return size; - - size = 0; - { - int dataSize = 0; - dataSize = 4 * value_.Count; - size += dataSize; - if (value_.Count!=0) size += 1 + pb::CodedOutputStream.ComputeInt32SizeNoTag(dataSize); - valueMemoizedSerializedSize = dataSize; - } - size += UnknownFields.SerializedSize; - memoizedSerializedSize = size; - return size; - } - } - - public static Vector3fProperty ParseFrom(pb::ByteString data) { - return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); - } - public static Vector3fProperty ParseFrom(pb::ByteString data, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); - } - public static Vector3fProperty ParseFrom(byte[] data) { - return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); - } - public static Vector3fProperty ParseFrom(byte[] data, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); - } - public static Vector3fProperty ParseFrom(global::System.IO.Stream input) { - return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); - } - public static Vector3fProperty ParseFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); - } - public static Vector3fProperty ParseDelimitedFrom(global::System.IO.Stream input) { - return CreateBuilder().MergeDelimitedFrom(input).BuildParsed(); - } - public static Vector3fProperty ParseDelimitedFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { - return CreateBuilder().MergeDelimitedFrom(input, extensionRegistry).BuildParsed(); - } - public static Vector3fProperty ParseFrom(pb::CodedInputStream input) { - return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); - } - public static Vector3fProperty ParseFrom(pb::CodedInputStream input, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); - } - public static Builder CreateBuilder() { return new Builder(); } - public override Builder ToBuilder() { return CreateBuilder(this); } - public override Builder CreateBuilderForType() { return new Builder(); } - public static Builder CreateBuilder(Vector3fProperty prototype) { - return (Builder) new Builder().MergeFrom(prototype); - } - - public sealed partial class Builder : pb::GeneratedBuilder { - protected override Builder ThisBuilder { - get { return this; } - } - public Builder() {} - - Vector3fProperty result = new Vector3fProperty(); - - protected override Vector3fProperty MessageBeingBuilt { - get { return result; } - } - - public override Builder Clear() { - result = new Vector3fProperty(); - return this; - } - - public override Builder Clone() { - return new Builder().MergeFrom(result); - } - - public override pbd::MessageDescriptor DescriptorForType { - get { return global::Sirikata.Protocol._PBJ_Internal.Vector3fProperty.Descriptor; } - } - - public override Vector3fProperty DefaultInstanceForType { - get { return global::Sirikata.Protocol._PBJ_Internal.Vector3fProperty.DefaultInstance; } - } - - public override Vector3fProperty BuildPartial() { - if (result == null) { - throw new global::System.InvalidOperationException("build() has already been called on this Builder"); - } - result.value_.MakeReadOnly(); - Vector3fProperty returnMe = result; - result = null; - return returnMe; - } - - public override Builder MergeFrom(pb::IMessage other) { - if (other is Vector3fProperty) { - return MergeFrom((Vector3fProperty) other); - } else { - base.MergeFrom(other); - return this; - } - } - - public override Builder MergeFrom(Vector3fProperty other) { - if (other == global::Sirikata.Protocol._PBJ_Internal.Vector3fProperty.DefaultInstance) return this; - if (other.value_.Count != 0) { - base.AddRange(other.value_, result.value_); - } - this.MergeUnknownFields(other.UnknownFields); - return this; - } - - public override Builder MergeFrom(pb::CodedInputStream input) { - return MergeFrom(input, pb::ExtensionRegistry.Empty); - } - - public override Builder MergeFrom(pb::CodedInputStream input, pb::ExtensionRegistry extensionRegistry) { - pb::UnknownFieldSet.Builder unknownFields = null; - while (true) { - uint tag = input.ReadTag(); - switch (tag) { - case 0: { - if (unknownFields != null) { - this.UnknownFields = unknownFields.Build(); - } - return this; - } - default: { - if (pb::WireFormat.IsEndGroupTag(tag)) { - if (unknownFields != null) { - this.UnknownFields = unknownFields.Build(); - } - return this; - } - if (unknownFields == null) { - unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); - } - ParseUnknownField(input, unknownFields, extensionRegistry, tag); - break; - } - case 82: { - int length = input.ReadInt32(); - int limit = input.PushLimit(length); - while (!input.ReachedLimit) { - AddValue(input.ReadFloat()); - } - input.PopLimit(limit); - break; - } - } - } - } - - - public pbc::IPopsicleList ValueList { - get { return result.value_; } - } - public int ValueCount { - get { return result.ValueCount; } - } - public float GetValue(int index) { - return result.GetValue(index); - } - public Builder SetValue(int index, float value) { - result.value_[index] = value; - return this; - } - public Builder AddValue(float value) { - result.value_.Add(value); - return this; - } - public Builder AddRangeValue(scg::IEnumerable values) { - base.AddRange(values, result.value_); - return this; - } - public Builder ClearValue() { - result.value_.Clear(); - return this; - } - } - static Vector3fProperty() { - object.ReferenceEquals(global::Sirikata.Protocol._PBJ_Internal.Sirikata.Descriptor, null); - } - } - - public sealed partial class StringProperty : pb::GeneratedMessage { - private static readonly StringProperty defaultInstance = new Builder().BuildPartial(); - public static StringProperty DefaultInstance { - get { return defaultInstance; } - } - - public override StringProperty DefaultInstanceForType { - get { return defaultInstance; } - } - - protected override StringProperty ThisMessage { - get { return this; } - } - - public static pbd::MessageDescriptor Descriptor { - get { return global::Sirikata.Protocol._PBJ_Internal.Sirikata.internal__static_Sirikata_Protocol__PBJ_Internal_StringProperty__Descriptor; } - } - - protected override pb::FieldAccess.FieldAccessorTable InternalFieldAccessors { - get { return global::Sirikata.Protocol._PBJ_Internal.Sirikata.internal__static_Sirikata_Protocol__PBJ_Internal_StringProperty__FieldAccessorTable; } - } - - public const int ValueFieldNumber = 10; - private bool hasValue; - private string value_ = ""; - public bool HasValue { - get { return hasValue; } - } - public string Value { - get { return value_; } - } - - public override bool IsInitialized { - get { - return true; - } - } - - public override void WriteTo(pb::CodedOutputStream output) { - if (HasValue) { - output.WriteString(10, Value); - } - UnknownFields.WriteTo(output); - } - - private int memoizedSerializedSize = -1; - public override int SerializedSize { - get { - int size = memoizedSerializedSize; - if (size != -1) return size; - - size = 0; - if (HasValue) { - size += pb::CodedOutputStream.ComputeStringSize(10, Value); - } - size += UnknownFields.SerializedSize; - memoizedSerializedSize = size; - return size; - } - } - - public static StringProperty ParseFrom(pb::ByteString data) { - return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); - } - public static StringProperty ParseFrom(pb::ByteString data, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); - } - public static StringProperty ParseFrom(byte[] data) { - return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); - } - public static StringProperty ParseFrom(byte[] data, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); - } - public static StringProperty ParseFrom(global::System.IO.Stream input) { - return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); - } - public static StringProperty ParseFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); - } - public static StringProperty ParseDelimitedFrom(global::System.IO.Stream input) { - return CreateBuilder().MergeDelimitedFrom(input).BuildParsed(); - } - public static StringProperty ParseDelimitedFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { - return CreateBuilder().MergeDelimitedFrom(input, extensionRegistry).BuildParsed(); - } - public static StringProperty ParseFrom(pb::CodedInputStream input) { - return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); - } - public static StringProperty ParseFrom(pb::CodedInputStream input, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); - } - public static Builder CreateBuilder() { return new Builder(); } - public override Builder ToBuilder() { return CreateBuilder(this); } - public override Builder CreateBuilderForType() { return new Builder(); } - public static Builder CreateBuilder(StringProperty prototype) { - return (Builder) new Builder().MergeFrom(prototype); - } - - public sealed partial class Builder : pb::GeneratedBuilder { - protected override Builder ThisBuilder { - get { return this; } - } - public Builder() {} - - StringProperty result = new StringProperty(); - - protected override StringProperty MessageBeingBuilt { - get { return result; } - } - - public override Builder Clear() { - result = new StringProperty(); - return this; - } - - public override Builder Clone() { - return new Builder().MergeFrom(result); - } - - public override pbd::MessageDescriptor DescriptorForType { - get { return global::Sirikata.Protocol._PBJ_Internal.StringProperty.Descriptor; } - } - - public override StringProperty DefaultInstanceForType { - get { return global::Sirikata.Protocol._PBJ_Internal.StringProperty.DefaultInstance; } - } - - public override StringProperty BuildPartial() { - if (result == null) { - throw new global::System.InvalidOperationException("build() has already been called on this Builder"); - } - StringProperty returnMe = result; - result = null; - return returnMe; - } - - public override Builder MergeFrom(pb::IMessage other) { - if (other is StringProperty) { - return MergeFrom((StringProperty) other); - } else { - base.MergeFrom(other); - return this; - } - } - - public override Builder MergeFrom(StringProperty other) { - if (other == global::Sirikata.Protocol._PBJ_Internal.StringProperty.DefaultInstance) return this; - if (other.HasValue) { - Value = other.Value; - } - this.MergeUnknownFields(other.UnknownFields); - return this; - } - - public override Builder MergeFrom(pb::CodedInputStream input) { - return MergeFrom(input, pb::ExtensionRegistry.Empty); - } - - public override Builder MergeFrom(pb::CodedInputStream input, pb::ExtensionRegistry extensionRegistry) { - pb::UnknownFieldSet.Builder unknownFields = null; - while (true) { - uint tag = input.ReadTag(); - switch (tag) { - case 0: { - if (unknownFields != null) { - this.UnknownFields = unknownFields.Build(); - } - return this; - } - default: { - if (pb::WireFormat.IsEndGroupTag(tag)) { - if (unknownFields != null) { - this.UnknownFields = unknownFields.Build(); - } - return this; - } - if (unknownFields == null) { - unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); - } - ParseUnknownField(input, unknownFields, extensionRegistry, tag); - break; - } - case 82: { - Value = input.ReadString(); - break; - } - } - } - } - - - public bool HasValue { - get { return result.HasValue; } - } - public string Value { - get { return result.Value; } - set { SetValue(value); } - } - public Builder SetValue(string value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - result.hasValue = true; - result.value_ = value; - return this; - } - public Builder ClearValue() { - result.hasValue = false; - result.value_ = ""; - return this; - } - } - static StringProperty() { - object.ReferenceEquals(global::Sirikata.Protocol._PBJ_Internal.Sirikata.Descriptor, null); - } - } - - public sealed partial class StringMapProperty : pb::GeneratedMessage { - private static readonly StringMapProperty defaultInstance = new Builder().BuildPartial(); - public static StringMapProperty DefaultInstance { - get { return defaultInstance; } - } - - public override StringMapProperty DefaultInstanceForType { - get { return defaultInstance; } - } - - protected override StringMapProperty ThisMessage { - get { return this; } - } - - public static pbd::MessageDescriptor Descriptor { - get { return global::Sirikata.Protocol._PBJ_Internal.Sirikata.internal__static_Sirikata_Protocol__PBJ_Internal_StringMapProperty__Descriptor; } - } - - protected override pb::FieldAccess.FieldAccessorTable InternalFieldAccessors { - get { return global::Sirikata.Protocol._PBJ_Internal.Sirikata.internal__static_Sirikata_Protocol__PBJ_Internal_StringMapProperty__FieldAccessorTable; } - } - - public const int KeysFieldNumber = 2; - private pbc::PopsicleList keys_ = new pbc::PopsicleList(); - public scg::IList KeysList { - get { return pbc::Lists.AsReadOnly(keys_); } - } - public int KeysCount { - get { return keys_.Count; } - } - public string GetKeys(int index) { - return keys_[index]; - } - - public const int ValuesFieldNumber = 3; - private pbc::PopsicleList values_ = new pbc::PopsicleList(); - public scg::IList ValuesList { - get { return pbc::Lists.AsReadOnly(values_); } - } - public int ValuesCount { - get { return values_.Count; } - } - public string GetValues(int index) { - return values_[index]; - } - - public override bool IsInitialized { - get { - return true; - } - } - - public override void WriteTo(pb::CodedOutputStream output) { - if (keys_.Count > 0) { - foreach (string element in keys_) { - output.WriteString(2, element); - } - } - if (values_.Count > 0) { - foreach (string element in values_) { - output.WriteString(3, element); - } - } - UnknownFields.WriteTo(output); - } - - private int memoizedSerializedSize = -1; - public override int SerializedSize { - get { - int size = memoizedSerializedSize; - if (size != -1) return size; - - size = 0; - { - int dataSize = 0; - foreach (string element in KeysList) { - dataSize += pb::CodedOutputStream.ComputeStringSizeNoTag(element); - } - size += dataSize; - size += 1 * keys_.Count; - } - { - int dataSize = 0; - foreach (string element in ValuesList) { - dataSize += pb::CodedOutputStream.ComputeStringSizeNoTag(element); - } - size += dataSize; - size += 1 * values_.Count; - } - size += UnknownFields.SerializedSize; - memoizedSerializedSize = size; - return size; - } - } - - public static StringMapProperty ParseFrom(pb::ByteString data) { - return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); - } - public static StringMapProperty ParseFrom(pb::ByteString data, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); - } - public static StringMapProperty ParseFrom(byte[] data) { - return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); - } - public static StringMapProperty ParseFrom(byte[] data, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); - } - public static StringMapProperty ParseFrom(global::System.IO.Stream input) { - return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); - } - public static StringMapProperty ParseFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); - } - public static StringMapProperty ParseDelimitedFrom(global::System.IO.Stream input) { - return CreateBuilder().MergeDelimitedFrom(input).BuildParsed(); - } - public static StringMapProperty ParseDelimitedFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { - return CreateBuilder().MergeDelimitedFrom(input, extensionRegistry).BuildParsed(); - } - public static StringMapProperty ParseFrom(pb::CodedInputStream input) { - return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); - } - public static StringMapProperty ParseFrom(pb::CodedInputStream input, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); - } - public static Builder CreateBuilder() { return new Builder(); } - public override Builder ToBuilder() { return CreateBuilder(this); } - public override Builder CreateBuilderForType() { return new Builder(); } - public static Builder CreateBuilder(StringMapProperty prototype) { - return (Builder) new Builder().MergeFrom(prototype); - } - - public sealed partial class Builder : pb::GeneratedBuilder { - protected override Builder ThisBuilder { - get { return this; } - } - public Builder() {} - - StringMapProperty result = new StringMapProperty(); - - protected override StringMapProperty MessageBeingBuilt { - get { return result; } - } - - public override Builder Clear() { - result = new StringMapProperty(); - return this; - } - - public override Builder Clone() { - return new Builder().MergeFrom(result); - } - - public override pbd::MessageDescriptor DescriptorForType { - get { return global::Sirikata.Protocol._PBJ_Internal.StringMapProperty.Descriptor; } - } - - public override StringMapProperty DefaultInstanceForType { - get { return global::Sirikata.Protocol._PBJ_Internal.StringMapProperty.DefaultInstance; } - } - - public override StringMapProperty BuildPartial() { - if (result == null) { - throw new global::System.InvalidOperationException("build() has already been called on this Builder"); - } - result.keys_.MakeReadOnly(); - result.values_.MakeReadOnly(); - StringMapProperty returnMe = result; - result = null; - return returnMe; - } - - public override Builder MergeFrom(pb::IMessage other) { - if (other is StringMapProperty) { - return MergeFrom((StringMapProperty) other); - } else { - base.MergeFrom(other); - return this; - } - } - - public override Builder MergeFrom(StringMapProperty other) { - if (other == global::Sirikata.Protocol._PBJ_Internal.StringMapProperty.DefaultInstance) return this; - if (other.keys_.Count != 0) { - base.AddRange(other.keys_, result.keys_); - } - if (other.values_.Count != 0) { - base.AddRange(other.values_, result.values_); - } - this.MergeUnknownFields(other.UnknownFields); - return this; - } - - public override Builder MergeFrom(pb::CodedInputStream input) { - return MergeFrom(input, pb::ExtensionRegistry.Empty); - } - - public override Builder MergeFrom(pb::CodedInputStream input, pb::ExtensionRegistry extensionRegistry) { - pb::UnknownFieldSet.Builder unknownFields = null; - while (true) { - uint tag = input.ReadTag(); - switch (tag) { - case 0: { - if (unknownFields != null) { - this.UnknownFields = unknownFields.Build(); - } - return this; - } - default: { - if (pb::WireFormat.IsEndGroupTag(tag)) { - if (unknownFields != null) { - this.UnknownFields = unknownFields.Build(); - } - return this; - } - if (unknownFields == null) { - unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); - } - ParseUnknownField(input, unknownFields, extensionRegistry, tag); - break; - } - case 18: { - AddKeys(input.ReadString()); - break; - } - case 26: { - AddValues(input.ReadString()); - break; - } - } - } - } - - - public pbc::IPopsicleList KeysList { - get { return result.keys_; } - } - public int KeysCount { - get { return result.KeysCount; } - } - public string GetKeys(int index) { - return result.GetKeys(index); - } - public Builder SetKeys(int index, string value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - result.keys_[index] = value; - return this; - } - public Builder AddKeys(string value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - result.keys_.Add(value); - return this; - } - public Builder AddRangeKeys(scg::IEnumerable values) { - base.AddRange(values, result.keys_); - return this; - } - public Builder ClearKeys() { - result.keys_.Clear(); - return this; - } - - public pbc::IPopsicleList ValuesList { - get { return result.values_; } - } - public int ValuesCount { - get { return result.ValuesCount; } - } - public string GetValues(int index) { - return result.GetValues(index); - } - public Builder SetValues(int index, string value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - result.values_[index] = value; - return this; - } - public Builder AddValues(string value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - result.values_.Add(value); - return this; - } - public Builder AddRangeValues(scg::IEnumerable values) { - base.AddRange(values, result.values_); - return this; - } - public Builder ClearValues() { - result.values_.Clear(); - return this; - } - } - static StringMapProperty() { - object.ReferenceEquals(global::Sirikata.Protocol._PBJ_Internal.Sirikata.Descriptor, null); - } - } - - public sealed partial class PhysicalParameters : pb::GeneratedMessage { - private static readonly PhysicalParameters defaultInstance = new Builder().BuildPartial(); - public static PhysicalParameters DefaultInstance { - get { return defaultInstance; } - } - - public override PhysicalParameters DefaultInstanceForType { - get { return defaultInstance; } - } - - protected override PhysicalParameters ThisMessage { - get { return this; } - } - - public static pbd::MessageDescriptor Descriptor { - get { return global::Sirikata.Protocol._PBJ_Internal.Sirikata.internal__static_Sirikata_Protocol__PBJ_Internal_PhysicalParameters__Descriptor; } - } - - protected override pb::FieldAccess.FieldAccessorTable InternalFieldAccessors { - get { return global::Sirikata.Protocol._PBJ_Internal.Sirikata.internal__static_Sirikata_Protocol__PBJ_Internal_PhysicalParameters__FieldAccessorTable; } - } - - #region Nested types - public static class Types { - public enum Mode { - NONPHYSICAL = 0, - STATIC = 1, - DYNAMICBOX = 2, - DYNAMICSPHERE = 3, - DYNAMICCYLINDER = 4, - CHARACTER = 5, - } - - } - #endregion - - public const int ModeFieldNumber = 2; - private bool hasMode; - private global::Sirikata.Protocol._PBJ_Internal.PhysicalParameters.Types.Mode mode_ = global::Sirikata.Protocol._PBJ_Internal.PhysicalParameters.Types.Mode.NONPHYSICAL; - public bool HasMode { - get { return hasMode; } - } - public global::Sirikata.Protocol._PBJ_Internal.PhysicalParameters.Types.Mode Mode { - get { return mode_; } - } - - public const int DensityFieldNumber = 3; - private bool hasDensity; - private float density_ = 0F; - public bool HasDensity { - get { return hasDensity; } - } - public float Density { - get { return density_; } - } - - public const int FrictionFieldNumber = 4; - private bool hasFriction; - private float friction_ = 0F; - public bool HasFriction { - get { return hasFriction; } - } - public float Friction { - get { return friction_; } - } - - public const int BounceFieldNumber = 5; - private bool hasBounce; - private float bounce_ = 0F; - public bool HasBounce { - get { return hasBounce; } - } - public float Bounce { - get { return bounce_; } - } - - public const int HullFieldNumber = 6; - private int hullMemoizedSerializedSize; - private pbc::PopsicleList hull_ = new pbc::PopsicleList(); - public scg::IList HullList { - get { return pbc::Lists.AsReadOnly(hull_); } - } - public int HullCount { - get { return hull_.Count; } - } - public float GetHull(int index) { - return hull_[index]; - } - - public const int CollideMsgFieldNumber = 16; - private bool hasCollideMsg; - private uint collideMsg_ = 0; - public bool HasCollideMsg { - get { return hasCollideMsg; } - } - [global::System.CLSCompliant(false)] - public uint CollideMsg { - get { return collideMsg_; } - } - - public const int CollideMaskFieldNumber = 17; - private bool hasCollideMask; - private uint collideMask_ = 0; - public bool HasCollideMask { - get { return hasCollideMask; } - } - [global::System.CLSCompliant(false)] - public uint CollideMask { - get { return collideMask_; } - } - - public const int GravityFieldNumber = 18; - private bool hasGravity; - private float gravity_ = 0F; - public bool HasGravity { - get { return hasGravity; } - } - public float Gravity { - get { return gravity_; } - } - - public override bool IsInitialized { - get { - return true; - } - } - - public override void WriteTo(pb::CodedOutputStream output) { - if (HasMode) { - output.WriteEnum(2, (int) Mode); - } - if (HasDensity) { - output.WriteFloat(3, Density); - } - if (HasFriction) { - output.WriteFloat(4, Friction); - } - if (HasBounce) { - output.WriteFloat(5, Bounce); - } - if (hull_.Count > 0) { - output.WriteRawVarint32(50); - output.WriteRawVarint32((uint) hullMemoizedSerializedSize); - foreach (float element in hull_) { - output.WriteFloatNoTag(element); - } - } - if (HasCollideMsg) { - output.WriteUInt32(16, CollideMsg); - } - if (HasCollideMask) { - output.WriteUInt32(17, CollideMask); - } - if (HasGravity) { - output.WriteFloat(18, Gravity); - } - UnknownFields.WriteTo(output); - } - - private int memoizedSerializedSize = -1; - public override int SerializedSize { - get { - int size = memoizedSerializedSize; - if (size != -1) return size; - - size = 0; - if (HasMode) { - size += pb::CodedOutputStream.ComputeEnumSize(2, (int) Mode); - } - if (HasDensity) { - size += pb::CodedOutputStream.ComputeFloatSize(3, Density); - } - if (HasFriction) { - size += pb::CodedOutputStream.ComputeFloatSize(4, Friction); - } - if (HasBounce) { - size += pb::CodedOutputStream.ComputeFloatSize(5, Bounce); - } - { - int dataSize = 0; - dataSize = 4 * hull_.Count; - size += dataSize; - if (hull_.Count!=0) size += 1 + pb::CodedOutputStream.ComputeInt32SizeNoTag(dataSize); - hullMemoizedSerializedSize = dataSize; - } - if (HasCollideMsg) { - size += pb::CodedOutputStream.ComputeUInt32Size(16, CollideMsg); - } - if (HasCollideMask) { - size += pb::CodedOutputStream.ComputeUInt32Size(17, CollideMask); - } - if (HasGravity) { - size += pb::CodedOutputStream.ComputeFloatSize(18, Gravity); - } - size += UnknownFields.SerializedSize; - memoizedSerializedSize = size; - return size; - } - } - - public static PhysicalParameters ParseFrom(pb::ByteString data) { - return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); - } - public static PhysicalParameters ParseFrom(pb::ByteString data, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); - } - public static PhysicalParameters ParseFrom(byte[] data) { - return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); - } - public static PhysicalParameters ParseFrom(byte[] data, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); - } - public static PhysicalParameters ParseFrom(global::System.IO.Stream input) { - return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); - } - public static PhysicalParameters ParseFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); - } - public static PhysicalParameters ParseDelimitedFrom(global::System.IO.Stream input) { - return CreateBuilder().MergeDelimitedFrom(input).BuildParsed(); - } - public static PhysicalParameters ParseDelimitedFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { - return CreateBuilder().MergeDelimitedFrom(input, extensionRegistry).BuildParsed(); - } - public static PhysicalParameters ParseFrom(pb::CodedInputStream input) { - return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); - } - public static PhysicalParameters ParseFrom(pb::CodedInputStream input, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); - } - public static Builder CreateBuilder() { return new Builder(); } - public override Builder ToBuilder() { return CreateBuilder(this); } - public override Builder CreateBuilderForType() { return new Builder(); } - public static Builder CreateBuilder(PhysicalParameters prototype) { - return (Builder) new Builder().MergeFrom(prototype); - } - - public sealed partial class Builder : pb::GeneratedBuilder { - protected override Builder ThisBuilder { - get { return this; } - } - public Builder() {} - - PhysicalParameters result = new PhysicalParameters(); - - protected override PhysicalParameters MessageBeingBuilt { - get { return result; } - } - - public override Builder Clear() { - result = new PhysicalParameters(); - return this; - } - - public override Builder Clone() { - return new Builder().MergeFrom(result); - } - - public override pbd::MessageDescriptor DescriptorForType { - get { return global::Sirikata.Protocol._PBJ_Internal.PhysicalParameters.Descriptor; } - } - - public override PhysicalParameters DefaultInstanceForType { - get { return global::Sirikata.Protocol._PBJ_Internal.PhysicalParameters.DefaultInstance; } - } - - public override PhysicalParameters BuildPartial() { - if (result == null) { - throw new global::System.InvalidOperationException("build() has already been called on this Builder"); - } - result.hull_.MakeReadOnly(); - PhysicalParameters returnMe = result; - result = null; - return returnMe; - } - - public override Builder MergeFrom(pb::IMessage other) { - if (other is PhysicalParameters) { - return MergeFrom((PhysicalParameters) other); - } else { - base.MergeFrom(other); - return this; - } - } - - public override Builder MergeFrom(PhysicalParameters other) { - if (other == global::Sirikata.Protocol._PBJ_Internal.PhysicalParameters.DefaultInstance) return this; - if (other.HasMode) { - Mode = other.Mode; - } - if (other.HasDensity) { - Density = other.Density; - } - if (other.HasFriction) { - Friction = other.Friction; - } - if (other.HasBounce) { - Bounce = other.Bounce; - } - if (other.hull_.Count != 0) { - base.AddRange(other.hull_, result.hull_); - } - if (other.HasCollideMsg) { - CollideMsg = other.CollideMsg; - } - if (other.HasCollideMask) { - CollideMask = other.CollideMask; - } - if (other.HasGravity) { - Gravity = other.Gravity; - } - this.MergeUnknownFields(other.UnknownFields); - return this; - } - - public override Builder MergeFrom(pb::CodedInputStream input) { - return MergeFrom(input, pb::ExtensionRegistry.Empty); - } - - public override Builder MergeFrom(pb::CodedInputStream input, pb::ExtensionRegistry extensionRegistry) { - pb::UnknownFieldSet.Builder unknownFields = null; - while (true) { - uint tag = input.ReadTag(); - switch (tag) { - case 0: { - if (unknownFields != null) { - this.UnknownFields = unknownFields.Build(); - } - return this; - } - default: { - if (pb::WireFormat.IsEndGroupTag(tag)) { - if (unknownFields != null) { - this.UnknownFields = unknownFields.Build(); - } - return this; - } - if (unknownFields == null) { - unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); - } - ParseUnknownField(input, unknownFields, extensionRegistry, tag); - break; - } - case 16: { - int rawValue = input.ReadEnum(); - if (!global::System.Enum.IsDefined(typeof(global::Sirikata.Protocol._PBJ_Internal.PhysicalParameters.Types.Mode), rawValue)) { - if (unknownFields == null) { - unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); - } - unknownFields.MergeVarintField(2, (ulong) rawValue); - } else { - Mode = (global::Sirikata.Protocol._PBJ_Internal.PhysicalParameters.Types.Mode) rawValue; - } - break; - } - case 29: { - Density = input.ReadFloat(); - break; - } - case 37: { - Friction = input.ReadFloat(); - break; - } - case 45: { - Bounce = input.ReadFloat(); - break; - } - case 50: { - int length = input.ReadInt32(); - int limit = input.PushLimit(length); - while (!input.ReachedLimit) { - AddHull(input.ReadFloat()); - } - input.PopLimit(limit); - break; - } - case 128: { - CollideMsg = input.ReadUInt32(); - break; - } - case 136: { - CollideMask = input.ReadUInt32(); - break; - } - case 149: { - Gravity = input.ReadFloat(); - break; - } - } - } - } - - - public bool HasMode { - get { return result.HasMode; } - } - public global::Sirikata.Protocol._PBJ_Internal.PhysicalParameters.Types.Mode Mode { - get { return result.Mode; } - set { SetMode(value); } - } - public Builder SetMode(global::Sirikata.Protocol._PBJ_Internal.PhysicalParameters.Types.Mode value) { - result.hasMode = true; - result.mode_ = value; - return this; - } - public Builder ClearMode() { - result.hasMode = false; - result.mode_ = global::Sirikata.Protocol._PBJ_Internal.PhysicalParameters.Types.Mode.NONPHYSICAL; - return this; - } - - public bool HasDensity { - get { return result.HasDensity; } - } - public float Density { - get { return result.Density; } - set { SetDensity(value); } - } - public Builder SetDensity(float value) { - result.hasDensity = true; - result.density_ = value; - return this; - } - public Builder ClearDensity() { - result.hasDensity = false; - result.density_ = 0F; - return this; - } - - public bool HasFriction { - get { return result.HasFriction; } - } - public float Friction { - get { return result.Friction; } - set { SetFriction(value); } - } - public Builder SetFriction(float value) { - result.hasFriction = true; - result.friction_ = value; - return this; - } - public Builder ClearFriction() { - result.hasFriction = false; - result.friction_ = 0F; - return this; - } - - public bool HasBounce { - get { return result.HasBounce; } - } - public float Bounce { - get { return result.Bounce; } - set { SetBounce(value); } - } - public Builder SetBounce(float value) { - result.hasBounce = true; - result.bounce_ = value; - return this; - } - public Builder ClearBounce() { - result.hasBounce = false; - result.bounce_ = 0F; - return this; - } - - public pbc::IPopsicleList HullList { - get { return result.hull_; } - } - public int HullCount { - get { return result.HullCount; } - } - public float GetHull(int index) { - return result.GetHull(index); - } - public Builder SetHull(int index, float value) { - result.hull_[index] = value; - return this; - } - public Builder AddHull(float value) { - result.hull_.Add(value); - return this; - } - public Builder AddRangeHull(scg::IEnumerable values) { - base.AddRange(values, result.hull_); - return this; - } - public Builder ClearHull() { - result.hull_.Clear(); - return this; - } - - public bool HasCollideMsg { - get { return result.HasCollideMsg; } - } - [global::System.CLSCompliant(false)] - public uint CollideMsg { - get { return result.CollideMsg; } - set { SetCollideMsg(value); } - } - [global::System.CLSCompliant(false)] - public Builder SetCollideMsg(uint value) { - result.hasCollideMsg = true; - result.collideMsg_ = value; - return this; - } - public Builder ClearCollideMsg() { - result.hasCollideMsg = false; - result.collideMsg_ = 0; - return this; - } - - public bool HasCollideMask { - get { return result.HasCollideMask; } - } - [global::System.CLSCompliant(false)] - public uint CollideMask { - get { return result.CollideMask; } - set { SetCollideMask(value); } - } - [global::System.CLSCompliant(false)] - public Builder SetCollideMask(uint value) { - result.hasCollideMask = true; - result.collideMask_ = value; - return this; - } - public Builder ClearCollideMask() { - result.hasCollideMask = false; - result.collideMask_ = 0; - return this; - } - - public bool HasGravity { - get { return result.HasGravity; } - } - public float Gravity { - get { return result.Gravity; } - set { SetGravity(value); } - } - public Builder SetGravity(float value) { - result.hasGravity = true; - result.gravity_ = value; - return this; - } - public Builder ClearGravity() { - result.hasGravity = false; - result.gravity_ = 0F; - return this; - } - } - static PhysicalParameters() { - object.ReferenceEquals(global::Sirikata.Protocol._PBJ_Internal.Sirikata.Descriptor, null); - } - } - - public sealed partial class LightInfoProperty : pb::GeneratedMessage { - private static readonly LightInfoProperty defaultInstance = new Builder().BuildPartial(); - public static LightInfoProperty DefaultInstance { - get { return defaultInstance; } - } - - public override LightInfoProperty DefaultInstanceForType { - get { return defaultInstance; } - } - - protected override LightInfoProperty ThisMessage { - get { return this; } - } - - public static pbd::MessageDescriptor Descriptor { - get { return global::Sirikata.Protocol._PBJ_Internal.Sirikata.internal__static_Sirikata_Protocol__PBJ_Internal_LightInfoProperty__Descriptor; } - } - - protected override pb::FieldAccess.FieldAccessorTable InternalFieldAccessors { - get { return global::Sirikata.Protocol._PBJ_Internal.Sirikata.internal__static_Sirikata_Protocol__PBJ_Internal_LightInfoProperty__FieldAccessorTable; } - } - - #region Nested types - public static class Types { - public enum LightTypes { - POINT = 0, - SPOTLIGHT = 1, - DIRECTIONAL = 2, - } - - } - #endregion - - public const int DiffuseColorFieldNumber = 3; - private int diffuseColorMemoizedSerializedSize; - private pbc::PopsicleList diffuseColor_ = new pbc::PopsicleList(); - public scg::IList DiffuseColorList { - get { return pbc::Lists.AsReadOnly(diffuseColor_); } - } - public int DiffuseColorCount { - get { return diffuseColor_.Count; } - } - public float GetDiffuseColor(int index) { - return diffuseColor_[index]; - } - - public const int SpecularColorFieldNumber = 4; - private int specularColorMemoizedSerializedSize; - private pbc::PopsicleList specularColor_ = new pbc::PopsicleList(); - public scg::IList SpecularColorList { - get { return pbc::Lists.AsReadOnly(specularColor_); } - } - public int SpecularColorCount { - get { return specularColor_.Count; } - } - public float GetSpecularColor(int index) { - return specularColor_[index]; - } - - public const int PowerFieldNumber = 5; - private bool hasPower; - private float power_ = 0F; - public bool HasPower { - get { return hasPower; } - } - public float Power { - get { return power_; } - } - - public const int AmbientColorFieldNumber = 6; - private int ambientColorMemoizedSerializedSize; - private pbc::PopsicleList ambientColor_ = new pbc::PopsicleList(); - public scg::IList AmbientColorList { - get { return pbc::Lists.AsReadOnly(ambientColor_); } - } - public int AmbientColorCount { - get { return ambientColor_.Count; } - } - public float GetAmbientColor(int index) { - return ambientColor_[index]; - } - - public const int ShadowColorFieldNumber = 7; - private int shadowColorMemoizedSerializedSize; - private pbc::PopsicleList shadowColor_ = new pbc::PopsicleList(); - public scg::IList ShadowColorList { - get { return pbc::Lists.AsReadOnly(shadowColor_); } - } - public int ShadowColorCount { - get { return shadowColor_.Count; } - } - public float GetShadowColor(int index) { - return shadowColor_[index]; - } - - public const int LightRangeFieldNumber = 8; - private bool hasLightRange; - private double lightRange_ = 0D; - public bool HasLightRange { - get { return hasLightRange; } - } - public double LightRange { - get { return lightRange_; } - } - - public const int ConstantFalloffFieldNumber = 9; - private bool hasConstantFalloff; - private float constantFalloff_ = 0F; - public bool HasConstantFalloff { - get { return hasConstantFalloff; } - } - public float ConstantFalloff { - get { return constantFalloff_; } - } - - public const int LinearFalloffFieldNumber = 10; - private bool hasLinearFalloff; - private float linearFalloff_ = 0F; - public bool HasLinearFalloff { - get { return hasLinearFalloff; } - } - public float LinearFalloff { - get { return linearFalloff_; } - } - - public const int QuadraticFalloffFieldNumber = 11; - private bool hasQuadraticFalloff; - private float quadraticFalloff_ = 0F; - public bool HasQuadraticFalloff { - get { return hasQuadraticFalloff; } - } - public float QuadraticFalloff { - get { return quadraticFalloff_; } - } - - public const int ConeInnerRadiansFieldNumber = 12; - private bool hasConeInnerRadians; - private float coneInnerRadians_ = 0F; - public bool HasConeInnerRadians { - get { return hasConeInnerRadians; } - } - public float ConeInnerRadians { - get { return coneInnerRadians_; } - } - - public const int ConeOuterRadiansFieldNumber = 13; - private bool hasConeOuterRadians; - private float coneOuterRadians_ = 0F; - public bool HasConeOuterRadians { - get { return hasConeOuterRadians; } - } - public float ConeOuterRadians { - get { return coneOuterRadians_; } - } - - public const int ConeFalloffFieldNumber = 14; - private bool hasConeFalloff; - private float coneFalloff_ = 0F; - public bool HasConeFalloff { - get { return hasConeFalloff; } - } - public float ConeFalloff { - get { return coneFalloff_; } - } - - public const int TypeFieldNumber = 15; - private bool hasType; - private global::Sirikata.Protocol._PBJ_Internal.LightInfoProperty.Types.LightTypes type_ = global::Sirikata.Protocol._PBJ_Internal.LightInfoProperty.Types.LightTypes.POINT; - public bool HasType { - get { return hasType; } - } - public global::Sirikata.Protocol._PBJ_Internal.LightInfoProperty.Types.LightTypes Type { - get { return type_; } - } - - public const int CastsShadowFieldNumber = 16; - private bool hasCastsShadow; - private bool castsShadow_ = false; - public bool HasCastsShadow { - get { return hasCastsShadow; } - } - public bool CastsShadow { - get { return castsShadow_; } - } - - public override bool IsInitialized { - get { - return true; - } - } - - public override void WriteTo(pb::CodedOutputStream output) { - if (diffuseColor_.Count > 0) { - output.WriteRawVarint32(26); - output.WriteRawVarint32((uint) diffuseColorMemoizedSerializedSize); - foreach (float element in diffuseColor_) { - output.WriteFloatNoTag(element); - } - } - if (specularColor_.Count > 0) { - output.WriteRawVarint32(34); - output.WriteRawVarint32((uint) specularColorMemoizedSerializedSize); - foreach (float element in specularColor_) { - output.WriteFloatNoTag(element); - } - } - if (HasPower) { - output.WriteFloat(5, Power); - } - if (ambientColor_.Count > 0) { - output.WriteRawVarint32(50); - output.WriteRawVarint32((uint) ambientColorMemoizedSerializedSize); - foreach (float element in ambientColor_) { - output.WriteFloatNoTag(element); - } - } - if (shadowColor_.Count > 0) { - output.WriteRawVarint32(58); - output.WriteRawVarint32((uint) shadowColorMemoizedSerializedSize); - foreach (float element in shadowColor_) { - output.WriteFloatNoTag(element); - } - } - if (HasLightRange) { - output.WriteDouble(8, LightRange); - } - if (HasConstantFalloff) { - output.WriteFloat(9, ConstantFalloff); - } - if (HasLinearFalloff) { - output.WriteFloat(10, LinearFalloff); - } - if (HasQuadraticFalloff) { - output.WriteFloat(11, QuadraticFalloff); - } - if (HasConeInnerRadians) { - output.WriteFloat(12, ConeInnerRadians); - } - if (HasConeOuterRadians) { - output.WriteFloat(13, ConeOuterRadians); - } - if (HasConeFalloff) { - output.WriteFloat(14, ConeFalloff); - } - if (HasType) { - output.WriteEnum(15, (int) Type); - } - if (HasCastsShadow) { - output.WriteBool(16, CastsShadow); - } - UnknownFields.WriteTo(output); - } - - private int memoizedSerializedSize = -1; - public override int SerializedSize { - get { - int size = memoizedSerializedSize; - if (size != -1) return size; - - size = 0; - { - int dataSize = 0; - dataSize = 4 * diffuseColor_.Count; - size += dataSize; - if (diffuseColor_.Count!=0) size += 1 + pb::CodedOutputStream.ComputeInt32SizeNoTag(dataSize); - diffuseColorMemoizedSerializedSize = dataSize; - } - { - int dataSize = 0; - dataSize = 4 * specularColor_.Count; - size += dataSize; - if (specularColor_.Count!=0) size += 1 + pb::CodedOutputStream.ComputeInt32SizeNoTag(dataSize); - specularColorMemoizedSerializedSize = dataSize; - } - if (HasPower) { - size += pb::CodedOutputStream.ComputeFloatSize(5, Power); - } - { - int dataSize = 0; - dataSize = 4 * ambientColor_.Count; - size += dataSize; - if (ambientColor_.Count!=0) size += 1 + pb::CodedOutputStream.ComputeInt32SizeNoTag(dataSize); - ambientColorMemoizedSerializedSize = dataSize; - } - { - int dataSize = 0; - dataSize = 4 * shadowColor_.Count; - size += dataSize; - if (shadowColor_.Count!=0) size += 1 + pb::CodedOutputStream.ComputeInt32SizeNoTag(dataSize); - shadowColorMemoizedSerializedSize = dataSize; - } - if (HasLightRange) { - size += pb::CodedOutputStream.ComputeDoubleSize(8, LightRange); - } - if (HasConstantFalloff) { - size += pb::CodedOutputStream.ComputeFloatSize(9, ConstantFalloff); - } - if (HasLinearFalloff) { - size += pb::CodedOutputStream.ComputeFloatSize(10, LinearFalloff); - } - if (HasQuadraticFalloff) { - size += pb::CodedOutputStream.ComputeFloatSize(11, QuadraticFalloff); - } - if (HasConeInnerRadians) { - size += pb::CodedOutputStream.ComputeFloatSize(12, ConeInnerRadians); - } - if (HasConeOuterRadians) { - size += pb::CodedOutputStream.ComputeFloatSize(13, ConeOuterRadians); - } - if (HasConeFalloff) { - size += pb::CodedOutputStream.ComputeFloatSize(14, ConeFalloff); - } - if (HasType) { - size += pb::CodedOutputStream.ComputeEnumSize(15, (int) Type); - } - if (HasCastsShadow) { - size += pb::CodedOutputStream.ComputeBoolSize(16, CastsShadow); - } - size += UnknownFields.SerializedSize; - memoizedSerializedSize = size; - return size; - } - } - - public static LightInfoProperty ParseFrom(pb::ByteString data) { - return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); - } - public static LightInfoProperty ParseFrom(pb::ByteString data, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); - } - public static LightInfoProperty ParseFrom(byte[] data) { - return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); - } - public static LightInfoProperty ParseFrom(byte[] data, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); - } - public static LightInfoProperty ParseFrom(global::System.IO.Stream input) { - return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); - } - public static LightInfoProperty ParseFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); - } - public static LightInfoProperty ParseDelimitedFrom(global::System.IO.Stream input) { - return CreateBuilder().MergeDelimitedFrom(input).BuildParsed(); - } - public static LightInfoProperty ParseDelimitedFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { - return CreateBuilder().MergeDelimitedFrom(input, extensionRegistry).BuildParsed(); - } - public static LightInfoProperty ParseFrom(pb::CodedInputStream input) { - return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); - } - public static LightInfoProperty ParseFrom(pb::CodedInputStream input, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); - } - public static Builder CreateBuilder() { return new Builder(); } - public override Builder ToBuilder() { return CreateBuilder(this); } - public override Builder CreateBuilderForType() { return new Builder(); } - public static Builder CreateBuilder(LightInfoProperty prototype) { - return (Builder) new Builder().MergeFrom(prototype); - } - - public sealed partial class Builder : pb::GeneratedBuilder { - protected override Builder ThisBuilder { - get { return this; } - } - public Builder() {} - - LightInfoProperty result = new LightInfoProperty(); - - protected override LightInfoProperty MessageBeingBuilt { - get { return result; } - } - - public override Builder Clear() { - result = new LightInfoProperty(); - return this; - } - - public override Builder Clone() { - return new Builder().MergeFrom(result); - } - - public override pbd::MessageDescriptor DescriptorForType { - get { return global::Sirikata.Protocol._PBJ_Internal.LightInfoProperty.Descriptor; } - } - - public override LightInfoProperty DefaultInstanceForType { - get { return global::Sirikata.Protocol._PBJ_Internal.LightInfoProperty.DefaultInstance; } - } - - public override LightInfoProperty BuildPartial() { - if (result == null) { - throw new global::System.InvalidOperationException("build() has already been called on this Builder"); - } - result.diffuseColor_.MakeReadOnly(); - result.specularColor_.MakeReadOnly(); - result.ambientColor_.MakeReadOnly(); - result.shadowColor_.MakeReadOnly(); - LightInfoProperty returnMe = result; - result = null; - return returnMe; - } - - public override Builder MergeFrom(pb::IMessage other) { - if (other is LightInfoProperty) { - return MergeFrom((LightInfoProperty) other); - } else { - base.MergeFrom(other); - return this; - } - } - - public override Builder MergeFrom(LightInfoProperty other) { - if (other == global::Sirikata.Protocol._PBJ_Internal.LightInfoProperty.DefaultInstance) return this; - if (other.diffuseColor_.Count != 0) { - base.AddRange(other.diffuseColor_, result.diffuseColor_); - } - if (other.specularColor_.Count != 0) { - base.AddRange(other.specularColor_, result.specularColor_); - } - if (other.HasPower) { - Power = other.Power; - } - if (other.ambientColor_.Count != 0) { - base.AddRange(other.ambientColor_, result.ambientColor_); - } - if (other.shadowColor_.Count != 0) { - base.AddRange(other.shadowColor_, result.shadowColor_); - } - if (other.HasLightRange) { - LightRange = other.LightRange; - } - if (other.HasConstantFalloff) { - ConstantFalloff = other.ConstantFalloff; - } - if (other.HasLinearFalloff) { - LinearFalloff = other.LinearFalloff; - } - if (other.HasQuadraticFalloff) { - QuadraticFalloff = other.QuadraticFalloff; - } - if (other.HasConeInnerRadians) { - ConeInnerRadians = other.ConeInnerRadians; - } - if (other.HasConeOuterRadians) { - ConeOuterRadians = other.ConeOuterRadians; - } - if (other.HasConeFalloff) { - ConeFalloff = other.ConeFalloff; - } - if (other.HasType) { - Type = other.Type; - } - if (other.HasCastsShadow) { - CastsShadow = other.CastsShadow; - } - this.MergeUnknownFields(other.UnknownFields); - return this; - } - - public override Builder MergeFrom(pb::CodedInputStream input) { - return MergeFrom(input, pb::ExtensionRegistry.Empty); - } - - public override Builder MergeFrom(pb::CodedInputStream input, pb::ExtensionRegistry extensionRegistry) { - pb::UnknownFieldSet.Builder unknownFields = null; - while (true) { - uint tag = input.ReadTag(); - switch (tag) { - case 0: { - if (unknownFields != null) { - this.UnknownFields = unknownFields.Build(); - } - return this; - } - default: { - if (pb::WireFormat.IsEndGroupTag(tag)) { - if (unknownFields != null) { - this.UnknownFields = unknownFields.Build(); - } - return this; - } - if (unknownFields == null) { - unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); - } - ParseUnknownField(input, unknownFields, extensionRegistry, tag); - break; - } - case 26: { - int length = input.ReadInt32(); - int limit = input.PushLimit(length); - while (!input.ReachedLimit) { - AddDiffuseColor(input.ReadFloat()); - } - input.PopLimit(limit); - break; - } - case 34: { - int length = input.ReadInt32(); - int limit = input.PushLimit(length); - while (!input.ReachedLimit) { - AddSpecularColor(input.ReadFloat()); - } - input.PopLimit(limit); - break; - } - case 45: { - Power = input.ReadFloat(); - break; - } - case 50: { - int length = input.ReadInt32(); - int limit = input.PushLimit(length); - while (!input.ReachedLimit) { - AddAmbientColor(input.ReadFloat()); - } - input.PopLimit(limit); - break; - } - case 58: { - int length = input.ReadInt32(); - int limit = input.PushLimit(length); - while (!input.ReachedLimit) { - AddShadowColor(input.ReadFloat()); - } - input.PopLimit(limit); - break; - } - case 65: { - LightRange = input.ReadDouble(); - break; - } - case 77: { - ConstantFalloff = input.ReadFloat(); - break; - } - case 85: { - LinearFalloff = input.ReadFloat(); - break; - } - case 93: { - QuadraticFalloff = input.ReadFloat(); - break; - } - case 101: { - ConeInnerRadians = input.ReadFloat(); - break; - } - case 109: { - ConeOuterRadians = input.ReadFloat(); - break; - } - case 117: { - ConeFalloff = input.ReadFloat(); - break; - } - case 120: { - int rawValue = input.ReadEnum(); - if (!global::System.Enum.IsDefined(typeof(global::Sirikata.Protocol._PBJ_Internal.LightInfoProperty.Types.LightTypes), rawValue)) { - if (unknownFields == null) { - unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); - } - unknownFields.MergeVarintField(15, (ulong) rawValue); - } else { - Type = (global::Sirikata.Protocol._PBJ_Internal.LightInfoProperty.Types.LightTypes) rawValue; - } - break; - } - case 128: { - CastsShadow = input.ReadBool(); - break; - } - } - } - } - - - public pbc::IPopsicleList DiffuseColorList { - get { return result.diffuseColor_; } - } - public int DiffuseColorCount { - get { return result.DiffuseColorCount; } - } - public float GetDiffuseColor(int index) { - return result.GetDiffuseColor(index); - } - public Builder SetDiffuseColor(int index, float value) { - result.diffuseColor_[index] = value; - return this; - } - public Builder AddDiffuseColor(float value) { - result.diffuseColor_.Add(value); - return this; - } - public Builder AddRangeDiffuseColor(scg::IEnumerable values) { - base.AddRange(values, result.diffuseColor_); - return this; - } - public Builder ClearDiffuseColor() { - result.diffuseColor_.Clear(); - return this; - } - - public pbc::IPopsicleList SpecularColorList { - get { return result.specularColor_; } - } - public int SpecularColorCount { - get { return result.SpecularColorCount; } - } - public float GetSpecularColor(int index) { - return result.GetSpecularColor(index); - } - public Builder SetSpecularColor(int index, float value) { - result.specularColor_[index] = value; - return this; - } - public Builder AddSpecularColor(float value) { - result.specularColor_.Add(value); - return this; - } - public Builder AddRangeSpecularColor(scg::IEnumerable values) { - base.AddRange(values, result.specularColor_); - return this; - } - public Builder ClearSpecularColor() { - result.specularColor_.Clear(); - return this; - } - - public bool HasPower { - get { return result.HasPower; } - } - public float Power { - get { return result.Power; } - set { SetPower(value); } - } - public Builder SetPower(float value) { - result.hasPower = true; - result.power_ = value; - return this; - } - public Builder ClearPower() { - result.hasPower = false; - result.power_ = 0F; - return this; - } - - public pbc::IPopsicleList AmbientColorList { - get { return result.ambientColor_; } - } - public int AmbientColorCount { - get { return result.AmbientColorCount; } - } - public float GetAmbientColor(int index) { - return result.GetAmbientColor(index); - } - public Builder SetAmbientColor(int index, float value) { - result.ambientColor_[index] = value; - return this; - } - public Builder AddAmbientColor(float value) { - result.ambientColor_.Add(value); - return this; - } - public Builder AddRangeAmbientColor(scg::IEnumerable values) { - base.AddRange(values, result.ambientColor_); - return this; - } - public Builder ClearAmbientColor() { - result.ambientColor_.Clear(); - return this; - } - - public pbc::IPopsicleList ShadowColorList { - get { return result.shadowColor_; } - } - public int ShadowColorCount { - get { return result.ShadowColorCount; } - } - public float GetShadowColor(int index) { - return result.GetShadowColor(index); - } - public Builder SetShadowColor(int index, float value) { - result.shadowColor_[index] = value; - return this; - } - public Builder AddShadowColor(float value) { - result.shadowColor_.Add(value); - return this; - } - public Builder AddRangeShadowColor(scg::IEnumerable values) { - base.AddRange(values, result.shadowColor_); - return this; - } - public Builder ClearShadowColor() { - result.shadowColor_.Clear(); - return this; - } - - public bool HasLightRange { - get { return result.HasLightRange; } - } - public double LightRange { - get { return result.LightRange; } - set { SetLightRange(value); } - } - public Builder SetLightRange(double value) { - result.hasLightRange = true; - result.lightRange_ = value; - return this; - } - public Builder ClearLightRange() { - result.hasLightRange = false; - result.lightRange_ = 0D; - return this; - } - - public bool HasConstantFalloff { - get { return result.HasConstantFalloff; } - } - public float ConstantFalloff { - get { return result.ConstantFalloff; } - set { SetConstantFalloff(value); } - } - public Builder SetConstantFalloff(float value) { - result.hasConstantFalloff = true; - result.constantFalloff_ = value; - return this; - } - public Builder ClearConstantFalloff() { - result.hasConstantFalloff = false; - result.constantFalloff_ = 0F; - return this; - } - - public bool HasLinearFalloff { - get { return result.HasLinearFalloff; } - } - public float LinearFalloff { - get { return result.LinearFalloff; } - set { SetLinearFalloff(value); } - } - public Builder SetLinearFalloff(float value) { - result.hasLinearFalloff = true; - result.linearFalloff_ = value; - return this; - } - public Builder ClearLinearFalloff() { - result.hasLinearFalloff = false; - result.linearFalloff_ = 0F; - return this; - } - - public bool HasQuadraticFalloff { - get { return result.HasQuadraticFalloff; } - } - public float QuadraticFalloff { - get { return result.QuadraticFalloff; } - set { SetQuadraticFalloff(value); } - } - public Builder SetQuadraticFalloff(float value) { - result.hasQuadraticFalloff = true; - result.quadraticFalloff_ = value; - return this; - } - public Builder ClearQuadraticFalloff() { - result.hasQuadraticFalloff = false; - result.quadraticFalloff_ = 0F; - return this; - } - - public bool HasConeInnerRadians { - get { return result.HasConeInnerRadians; } - } - public float ConeInnerRadians { - get { return result.ConeInnerRadians; } - set { SetConeInnerRadians(value); } - } - public Builder SetConeInnerRadians(float value) { - result.hasConeInnerRadians = true; - result.coneInnerRadians_ = value; - return this; - } - public Builder ClearConeInnerRadians() { - result.hasConeInnerRadians = false; - result.coneInnerRadians_ = 0F; - return this; - } - - public bool HasConeOuterRadians { - get { return result.HasConeOuterRadians; } - } - public float ConeOuterRadians { - get { return result.ConeOuterRadians; } - set { SetConeOuterRadians(value); } - } - public Builder SetConeOuterRadians(float value) { - result.hasConeOuterRadians = true; - result.coneOuterRadians_ = value; - return this; - } - public Builder ClearConeOuterRadians() { - result.hasConeOuterRadians = false; - result.coneOuterRadians_ = 0F; - return this; - } - - public bool HasConeFalloff { - get { return result.HasConeFalloff; } - } - public float ConeFalloff { - get { return result.ConeFalloff; } - set { SetConeFalloff(value); } - } - public Builder SetConeFalloff(float value) { - result.hasConeFalloff = true; - result.coneFalloff_ = value; - return this; - } - public Builder ClearConeFalloff() { - result.hasConeFalloff = false; - result.coneFalloff_ = 0F; - return this; - } - - public bool HasType { - get { return result.HasType; } - } - public global::Sirikata.Protocol._PBJ_Internal.LightInfoProperty.Types.LightTypes Type { - get { return result.Type; } - set { SetType(value); } - } - public Builder SetType(global::Sirikata.Protocol._PBJ_Internal.LightInfoProperty.Types.LightTypes value) { - result.hasType = true; - result.type_ = value; - return this; - } - public Builder ClearType() { - result.hasType = false; - result.type_ = global::Sirikata.Protocol._PBJ_Internal.LightInfoProperty.Types.LightTypes.POINT; - return this; - } - - public bool HasCastsShadow { - get { return result.HasCastsShadow; } - } - public bool CastsShadow { - get { return result.CastsShadow; } - set { SetCastsShadow(value); } - } - public Builder SetCastsShadow(bool value) { - result.hasCastsShadow = true; - result.castsShadow_ = value; - return this; - } - public Builder ClearCastsShadow() { - result.hasCastsShadow = false; - result.castsShadow_ = false; - return this; - } - } - static LightInfoProperty() { - object.ReferenceEquals(global::Sirikata.Protocol._PBJ_Internal.Sirikata.Descriptor, null); - } - } - - public sealed partial class ParentProperty : pb::GeneratedMessage { - private static readonly ParentProperty defaultInstance = new Builder().BuildPartial(); - public static ParentProperty DefaultInstance { - get { return defaultInstance; } - } - - public override ParentProperty DefaultInstanceForType { - get { return defaultInstance; } - } - - protected override ParentProperty ThisMessage { - get { return this; } - } - - public static pbd::MessageDescriptor Descriptor { - get { return global::Sirikata.Protocol._PBJ_Internal.Sirikata.internal__static_Sirikata_Protocol__PBJ_Internal_ParentProperty__Descriptor; } - } - - protected override pb::FieldAccess.FieldAccessorTable InternalFieldAccessors { - get { return global::Sirikata.Protocol._PBJ_Internal.Sirikata.internal__static_Sirikata_Protocol__PBJ_Internal_ParentProperty__FieldAccessorTable; } - } - - public const int ValueFieldNumber = 10; - private bool hasValue; - private pb::ByteString value_ = pb::ByteString.Empty; - public bool HasValue { - get { return hasValue; } - } - public pb::ByteString Value { - get { return value_; } - } - - public override bool IsInitialized { - get { - return true; - } - } - - public override void WriteTo(pb::CodedOutputStream output) { - if (HasValue) { - output.WriteBytes(10, Value); - } - UnknownFields.WriteTo(output); - } - - private int memoizedSerializedSize = -1; - public override int SerializedSize { - get { - int size = memoizedSerializedSize; - if (size != -1) return size; - - size = 0; - if (HasValue) { - size += pb::CodedOutputStream.ComputeBytesSize(10, Value); - } - size += UnknownFields.SerializedSize; - memoizedSerializedSize = size; - return size; - } - } - - public static ParentProperty ParseFrom(pb::ByteString data) { - return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); - } - public static ParentProperty ParseFrom(pb::ByteString data, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); - } - public static ParentProperty ParseFrom(byte[] data) { - return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); - } - public static ParentProperty ParseFrom(byte[] data, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); - } - public static ParentProperty ParseFrom(global::System.IO.Stream input) { - return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); - } - public static ParentProperty ParseFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); - } - public static ParentProperty ParseDelimitedFrom(global::System.IO.Stream input) { - return CreateBuilder().MergeDelimitedFrom(input).BuildParsed(); - } - public static ParentProperty ParseDelimitedFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { - return CreateBuilder().MergeDelimitedFrom(input, extensionRegistry).BuildParsed(); - } - public static ParentProperty ParseFrom(pb::CodedInputStream input) { - return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); - } - public static ParentProperty ParseFrom(pb::CodedInputStream input, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); - } - public static Builder CreateBuilder() { return new Builder(); } - public override Builder ToBuilder() { return CreateBuilder(this); } - public override Builder CreateBuilderForType() { return new Builder(); } - public static Builder CreateBuilder(ParentProperty prototype) { - return (Builder) new Builder().MergeFrom(prototype); - } - - public sealed partial class Builder : pb::GeneratedBuilder { - protected override Builder ThisBuilder { - get { return this; } - } - public Builder() {} - - ParentProperty result = new ParentProperty(); - - protected override ParentProperty MessageBeingBuilt { - get { return result; } - } - - public override Builder Clear() { - result = new ParentProperty(); - return this; - } - - public override Builder Clone() { - return new Builder().MergeFrom(result); - } - - public override pbd::MessageDescriptor DescriptorForType { - get { return global::Sirikata.Protocol._PBJ_Internal.ParentProperty.Descriptor; } - } - - public override ParentProperty DefaultInstanceForType { - get { return global::Sirikata.Protocol._PBJ_Internal.ParentProperty.DefaultInstance; } - } - - public override ParentProperty BuildPartial() { - if (result == null) { - throw new global::System.InvalidOperationException("build() has already been called on this Builder"); - } - ParentProperty returnMe = result; - result = null; - return returnMe; - } - - public override Builder MergeFrom(pb::IMessage other) { - if (other is ParentProperty) { - return MergeFrom((ParentProperty) other); - } else { - base.MergeFrom(other); - return this; - } - } - - public override Builder MergeFrom(ParentProperty other) { - if (other == global::Sirikata.Protocol._PBJ_Internal.ParentProperty.DefaultInstance) return this; - if (other.HasValue) { - Value = other.Value; - } - this.MergeUnknownFields(other.UnknownFields); - return this; - } - - public override Builder MergeFrom(pb::CodedInputStream input) { - return MergeFrom(input, pb::ExtensionRegistry.Empty); - } - - public override Builder MergeFrom(pb::CodedInputStream input, pb::ExtensionRegistry extensionRegistry) { - pb::UnknownFieldSet.Builder unknownFields = null; - while (true) { - uint tag = input.ReadTag(); - switch (tag) { - case 0: { - if (unknownFields != null) { - this.UnknownFields = unknownFields.Build(); - } - return this; - } - default: { - if (pb::WireFormat.IsEndGroupTag(tag)) { - if (unknownFields != null) { - this.UnknownFields = unknownFields.Build(); - } - return this; - } - if (unknownFields == null) { - unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); - } - ParseUnknownField(input, unknownFields, extensionRegistry, tag); - break; - } - case 82: { - Value = input.ReadBytes(); - break; - } - } - } - } - - - public bool HasValue { - get { return result.HasValue; } - } - public pb::ByteString Value { - get { return result.Value; } - set { SetValue(value); } - } - public Builder SetValue(pb::ByteString value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - result.hasValue = true; - result.value_ = value; - return this; - } - public Builder ClearValue() { - result.hasValue = false; - result.value_ = pb::ByteString.Empty; - return this; - } - } - static ParentProperty() { - object.ReferenceEquals(global::Sirikata.Protocol._PBJ_Internal.Sirikata.Descriptor, null); - } - } - - public sealed partial class UUIDListProperty : pb::GeneratedMessage { - private static readonly UUIDListProperty defaultInstance = new Builder().BuildPartial(); - public static UUIDListProperty DefaultInstance { - get { return defaultInstance; } - } - - public override UUIDListProperty DefaultInstanceForType { - get { return defaultInstance; } - } - - protected override UUIDListProperty ThisMessage { - get { return this; } - } - - public static pbd::MessageDescriptor Descriptor { - get { return global::Sirikata.Protocol._PBJ_Internal.Sirikata.internal__static_Sirikata_Protocol__PBJ_Internal_UUIDListProperty__Descriptor; } - } - - protected override pb::FieldAccess.FieldAccessorTable InternalFieldAccessors { - get { return global::Sirikata.Protocol._PBJ_Internal.Sirikata.internal__static_Sirikata_Protocol__PBJ_Internal_UUIDListProperty__FieldAccessorTable; } - } - - public const int ValueFieldNumber = 10; - private pbc::PopsicleList value_ = new pbc::PopsicleList(); - public scg::IList ValueList { - get { return pbc::Lists.AsReadOnly(value_); } - } - public int ValueCount { - get { return value_.Count; } - } - public pb::ByteString GetValue(int index) { - return value_[index]; - } - - public override bool IsInitialized { - get { - return true; - } - } - - public override void WriteTo(pb::CodedOutputStream output) { - if (value_.Count > 0) { - foreach (pb::ByteString element in value_) { - output.WriteBytes(10, element); - } - } - UnknownFields.WriteTo(output); - } - - private int memoizedSerializedSize = -1; - public override int SerializedSize { - get { - int size = memoizedSerializedSize; - if (size != -1) return size; - - size = 0; - { - int dataSize = 0; - foreach (pb::ByteString element in ValueList) { - dataSize += pb::CodedOutputStream.ComputeBytesSizeNoTag(element); - } - size += dataSize; - size += 1 * value_.Count; - } - size += UnknownFields.SerializedSize; - memoizedSerializedSize = size; - return size; - } - } - - public static UUIDListProperty ParseFrom(pb::ByteString data) { - return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); - } - public static UUIDListProperty ParseFrom(pb::ByteString data, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); - } - public static UUIDListProperty ParseFrom(byte[] data) { - return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); - } - public static UUIDListProperty ParseFrom(byte[] data, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); - } - public static UUIDListProperty ParseFrom(global::System.IO.Stream input) { - return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); - } - public static UUIDListProperty ParseFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); - } - public static UUIDListProperty ParseDelimitedFrom(global::System.IO.Stream input) { - return CreateBuilder().MergeDelimitedFrom(input).BuildParsed(); - } - public static UUIDListProperty ParseDelimitedFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { - return CreateBuilder().MergeDelimitedFrom(input, extensionRegistry).BuildParsed(); - } - public static UUIDListProperty ParseFrom(pb::CodedInputStream input) { - return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); - } - public static UUIDListProperty ParseFrom(pb::CodedInputStream input, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); - } - public static Builder CreateBuilder() { return new Builder(); } - public override Builder ToBuilder() { return CreateBuilder(this); } - public override Builder CreateBuilderForType() { return new Builder(); } - public static Builder CreateBuilder(UUIDListProperty prototype) { - return (Builder) new Builder().MergeFrom(prototype); - } - - public sealed partial class Builder : pb::GeneratedBuilder { - protected override Builder ThisBuilder { - get { return this; } - } - public Builder() {} - - UUIDListProperty result = new UUIDListProperty(); - - protected override UUIDListProperty MessageBeingBuilt { - get { return result; } - } - - public override Builder Clear() { - result = new UUIDListProperty(); - return this; - } - - public override Builder Clone() { - return new Builder().MergeFrom(result); - } - - public override pbd::MessageDescriptor DescriptorForType { - get { return global::Sirikata.Protocol._PBJ_Internal.UUIDListProperty.Descriptor; } - } - - public override UUIDListProperty DefaultInstanceForType { - get { return global::Sirikata.Protocol._PBJ_Internal.UUIDListProperty.DefaultInstance; } - } - - public override UUIDListProperty BuildPartial() { - if (result == null) { - throw new global::System.InvalidOperationException("build() has already been called on this Builder"); - } - result.value_.MakeReadOnly(); - UUIDListProperty returnMe = result; - result = null; - return returnMe; - } - - public override Builder MergeFrom(pb::IMessage other) { - if (other is UUIDListProperty) { - return MergeFrom((UUIDListProperty) other); - } else { - base.MergeFrom(other); - return this; - } - } - - public override Builder MergeFrom(UUIDListProperty other) { - if (other == global::Sirikata.Protocol._PBJ_Internal.UUIDListProperty.DefaultInstance) return this; - if (other.value_.Count != 0) { - base.AddRange(other.value_, result.value_); - } - this.MergeUnknownFields(other.UnknownFields); - return this; - } - - public override Builder MergeFrom(pb::CodedInputStream input) { - return MergeFrom(input, pb::ExtensionRegistry.Empty); - } - - public override Builder MergeFrom(pb::CodedInputStream input, pb::ExtensionRegistry extensionRegistry) { - pb::UnknownFieldSet.Builder unknownFields = null; - while (true) { - uint tag = input.ReadTag(); - switch (tag) { - case 0: { - if (unknownFields != null) { - this.UnknownFields = unknownFields.Build(); - } - return this; - } - default: { - if (pb::WireFormat.IsEndGroupTag(tag)) { - if (unknownFields != null) { - this.UnknownFields = unknownFields.Build(); - } - return this; - } - if (unknownFields == null) { - unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); - } - ParseUnknownField(input, unknownFields, extensionRegistry, tag); - break; - } - case 82: { - AddValue(input.ReadBytes()); - break; - } - } - } - } - - - public pbc::IPopsicleList ValueList { - get { return result.value_; } - } - public int ValueCount { - get { return result.ValueCount; } - } - public pb::ByteString GetValue(int index) { - return result.GetValue(index); - } - public Builder SetValue(int index, pb::ByteString value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - result.value_[index] = value; - return this; - } - public Builder AddValue(pb::ByteString value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - result.value_.Add(value); - return this; - } - public Builder AddRangeValue(scg::IEnumerable values) { - base.AddRange(values, result.value_); - return this; - } - public Builder ClearValue() { - result.value_.Clear(); - return this; - } - } - static UUIDListProperty() { - object.ReferenceEquals(global::Sirikata.Protocol._PBJ_Internal.Sirikata.Descriptor, null); - } - } - - public sealed partial class ConnectToSpace : pb::GeneratedMessage { - private static readonly ConnectToSpace defaultInstance = new Builder().BuildPartial(); - public static ConnectToSpace DefaultInstance { - get { return defaultInstance; } - } - - public override ConnectToSpace DefaultInstanceForType { - get { return defaultInstance; } - } - - protected override ConnectToSpace ThisMessage { - get { return this; } - } - - public static pbd::MessageDescriptor Descriptor { - get { return global::Sirikata.Protocol._PBJ_Internal.Sirikata.internal__static_Sirikata_Protocol__PBJ_Internal_ConnectToSpace__Descriptor; } - } - - protected override pb::FieldAccess.FieldAccessorTable InternalFieldAccessors { - get { return global::Sirikata.Protocol._PBJ_Internal.Sirikata.internal__static_Sirikata_Protocol__PBJ_Internal_ConnectToSpace__FieldAccessorTable; } - } - - public const int SpaceIdFieldNumber = 1; - private bool hasSpaceId; - private pb::ByteString spaceId_ = pb::ByteString.Empty; - public bool HasSpaceId { - get { return hasSpaceId; } - } - public pb::ByteString SpaceId { - get { return spaceId_; } - } - - public const int ObjectUuidEvidenceFieldNumber = 2; - private bool hasObjectUuidEvidence; - private pb::ByteString objectUuidEvidence_ = pb::ByteString.Empty; - public bool HasObjectUuidEvidence { - get { return hasObjectUuidEvidence; } - } - public pb::ByteString ObjectUuidEvidence { - get { return objectUuidEvidence_; } - } - - public const int RequestedObjectLocFieldNumber = 3; - private bool hasRequestedObjectLoc; - private global::Sirikata.Protocol._PBJ_Internal.ObjLoc requestedObjectLoc_ = global::Sirikata.Protocol._PBJ_Internal.ObjLoc.DefaultInstance; - public bool HasRequestedObjectLoc { - get { return hasRequestedObjectLoc; } - } - public global::Sirikata.Protocol._PBJ_Internal.ObjLoc RequestedObjectLoc { - get { return requestedObjectLoc_; } - } - - public const int BoundingSphereFieldNumber = 4; - private int boundingSphereMemoizedSerializedSize; - private pbc::PopsicleList boundingSphere_ = new pbc::PopsicleList(); - public scg::IList BoundingSphereList { - get { return pbc::Lists.AsReadOnly(boundingSphere_); } - } - public int BoundingSphereCount { - get { return boundingSphere_.Count; } - } - public float GetBoundingSphere(int index) { - return boundingSphere_[index]; - } - - public override bool IsInitialized { - get { - return true; - } - } - - public override void WriteTo(pb::CodedOutputStream output) { - if (HasSpaceId) { - output.WriteBytes(1, SpaceId); - } - if (HasObjectUuidEvidence) { - output.WriteBytes(2, ObjectUuidEvidence); - } - if (HasRequestedObjectLoc) { - output.WriteMessage(3, RequestedObjectLoc); - } - if (boundingSphere_.Count > 0) { - output.WriteRawVarint32(34); - output.WriteRawVarint32((uint) boundingSphereMemoizedSerializedSize); - foreach (float element in boundingSphere_) { - output.WriteFloatNoTag(element); - } - } - UnknownFields.WriteTo(output); - } - - private int memoizedSerializedSize = -1; - public override int SerializedSize { - get { - int size = memoizedSerializedSize; - if (size != -1) return size; - - size = 0; - if (HasSpaceId) { - size += pb::CodedOutputStream.ComputeBytesSize(1, SpaceId); - } - if (HasObjectUuidEvidence) { - size += pb::CodedOutputStream.ComputeBytesSize(2, ObjectUuidEvidence); - } - if (HasRequestedObjectLoc) { - size += pb::CodedOutputStream.ComputeMessageSize(3, RequestedObjectLoc); - } - { - int dataSize = 0; - dataSize = 4 * boundingSphere_.Count; - size += dataSize; - if (boundingSphere_.Count!=0) size += 1 + pb::CodedOutputStream.ComputeInt32SizeNoTag(dataSize); - boundingSphereMemoizedSerializedSize = dataSize; - } - size += UnknownFields.SerializedSize; - memoizedSerializedSize = size; - return size; - } - } - - public static ConnectToSpace ParseFrom(pb::ByteString data) { - return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); - } - public static ConnectToSpace ParseFrom(pb::ByteString data, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); - } - public static ConnectToSpace ParseFrom(byte[] data) { - return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); - } - public static ConnectToSpace ParseFrom(byte[] data, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); - } - public static ConnectToSpace ParseFrom(global::System.IO.Stream input) { - return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); - } - public static ConnectToSpace ParseFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); - } - public static ConnectToSpace ParseDelimitedFrom(global::System.IO.Stream input) { - return CreateBuilder().MergeDelimitedFrom(input).BuildParsed(); - } - public static ConnectToSpace ParseDelimitedFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { - return CreateBuilder().MergeDelimitedFrom(input, extensionRegistry).BuildParsed(); - } - public static ConnectToSpace ParseFrom(pb::CodedInputStream input) { - return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); - } - public static ConnectToSpace ParseFrom(pb::CodedInputStream input, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); - } - public static Builder CreateBuilder() { return new Builder(); } - public override Builder ToBuilder() { return CreateBuilder(this); } - public override Builder CreateBuilderForType() { return new Builder(); } - public static Builder CreateBuilder(ConnectToSpace prototype) { - return (Builder) new Builder().MergeFrom(prototype); - } - - public sealed partial class Builder : pb::GeneratedBuilder { - protected override Builder ThisBuilder { - get { return this; } - } - public Builder() {} - - ConnectToSpace result = new ConnectToSpace(); - - protected override ConnectToSpace MessageBeingBuilt { - get { return result; } - } - - public override Builder Clear() { - result = new ConnectToSpace(); - return this; - } - - public override Builder Clone() { - return new Builder().MergeFrom(result); - } - - public override pbd::MessageDescriptor DescriptorForType { - get { return global::Sirikata.Protocol._PBJ_Internal.ConnectToSpace.Descriptor; } - } - - public override ConnectToSpace DefaultInstanceForType { - get { return global::Sirikata.Protocol._PBJ_Internal.ConnectToSpace.DefaultInstance; } - } - - public override ConnectToSpace BuildPartial() { - if (result == null) { - throw new global::System.InvalidOperationException("build() has already been called on this Builder"); - } - result.boundingSphere_.MakeReadOnly(); - ConnectToSpace returnMe = result; - result = null; - return returnMe; - } - - public override Builder MergeFrom(pb::IMessage other) { - if (other is ConnectToSpace) { - return MergeFrom((ConnectToSpace) other); - } else { - base.MergeFrom(other); - return this; - } - } - - public override Builder MergeFrom(ConnectToSpace other) { - if (other == global::Sirikata.Protocol._PBJ_Internal.ConnectToSpace.DefaultInstance) return this; - if (other.HasSpaceId) { - SpaceId = other.SpaceId; - } - if (other.HasObjectUuidEvidence) { - ObjectUuidEvidence = other.ObjectUuidEvidence; - } - if (other.HasRequestedObjectLoc) { - MergeRequestedObjectLoc(other.RequestedObjectLoc); - } - if (other.boundingSphere_.Count != 0) { - base.AddRange(other.boundingSphere_, result.boundingSphere_); - } - this.MergeUnknownFields(other.UnknownFields); - return this; - } - - public override Builder MergeFrom(pb::CodedInputStream input) { - return MergeFrom(input, pb::ExtensionRegistry.Empty); - } - - public override Builder MergeFrom(pb::CodedInputStream input, pb::ExtensionRegistry extensionRegistry) { - pb::UnknownFieldSet.Builder unknownFields = null; - while (true) { - uint tag = input.ReadTag(); - switch (tag) { - case 0: { - if (unknownFields != null) { - this.UnknownFields = unknownFields.Build(); - } - return this; - } - default: { - if (pb::WireFormat.IsEndGroupTag(tag)) { - if (unknownFields != null) { - this.UnknownFields = unknownFields.Build(); - } - return this; - } - if (unknownFields == null) { - unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); - } - ParseUnknownField(input, unknownFields, extensionRegistry, tag); - break; - } - case 10: { - SpaceId = input.ReadBytes(); - break; - } - case 18: { - ObjectUuidEvidence = input.ReadBytes(); - break; - } - case 26: { - global::Sirikata.Protocol._PBJ_Internal.ObjLoc.Builder subBuilder = global::Sirikata.Protocol._PBJ_Internal.ObjLoc.CreateBuilder(); - if (HasRequestedObjectLoc) { - subBuilder.MergeFrom(RequestedObjectLoc); - } - input.ReadMessage(subBuilder, extensionRegistry); - RequestedObjectLoc = subBuilder.BuildPartial(); - break; - } - case 34: { - int length = input.ReadInt32(); - int limit = input.PushLimit(length); - while (!input.ReachedLimit) { - AddBoundingSphere(input.ReadFloat()); - } - input.PopLimit(limit); - break; - } - } - } - } - - - public bool HasSpaceId { - get { return result.HasSpaceId; } - } - public pb::ByteString SpaceId { - get { return result.SpaceId; } - set { SetSpaceId(value); } - } - public Builder SetSpaceId(pb::ByteString value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - result.hasSpaceId = true; - result.spaceId_ = value; - return this; - } - public Builder ClearSpaceId() { - result.hasSpaceId = false; - result.spaceId_ = pb::ByteString.Empty; - return this; - } - - public bool HasObjectUuidEvidence { - get { return result.HasObjectUuidEvidence; } - } - public pb::ByteString ObjectUuidEvidence { - get { return result.ObjectUuidEvidence; } - set { SetObjectUuidEvidence(value); } - } - public Builder SetObjectUuidEvidence(pb::ByteString value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - result.hasObjectUuidEvidence = true; - result.objectUuidEvidence_ = value; - return this; - } - public Builder ClearObjectUuidEvidence() { - result.hasObjectUuidEvidence = false; - result.objectUuidEvidence_ = pb::ByteString.Empty; - return this; - } - - public bool HasRequestedObjectLoc { - get { return result.HasRequestedObjectLoc; } - } - public global::Sirikata.Protocol._PBJ_Internal.ObjLoc RequestedObjectLoc { - get { return result.RequestedObjectLoc; } - set { SetRequestedObjectLoc(value); } - } - public Builder SetRequestedObjectLoc(global::Sirikata.Protocol._PBJ_Internal.ObjLoc value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - result.hasRequestedObjectLoc = true; - result.requestedObjectLoc_ = value; - return this; - } - public Builder SetRequestedObjectLoc(global::Sirikata.Protocol._PBJ_Internal.ObjLoc.Builder builderForValue) { - pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); - result.hasRequestedObjectLoc = true; - result.requestedObjectLoc_ = builderForValue.Build(); - return this; - } - public Builder MergeRequestedObjectLoc(global::Sirikata.Protocol._PBJ_Internal.ObjLoc value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - if (result.HasRequestedObjectLoc && - result.requestedObjectLoc_ != global::Sirikata.Protocol._PBJ_Internal.ObjLoc.DefaultInstance) { - result.requestedObjectLoc_ = global::Sirikata.Protocol._PBJ_Internal.ObjLoc.CreateBuilder(result.requestedObjectLoc_).MergeFrom(value).BuildPartial(); - } else { - result.requestedObjectLoc_ = value; - } - result.hasRequestedObjectLoc = true; - return this; - } - public Builder ClearRequestedObjectLoc() { - result.hasRequestedObjectLoc = false; - result.requestedObjectLoc_ = global::Sirikata.Protocol._PBJ_Internal.ObjLoc.DefaultInstance; - return this; - } - - public pbc::IPopsicleList BoundingSphereList { - get { return result.boundingSphere_; } - } - public int BoundingSphereCount { - get { return result.BoundingSphereCount; } - } - public float GetBoundingSphere(int index) { - return result.GetBoundingSphere(index); - } - public Builder SetBoundingSphere(int index, float value) { - result.boundingSphere_[index] = value; - return this; - } - public Builder AddBoundingSphere(float value) { - result.boundingSphere_.Add(value); - return this; - } - public Builder AddRangeBoundingSphere(scg::IEnumerable values) { - base.AddRange(values, result.boundingSphere_); - return this; - } - public Builder ClearBoundingSphere() { - result.boundingSphere_.Clear(); - return this; - } - } - static ConnectToSpace() { - object.ReferenceEquals(global::Sirikata.Protocol._PBJ_Internal.Sirikata.Descriptor, null); - } - } - - public sealed partial class CreateObject : pb::GeneratedMessage { - private static readonly CreateObject defaultInstance = new Builder().BuildPartial(); - public static CreateObject DefaultInstance { - get { return defaultInstance; } - } - - public override CreateObject DefaultInstanceForType { - get { return defaultInstance; } - } - - protected override CreateObject ThisMessage { - get { return this; } - } - - public static pbd::MessageDescriptor Descriptor { - get { return global::Sirikata.Protocol._PBJ_Internal.Sirikata.internal__static_Sirikata_Protocol__PBJ_Internal_CreateObject__Descriptor; } - } - - protected override pb::FieldAccess.FieldAccessorTable InternalFieldAccessors { - get { return global::Sirikata.Protocol._PBJ_Internal.Sirikata.internal__static_Sirikata_Protocol__PBJ_Internal_CreateObject__FieldAccessorTable; } - } - - public const int ObjectUuidFieldNumber = 1; - private bool hasObjectUuid; - private pb::ByteString objectUuid_ = pb::ByteString.Empty; - public bool HasObjectUuid { - get { return hasObjectUuid; } - } - public pb::ByteString ObjectUuid { - get { return objectUuid_; } - } - - public const int SpacePropertiesFieldNumber = 2; - private pbc::PopsicleList spaceProperties_ = new pbc::PopsicleList(); - public scg::IList SpacePropertiesList { - get { return spaceProperties_; } - } - public int SpacePropertiesCount { - get { return spaceProperties_.Count; } - } - public global::Sirikata.Protocol._PBJ_Internal.ConnectToSpace GetSpaceProperties(int index) { - return spaceProperties_[index]; - } - - public const int MeshFieldNumber = 3; - private bool hasMesh; - private string mesh_ = ""; - public bool HasMesh { - get { return hasMesh; } - } - public string Mesh { - get { return mesh_; } - } - - public const int ScaleFieldNumber = 4; - private int scaleMemoizedSerializedSize; - private pbc::PopsicleList scale_ = new pbc::PopsicleList(); - public scg::IList ScaleList { - get { return pbc::Lists.AsReadOnly(scale_); } - } - public int ScaleCount { - get { return scale_.Count; } - } - public float GetScale(int index) { - return scale_[index]; - } - - public const int WeburlFieldNumber = 5; - private bool hasWeburl; - private string weburl_ = ""; - public bool HasWeburl { - get { return hasWeburl; } - } - public string Weburl { - get { return weburl_; } - } - - public const int LightInfoFieldNumber = 6; - private bool hasLightInfo; - private global::Sirikata.Protocol._PBJ_Internal.LightInfoProperty lightInfo_ = global::Sirikata.Protocol._PBJ_Internal.LightInfoProperty.DefaultInstance; - public bool HasLightInfo { - get { return hasLightInfo; } - } - public global::Sirikata.Protocol._PBJ_Internal.LightInfoProperty LightInfo { - get { return lightInfo_; } - } - - public const int CameraFieldNumber = 7; - private bool hasCamera; - private bool camera_ = false; - public bool HasCamera { - get { return hasCamera; } - } - public bool Camera { - get { return camera_; } - } - - public const int PhysicalFieldNumber = 8; - private bool hasPhysical; - private global::Sirikata.Protocol._PBJ_Internal.PhysicalParameters physical_ = global::Sirikata.Protocol._PBJ_Internal.PhysicalParameters.DefaultInstance; - public bool HasPhysical { - get { return hasPhysical; } - } - public global::Sirikata.Protocol._PBJ_Internal.PhysicalParameters Physical { - get { return physical_; } - } - - public override bool IsInitialized { - get { - return true; - } - } - - public override void WriteTo(pb::CodedOutputStream output) { - if (HasObjectUuid) { - output.WriteBytes(1, ObjectUuid); - } - foreach (global::Sirikata.Protocol._PBJ_Internal.ConnectToSpace element in SpacePropertiesList) { - output.WriteMessage(2, element); - } - if (HasMesh) { - output.WriteString(3, Mesh); - } - if (scale_.Count > 0) { - output.WriteRawVarint32(34); - output.WriteRawVarint32((uint) scaleMemoizedSerializedSize); - foreach (float element in scale_) { - output.WriteFloatNoTag(element); - } - } - if (HasWeburl) { - output.WriteString(5, Weburl); - } - if (HasLightInfo) { - output.WriteMessage(6, LightInfo); - } - if (HasCamera) { - output.WriteBool(7, Camera); - } - if (HasPhysical) { - output.WriteMessage(8, Physical); - } - UnknownFields.WriteTo(output); - } - - private int memoizedSerializedSize = -1; - public override int SerializedSize { - get { - int size = memoizedSerializedSize; - if (size != -1) return size; - - size = 0; - if (HasObjectUuid) { - size += pb::CodedOutputStream.ComputeBytesSize(1, ObjectUuid); - } - foreach (global::Sirikata.Protocol._PBJ_Internal.ConnectToSpace element in SpacePropertiesList) { - size += pb::CodedOutputStream.ComputeMessageSize(2, element); - } - if (HasMesh) { - size += pb::CodedOutputStream.ComputeStringSize(3, Mesh); - } - { - int dataSize = 0; - dataSize = 4 * scale_.Count; - size += dataSize; - if (scale_.Count!=0) size += 1 + pb::CodedOutputStream.ComputeInt32SizeNoTag(dataSize); - scaleMemoizedSerializedSize = dataSize; - } - if (HasWeburl) { - size += pb::CodedOutputStream.ComputeStringSize(5, Weburl); - } - if (HasLightInfo) { - size += pb::CodedOutputStream.ComputeMessageSize(6, LightInfo); - } - if (HasCamera) { - size += pb::CodedOutputStream.ComputeBoolSize(7, Camera); - } - if (HasPhysical) { - size += pb::CodedOutputStream.ComputeMessageSize(8, Physical); - } - size += UnknownFields.SerializedSize; - memoizedSerializedSize = size; - return size; - } - } - - public static CreateObject ParseFrom(pb::ByteString data) { - return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); - } - public static CreateObject ParseFrom(pb::ByteString data, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); - } - public static CreateObject ParseFrom(byte[] data) { - return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); - } - public static CreateObject ParseFrom(byte[] data, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); - } - public static CreateObject ParseFrom(global::System.IO.Stream input) { - return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); - } - public static CreateObject ParseFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); - } - public static CreateObject ParseDelimitedFrom(global::System.IO.Stream input) { - return CreateBuilder().MergeDelimitedFrom(input).BuildParsed(); - } - public static CreateObject ParseDelimitedFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { - return CreateBuilder().MergeDelimitedFrom(input, extensionRegistry).BuildParsed(); - } - public static CreateObject ParseFrom(pb::CodedInputStream input) { - return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); - } - public static CreateObject ParseFrom(pb::CodedInputStream input, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); - } - public static Builder CreateBuilder() { return new Builder(); } - public override Builder ToBuilder() { return CreateBuilder(this); } - public override Builder CreateBuilderForType() { return new Builder(); } - public static Builder CreateBuilder(CreateObject prototype) { - return (Builder) new Builder().MergeFrom(prototype); - } - - public sealed partial class Builder : pb::GeneratedBuilder { - protected override Builder ThisBuilder { - get { return this; } - } - public Builder() {} - - CreateObject result = new CreateObject(); - - protected override CreateObject MessageBeingBuilt { - get { return result; } - } - - public override Builder Clear() { - result = new CreateObject(); - return this; - } - - public override Builder Clone() { - return new Builder().MergeFrom(result); - } - - public override pbd::MessageDescriptor DescriptorForType { - get { return global::Sirikata.Protocol._PBJ_Internal.CreateObject.Descriptor; } - } - - public override CreateObject DefaultInstanceForType { - get { return global::Sirikata.Protocol._PBJ_Internal.CreateObject.DefaultInstance; } - } - - public override CreateObject BuildPartial() { - if (result == null) { - throw new global::System.InvalidOperationException("build() has already been called on this Builder"); - } - result.spaceProperties_.MakeReadOnly(); - result.scale_.MakeReadOnly(); - CreateObject returnMe = result; - result = null; - return returnMe; - } - - public override Builder MergeFrom(pb::IMessage other) { - if (other is CreateObject) { - return MergeFrom((CreateObject) other); - } else { - base.MergeFrom(other); - return this; - } - } - - public override Builder MergeFrom(CreateObject other) { - if (other == global::Sirikata.Protocol._PBJ_Internal.CreateObject.DefaultInstance) return this; - if (other.HasObjectUuid) { - ObjectUuid = other.ObjectUuid; - } - if (other.spaceProperties_.Count != 0) { - base.AddRange(other.spaceProperties_, result.spaceProperties_); - } - if (other.HasMesh) { - Mesh = other.Mesh; - } - if (other.scale_.Count != 0) { - base.AddRange(other.scale_, result.scale_); - } - if (other.HasWeburl) { - Weburl = other.Weburl; - } - if (other.HasLightInfo) { - MergeLightInfo(other.LightInfo); - } - if (other.HasCamera) { - Camera = other.Camera; - } - if (other.HasPhysical) { - MergePhysical(other.Physical); - } - this.MergeUnknownFields(other.UnknownFields); - return this; - } - - public override Builder MergeFrom(pb::CodedInputStream input) { - return MergeFrom(input, pb::ExtensionRegistry.Empty); - } - - public override Builder MergeFrom(pb::CodedInputStream input, pb::ExtensionRegistry extensionRegistry) { - pb::UnknownFieldSet.Builder unknownFields = null; - while (true) { - uint tag = input.ReadTag(); - switch (tag) { - case 0: { - if (unknownFields != null) { - this.UnknownFields = unknownFields.Build(); - } - return this; - } - default: { - if (pb::WireFormat.IsEndGroupTag(tag)) { - if (unknownFields != null) { - this.UnknownFields = unknownFields.Build(); - } - return this; - } - if (unknownFields == null) { - unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); - } - ParseUnknownField(input, unknownFields, extensionRegistry, tag); - break; - } - case 10: { - ObjectUuid = input.ReadBytes(); - break; - } - case 18: { - global::Sirikata.Protocol._PBJ_Internal.ConnectToSpace.Builder subBuilder = global::Sirikata.Protocol._PBJ_Internal.ConnectToSpace.CreateBuilder(); - input.ReadMessage(subBuilder, extensionRegistry); - AddSpaceProperties(subBuilder.BuildPartial()); - break; - } - case 26: { - Mesh = input.ReadString(); - break; - } - case 34: { - int length = input.ReadInt32(); - int limit = input.PushLimit(length); - while (!input.ReachedLimit) { - AddScale(input.ReadFloat()); - } - input.PopLimit(limit); - break; - } - case 42: { - Weburl = input.ReadString(); - break; - } - case 50: { - global::Sirikata.Protocol._PBJ_Internal.LightInfoProperty.Builder subBuilder = global::Sirikata.Protocol._PBJ_Internal.LightInfoProperty.CreateBuilder(); - if (HasLightInfo) { - subBuilder.MergeFrom(LightInfo); - } - input.ReadMessage(subBuilder, extensionRegistry); - LightInfo = subBuilder.BuildPartial(); - break; - } - case 56: { - Camera = input.ReadBool(); - break; - } - case 66: { - global::Sirikata.Protocol._PBJ_Internal.PhysicalParameters.Builder subBuilder = global::Sirikata.Protocol._PBJ_Internal.PhysicalParameters.CreateBuilder(); - if (HasPhysical) { - subBuilder.MergeFrom(Physical); - } - input.ReadMessage(subBuilder, extensionRegistry); - Physical = subBuilder.BuildPartial(); - break; - } - } - } - } - - - public bool HasObjectUuid { - get { return result.HasObjectUuid; } - } - public pb::ByteString ObjectUuid { - get { return result.ObjectUuid; } - set { SetObjectUuid(value); } - } - public Builder SetObjectUuid(pb::ByteString value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - result.hasObjectUuid = true; - result.objectUuid_ = value; - return this; - } - public Builder ClearObjectUuid() { - result.hasObjectUuid = false; - result.objectUuid_ = pb::ByteString.Empty; - return this; - } - - public pbc::IPopsicleList SpacePropertiesList { - get { return result.spaceProperties_; } - } - public int SpacePropertiesCount { - get { return result.SpacePropertiesCount; } - } - public global::Sirikata.Protocol._PBJ_Internal.ConnectToSpace GetSpaceProperties(int index) { - return result.GetSpaceProperties(index); - } - public Builder SetSpaceProperties(int index, global::Sirikata.Protocol._PBJ_Internal.ConnectToSpace value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - result.spaceProperties_[index] = value; - return this; - } - public Builder SetSpaceProperties(int index, global::Sirikata.Protocol._PBJ_Internal.ConnectToSpace.Builder builderForValue) { - pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); - result.spaceProperties_[index] = builderForValue.Build(); - return this; - } - public Builder AddSpaceProperties(global::Sirikata.Protocol._PBJ_Internal.ConnectToSpace value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - result.spaceProperties_.Add(value); - return this; - } - public Builder AddSpaceProperties(global::Sirikata.Protocol._PBJ_Internal.ConnectToSpace.Builder builderForValue) { - pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); - result.spaceProperties_.Add(builderForValue.Build()); - return this; - } - public Builder AddRangeSpaceProperties(scg::IEnumerable values) { - base.AddRange(values, result.spaceProperties_); - return this; - } - public Builder ClearSpaceProperties() { - result.spaceProperties_.Clear(); - return this; - } - - public bool HasMesh { - get { return result.HasMesh; } - } - public string Mesh { - get { return result.Mesh; } - set { SetMesh(value); } - } - public Builder SetMesh(string value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - result.hasMesh = true; - result.mesh_ = value; - return this; - } - public Builder ClearMesh() { - result.hasMesh = false; - result.mesh_ = ""; - return this; - } - - public pbc::IPopsicleList ScaleList { - get { return result.scale_; } - } - public int ScaleCount { - get { return result.ScaleCount; } - } - public float GetScale(int index) { - return result.GetScale(index); - } - public Builder SetScale(int index, float value) { - result.scale_[index] = value; - return this; - } - public Builder AddScale(float value) { - result.scale_.Add(value); - return this; - } - public Builder AddRangeScale(scg::IEnumerable values) { - base.AddRange(values, result.scale_); - return this; - } - public Builder ClearScale() { - result.scale_.Clear(); - return this; - } - - public bool HasWeburl { - get { return result.HasWeburl; } - } - public string Weburl { - get { return result.Weburl; } - set { SetWeburl(value); } - } - public Builder SetWeburl(string value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - result.hasWeburl = true; - result.weburl_ = value; - return this; - } - public Builder ClearWeburl() { - result.hasWeburl = false; - result.weburl_ = ""; - return this; - } - - public bool HasLightInfo { - get { return result.HasLightInfo; } - } - public global::Sirikata.Protocol._PBJ_Internal.LightInfoProperty LightInfo { - get { return result.LightInfo; } - set { SetLightInfo(value); } - } - public Builder SetLightInfo(global::Sirikata.Protocol._PBJ_Internal.LightInfoProperty value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - result.hasLightInfo = true; - result.lightInfo_ = value; - return this; - } - public Builder SetLightInfo(global::Sirikata.Protocol._PBJ_Internal.LightInfoProperty.Builder builderForValue) { - pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); - result.hasLightInfo = true; - result.lightInfo_ = builderForValue.Build(); - return this; - } - public Builder MergeLightInfo(global::Sirikata.Protocol._PBJ_Internal.LightInfoProperty value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - if (result.HasLightInfo && - result.lightInfo_ != global::Sirikata.Protocol._PBJ_Internal.LightInfoProperty.DefaultInstance) { - result.lightInfo_ = global::Sirikata.Protocol._PBJ_Internal.LightInfoProperty.CreateBuilder(result.lightInfo_).MergeFrom(value).BuildPartial(); - } else { - result.lightInfo_ = value; - } - result.hasLightInfo = true; - return this; - } - public Builder ClearLightInfo() { - result.hasLightInfo = false; - result.lightInfo_ = global::Sirikata.Protocol._PBJ_Internal.LightInfoProperty.DefaultInstance; - return this; - } - - public bool HasCamera { - get { return result.HasCamera; } - } - public bool Camera { - get { return result.Camera; } - set { SetCamera(value); } - } - public Builder SetCamera(bool value) { - result.hasCamera = true; - result.camera_ = value; - return this; - } - public Builder ClearCamera() { - result.hasCamera = false; - result.camera_ = false; - return this; - } - - public bool HasPhysical { - get { return result.HasPhysical; } - } - public global::Sirikata.Protocol._PBJ_Internal.PhysicalParameters Physical { - get { return result.Physical; } - set { SetPhysical(value); } - } - public Builder SetPhysical(global::Sirikata.Protocol._PBJ_Internal.PhysicalParameters value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - result.hasPhysical = true; - result.physical_ = value; - return this; - } - public Builder SetPhysical(global::Sirikata.Protocol._PBJ_Internal.PhysicalParameters.Builder builderForValue) { - pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); - result.hasPhysical = true; - result.physical_ = builderForValue.Build(); - return this; - } - public Builder MergePhysical(global::Sirikata.Protocol._PBJ_Internal.PhysicalParameters value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - if (result.HasPhysical && - result.physical_ != global::Sirikata.Protocol._PBJ_Internal.PhysicalParameters.DefaultInstance) { - result.physical_ = global::Sirikata.Protocol._PBJ_Internal.PhysicalParameters.CreateBuilder(result.physical_).MergeFrom(value).BuildPartial(); - } else { - result.physical_ = value; - } - result.hasPhysical = true; - return this; - } - public Builder ClearPhysical() { - result.hasPhysical = false; - result.physical_ = global::Sirikata.Protocol._PBJ_Internal.PhysicalParameters.DefaultInstance; - return this; - } - } - static CreateObject() { - object.ReferenceEquals(global::Sirikata.Protocol._PBJ_Internal.Sirikata.Descriptor, null); - } - } - - #endregion - -} diff --git a/OpenSim/Client/Sirikata/Protocol/Sirikata.pbj.cs b/OpenSim/Client/Sirikata/Protocol/Sirikata.pbj.cs deleted file mode 100644 index fcf01527ba..0000000000 --- a/OpenSim/Client/Sirikata/Protocol/Sirikata.pbj.cs +++ /dev/null @@ -1,3934 +0,0 @@ -/* - * Copyright (c) Contributors, http://opensimulator.org/ - * See CONTRIBUTORS.TXT for a full list of copyright holders. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * * Neither the name of the OpenSimulator Project nor the - * names of its contributors may be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE DEVELOPERS ``AS IS'' AND ANY - * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED - * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL THE CONTRIBUTORS BE LIABLE FOR ANY - * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES - * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; - * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ - -using pbd = global::Google.ProtocolBuffers.Descriptors; -using pb = global::Google.ProtocolBuffers; -namespace Sirikata.Protocol { - public class MessageBody : PBJ.IMessage { - protected _PBJ_Internal.MessageBody super; - public _PBJ_Internal.MessageBody _PBJSuper{ get { return super;} } - public MessageBody() { - super=new _PBJ_Internal.MessageBody(); - } - public MessageBody(_PBJ_Internal.MessageBody reference) { - super=reference; - } - public static MessageBody defaultInstance= new MessageBody (_PBJ_Internal.MessageBody.DefaultInstance); - public static MessageBody DefaultInstance{ - get {return defaultInstance;} - } - public static pbd.MessageDescriptor Descriptor { - get { return _PBJ_Internal.MessageBody.Descriptor; } } - public static class Types { - } - public static bool WithinReservedFieldTagRange(int field_tag) { - return false||(field_tag>=1&&field_tag<=8)||(field_tag>=1536&&field_tag<=2560)||(field_tag>=229376&&field_tag<=294912); - } - public static bool WithinExtensionFieldTagRange(int field_tag) { - return false; - } - public const int MessageNamesFieldTag=9; - public int MessageNamesCount { get { return super.MessageNamesCount;} } - public bool HasMessageNames(int index) {return PBJ._PBJ.ValidateString(super.GetMessageNames(index));} - public string MessageNames(int index) { - return (string)PBJ._PBJ.CastString(super.GetMessageNames(index)); - } - public const int MessageArgumentsFieldTag=10; - public int MessageArgumentsCount { get { return super.MessageArgumentsCount;} } - public bool HasMessageArguments(int index) {return PBJ._PBJ.ValidateBytes(super.GetMessageArguments(index));} - public pb::ByteString MessageArguments(int index) { - return (pb::ByteString)PBJ._PBJ.CastBytes(super.GetMessageArguments(index)); - } - public override Google.ProtocolBuffers.IMessage _PBJISuper { get { return super; } } - public override PBJ.IMessage.IBuilder WeakCreateBuilderForType() { return new Builder(); } - public static Builder CreateBuilder() { return new Builder(); } - public static Builder CreateBuilder(MessageBody prototype) { - return (Builder)new Builder().MergeFrom(prototype); - } - public static MessageBody ParseFrom(pb::ByteString data) { - return new MessageBody(_PBJ_Internal.MessageBody.ParseFrom(data)); - } - public static MessageBody ParseFrom(pb::ByteString data, pb::ExtensionRegistry er) { - return new MessageBody(_PBJ_Internal.MessageBody.ParseFrom(data,er)); - } - public static MessageBody ParseFrom(byte[] data) { - return new MessageBody(_PBJ_Internal.MessageBody.ParseFrom(data)); - } - public static MessageBody ParseFrom(byte[] data, pb::ExtensionRegistry er) { - return new MessageBody(_PBJ_Internal.MessageBody.ParseFrom(data,er)); - } - public static MessageBody ParseFrom(global::System.IO.Stream data) { - return new MessageBody(_PBJ_Internal.MessageBody.ParseFrom(data)); - } - public static MessageBody ParseFrom(global::System.IO.Stream data, pb::ExtensionRegistry er) { - return new MessageBody(_PBJ_Internal.MessageBody.ParseFrom(data,er)); - } - public static MessageBody ParseFrom(pb::CodedInputStream data) { - return new MessageBody(_PBJ_Internal.MessageBody.ParseFrom(data)); - } - public static MessageBody ParseFrom(pb::CodedInputStream data, pb::ExtensionRegistry er) { - return new MessageBody(_PBJ_Internal.MessageBody.ParseFrom(data,er)); - } - protected override bool _HasAllPBJFields{ get { - return true - ; - } } - public bool IsInitialized { get { - return super.IsInitialized&&_HasAllPBJFields; - } } - public class Builder : global::PBJ.IMessage.IBuilder{ - protected override bool _HasAllPBJFields{ get { - return true - ; - } } - public bool IsInitialized { get { - return super.IsInitialized&&_HasAllPBJFields; - } } - protected _PBJ_Internal.MessageBody.Builder super; - public override Google.ProtocolBuffers.IBuilder _PBJISuper { get { return super; } } - public _PBJ_Internal.MessageBody.Builder _PBJSuper{ get { return super;} } - public Builder() {super = new _PBJ_Internal.MessageBody.Builder();} - public Builder(_PBJ_Internal.MessageBody.Builder other) { - super=other; - } - public Builder Clone() {return new Builder(super.Clone());} - public Builder MergeFrom(MessageBody prototype) { super.MergeFrom(prototype._PBJSuper);return this;} - public Builder Clear() {super.Clear();return this;} - public MessageBody BuildPartial() {return new MessageBody(super.BuildPartial());} - public MessageBody Build() {if (_HasAllPBJFields) return new MessageBody(super.Build());return null;} - public pbd::MessageDescriptor DescriptorForType { - get { return MessageBody.Descriptor; } } - public Builder ClearMessageNames() { super.ClearMessageNames();return this;} - public Builder SetMessageNames(int index, string value) { - super.SetMessageNames(index,PBJ._PBJ.Construct(value)); - return this; - } - public const int MessageNamesFieldTag=9; - public int MessageNamesCount { get { return super.MessageNamesCount;} } - public bool HasMessageNames(int index) {return PBJ._PBJ.ValidateString(super.GetMessageNames(index));} - public string MessageNames(int index) { - return (string)PBJ._PBJ.CastString(super.GetMessageNames(index)); - } - public Builder AddMessageNames(string value) { - super.AddMessageNames(PBJ._PBJ.Construct(value)); - return this; - } - public Builder ClearMessageArguments() { super.ClearMessageArguments();return this;} - public Builder SetMessageArguments(int index, pb::ByteString value) { - super.SetMessageArguments(index,PBJ._PBJ.Construct(value)); - return this; - } - public const int MessageArgumentsFieldTag=10; - public int MessageArgumentsCount { get { return super.MessageArgumentsCount;} } - public bool HasMessageArguments(int index) {return PBJ._PBJ.ValidateBytes(super.GetMessageArguments(index));} - public pb::ByteString MessageArguments(int index) { - return (pb::ByteString)PBJ._PBJ.CastBytes(super.GetMessageArguments(index)); - } - public Builder AddMessageArguments(pb::ByteString value) { - super.AddMessageArguments(PBJ._PBJ.Construct(value)); - return this; - } - } - } -} -namespace Sirikata.Protocol { - public class ReadOnlyMessage : PBJ.IMessage { - protected _PBJ_Internal.ReadOnlyMessage super; - public _PBJ_Internal.ReadOnlyMessage _PBJSuper{ get { return super;} } - public ReadOnlyMessage() { - super=new _PBJ_Internal.ReadOnlyMessage(); - } - public ReadOnlyMessage(_PBJ_Internal.ReadOnlyMessage reference) { - super=reference; - } - public static ReadOnlyMessage defaultInstance= new ReadOnlyMessage (_PBJ_Internal.ReadOnlyMessage.DefaultInstance); - public static ReadOnlyMessage DefaultInstance{ - get {return defaultInstance;} - } - public static pbd.MessageDescriptor Descriptor { - get { return _PBJ_Internal.ReadOnlyMessage.Descriptor; } } - public static class Types { - public enum ReturnStatus { - SUCCESS=_PBJ_Internal.ReadOnlyMessage.Types.ReturnStatus.SUCCESS, - NETWORK_FAILURE=_PBJ_Internal.ReadOnlyMessage.Types.ReturnStatus.NETWORK_FAILURE, - TIMEOUT_FAILURE=_PBJ_Internal.ReadOnlyMessage.Types.ReturnStatus.TIMEOUT_FAILURE, - PROTOCOL_ERROR=_PBJ_Internal.ReadOnlyMessage.Types.ReturnStatus.PROTOCOL_ERROR, - PORT_FAILURE=_PBJ_Internal.ReadOnlyMessage.Types.ReturnStatus.PORT_FAILURE - }; - } - public static bool WithinReservedFieldTagRange(int field_tag) { - return false||(field_tag>=1&&field_tag<=8)||(field_tag>=1536&&field_tag<=2560)||(field_tag>=229376&&field_tag<=294912); - } - public static bool WithinExtensionFieldTagRange(int field_tag) { - return false; - } - public const int SourceObjectFieldTag=1; - public bool HasSourceObject{ get {return super.HasSourceObject&&PBJ._PBJ.ValidateUuid(super.SourceObject);} } - public PBJ.UUID SourceObject{ get { - if (HasSourceObject) { - return PBJ._PBJ.CastUuid(super.SourceObject); - } else { - return PBJ._PBJ.CastUuid(); - } - } - } - public const int SourcePortFieldTag=3; - public bool HasSourcePort{ get {return super.HasSourcePort&&PBJ._PBJ.ValidateUint32(super.SourcePort);} } - public uint SourcePort{ get { - if (HasSourcePort) { - return PBJ._PBJ.CastUint32(super.SourcePort); - } else { - return PBJ._PBJ.CastUint32(); - } - } - } - public const int SourceSpaceFieldTag=1536; - public bool HasSourceSpace{ get {return super.HasSourceSpace&&PBJ._PBJ.ValidateUuid(super.SourceSpace);} } - public PBJ.UUID SourceSpace{ get { - if (HasSourceSpace) { - return PBJ._PBJ.CastUuid(super.SourceSpace); - } else { - return PBJ._PBJ.CastUuid(); - } - } - } - public const int DestinationObjectFieldTag=2; - public bool HasDestinationObject{ get {return super.HasDestinationObject&&PBJ._PBJ.ValidateUuid(super.DestinationObject);} } - public PBJ.UUID DestinationObject{ get { - if (HasDestinationObject) { - return PBJ._PBJ.CastUuid(super.DestinationObject); - } else { - return PBJ._PBJ.CastUuid(); - } - } - } - public const int DestinationPortFieldTag=4; - public bool HasDestinationPort{ get {return super.HasDestinationPort&&PBJ._PBJ.ValidateUint32(super.DestinationPort);} } - public uint DestinationPort{ get { - if (HasDestinationPort) { - return PBJ._PBJ.CastUint32(super.DestinationPort); - } else { - return PBJ._PBJ.CastUint32(); - } - } - } - public const int DestinationSpaceFieldTag=1537; - public bool HasDestinationSpace{ get {return super.HasDestinationSpace&&PBJ._PBJ.ValidateUuid(super.DestinationSpace);} } - public PBJ.UUID DestinationSpace{ get { - if (HasDestinationSpace) { - return PBJ._PBJ.CastUuid(super.DestinationSpace); - } else { - return PBJ._PBJ.CastUuid(); - } - } - } - public const int IdFieldTag=7; - public bool HasId{ get {return super.HasId&&PBJ._PBJ.ValidateInt64(super.Id);} } - public long Id{ get { - if (HasId) { - return PBJ._PBJ.CastInt64(super.Id); - } else { - return PBJ._PBJ.CastInt64(); - } - } - } - public const int ReplyIdFieldTag=8; - public bool HasReplyId{ get {return super.HasReplyId&&PBJ._PBJ.ValidateInt64(super.ReplyId);} } - public long ReplyId{ get { - if (HasReplyId) { - return PBJ._PBJ.CastInt64(super.ReplyId); - } else { - return PBJ._PBJ.CastInt64(); - } - } - } - public const int ReturnStatusFieldTag=1792; - public bool HasReturnStatus{ get {return super.HasReturnStatus;} } - public Types.ReturnStatus ReturnStatus{ get { - if (HasReturnStatus) { - return (Types.ReturnStatus)super.ReturnStatus; - } else { - return new Types.ReturnStatus(); - } - } - } - public const int MessageNamesFieldTag=9; - public int MessageNamesCount { get { return super.MessageNamesCount;} } - public bool HasMessageNames(int index) {return PBJ._PBJ.ValidateString(super.GetMessageNames(index));} - public string MessageNames(int index) { - return (string)PBJ._PBJ.CastString(super.GetMessageNames(index)); - } - public const int MessageArgumentsFieldTag=10; - public int MessageArgumentsCount { get { return super.MessageArgumentsCount;} } - public bool HasMessageArguments(int index) {return PBJ._PBJ.ValidateBytes(super.GetMessageArguments(index));} - public pb::ByteString MessageArguments(int index) { - return (pb::ByteString)PBJ._PBJ.CastBytes(super.GetMessageArguments(index)); - } - public override Google.ProtocolBuffers.IMessage _PBJISuper { get { return super; } } - public override PBJ.IMessage.IBuilder WeakCreateBuilderForType() { return new Builder(); } - public static Builder CreateBuilder() { return new Builder(); } - public static Builder CreateBuilder(ReadOnlyMessage prototype) { - return (Builder)new Builder().MergeFrom(prototype); - } - public static ReadOnlyMessage ParseFrom(pb::ByteString data) { - return new ReadOnlyMessage(_PBJ_Internal.ReadOnlyMessage.ParseFrom(data)); - } - public static ReadOnlyMessage ParseFrom(pb::ByteString data, pb::ExtensionRegistry er) { - return new ReadOnlyMessage(_PBJ_Internal.ReadOnlyMessage.ParseFrom(data,er)); - } - public static ReadOnlyMessage ParseFrom(byte[] data) { - return new ReadOnlyMessage(_PBJ_Internal.ReadOnlyMessage.ParseFrom(data)); - } - public static ReadOnlyMessage ParseFrom(byte[] data, pb::ExtensionRegistry er) { - return new ReadOnlyMessage(_PBJ_Internal.ReadOnlyMessage.ParseFrom(data,er)); - } - public static ReadOnlyMessage ParseFrom(global::System.IO.Stream data) { - return new ReadOnlyMessage(_PBJ_Internal.ReadOnlyMessage.ParseFrom(data)); - } - public static ReadOnlyMessage ParseFrom(global::System.IO.Stream data, pb::ExtensionRegistry er) { - return new ReadOnlyMessage(_PBJ_Internal.ReadOnlyMessage.ParseFrom(data,er)); - } - public static ReadOnlyMessage ParseFrom(pb::CodedInputStream data) { - return new ReadOnlyMessage(_PBJ_Internal.ReadOnlyMessage.ParseFrom(data)); - } - public static ReadOnlyMessage ParseFrom(pb::CodedInputStream data, pb::ExtensionRegistry er) { - return new ReadOnlyMessage(_PBJ_Internal.ReadOnlyMessage.ParseFrom(data,er)); - } - protected override bool _HasAllPBJFields{ get { - return true - ; - } } - public bool IsInitialized { get { - return super.IsInitialized&&_HasAllPBJFields; - } } - public class Builder : global::PBJ.IMessage.IBuilder{ - protected override bool _HasAllPBJFields{ get { - return true - ; - } } - public bool IsInitialized { get { - return super.IsInitialized&&_HasAllPBJFields; - } } - protected _PBJ_Internal.ReadOnlyMessage.Builder super; - public override Google.ProtocolBuffers.IBuilder _PBJISuper { get { return super; } } - public _PBJ_Internal.ReadOnlyMessage.Builder _PBJSuper{ get { return super;} } - public Builder() {super = new _PBJ_Internal.ReadOnlyMessage.Builder();} - public Builder(_PBJ_Internal.ReadOnlyMessage.Builder other) { - super=other; - } - public Builder Clone() {return new Builder(super.Clone());} - public Builder MergeFrom(ReadOnlyMessage prototype) { super.MergeFrom(prototype._PBJSuper);return this;} - public Builder Clear() {super.Clear();return this;} - public ReadOnlyMessage BuildPartial() {return new ReadOnlyMessage(super.BuildPartial());} - public ReadOnlyMessage Build() {if (_HasAllPBJFields) return new ReadOnlyMessage(super.Build());return null;} - public pbd::MessageDescriptor DescriptorForType { - get { return ReadOnlyMessage.Descriptor; } } - public Builder ClearSourceObject() { super.ClearSourceObject();return this;} - public const int SourceObjectFieldTag=1; - public bool HasSourceObject{ get {return super.HasSourceObject&&PBJ._PBJ.ValidateUuid(super.SourceObject);} } - public PBJ.UUID SourceObject{ get { - if (HasSourceObject) { - return PBJ._PBJ.CastUuid(super.SourceObject); - } else { - return PBJ._PBJ.CastUuid(); - } - } - set { - super.SourceObject=(PBJ._PBJ.Construct(value)); - } - } - public Builder ClearSourcePort() { super.ClearSourcePort();return this;} - public const int SourcePortFieldTag=3; - public bool HasSourcePort{ get {return super.HasSourcePort&&PBJ._PBJ.ValidateUint32(super.SourcePort);} } - public uint SourcePort{ get { - if (HasSourcePort) { - return PBJ._PBJ.CastUint32(super.SourcePort); - } else { - return PBJ._PBJ.CastUint32(); - } - } - set { - super.SourcePort=(PBJ._PBJ.Construct(value)); - } - } - public Builder ClearSourceSpace() { super.ClearSourceSpace();return this;} - public const int SourceSpaceFieldTag=1536; - public bool HasSourceSpace{ get {return super.HasSourceSpace&&PBJ._PBJ.ValidateUuid(super.SourceSpace);} } - public PBJ.UUID SourceSpace{ get { - if (HasSourceSpace) { - return PBJ._PBJ.CastUuid(super.SourceSpace); - } else { - return PBJ._PBJ.CastUuid(); - } - } - set { - super.SourceSpace=(PBJ._PBJ.Construct(value)); - } - } - public Builder ClearDestinationObject() { super.ClearDestinationObject();return this;} - public const int DestinationObjectFieldTag=2; - public bool HasDestinationObject{ get {return super.HasDestinationObject&&PBJ._PBJ.ValidateUuid(super.DestinationObject);} } - public PBJ.UUID DestinationObject{ get { - if (HasDestinationObject) { - return PBJ._PBJ.CastUuid(super.DestinationObject); - } else { - return PBJ._PBJ.CastUuid(); - } - } - set { - super.DestinationObject=(PBJ._PBJ.Construct(value)); - } - } - public Builder ClearDestinationPort() { super.ClearDestinationPort();return this;} - public const int DestinationPortFieldTag=4; - public bool HasDestinationPort{ get {return super.HasDestinationPort&&PBJ._PBJ.ValidateUint32(super.DestinationPort);} } - public uint DestinationPort{ get { - if (HasDestinationPort) { - return PBJ._PBJ.CastUint32(super.DestinationPort); - } else { - return PBJ._PBJ.CastUint32(); - } - } - set { - super.DestinationPort=(PBJ._PBJ.Construct(value)); - } - } - public Builder ClearDestinationSpace() { super.ClearDestinationSpace();return this;} - public const int DestinationSpaceFieldTag=1537; - public bool HasDestinationSpace{ get {return super.HasDestinationSpace&&PBJ._PBJ.ValidateUuid(super.DestinationSpace);} } - public PBJ.UUID DestinationSpace{ get { - if (HasDestinationSpace) { - return PBJ._PBJ.CastUuid(super.DestinationSpace); - } else { - return PBJ._PBJ.CastUuid(); - } - } - set { - super.DestinationSpace=(PBJ._PBJ.Construct(value)); - } - } - public Builder ClearId() { super.ClearId();return this;} - public const int IdFieldTag=7; - public bool HasId{ get {return super.HasId&&PBJ._PBJ.ValidateInt64(super.Id);} } - public long Id{ get { - if (HasId) { - return PBJ._PBJ.CastInt64(super.Id); - } else { - return PBJ._PBJ.CastInt64(); - } - } - set { - super.Id=(PBJ._PBJ.Construct(value)); - } - } - public Builder ClearReplyId() { super.ClearReplyId();return this;} - public const int ReplyIdFieldTag=8; - public bool HasReplyId{ get {return super.HasReplyId&&PBJ._PBJ.ValidateInt64(super.ReplyId);} } - public long ReplyId{ get { - if (HasReplyId) { - return PBJ._PBJ.CastInt64(super.ReplyId); - } else { - return PBJ._PBJ.CastInt64(); - } - } - set { - super.ReplyId=(PBJ._PBJ.Construct(value)); - } - } - public Builder ClearReturnStatus() { super.ClearReturnStatus();return this;} - public const int ReturnStatusFieldTag=1792; - public bool HasReturnStatus{ get {return super.HasReturnStatus;} } - public Types.ReturnStatus ReturnStatus{ get { - if (HasReturnStatus) { - return (Types.ReturnStatus)super.ReturnStatus; - } else { - return new Types.ReturnStatus(); - } - } - set { - super.ReturnStatus=((_PBJ_Internal.ReadOnlyMessage.Types.ReturnStatus)value); - } - } - public Builder ClearMessageNames() { super.ClearMessageNames();return this;} - public Builder SetMessageNames(int index, string value) { - super.SetMessageNames(index,PBJ._PBJ.Construct(value)); - return this; - } - public const int MessageNamesFieldTag=9; - public int MessageNamesCount { get { return super.MessageNamesCount;} } - public bool HasMessageNames(int index) {return PBJ._PBJ.ValidateString(super.GetMessageNames(index));} - public string MessageNames(int index) { - return (string)PBJ._PBJ.CastString(super.GetMessageNames(index)); - } - public Builder AddMessageNames(string value) { - super.AddMessageNames(PBJ._PBJ.Construct(value)); - return this; - } - public Builder ClearMessageArguments() { super.ClearMessageArguments();return this;} - public Builder SetMessageArguments(int index, pb::ByteString value) { - super.SetMessageArguments(index,PBJ._PBJ.Construct(value)); - return this; - } - public const int MessageArgumentsFieldTag=10; - public int MessageArgumentsCount { get { return super.MessageArgumentsCount;} } - public bool HasMessageArguments(int index) {return PBJ._PBJ.ValidateBytes(super.GetMessageArguments(index));} - public pb::ByteString MessageArguments(int index) { - return (pb::ByteString)PBJ._PBJ.CastBytes(super.GetMessageArguments(index)); - } - public Builder AddMessageArguments(pb::ByteString value) { - super.AddMessageArguments(PBJ._PBJ.Construct(value)); - return this; - } - } - } -} -namespace Sirikata.Protocol { - public class SpaceServices : PBJ.IMessage { - protected _PBJ_Internal.SpaceServices super; - public _PBJ_Internal.SpaceServices _PBJSuper{ get { return super;} } - public SpaceServices() { - super=new _PBJ_Internal.SpaceServices(); - } - public SpaceServices(_PBJ_Internal.SpaceServices reference) { - super=reference; - } - public static SpaceServices defaultInstance= new SpaceServices (_PBJ_Internal.SpaceServices.DefaultInstance); - public static SpaceServices DefaultInstance{ - get {return defaultInstance;} - } - public static pbd.MessageDescriptor Descriptor { - get { return _PBJ_Internal.SpaceServices.Descriptor; } } - public static class Types { - } - public static bool WithinReservedFieldTagRange(int field_tag) { - return false; - } - public static bool WithinExtensionFieldTagRange(int field_tag) { - return false; - } - public const int RegistrationPortFieldTag=33; - public bool HasRegistrationPort{ get {return super.HasRegistrationPort&&PBJ._PBJ.ValidateUint32(super.RegistrationPort);} } - public uint RegistrationPort{ get { - if (HasRegistrationPort) { - return PBJ._PBJ.CastUint32(super.RegistrationPort); - } else { - return PBJ._PBJ.CastUint32(); - } - } - } - public const int LocPortFieldTag=34; - public bool HasLocPort{ get {return super.HasLocPort&&PBJ._PBJ.ValidateUint32(super.LocPort);} } - public uint LocPort{ get { - if (HasLocPort) { - return PBJ._PBJ.CastUint32(super.LocPort); - } else { - return PBJ._PBJ.CastUint32(); - } - } - } - public const int GeomPortFieldTag=35; - public bool HasGeomPort{ get {return super.HasGeomPort&&PBJ._PBJ.ValidateUint32(super.GeomPort);} } - public uint GeomPort{ get { - if (HasGeomPort) { - return PBJ._PBJ.CastUint32(super.GeomPort); - } else { - return PBJ._PBJ.CastUint32(); - } - } - } - public const int OsegPortFieldTag=36; - public bool HasOsegPort{ get {return super.HasOsegPort&&PBJ._PBJ.ValidateUint32(super.OsegPort);} } - public uint OsegPort{ get { - if (HasOsegPort) { - return PBJ._PBJ.CastUint32(super.OsegPort); - } else { - return PBJ._PBJ.CastUint32(); - } - } - } - public const int CsegPortFieldTag=37; - public bool HasCsegPort{ get {return super.HasCsegPort&&PBJ._PBJ.ValidateUint32(super.CsegPort);} } - public uint CsegPort{ get { - if (HasCsegPort) { - return PBJ._PBJ.CastUint32(super.CsegPort); - } else { - return PBJ._PBJ.CastUint32(); - } - } - } - public const int RouterPortFieldTag=38; - public bool HasRouterPort{ get {return super.HasRouterPort&&PBJ._PBJ.ValidateUint32(super.RouterPort);} } - public uint RouterPort{ get { - if (HasRouterPort) { - return PBJ._PBJ.CastUint32(super.RouterPort); - } else { - return PBJ._PBJ.CastUint32(); - } - } - } - public const int PreConnectionBufferFieldTag=64; - public bool HasPreConnectionBuffer{ get {return super.HasPreConnectionBuffer&&PBJ._PBJ.ValidateUint64(super.PreConnectionBuffer);} } - public ulong PreConnectionBuffer{ get { - if (HasPreConnectionBuffer) { - return PBJ._PBJ.CastUint64(super.PreConnectionBuffer); - } else { - return PBJ._PBJ.CastUint64(); - } - } - } - public const int MaxPreConnectionMessagesFieldTag=65; - public bool HasMaxPreConnectionMessages{ get {return super.HasMaxPreConnectionMessages&&PBJ._PBJ.ValidateUint64(super.MaxPreConnectionMessages);} } - public ulong MaxPreConnectionMessages{ get { - if (HasMaxPreConnectionMessages) { - return PBJ._PBJ.CastUint64(super.MaxPreConnectionMessages); - } else { - return PBJ._PBJ.CastUint64(); - } - } - } - public override Google.ProtocolBuffers.IMessage _PBJISuper { get { return super; } } - public override PBJ.IMessage.IBuilder WeakCreateBuilderForType() { return new Builder(); } - public static Builder CreateBuilder() { return new Builder(); } - public static Builder CreateBuilder(SpaceServices prototype) { - return (Builder)new Builder().MergeFrom(prototype); - } - public static SpaceServices ParseFrom(pb::ByteString data) { - return new SpaceServices(_PBJ_Internal.SpaceServices.ParseFrom(data)); - } - public static SpaceServices ParseFrom(pb::ByteString data, pb::ExtensionRegistry er) { - return new SpaceServices(_PBJ_Internal.SpaceServices.ParseFrom(data,er)); - } - public static SpaceServices ParseFrom(byte[] data) { - return new SpaceServices(_PBJ_Internal.SpaceServices.ParseFrom(data)); - } - public static SpaceServices ParseFrom(byte[] data, pb::ExtensionRegistry er) { - return new SpaceServices(_PBJ_Internal.SpaceServices.ParseFrom(data,er)); - } - public static SpaceServices ParseFrom(global::System.IO.Stream data) { - return new SpaceServices(_PBJ_Internal.SpaceServices.ParseFrom(data)); - } - public static SpaceServices ParseFrom(global::System.IO.Stream data, pb::ExtensionRegistry er) { - return new SpaceServices(_PBJ_Internal.SpaceServices.ParseFrom(data,er)); - } - public static SpaceServices ParseFrom(pb::CodedInputStream data) { - return new SpaceServices(_PBJ_Internal.SpaceServices.ParseFrom(data)); - } - public static SpaceServices ParseFrom(pb::CodedInputStream data, pb::ExtensionRegistry er) { - return new SpaceServices(_PBJ_Internal.SpaceServices.ParseFrom(data,er)); - } - protected override bool _HasAllPBJFields{ get { - return true - ; - } } - public bool IsInitialized { get { - return super.IsInitialized&&_HasAllPBJFields; - } } - public class Builder : global::PBJ.IMessage.IBuilder{ - protected override bool _HasAllPBJFields{ get { - return true - ; - } } - public bool IsInitialized { get { - return super.IsInitialized&&_HasAllPBJFields; - } } - protected _PBJ_Internal.SpaceServices.Builder super; - public override Google.ProtocolBuffers.IBuilder _PBJISuper { get { return super; } } - public _PBJ_Internal.SpaceServices.Builder _PBJSuper{ get { return super;} } - public Builder() {super = new _PBJ_Internal.SpaceServices.Builder();} - public Builder(_PBJ_Internal.SpaceServices.Builder other) { - super=other; - } - public Builder Clone() {return new Builder(super.Clone());} - public Builder MergeFrom(SpaceServices prototype) { super.MergeFrom(prototype._PBJSuper);return this;} - public Builder Clear() {super.Clear();return this;} - public SpaceServices BuildPartial() {return new SpaceServices(super.BuildPartial());} - public SpaceServices Build() {if (_HasAllPBJFields) return new SpaceServices(super.Build());return null;} - public pbd::MessageDescriptor DescriptorForType { - get { return SpaceServices.Descriptor; } } - public Builder ClearRegistrationPort() { super.ClearRegistrationPort();return this;} - public const int RegistrationPortFieldTag=33; - public bool HasRegistrationPort{ get {return super.HasRegistrationPort&&PBJ._PBJ.ValidateUint32(super.RegistrationPort);} } - public uint RegistrationPort{ get { - if (HasRegistrationPort) { - return PBJ._PBJ.CastUint32(super.RegistrationPort); - } else { - return PBJ._PBJ.CastUint32(); - } - } - set { - super.RegistrationPort=(PBJ._PBJ.Construct(value)); - } - } - public Builder ClearLocPort() { super.ClearLocPort();return this;} - public const int LocPortFieldTag=34; - public bool HasLocPort{ get {return super.HasLocPort&&PBJ._PBJ.ValidateUint32(super.LocPort);} } - public uint LocPort{ get { - if (HasLocPort) { - return PBJ._PBJ.CastUint32(super.LocPort); - } else { - return PBJ._PBJ.CastUint32(); - } - } - set { - super.LocPort=(PBJ._PBJ.Construct(value)); - } - } - public Builder ClearGeomPort() { super.ClearGeomPort();return this;} - public const int GeomPortFieldTag=35; - public bool HasGeomPort{ get {return super.HasGeomPort&&PBJ._PBJ.ValidateUint32(super.GeomPort);} } - public uint GeomPort{ get { - if (HasGeomPort) { - return PBJ._PBJ.CastUint32(super.GeomPort); - } else { - return PBJ._PBJ.CastUint32(); - } - } - set { - super.GeomPort=(PBJ._PBJ.Construct(value)); - } - } - public Builder ClearOsegPort() { super.ClearOsegPort();return this;} - public const int OsegPortFieldTag=36; - public bool HasOsegPort{ get {return super.HasOsegPort&&PBJ._PBJ.ValidateUint32(super.OsegPort);} } - public uint OsegPort{ get { - if (HasOsegPort) { - return PBJ._PBJ.CastUint32(super.OsegPort); - } else { - return PBJ._PBJ.CastUint32(); - } - } - set { - super.OsegPort=(PBJ._PBJ.Construct(value)); - } - } - public Builder ClearCsegPort() { super.ClearCsegPort();return this;} - public const int CsegPortFieldTag=37; - public bool HasCsegPort{ get {return super.HasCsegPort&&PBJ._PBJ.ValidateUint32(super.CsegPort);} } - public uint CsegPort{ get { - if (HasCsegPort) { - return PBJ._PBJ.CastUint32(super.CsegPort); - } else { - return PBJ._PBJ.CastUint32(); - } - } - set { - super.CsegPort=(PBJ._PBJ.Construct(value)); - } - } - public Builder ClearRouterPort() { super.ClearRouterPort();return this;} - public const int RouterPortFieldTag=38; - public bool HasRouterPort{ get {return super.HasRouterPort&&PBJ._PBJ.ValidateUint32(super.RouterPort);} } - public uint RouterPort{ get { - if (HasRouterPort) { - return PBJ._PBJ.CastUint32(super.RouterPort); - } else { - return PBJ._PBJ.CastUint32(); - } - } - set { - super.RouterPort=(PBJ._PBJ.Construct(value)); - } - } - public Builder ClearPreConnectionBuffer() { super.ClearPreConnectionBuffer();return this;} - public const int PreConnectionBufferFieldTag=64; - public bool HasPreConnectionBuffer{ get {return super.HasPreConnectionBuffer&&PBJ._PBJ.ValidateUint64(super.PreConnectionBuffer);} } - public ulong PreConnectionBuffer{ get { - if (HasPreConnectionBuffer) { - return PBJ._PBJ.CastUint64(super.PreConnectionBuffer); - } else { - return PBJ._PBJ.CastUint64(); - } - } - set { - super.PreConnectionBuffer=(PBJ._PBJ.Construct(value)); - } - } - public Builder ClearMaxPreConnectionMessages() { super.ClearMaxPreConnectionMessages();return this;} - public const int MaxPreConnectionMessagesFieldTag=65; - public bool HasMaxPreConnectionMessages{ get {return super.HasMaxPreConnectionMessages&&PBJ._PBJ.ValidateUint64(super.MaxPreConnectionMessages);} } - public ulong MaxPreConnectionMessages{ get { - if (HasMaxPreConnectionMessages) { - return PBJ._PBJ.CastUint64(super.MaxPreConnectionMessages); - } else { - return PBJ._PBJ.CastUint64(); - } - } - set { - super.MaxPreConnectionMessages=(PBJ._PBJ.Construct(value)); - } - } - } - } -} -namespace Sirikata.Protocol { - public class ObjLoc : PBJ.IMessage { - protected _PBJ_Internal.ObjLoc super; - public _PBJ_Internal.ObjLoc _PBJSuper{ get { return super;} } - public ObjLoc() { - super=new _PBJ_Internal.ObjLoc(); - } - public ObjLoc(_PBJ_Internal.ObjLoc reference) { - super=reference; - } - public static ObjLoc defaultInstance= new ObjLoc (_PBJ_Internal.ObjLoc.DefaultInstance); - public static ObjLoc DefaultInstance{ - get {return defaultInstance;} - } - public static pbd.MessageDescriptor Descriptor { - get { return _PBJ_Internal.ObjLoc.Descriptor; } } - public static class Types { - public enum UpdateFlags { - FORCE=_PBJ_Internal.ObjLoc.Types.UpdateFlags.FORCE - }; - } - public static bool WithinReservedFieldTagRange(int field_tag) { - return false; - } - public static bool WithinExtensionFieldTagRange(int field_tag) { - return false; - } - public const int TimestampFieldTag=2; - public bool HasTimestamp{ get {return super.HasTimestamp&&PBJ._PBJ.ValidateTime(super.Timestamp);} } - public PBJ.Time Timestamp{ get { - if (HasTimestamp) { - return PBJ._PBJ.CastTime(super.Timestamp); - } else { - return PBJ._PBJ.CastTime(); - } - } - } - public const int PositionFieldTag=3; - public bool HasPosition{ get {return super.PositionCount>=3;} } - public PBJ.Vector3d Position{ get { - int index=0; - if (HasPosition) { - return PBJ._PBJ.CastVector3d(super.GetPosition(index*3+0),super.GetPosition(index*3+1),super.GetPosition(index*3+2)); - } else { - return PBJ._PBJ.CastVector3d(); - } - } - } - public const int OrientationFieldTag=4; - public bool HasOrientation{ get {return super.OrientationCount>=3;} } - public PBJ.Quaternion Orientation{ get { - int index=0; - if (HasOrientation) { - return PBJ._PBJ.CastQuaternion(super.GetOrientation(index*3+0),super.GetOrientation(index*3+1),super.GetOrientation(index*3+2)); - } else { - return PBJ._PBJ.CastQuaternion(); - } - } - } - public const int VelocityFieldTag=5; - public bool HasVelocity{ get {return super.VelocityCount>=3;} } - public PBJ.Vector3f Velocity{ get { - int index=0; - if (HasVelocity) { - return PBJ._PBJ.CastVector3f(super.GetVelocity(index*3+0),super.GetVelocity(index*3+1),super.GetVelocity(index*3+2)); - } else { - return PBJ._PBJ.CastVector3f(); - } - } - } - public const int RotationalAxisFieldTag=7; - public bool HasRotationalAxis{ get {return super.RotationalAxisCount>=2;} } - public PBJ.Vector3f RotationalAxis{ get { - int index=0; - if (HasRotationalAxis) { - return PBJ._PBJ.CastNormal(super.GetRotationalAxis(index*2+0),super.GetRotationalAxis(index*2+1)); - } else { - return PBJ._PBJ.CastNormal(); - } - } - } - public const int AngularSpeedFieldTag=8; - public bool HasAngularSpeed{ get {return super.HasAngularSpeed&&PBJ._PBJ.ValidateFloat(super.AngularSpeed);} } - public float AngularSpeed{ get { - if (HasAngularSpeed) { - return PBJ._PBJ.CastFloat(super.AngularSpeed); - } else { - return PBJ._PBJ.CastFloat(); - } - } - } - public const int UpdateFlagsFieldTag=6; - public bool HasUpdateFlags { get { - if (!super.HasUpdateFlags) return false; - return PBJ._PBJ.ValidateFlags(super.UpdateFlags,(ulong)Types.UpdateFlags.FORCE); - } } - public byte UpdateFlags{ get { - if (HasUpdateFlags) { - return (byte)PBJ._PBJ.CastFlags(super.UpdateFlags,(ulong)Types.UpdateFlags.FORCE); - } else { - return (byte)PBJ._PBJ.CastFlags((ulong)Types.UpdateFlags.FORCE); - } - } - } - public override Google.ProtocolBuffers.IMessage _PBJISuper { get { return super; } } - public override PBJ.IMessage.IBuilder WeakCreateBuilderForType() { return new Builder(); } - public static Builder CreateBuilder() { return new Builder(); } - public static Builder CreateBuilder(ObjLoc prototype) { - return (Builder)new Builder().MergeFrom(prototype); - } - public static ObjLoc ParseFrom(pb::ByteString data) { - return new ObjLoc(_PBJ_Internal.ObjLoc.ParseFrom(data)); - } - public static ObjLoc ParseFrom(pb::ByteString data, pb::ExtensionRegistry er) { - return new ObjLoc(_PBJ_Internal.ObjLoc.ParseFrom(data,er)); - } - public static ObjLoc ParseFrom(byte[] data) { - return new ObjLoc(_PBJ_Internal.ObjLoc.ParseFrom(data)); - } - public static ObjLoc ParseFrom(byte[] data, pb::ExtensionRegistry er) { - return new ObjLoc(_PBJ_Internal.ObjLoc.ParseFrom(data,er)); - } - public static ObjLoc ParseFrom(global::System.IO.Stream data) { - return new ObjLoc(_PBJ_Internal.ObjLoc.ParseFrom(data)); - } - public static ObjLoc ParseFrom(global::System.IO.Stream data, pb::ExtensionRegistry er) { - return new ObjLoc(_PBJ_Internal.ObjLoc.ParseFrom(data,er)); - } - public static ObjLoc ParseFrom(pb::CodedInputStream data) { - return new ObjLoc(_PBJ_Internal.ObjLoc.ParseFrom(data)); - } - public static ObjLoc ParseFrom(pb::CodedInputStream data, pb::ExtensionRegistry er) { - return new ObjLoc(_PBJ_Internal.ObjLoc.ParseFrom(data,er)); - } - protected override bool _HasAllPBJFields{ get { - return true - ; - } } - public bool IsInitialized { get { - return super.IsInitialized&&_HasAllPBJFields; - } } - public class Builder : global::PBJ.IMessage.IBuilder{ - protected override bool _HasAllPBJFields{ get { - return true - ; - } } - public bool IsInitialized { get { - return super.IsInitialized&&_HasAllPBJFields; - } } - protected _PBJ_Internal.ObjLoc.Builder super; - public override Google.ProtocolBuffers.IBuilder _PBJISuper { get { return super; } } - public _PBJ_Internal.ObjLoc.Builder _PBJSuper{ get { return super;} } - public Builder() {super = new _PBJ_Internal.ObjLoc.Builder();} - public Builder(_PBJ_Internal.ObjLoc.Builder other) { - super=other; - } - public Builder Clone() {return new Builder(super.Clone());} - public Builder MergeFrom(ObjLoc prototype) { super.MergeFrom(prototype._PBJSuper);return this;} - public Builder Clear() {super.Clear();return this;} - public ObjLoc BuildPartial() {return new ObjLoc(super.BuildPartial());} - public ObjLoc Build() {if (_HasAllPBJFields) return new ObjLoc(super.Build());return null;} - public pbd::MessageDescriptor DescriptorForType { - get { return ObjLoc.Descriptor; } } - public Builder ClearTimestamp() { super.ClearTimestamp();return this;} - public const int TimestampFieldTag=2; - public bool HasTimestamp{ get {return super.HasTimestamp&&PBJ._PBJ.ValidateTime(super.Timestamp);} } - public PBJ.Time Timestamp{ get { - if (HasTimestamp) { - return PBJ._PBJ.CastTime(super.Timestamp); - } else { - return PBJ._PBJ.CastTime(); - } - } - set { - super.Timestamp=(PBJ._PBJ.Construct(value)); - } - } - public Builder ClearPosition() { super.ClearPosition();return this;} - public const int PositionFieldTag=3; - public bool HasPosition{ get {return super.PositionCount>=3;} } - public PBJ.Vector3d Position{ get { - int index=0; - if (HasPosition) { - return PBJ._PBJ.CastVector3d(super.GetPosition(index*3+0),super.GetPosition(index*3+1),super.GetPosition(index*3+2)); - } else { - return PBJ._PBJ.CastVector3d(); - } - } - set { - super.ClearPosition(); - double[] _PBJtempArray=PBJ._PBJ.ConstructVector3d(value); - super.AddPosition(_PBJtempArray[0]); - super.AddPosition(_PBJtempArray[1]); - super.AddPosition(_PBJtempArray[2]); - } - } - public Builder ClearOrientation() { super.ClearOrientation();return this;} - public const int OrientationFieldTag=4; - public bool HasOrientation{ get {return super.OrientationCount>=3;} } - public PBJ.Quaternion Orientation{ get { - int index=0; - if (HasOrientation) { - return PBJ._PBJ.CastQuaternion(super.GetOrientation(index*3+0),super.GetOrientation(index*3+1),super.GetOrientation(index*3+2)); - } else { - return PBJ._PBJ.CastQuaternion(); - } - } - set { - super.ClearOrientation(); - float[] _PBJtempArray=PBJ._PBJ.ConstructQuaternion(value); - super.AddOrientation(_PBJtempArray[0]); - super.AddOrientation(_PBJtempArray[1]); - super.AddOrientation(_PBJtempArray[2]); - } - } - public Builder ClearVelocity() { super.ClearVelocity();return this;} - public const int VelocityFieldTag=5; - public bool HasVelocity{ get {return super.VelocityCount>=3;} } - public PBJ.Vector3f Velocity{ get { - int index=0; - if (HasVelocity) { - return PBJ._PBJ.CastVector3f(super.GetVelocity(index*3+0),super.GetVelocity(index*3+1),super.GetVelocity(index*3+2)); - } else { - return PBJ._PBJ.CastVector3f(); - } - } - set { - super.ClearVelocity(); - float[] _PBJtempArray=PBJ._PBJ.ConstructVector3f(value); - super.AddVelocity(_PBJtempArray[0]); - super.AddVelocity(_PBJtempArray[1]); - super.AddVelocity(_PBJtempArray[2]); - } - } - public Builder ClearRotationalAxis() { super.ClearRotationalAxis();return this;} - public const int RotationalAxisFieldTag=7; - public bool HasRotationalAxis{ get {return super.RotationalAxisCount>=2;} } - public PBJ.Vector3f RotationalAxis{ get { - int index=0; - if (HasRotationalAxis) { - return PBJ._PBJ.CastNormal(super.GetRotationalAxis(index*2+0),super.GetRotationalAxis(index*2+1)); - } else { - return PBJ._PBJ.CastNormal(); - } - } - set { - super.ClearRotationalAxis(); - float[] _PBJtempArray=PBJ._PBJ.ConstructNormal(value); - super.AddRotationalAxis(_PBJtempArray[0]); - super.AddRotationalAxis(_PBJtempArray[1]); - } - } - public Builder ClearAngularSpeed() { super.ClearAngularSpeed();return this;} - public const int AngularSpeedFieldTag=8; - public bool HasAngularSpeed{ get {return super.HasAngularSpeed&&PBJ._PBJ.ValidateFloat(super.AngularSpeed);} } - public float AngularSpeed{ get { - if (HasAngularSpeed) { - return PBJ._PBJ.CastFloat(super.AngularSpeed); - } else { - return PBJ._PBJ.CastFloat(); - } - } - set { - super.AngularSpeed=(PBJ._PBJ.Construct(value)); - } - } - public Builder ClearUpdateFlags() { super.ClearUpdateFlags();return this;} - public const int UpdateFlagsFieldTag=6; - public bool HasUpdateFlags { get { - if (!super.HasUpdateFlags) return false; - return PBJ._PBJ.ValidateFlags(super.UpdateFlags,(ulong)Types.UpdateFlags.FORCE); - } } - public byte UpdateFlags{ get { - if (HasUpdateFlags) { - return (byte)PBJ._PBJ.CastFlags(super.UpdateFlags,(ulong)Types.UpdateFlags.FORCE); - } else { - return (byte)PBJ._PBJ.CastFlags((ulong)Types.UpdateFlags.FORCE); - } - } - set { - super.UpdateFlags=((value)); - } - } - } - } -} -namespace Sirikata.Protocol { - public class LocRequest : PBJ.IMessage { - protected _PBJ_Internal.LocRequest super; - public _PBJ_Internal.LocRequest _PBJSuper{ get { return super;} } - public LocRequest() { - super=new _PBJ_Internal.LocRequest(); - } - public LocRequest(_PBJ_Internal.LocRequest reference) { - super=reference; - } - public static LocRequest defaultInstance= new LocRequest (_PBJ_Internal.LocRequest.DefaultInstance); - public static LocRequest DefaultInstance{ - get {return defaultInstance;} - } - public static pbd.MessageDescriptor Descriptor { - get { return _PBJ_Internal.LocRequest.Descriptor; } } - public static class Types { - public enum Fields { - POSITION=_PBJ_Internal.LocRequest.Types.Fields.POSITION, - ORIENTATION=_PBJ_Internal.LocRequest.Types.Fields.ORIENTATION, - VELOCITY=_PBJ_Internal.LocRequest.Types.Fields.VELOCITY, - ROTATIONAL_AXIS=_PBJ_Internal.LocRequest.Types.Fields.ROTATIONAL_AXIS, - ANGULAR_SPEED=_PBJ_Internal.LocRequest.Types.Fields.ANGULAR_SPEED - }; - } - public static bool WithinReservedFieldTagRange(int field_tag) { - return false; - } - public static bool WithinExtensionFieldTagRange(int field_tag) { - return false; - } - public const int RequestedFieldsFieldTag=2; - public bool HasRequestedFields { get { - if (!super.HasRequestedFields) return false; - return PBJ._PBJ.ValidateFlags(super.RequestedFields,(ulong)Types.Fields.POSITION|(ulong)Types.Fields.ORIENTATION|(ulong)Types.Fields.VELOCITY|(ulong)Types.Fields.ROTATIONAL_AXIS|(ulong)Types.Fields.ANGULAR_SPEED); - } } - public uint RequestedFields{ get { - if (HasRequestedFields) { - return (uint)PBJ._PBJ.CastFlags(super.RequestedFields,(ulong)Types.Fields.POSITION|(ulong)Types.Fields.ORIENTATION|(ulong)Types.Fields.VELOCITY|(ulong)Types.Fields.ROTATIONAL_AXIS|(ulong)Types.Fields.ANGULAR_SPEED); - } else { - return (uint)PBJ._PBJ.CastFlags((ulong)Types.Fields.POSITION|(ulong)Types.Fields.ORIENTATION|(ulong)Types.Fields.VELOCITY|(ulong)Types.Fields.ROTATIONAL_AXIS|(ulong)Types.Fields.ANGULAR_SPEED); - } - } - } - public override Google.ProtocolBuffers.IMessage _PBJISuper { get { return super; } } - public override PBJ.IMessage.IBuilder WeakCreateBuilderForType() { return new Builder(); } - public static Builder CreateBuilder() { return new Builder(); } - public static Builder CreateBuilder(LocRequest prototype) { - return (Builder)new Builder().MergeFrom(prototype); - } - public static LocRequest ParseFrom(pb::ByteString data) { - return new LocRequest(_PBJ_Internal.LocRequest.ParseFrom(data)); - } - public static LocRequest ParseFrom(pb::ByteString data, pb::ExtensionRegistry er) { - return new LocRequest(_PBJ_Internal.LocRequest.ParseFrom(data,er)); - } - public static LocRequest ParseFrom(byte[] data) { - return new LocRequest(_PBJ_Internal.LocRequest.ParseFrom(data)); - } - public static LocRequest ParseFrom(byte[] data, pb::ExtensionRegistry er) { - return new LocRequest(_PBJ_Internal.LocRequest.ParseFrom(data,er)); - } - public static LocRequest ParseFrom(global::System.IO.Stream data) { - return new LocRequest(_PBJ_Internal.LocRequest.ParseFrom(data)); - } - public static LocRequest ParseFrom(global::System.IO.Stream data, pb::ExtensionRegistry er) { - return new LocRequest(_PBJ_Internal.LocRequest.ParseFrom(data,er)); - } - public static LocRequest ParseFrom(pb::CodedInputStream data) { - return new LocRequest(_PBJ_Internal.LocRequest.ParseFrom(data)); - } - public static LocRequest ParseFrom(pb::CodedInputStream data, pb::ExtensionRegistry er) { - return new LocRequest(_PBJ_Internal.LocRequest.ParseFrom(data,er)); - } - protected override bool _HasAllPBJFields{ get { - return true - ; - } } - public bool IsInitialized { get { - return super.IsInitialized&&_HasAllPBJFields; - } } - public class Builder : global::PBJ.IMessage.IBuilder{ - protected override bool _HasAllPBJFields{ get { - return true - ; - } } - public bool IsInitialized { get { - return super.IsInitialized&&_HasAllPBJFields; - } } - protected _PBJ_Internal.LocRequest.Builder super; - public override Google.ProtocolBuffers.IBuilder _PBJISuper { get { return super; } } - public _PBJ_Internal.LocRequest.Builder _PBJSuper{ get { return super;} } - public Builder() {super = new _PBJ_Internal.LocRequest.Builder();} - public Builder(_PBJ_Internal.LocRequest.Builder other) { - super=other; - } - public Builder Clone() {return new Builder(super.Clone());} - public Builder MergeFrom(LocRequest prototype) { super.MergeFrom(prototype._PBJSuper);return this;} - public Builder Clear() {super.Clear();return this;} - public LocRequest BuildPartial() {return new LocRequest(super.BuildPartial());} - public LocRequest Build() {if (_HasAllPBJFields) return new LocRequest(super.Build());return null;} - public pbd::MessageDescriptor DescriptorForType { - get { return LocRequest.Descriptor; } } - public Builder ClearRequestedFields() { super.ClearRequestedFields();return this;} - public const int RequestedFieldsFieldTag=2; - public bool HasRequestedFields { get { - if (!super.HasRequestedFields) return false; - return PBJ._PBJ.ValidateFlags(super.RequestedFields,(ulong)Types.Fields.POSITION|(ulong)Types.Fields.ORIENTATION|(ulong)Types.Fields.VELOCITY|(ulong)Types.Fields.ROTATIONAL_AXIS|(ulong)Types.Fields.ANGULAR_SPEED); - } } - public uint RequestedFields{ get { - if (HasRequestedFields) { - return (uint)PBJ._PBJ.CastFlags(super.RequestedFields,(ulong)Types.Fields.POSITION|(ulong)Types.Fields.ORIENTATION|(ulong)Types.Fields.VELOCITY|(ulong)Types.Fields.ROTATIONAL_AXIS|(ulong)Types.Fields.ANGULAR_SPEED); - } else { - return (uint)PBJ._PBJ.CastFlags((ulong)Types.Fields.POSITION|(ulong)Types.Fields.ORIENTATION|(ulong)Types.Fields.VELOCITY|(ulong)Types.Fields.ROTATIONAL_AXIS|(ulong)Types.Fields.ANGULAR_SPEED); - } - } - set { - super.RequestedFields=((value)); - } - } - } - } -} -namespace Sirikata.Protocol { - public class NewObj : PBJ.IMessage { - protected _PBJ_Internal.NewObj super; - public _PBJ_Internal.NewObj _PBJSuper{ get { return super;} } - public NewObj() { - super=new _PBJ_Internal.NewObj(); - } - public NewObj(_PBJ_Internal.NewObj reference) { - super=reference; - } - public static NewObj defaultInstance= new NewObj (_PBJ_Internal.NewObj.DefaultInstance); - public static NewObj DefaultInstance{ - get {return defaultInstance;} - } - public static pbd.MessageDescriptor Descriptor { - get { return _PBJ_Internal.NewObj.Descriptor; } } - public static class Types { - } - public static bool WithinReservedFieldTagRange(int field_tag) { - return false; - } - public static bool WithinExtensionFieldTagRange(int field_tag) { - return false; - } - public const int ObjectUuidEvidenceFieldTag=2; - public bool HasObjectUuidEvidence{ get {return super.HasObjectUuidEvidence&&PBJ._PBJ.ValidateUuid(super.ObjectUuidEvidence);} } - public PBJ.UUID ObjectUuidEvidence{ get { - if (HasObjectUuidEvidence) { - return PBJ._PBJ.CastUuid(super.ObjectUuidEvidence); - } else { - return PBJ._PBJ.CastUuid(); - } - } - } - public const int RequestedObjectLocFieldTag=3; - public bool HasRequestedObjectLoc{ get {return super.HasRequestedObjectLoc;} } - public ObjLoc RequestedObjectLoc{ get { - if (HasRequestedObjectLoc) { - return new ObjLoc(super.RequestedObjectLoc); - } else { - return new ObjLoc(); - } - } - } - public const int BoundingSphereFieldTag=4; - public bool HasBoundingSphere{ get {return super.BoundingSphereCount>=4;} } - public PBJ.BoundingSphere3f BoundingSphere{ get { - int index=0; - if (HasBoundingSphere) { - return PBJ._PBJ.CastBoundingsphere3f(super.GetBoundingSphere(index*4+0),super.GetBoundingSphere(index*4+1),super.GetBoundingSphere(index*4+2),super.GetBoundingSphere(index*4+3)); - } else { - return PBJ._PBJ.CastBoundingsphere3f(); - } - } - } - public override Google.ProtocolBuffers.IMessage _PBJISuper { get { return super; } } - public override PBJ.IMessage.IBuilder WeakCreateBuilderForType() { return new Builder(); } - public static Builder CreateBuilder() { return new Builder(); } - public static Builder CreateBuilder(NewObj prototype) { - return (Builder)new Builder().MergeFrom(prototype); - } - public static NewObj ParseFrom(pb::ByteString data) { - return new NewObj(_PBJ_Internal.NewObj.ParseFrom(data)); - } - public static NewObj ParseFrom(pb::ByteString data, pb::ExtensionRegistry er) { - return new NewObj(_PBJ_Internal.NewObj.ParseFrom(data,er)); - } - public static NewObj ParseFrom(byte[] data) { - return new NewObj(_PBJ_Internal.NewObj.ParseFrom(data)); - } - public static NewObj ParseFrom(byte[] data, pb::ExtensionRegistry er) { - return new NewObj(_PBJ_Internal.NewObj.ParseFrom(data,er)); - } - public static NewObj ParseFrom(global::System.IO.Stream data) { - return new NewObj(_PBJ_Internal.NewObj.ParseFrom(data)); - } - public static NewObj ParseFrom(global::System.IO.Stream data, pb::ExtensionRegistry er) { - return new NewObj(_PBJ_Internal.NewObj.ParseFrom(data,er)); - } - public static NewObj ParseFrom(pb::CodedInputStream data) { - return new NewObj(_PBJ_Internal.NewObj.ParseFrom(data)); - } - public static NewObj ParseFrom(pb::CodedInputStream data, pb::ExtensionRegistry er) { - return new NewObj(_PBJ_Internal.NewObj.ParseFrom(data,er)); - } - protected override bool _HasAllPBJFields{ get { - return true - ; - } } - public bool IsInitialized { get { - return super.IsInitialized&&_HasAllPBJFields; - } } - public class Builder : global::PBJ.IMessage.IBuilder{ - protected override bool _HasAllPBJFields{ get { - return true - ; - } } - public bool IsInitialized { get { - return super.IsInitialized&&_HasAllPBJFields; - } } - protected _PBJ_Internal.NewObj.Builder super; - public override Google.ProtocolBuffers.IBuilder _PBJISuper { get { return super; } } - public _PBJ_Internal.NewObj.Builder _PBJSuper{ get { return super;} } - public Builder() {super = new _PBJ_Internal.NewObj.Builder();} - public Builder(_PBJ_Internal.NewObj.Builder other) { - super=other; - } - public Builder Clone() {return new Builder(super.Clone());} - public Builder MergeFrom(NewObj prototype) { super.MergeFrom(prototype._PBJSuper);return this;} - public Builder Clear() {super.Clear();return this;} - public NewObj BuildPartial() {return new NewObj(super.BuildPartial());} - public NewObj Build() {if (_HasAllPBJFields) return new NewObj(super.Build());return null;} - public pbd::MessageDescriptor DescriptorForType { - get { return NewObj.Descriptor; } } - public Builder ClearObjectUuidEvidence() { super.ClearObjectUuidEvidence();return this;} - public const int ObjectUuidEvidenceFieldTag=2; - public bool HasObjectUuidEvidence{ get {return super.HasObjectUuidEvidence&&PBJ._PBJ.ValidateUuid(super.ObjectUuidEvidence);} } - public PBJ.UUID ObjectUuidEvidence{ get { - if (HasObjectUuidEvidence) { - return PBJ._PBJ.CastUuid(super.ObjectUuidEvidence); - } else { - return PBJ._PBJ.CastUuid(); - } - } - set { - super.ObjectUuidEvidence=(PBJ._PBJ.Construct(value)); - } - } - public Builder ClearRequestedObjectLoc() { super.ClearRequestedObjectLoc();return this;} - public const int RequestedObjectLocFieldTag=3; - public bool HasRequestedObjectLoc{ get {return super.HasRequestedObjectLoc;} } - public ObjLoc RequestedObjectLoc{ get { - if (HasRequestedObjectLoc) { - return new ObjLoc(super.RequestedObjectLoc); - } else { - return new ObjLoc(); - } - } - set { - super.RequestedObjectLoc=value._PBJSuper; - } - } - public Builder ClearBoundingSphere() { super.ClearBoundingSphere();return this;} - public const int BoundingSphereFieldTag=4; - public bool HasBoundingSphere{ get {return super.BoundingSphereCount>=4;} } - public PBJ.BoundingSphere3f BoundingSphere{ get { - int index=0; - if (HasBoundingSphere) { - return PBJ._PBJ.CastBoundingsphere3f(super.GetBoundingSphere(index*4+0),super.GetBoundingSphere(index*4+1),super.GetBoundingSphere(index*4+2),super.GetBoundingSphere(index*4+3)); - } else { - return PBJ._PBJ.CastBoundingsphere3f(); - } - } - set { - super.ClearBoundingSphere(); - float[] _PBJtempArray=PBJ._PBJ.ConstructBoundingsphere3f(value); - super.AddBoundingSphere(_PBJtempArray[0]); - super.AddBoundingSphere(_PBJtempArray[1]); - super.AddBoundingSphere(_PBJtempArray[2]); - super.AddBoundingSphere(_PBJtempArray[3]); - } - } - } - } -} -namespace Sirikata.Protocol { - public class RetObj : PBJ.IMessage { - protected _PBJ_Internal.RetObj super; - public _PBJ_Internal.RetObj _PBJSuper{ get { return super;} } - public RetObj() { - super=new _PBJ_Internal.RetObj(); - } - public RetObj(_PBJ_Internal.RetObj reference) { - super=reference; - } - public static RetObj defaultInstance= new RetObj (_PBJ_Internal.RetObj.DefaultInstance); - public static RetObj DefaultInstance{ - get {return defaultInstance;} - } - public static pbd.MessageDescriptor Descriptor { - get { return _PBJ_Internal.RetObj.Descriptor; } } - public static class Types { - } - public static bool WithinReservedFieldTagRange(int field_tag) { - return false; - } - public static bool WithinExtensionFieldTagRange(int field_tag) { - return false; - } - public const int ObjectReferenceFieldTag=2; - public bool HasObjectReference{ get {return super.HasObjectReference&&PBJ._PBJ.ValidateUuid(super.ObjectReference);} } - public PBJ.UUID ObjectReference{ get { - if (HasObjectReference) { - return PBJ._PBJ.CastUuid(super.ObjectReference); - } else { - return PBJ._PBJ.CastUuid(); - } - } - } - public const int LocationFieldTag=3; - public bool HasLocation{ get {return super.HasLocation;} } - public ObjLoc Location{ get { - if (HasLocation) { - return new ObjLoc(super.Location); - } else { - return new ObjLoc(); - } - } - } - public const int BoundingSphereFieldTag=4; - public bool HasBoundingSphere{ get {return super.BoundingSphereCount>=4;} } - public PBJ.BoundingSphere3f BoundingSphere{ get { - int index=0; - if (HasBoundingSphere) { - return PBJ._PBJ.CastBoundingsphere3f(super.GetBoundingSphere(index*4+0),super.GetBoundingSphere(index*4+1),super.GetBoundingSphere(index*4+2),super.GetBoundingSphere(index*4+3)); - } else { - return PBJ._PBJ.CastBoundingsphere3f(); - } - } - } - public override Google.ProtocolBuffers.IMessage _PBJISuper { get { return super; } } - public override PBJ.IMessage.IBuilder WeakCreateBuilderForType() { return new Builder(); } - public static Builder CreateBuilder() { return new Builder(); } - public static Builder CreateBuilder(RetObj prototype) { - return (Builder)new Builder().MergeFrom(prototype); - } - public static RetObj ParseFrom(pb::ByteString data) { - return new RetObj(_PBJ_Internal.RetObj.ParseFrom(data)); - } - public static RetObj ParseFrom(pb::ByteString data, pb::ExtensionRegistry er) { - return new RetObj(_PBJ_Internal.RetObj.ParseFrom(data,er)); - } - public static RetObj ParseFrom(byte[] data) { - return new RetObj(_PBJ_Internal.RetObj.ParseFrom(data)); - } - public static RetObj ParseFrom(byte[] data, pb::ExtensionRegistry er) { - return new RetObj(_PBJ_Internal.RetObj.ParseFrom(data,er)); - } - public static RetObj ParseFrom(global::System.IO.Stream data) { - return new RetObj(_PBJ_Internal.RetObj.ParseFrom(data)); - } - public static RetObj ParseFrom(global::System.IO.Stream data, pb::ExtensionRegistry er) { - return new RetObj(_PBJ_Internal.RetObj.ParseFrom(data,er)); - } - public static RetObj ParseFrom(pb::CodedInputStream data) { - return new RetObj(_PBJ_Internal.RetObj.ParseFrom(data)); - } - public static RetObj ParseFrom(pb::CodedInputStream data, pb::ExtensionRegistry er) { - return new RetObj(_PBJ_Internal.RetObj.ParseFrom(data,er)); - } - protected override bool _HasAllPBJFields{ get { - return true - ; - } } - public bool IsInitialized { get { - return super.IsInitialized&&_HasAllPBJFields; - } } - public class Builder : global::PBJ.IMessage.IBuilder{ - protected override bool _HasAllPBJFields{ get { - return true - ; - } } - public bool IsInitialized { get { - return super.IsInitialized&&_HasAllPBJFields; - } } - protected _PBJ_Internal.RetObj.Builder super; - public override Google.ProtocolBuffers.IBuilder _PBJISuper { get { return super; } } - public _PBJ_Internal.RetObj.Builder _PBJSuper{ get { return super;} } - public Builder() {super = new _PBJ_Internal.RetObj.Builder();} - public Builder(_PBJ_Internal.RetObj.Builder other) { - super=other; - } - public Builder Clone() {return new Builder(super.Clone());} - public Builder MergeFrom(RetObj prototype) { super.MergeFrom(prototype._PBJSuper);return this;} - public Builder Clear() {super.Clear();return this;} - public RetObj BuildPartial() {return new RetObj(super.BuildPartial());} - public RetObj Build() {if (_HasAllPBJFields) return new RetObj(super.Build());return null;} - public pbd::MessageDescriptor DescriptorForType { - get { return RetObj.Descriptor; } } - public Builder ClearObjectReference() { super.ClearObjectReference();return this;} - public const int ObjectReferenceFieldTag=2; - public bool HasObjectReference{ get {return super.HasObjectReference&&PBJ._PBJ.ValidateUuid(super.ObjectReference);} } - public PBJ.UUID ObjectReference{ get { - if (HasObjectReference) { - return PBJ._PBJ.CastUuid(super.ObjectReference); - } else { - return PBJ._PBJ.CastUuid(); - } - } - set { - super.ObjectReference=(PBJ._PBJ.Construct(value)); - } - } - public Builder ClearLocation() { super.ClearLocation();return this;} - public const int LocationFieldTag=3; - public bool HasLocation{ get {return super.HasLocation;} } - public ObjLoc Location{ get { - if (HasLocation) { - return new ObjLoc(super.Location); - } else { - return new ObjLoc(); - } - } - set { - super.Location=value._PBJSuper; - } - } - public Builder ClearBoundingSphere() { super.ClearBoundingSphere();return this;} - public const int BoundingSphereFieldTag=4; - public bool HasBoundingSphere{ get {return super.BoundingSphereCount>=4;} } - public PBJ.BoundingSphere3f BoundingSphere{ get { - int index=0; - if (HasBoundingSphere) { - return PBJ._PBJ.CastBoundingsphere3f(super.GetBoundingSphere(index*4+0),super.GetBoundingSphere(index*4+1),super.GetBoundingSphere(index*4+2),super.GetBoundingSphere(index*4+3)); - } else { - return PBJ._PBJ.CastBoundingsphere3f(); - } - } - set { - super.ClearBoundingSphere(); - float[] _PBJtempArray=PBJ._PBJ.ConstructBoundingsphere3f(value); - super.AddBoundingSphere(_PBJtempArray[0]); - super.AddBoundingSphere(_PBJtempArray[1]); - super.AddBoundingSphere(_PBJtempArray[2]); - super.AddBoundingSphere(_PBJtempArray[3]); - } - } - } - } -} -namespace Sirikata.Protocol { - public class DelObj : PBJ.IMessage { - protected _PBJ_Internal.DelObj super; - public _PBJ_Internal.DelObj _PBJSuper{ get { return super;} } - public DelObj() { - super=new _PBJ_Internal.DelObj(); - } - public DelObj(_PBJ_Internal.DelObj reference) { - super=reference; - } - public static DelObj defaultInstance= new DelObj (_PBJ_Internal.DelObj.DefaultInstance); - public static DelObj DefaultInstance{ - get {return defaultInstance;} - } - public static pbd.MessageDescriptor Descriptor { - get { return _PBJ_Internal.DelObj.Descriptor; } } - public static class Types { - } - public static bool WithinReservedFieldTagRange(int field_tag) { - return false; - } - public static bool WithinExtensionFieldTagRange(int field_tag) { - return false; - } - public const int ObjectReferenceFieldTag=2; - public bool HasObjectReference{ get {return super.HasObjectReference&&PBJ._PBJ.ValidateUuid(super.ObjectReference);} } - public PBJ.UUID ObjectReference{ get { - if (HasObjectReference) { - return PBJ._PBJ.CastUuid(super.ObjectReference); - } else { - return PBJ._PBJ.CastUuid(); - } - } - } - public override Google.ProtocolBuffers.IMessage _PBJISuper { get { return super; } } - public override PBJ.IMessage.IBuilder WeakCreateBuilderForType() { return new Builder(); } - public static Builder CreateBuilder() { return new Builder(); } - public static Builder CreateBuilder(DelObj prototype) { - return (Builder)new Builder().MergeFrom(prototype); - } - public static DelObj ParseFrom(pb::ByteString data) { - return new DelObj(_PBJ_Internal.DelObj.ParseFrom(data)); - } - public static DelObj ParseFrom(pb::ByteString data, pb::ExtensionRegistry er) { - return new DelObj(_PBJ_Internal.DelObj.ParseFrom(data,er)); - } - public static DelObj ParseFrom(byte[] data) { - return new DelObj(_PBJ_Internal.DelObj.ParseFrom(data)); - } - public static DelObj ParseFrom(byte[] data, pb::ExtensionRegistry er) { - return new DelObj(_PBJ_Internal.DelObj.ParseFrom(data,er)); - } - public static DelObj ParseFrom(global::System.IO.Stream data) { - return new DelObj(_PBJ_Internal.DelObj.ParseFrom(data)); - } - public static DelObj ParseFrom(global::System.IO.Stream data, pb::ExtensionRegistry er) { - return new DelObj(_PBJ_Internal.DelObj.ParseFrom(data,er)); - } - public static DelObj ParseFrom(pb::CodedInputStream data) { - return new DelObj(_PBJ_Internal.DelObj.ParseFrom(data)); - } - public static DelObj ParseFrom(pb::CodedInputStream data, pb::ExtensionRegistry er) { - return new DelObj(_PBJ_Internal.DelObj.ParseFrom(data,er)); - } - protected override bool _HasAllPBJFields{ get { - return true - ; - } } - public bool IsInitialized { get { - return super.IsInitialized&&_HasAllPBJFields; - } } - public class Builder : global::PBJ.IMessage.IBuilder{ - protected override bool _HasAllPBJFields{ get { - return true - ; - } } - public bool IsInitialized { get { - return super.IsInitialized&&_HasAllPBJFields; - } } - protected _PBJ_Internal.DelObj.Builder super; - public override Google.ProtocolBuffers.IBuilder _PBJISuper { get { return super; } } - public _PBJ_Internal.DelObj.Builder _PBJSuper{ get { return super;} } - public Builder() {super = new _PBJ_Internal.DelObj.Builder();} - public Builder(_PBJ_Internal.DelObj.Builder other) { - super=other; - } - public Builder Clone() {return new Builder(super.Clone());} - public Builder MergeFrom(DelObj prototype) { super.MergeFrom(prototype._PBJSuper);return this;} - public Builder Clear() {super.Clear();return this;} - public DelObj BuildPartial() {return new DelObj(super.BuildPartial());} - public DelObj Build() {if (_HasAllPBJFields) return new DelObj(super.Build());return null;} - public pbd::MessageDescriptor DescriptorForType { - get { return DelObj.Descriptor; } } - public Builder ClearObjectReference() { super.ClearObjectReference();return this;} - public const int ObjectReferenceFieldTag=2; - public bool HasObjectReference{ get {return super.HasObjectReference&&PBJ._PBJ.ValidateUuid(super.ObjectReference);} } - public PBJ.UUID ObjectReference{ get { - if (HasObjectReference) { - return PBJ._PBJ.CastUuid(super.ObjectReference); - } else { - return PBJ._PBJ.CastUuid(); - } - } - set { - super.ObjectReference=(PBJ._PBJ.Construct(value)); - } - } - } - } -} -namespace Sirikata.Protocol { - public class NewProxQuery : PBJ.IMessage { - protected _PBJ_Internal.NewProxQuery super; - public _PBJ_Internal.NewProxQuery _PBJSuper{ get { return super;} } - public NewProxQuery() { - super=new _PBJ_Internal.NewProxQuery(); - } - public NewProxQuery(_PBJ_Internal.NewProxQuery reference) { - super=reference; - } - public static NewProxQuery defaultInstance= new NewProxQuery (_PBJ_Internal.NewProxQuery.DefaultInstance); - public static NewProxQuery DefaultInstance{ - get {return defaultInstance;} - } - public static pbd.MessageDescriptor Descriptor { - get { return _PBJ_Internal.NewProxQuery.Descriptor; } } - public static class Types { - } - public static bool WithinReservedFieldTagRange(int field_tag) { - return false; - } - public static bool WithinExtensionFieldTagRange(int field_tag) { - return false; - } - public const int QueryIdFieldTag=2; - public bool HasQueryId{ get {return super.HasQueryId&&PBJ._PBJ.ValidateUint32(super.QueryId);} } - public uint QueryId{ get { - if (HasQueryId) { - return PBJ._PBJ.CastUint32(super.QueryId); - } else { - return PBJ._PBJ.CastUint32(); - } - } - } - public const int StatelessFieldTag=3; - public bool HasStateless{ get {return super.HasStateless&&PBJ._PBJ.ValidateBool(super.Stateless);} } - public bool Stateless{ get { - if (HasStateless) { - return PBJ._PBJ.CastBool(super.Stateless); - } else { - return PBJ._PBJ.CastBool(); - } - } - } - public const int RelativeCenterFieldTag=4; - public bool HasRelativeCenter{ get {return super.RelativeCenterCount>=3;} } - public PBJ.Vector3f RelativeCenter{ get { - int index=0; - if (HasRelativeCenter) { - return PBJ._PBJ.CastVector3f(super.GetRelativeCenter(index*3+0),super.GetRelativeCenter(index*3+1),super.GetRelativeCenter(index*3+2)); - } else { - return PBJ._PBJ.CastVector3f(); - } - } - } - public const int AbsoluteCenterFieldTag=5; - public bool HasAbsoluteCenter{ get {return super.AbsoluteCenterCount>=3;} } - public PBJ.Vector3d AbsoluteCenter{ get { - int index=0; - if (HasAbsoluteCenter) { - return PBJ._PBJ.CastVector3d(super.GetAbsoluteCenter(index*3+0),super.GetAbsoluteCenter(index*3+1),super.GetAbsoluteCenter(index*3+2)); - } else { - return PBJ._PBJ.CastVector3d(); - } - } - } - public const int MaxRadiusFieldTag=6; - public bool HasMaxRadius{ get {return super.HasMaxRadius&&PBJ._PBJ.ValidateFloat(super.MaxRadius);} } - public float MaxRadius{ get { - if (HasMaxRadius) { - return PBJ._PBJ.CastFloat(super.MaxRadius); - } else { - return PBJ._PBJ.CastFloat(); - } - } - } - public const int MinSolidAngleFieldTag=7; - public bool HasMinSolidAngle{ get {return super.HasMinSolidAngle&&PBJ._PBJ.ValidateAngle(super.MinSolidAngle);} } - public float MinSolidAngle{ get { - if (HasMinSolidAngle) { - return PBJ._PBJ.CastAngle(super.MinSolidAngle); - } else { - return PBJ._PBJ.CastAngle(); - } - } - } - public override Google.ProtocolBuffers.IMessage _PBJISuper { get { return super; } } - public override PBJ.IMessage.IBuilder WeakCreateBuilderForType() { return new Builder(); } - public static Builder CreateBuilder() { return new Builder(); } - public static Builder CreateBuilder(NewProxQuery prototype) { - return (Builder)new Builder().MergeFrom(prototype); - } - public static NewProxQuery ParseFrom(pb::ByteString data) { - return new NewProxQuery(_PBJ_Internal.NewProxQuery.ParseFrom(data)); - } - public static NewProxQuery ParseFrom(pb::ByteString data, pb::ExtensionRegistry er) { - return new NewProxQuery(_PBJ_Internal.NewProxQuery.ParseFrom(data,er)); - } - public static NewProxQuery ParseFrom(byte[] data) { - return new NewProxQuery(_PBJ_Internal.NewProxQuery.ParseFrom(data)); - } - public static NewProxQuery ParseFrom(byte[] data, pb::ExtensionRegistry er) { - return new NewProxQuery(_PBJ_Internal.NewProxQuery.ParseFrom(data,er)); - } - public static NewProxQuery ParseFrom(global::System.IO.Stream data) { - return new NewProxQuery(_PBJ_Internal.NewProxQuery.ParseFrom(data)); - } - public static NewProxQuery ParseFrom(global::System.IO.Stream data, pb::ExtensionRegistry er) { - return new NewProxQuery(_PBJ_Internal.NewProxQuery.ParseFrom(data,er)); - } - public static NewProxQuery ParseFrom(pb::CodedInputStream data) { - return new NewProxQuery(_PBJ_Internal.NewProxQuery.ParseFrom(data)); - } - public static NewProxQuery ParseFrom(pb::CodedInputStream data, pb::ExtensionRegistry er) { - return new NewProxQuery(_PBJ_Internal.NewProxQuery.ParseFrom(data,er)); - } - protected override bool _HasAllPBJFields{ get { - return true - ; - } } - public bool IsInitialized { get { - return super.IsInitialized&&_HasAllPBJFields; - } } - public class Builder : global::PBJ.IMessage.IBuilder{ - protected override bool _HasAllPBJFields{ get { - return true - ; - } } - public bool IsInitialized { get { - return super.IsInitialized&&_HasAllPBJFields; - } } - protected _PBJ_Internal.NewProxQuery.Builder super; - public override Google.ProtocolBuffers.IBuilder _PBJISuper { get { return super; } } - public _PBJ_Internal.NewProxQuery.Builder _PBJSuper{ get { return super;} } - public Builder() {super = new _PBJ_Internal.NewProxQuery.Builder();} - public Builder(_PBJ_Internal.NewProxQuery.Builder other) { - super=other; - } - public Builder Clone() {return new Builder(super.Clone());} - public Builder MergeFrom(NewProxQuery prototype) { super.MergeFrom(prototype._PBJSuper);return this;} - public Builder Clear() {super.Clear();return this;} - public NewProxQuery BuildPartial() {return new NewProxQuery(super.BuildPartial());} - public NewProxQuery Build() {if (_HasAllPBJFields) return new NewProxQuery(super.Build());return null;} - public pbd::MessageDescriptor DescriptorForType { - get { return NewProxQuery.Descriptor; } } - public Builder ClearQueryId() { super.ClearQueryId();return this;} - public const int QueryIdFieldTag=2; - public bool HasQueryId{ get {return super.HasQueryId&&PBJ._PBJ.ValidateUint32(super.QueryId);} } - public uint QueryId{ get { - if (HasQueryId) { - return PBJ._PBJ.CastUint32(super.QueryId); - } else { - return PBJ._PBJ.CastUint32(); - } - } - set { - super.QueryId=(PBJ._PBJ.Construct(value)); - } - } - public Builder ClearStateless() { super.ClearStateless();return this;} - public const int StatelessFieldTag=3; - public bool HasStateless{ get {return super.HasStateless&&PBJ._PBJ.ValidateBool(super.Stateless);} } - public bool Stateless{ get { - if (HasStateless) { - return PBJ._PBJ.CastBool(super.Stateless); - } else { - return PBJ._PBJ.CastBool(); - } - } - set { - super.Stateless=(PBJ._PBJ.Construct(value)); - } - } - public Builder ClearRelativeCenter() { super.ClearRelativeCenter();return this;} - public const int RelativeCenterFieldTag=4; - public bool HasRelativeCenter{ get {return super.RelativeCenterCount>=3;} } - public PBJ.Vector3f RelativeCenter{ get { - int index=0; - if (HasRelativeCenter) { - return PBJ._PBJ.CastVector3f(super.GetRelativeCenter(index*3+0),super.GetRelativeCenter(index*3+1),super.GetRelativeCenter(index*3+2)); - } else { - return PBJ._PBJ.CastVector3f(); - } - } - set { - super.ClearRelativeCenter(); - float[] _PBJtempArray=PBJ._PBJ.ConstructVector3f(value); - super.AddRelativeCenter(_PBJtempArray[0]); - super.AddRelativeCenter(_PBJtempArray[1]); - super.AddRelativeCenter(_PBJtempArray[2]); - } - } - public Builder ClearAbsoluteCenter() { super.ClearAbsoluteCenter();return this;} - public const int AbsoluteCenterFieldTag=5; - public bool HasAbsoluteCenter{ get {return super.AbsoluteCenterCount>=3;} } - public PBJ.Vector3d AbsoluteCenter{ get { - int index=0; - if (HasAbsoluteCenter) { - return PBJ._PBJ.CastVector3d(super.GetAbsoluteCenter(index*3+0),super.GetAbsoluteCenter(index*3+1),super.GetAbsoluteCenter(index*3+2)); - } else { - return PBJ._PBJ.CastVector3d(); - } - } - set { - super.ClearAbsoluteCenter(); - double[] _PBJtempArray=PBJ._PBJ.ConstructVector3d(value); - super.AddAbsoluteCenter(_PBJtempArray[0]); - super.AddAbsoluteCenter(_PBJtempArray[1]); - super.AddAbsoluteCenter(_PBJtempArray[2]); - } - } - public Builder ClearMaxRadius() { super.ClearMaxRadius();return this;} - public const int MaxRadiusFieldTag=6; - public bool HasMaxRadius{ get {return super.HasMaxRadius&&PBJ._PBJ.ValidateFloat(super.MaxRadius);} } - public float MaxRadius{ get { - if (HasMaxRadius) { - return PBJ._PBJ.CastFloat(super.MaxRadius); - } else { - return PBJ._PBJ.CastFloat(); - } - } - set { - super.MaxRadius=(PBJ._PBJ.Construct(value)); - } - } - public Builder ClearMinSolidAngle() { super.ClearMinSolidAngle();return this;} - public const int MinSolidAngleFieldTag=7; - public bool HasMinSolidAngle{ get {return super.HasMinSolidAngle&&PBJ._PBJ.ValidateAngle(super.MinSolidAngle);} } - public float MinSolidAngle{ get { - if (HasMinSolidAngle) { - return PBJ._PBJ.CastAngle(super.MinSolidAngle); - } else { - return PBJ._PBJ.CastAngle(); - } - } - set { - super.MinSolidAngle=(PBJ._PBJ.Construct(value)); - } - } - } - } -} -namespace Sirikata.Protocol { - public class ProxCall : PBJ.IMessage { - protected _PBJ_Internal.ProxCall super; - public _PBJ_Internal.ProxCall _PBJSuper{ get { return super;} } - public ProxCall() { - super=new _PBJ_Internal.ProxCall(); - } - public ProxCall(_PBJ_Internal.ProxCall reference) { - super=reference; - } - public static ProxCall defaultInstance= new ProxCall (_PBJ_Internal.ProxCall.DefaultInstance); - public static ProxCall DefaultInstance{ - get {return defaultInstance;} - } - public static pbd.MessageDescriptor Descriptor { - get { return _PBJ_Internal.ProxCall.Descriptor; } } - public static class Types { - public enum ProximityEvent { - EXITED_PROXIMITY=_PBJ_Internal.ProxCall.Types.ProximityEvent.EXITED_PROXIMITY, - ENTERED_PROXIMITY=_PBJ_Internal.ProxCall.Types.ProximityEvent.ENTERED_PROXIMITY, - STATELESS_PROXIMITY=_PBJ_Internal.ProxCall.Types.ProximityEvent.STATELESS_PROXIMITY - }; - } - public static bool WithinReservedFieldTagRange(int field_tag) { - return false; - } - public static bool WithinExtensionFieldTagRange(int field_tag) { - return false; - } - public const int QueryIdFieldTag=2; - public bool HasQueryId{ get {return super.HasQueryId&&PBJ._PBJ.ValidateUint32(super.QueryId);} } - public uint QueryId{ get { - if (HasQueryId) { - return PBJ._PBJ.CastUint32(super.QueryId); - } else { - return PBJ._PBJ.CastUint32(); - } - } - } - public const int ProximateObjectFieldTag=3; - public bool HasProximateObject{ get {return super.HasProximateObject&&PBJ._PBJ.ValidateUuid(super.ProximateObject);} } - public PBJ.UUID ProximateObject{ get { - if (HasProximateObject) { - return PBJ._PBJ.CastUuid(super.ProximateObject); - } else { - return PBJ._PBJ.CastUuid(); - } - } - } - public const int ProximityEventFieldTag=4; - public bool HasProximityEvent{ get {return super.HasProximityEvent;} } - public Types.ProximityEvent ProximityEvent{ get { - if (HasProximityEvent) { - return (Types.ProximityEvent)super.ProximityEvent; - } else { - return new Types.ProximityEvent(); - } - } - } - public override Google.ProtocolBuffers.IMessage _PBJISuper { get { return super; } } - public override PBJ.IMessage.IBuilder WeakCreateBuilderForType() { return new Builder(); } - public static Builder CreateBuilder() { return new Builder(); } - public static Builder CreateBuilder(ProxCall prototype) { - return (Builder)new Builder().MergeFrom(prototype); - } - public static ProxCall ParseFrom(pb::ByteString data) { - return new ProxCall(_PBJ_Internal.ProxCall.ParseFrom(data)); - } - public static ProxCall ParseFrom(pb::ByteString data, pb::ExtensionRegistry er) { - return new ProxCall(_PBJ_Internal.ProxCall.ParseFrom(data,er)); - } - public static ProxCall ParseFrom(byte[] data) { - return new ProxCall(_PBJ_Internal.ProxCall.ParseFrom(data)); - } - public static ProxCall ParseFrom(byte[] data, pb::ExtensionRegistry er) { - return new ProxCall(_PBJ_Internal.ProxCall.ParseFrom(data,er)); - } - public static ProxCall ParseFrom(global::System.IO.Stream data) { - return new ProxCall(_PBJ_Internal.ProxCall.ParseFrom(data)); - } - public static ProxCall ParseFrom(global::System.IO.Stream data, pb::ExtensionRegistry er) { - return new ProxCall(_PBJ_Internal.ProxCall.ParseFrom(data,er)); - } - public static ProxCall ParseFrom(pb::CodedInputStream data) { - return new ProxCall(_PBJ_Internal.ProxCall.ParseFrom(data)); - } - public static ProxCall ParseFrom(pb::CodedInputStream data, pb::ExtensionRegistry er) { - return new ProxCall(_PBJ_Internal.ProxCall.ParseFrom(data,er)); - } - protected override bool _HasAllPBJFields{ get { - return true - ; - } } - public bool IsInitialized { get { - return super.IsInitialized&&_HasAllPBJFields; - } } - public class Builder : global::PBJ.IMessage.IBuilder{ - protected override bool _HasAllPBJFields{ get { - return true - ; - } } - public bool IsInitialized { get { - return super.IsInitialized&&_HasAllPBJFields; - } } - protected _PBJ_Internal.ProxCall.Builder super; - public override Google.ProtocolBuffers.IBuilder _PBJISuper { get { return super; } } - public _PBJ_Internal.ProxCall.Builder _PBJSuper{ get { return super;} } - public Builder() {super = new _PBJ_Internal.ProxCall.Builder();} - public Builder(_PBJ_Internal.ProxCall.Builder other) { - super=other; - } - public Builder Clone() {return new Builder(super.Clone());} - public Builder MergeFrom(ProxCall prototype) { super.MergeFrom(prototype._PBJSuper);return this;} - public Builder Clear() {super.Clear();return this;} - public ProxCall BuildPartial() {return new ProxCall(super.BuildPartial());} - public ProxCall Build() {if (_HasAllPBJFields) return new ProxCall(super.Build());return null;} - public pbd::MessageDescriptor DescriptorForType { - get { return ProxCall.Descriptor; } } - public Builder ClearQueryId() { super.ClearQueryId();return this;} - public const int QueryIdFieldTag=2; - public bool HasQueryId{ get {return super.HasQueryId&&PBJ._PBJ.ValidateUint32(super.QueryId);} } - public uint QueryId{ get { - if (HasQueryId) { - return PBJ._PBJ.CastUint32(super.QueryId); - } else { - return PBJ._PBJ.CastUint32(); - } - } - set { - super.QueryId=(PBJ._PBJ.Construct(value)); - } - } - public Builder ClearProximateObject() { super.ClearProximateObject();return this;} - public const int ProximateObjectFieldTag=3; - public bool HasProximateObject{ get {return super.HasProximateObject&&PBJ._PBJ.ValidateUuid(super.ProximateObject);} } - public PBJ.UUID ProximateObject{ get { - if (HasProximateObject) { - return PBJ._PBJ.CastUuid(super.ProximateObject); - } else { - return PBJ._PBJ.CastUuid(); - } - } - set { - super.ProximateObject=(PBJ._PBJ.Construct(value)); - } - } - public Builder ClearProximityEvent() { super.ClearProximityEvent();return this;} - public const int ProximityEventFieldTag=4; - public bool HasProximityEvent{ get {return super.HasProximityEvent;} } - public Types.ProximityEvent ProximityEvent{ get { - if (HasProximityEvent) { - return (Types.ProximityEvent)super.ProximityEvent; - } else { - return new Types.ProximityEvent(); - } - } - set { - super.ProximityEvent=((_PBJ_Internal.ProxCall.Types.ProximityEvent)value); - } - } - } - } -} -namespace Sirikata.Protocol { - public class DelProxQuery : PBJ.IMessage { - protected _PBJ_Internal.DelProxQuery super; - public _PBJ_Internal.DelProxQuery _PBJSuper{ get { return super;} } - public DelProxQuery() { - super=new _PBJ_Internal.DelProxQuery(); - } - public DelProxQuery(_PBJ_Internal.DelProxQuery reference) { - super=reference; - } - public static DelProxQuery defaultInstance= new DelProxQuery (_PBJ_Internal.DelProxQuery.DefaultInstance); - public static DelProxQuery DefaultInstance{ - get {return defaultInstance;} - } - public static pbd.MessageDescriptor Descriptor { - get { return _PBJ_Internal.DelProxQuery.Descriptor; } } - public static class Types { - } - public static bool WithinReservedFieldTagRange(int field_tag) { - return false; - } - public static bool WithinExtensionFieldTagRange(int field_tag) { - return false; - } - public const int QueryIdFieldTag=2; - public bool HasQueryId{ get {return super.HasQueryId&&PBJ._PBJ.ValidateUint32(super.QueryId);} } - public uint QueryId{ get { - if (HasQueryId) { - return PBJ._PBJ.CastUint32(super.QueryId); - } else { - return PBJ._PBJ.CastUint32(); - } - } - } - public override Google.ProtocolBuffers.IMessage _PBJISuper { get { return super; } } - public override PBJ.IMessage.IBuilder WeakCreateBuilderForType() { return new Builder(); } - public static Builder CreateBuilder() { return new Builder(); } - public static Builder CreateBuilder(DelProxQuery prototype) { - return (Builder)new Builder().MergeFrom(prototype); - } - public static DelProxQuery ParseFrom(pb::ByteString data) { - return new DelProxQuery(_PBJ_Internal.DelProxQuery.ParseFrom(data)); - } - public static DelProxQuery ParseFrom(pb::ByteString data, pb::ExtensionRegistry er) { - return new DelProxQuery(_PBJ_Internal.DelProxQuery.ParseFrom(data,er)); - } - public static DelProxQuery ParseFrom(byte[] data) { - return new DelProxQuery(_PBJ_Internal.DelProxQuery.ParseFrom(data)); - } - public static DelProxQuery ParseFrom(byte[] data, pb::ExtensionRegistry er) { - return new DelProxQuery(_PBJ_Internal.DelProxQuery.ParseFrom(data,er)); - } - public static DelProxQuery ParseFrom(global::System.IO.Stream data) { - return new DelProxQuery(_PBJ_Internal.DelProxQuery.ParseFrom(data)); - } - public static DelProxQuery ParseFrom(global::System.IO.Stream data, pb::ExtensionRegistry er) { - return new DelProxQuery(_PBJ_Internal.DelProxQuery.ParseFrom(data,er)); - } - public static DelProxQuery ParseFrom(pb::CodedInputStream data) { - return new DelProxQuery(_PBJ_Internal.DelProxQuery.ParseFrom(data)); - } - public static DelProxQuery ParseFrom(pb::CodedInputStream data, pb::ExtensionRegistry er) { - return new DelProxQuery(_PBJ_Internal.DelProxQuery.ParseFrom(data,er)); - } - protected override bool _HasAllPBJFields{ get { - return true - ; - } } - public bool IsInitialized { get { - return super.IsInitialized&&_HasAllPBJFields; - } } - public class Builder : global::PBJ.IMessage.IBuilder{ - protected override bool _HasAllPBJFields{ get { - return true - ; - } } - public bool IsInitialized { get { - return super.IsInitialized&&_HasAllPBJFields; - } } - protected _PBJ_Internal.DelProxQuery.Builder super; - public override Google.ProtocolBuffers.IBuilder _PBJISuper { get { return super; } } - public _PBJ_Internal.DelProxQuery.Builder _PBJSuper{ get { return super;} } - public Builder() {super = new _PBJ_Internal.DelProxQuery.Builder();} - public Builder(_PBJ_Internal.DelProxQuery.Builder other) { - super=other; - } - public Builder Clone() {return new Builder(super.Clone());} - public Builder MergeFrom(DelProxQuery prototype) { super.MergeFrom(prototype._PBJSuper);return this;} - public Builder Clear() {super.Clear();return this;} - public DelProxQuery BuildPartial() {return new DelProxQuery(super.BuildPartial());} - public DelProxQuery Build() {if (_HasAllPBJFields) return new DelProxQuery(super.Build());return null;} - public pbd::MessageDescriptor DescriptorForType { - get { return DelProxQuery.Descriptor; } } - public Builder ClearQueryId() { super.ClearQueryId();return this;} - public const int QueryIdFieldTag=2; - public bool HasQueryId{ get {return super.HasQueryId&&PBJ._PBJ.ValidateUint32(super.QueryId);} } - public uint QueryId{ get { - if (HasQueryId) { - return PBJ._PBJ.CastUint32(super.QueryId); - } else { - return PBJ._PBJ.CastUint32(); - } - } - set { - super.QueryId=(PBJ._PBJ.Construct(value)); - } - } - } - } -} -namespace Sirikata.Protocol { - public class Vector3fProperty : PBJ.IMessage { - protected _PBJ_Internal.Vector3fProperty super; - public _PBJ_Internal.Vector3fProperty _PBJSuper{ get { return super;} } - public Vector3fProperty() { - super=new _PBJ_Internal.Vector3fProperty(); - } - public Vector3fProperty(_PBJ_Internal.Vector3fProperty reference) { - super=reference; - } - public static Vector3fProperty defaultInstance= new Vector3fProperty (_PBJ_Internal.Vector3fProperty.DefaultInstance); - public static Vector3fProperty DefaultInstance{ - get {return defaultInstance;} - } - public static pbd.MessageDescriptor Descriptor { - get { return _PBJ_Internal.Vector3fProperty.Descriptor; } } - public static class Types { - } - public static bool WithinReservedFieldTagRange(int field_tag) { - return false; - } - public static bool WithinExtensionFieldTagRange(int field_tag) { - return false; - } - public const int ValueFieldTag=10; - public bool HasValue{ get {return super.ValueCount>=3;} } - public PBJ.Vector3f Value{ get { - int index=0; - if (HasValue) { - return PBJ._PBJ.CastVector3f(super.GetValue(index*3+0),super.GetValue(index*3+1),super.GetValue(index*3+2)); - } else { - return PBJ._PBJ.CastVector3f(); - } - } - } - public override Google.ProtocolBuffers.IMessage _PBJISuper { get { return super; } } - public override PBJ.IMessage.IBuilder WeakCreateBuilderForType() { return new Builder(); } - public static Builder CreateBuilder() { return new Builder(); } - public static Builder CreateBuilder(Vector3fProperty prototype) { - return (Builder)new Builder().MergeFrom(prototype); - } - public static Vector3fProperty ParseFrom(pb::ByteString data) { - return new Vector3fProperty(_PBJ_Internal.Vector3fProperty.ParseFrom(data)); - } - public static Vector3fProperty ParseFrom(pb::ByteString data, pb::ExtensionRegistry er) { - return new Vector3fProperty(_PBJ_Internal.Vector3fProperty.ParseFrom(data,er)); - } - public static Vector3fProperty ParseFrom(byte[] data) { - return new Vector3fProperty(_PBJ_Internal.Vector3fProperty.ParseFrom(data)); - } - public static Vector3fProperty ParseFrom(byte[] data, pb::ExtensionRegistry er) { - return new Vector3fProperty(_PBJ_Internal.Vector3fProperty.ParseFrom(data,er)); - } - public static Vector3fProperty ParseFrom(global::System.IO.Stream data) { - return new Vector3fProperty(_PBJ_Internal.Vector3fProperty.ParseFrom(data)); - } - public static Vector3fProperty ParseFrom(global::System.IO.Stream data, pb::ExtensionRegistry er) { - return new Vector3fProperty(_PBJ_Internal.Vector3fProperty.ParseFrom(data,er)); - } - public static Vector3fProperty ParseFrom(pb::CodedInputStream data) { - return new Vector3fProperty(_PBJ_Internal.Vector3fProperty.ParseFrom(data)); - } - public static Vector3fProperty ParseFrom(pb::CodedInputStream data, pb::ExtensionRegistry er) { - return new Vector3fProperty(_PBJ_Internal.Vector3fProperty.ParseFrom(data,er)); - } - protected override bool _HasAllPBJFields{ get { - return true - ; - } } - public bool IsInitialized { get { - return super.IsInitialized&&_HasAllPBJFields; - } } - public class Builder : global::PBJ.IMessage.IBuilder{ - protected override bool _HasAllPBJFields{ get { - return true - ; - } } - public bool IsInitialized { get { - return super.IsInitialized&&_HasAllPBJFields; - } } - protected _PBJ_Internal.Vector3fProperty.Builder super; - public override Google.ProtocolBuffers.IBuilder _PBJISuper { get { return super; } } - public _PBJ_Internal.Vector3fProperty.Builder _PBJSuper{ get { return super;} } - public Builder() {super = new _PBJ_Internal.Vector3fProperty.Builder();} - public Builder(_PBJ_Internal.Vector3fProperty.Builder other) { - super=other; - } - public Builder Clone() {return new Builder(super.Clone());} - public Builder MergeFrom(Vector3fProperty prototype) { super.MergeFrom(prototype._PBJSuper);return this;} - public Builder Clear() {super.Clear();return this;} - public Vector3fProperty BuildPartial() {return new Vector3fProperty(super.BuildPartial());} - public Vector3fProperty Build() {if (_HasAllPBJFields) return new Vector3fProperty(super.Build());return null;} - public pbd::MessageDescriptor DescriptorForType { - get { return Vector3fProperty.Descriptor; } } - public Builder ClearValue() { super.ClearValue();return this;} - public const int ValueFieldTag=10; - public bool HasValue{ get {return super.ValueCount>=3;} } - public PBJ.Vector3f Value{ get { - int index=0; - if (HasValue) { - return PBJ._PBJ.CastVector3f(super.GetValue(index*3+0),super.GetValue(index*3+1),super.GetValue(index*3+2)); - } else { - return PBJ._PBJ.CastVector3f(); - } - } - set { - super.ClearValue(); - float[] _PBJtempArray=PBJ._PBJ.ConstructVector3f(value); - super.AddValue(_PBJtempArray[0]); - super.AddValue(_PBJtempArray[1]); - super.AddValue(_PBJtempArray[2]); - } - } - } - } -} -namespace Sirikata.Protocol { - public class StringProperty : PBJ.IMessage { - protected _PBJ_Internal.StringProperty super; - public _PBJ_Internal.StringProperty _PBJSuper{ get { return super;} } - public StringProperty() { - super=new _PBJ_Internal.StringProperty(); - } - public StringProperty(_PBJ_Internal.StringProperty reference) { - super=reference; - } - public static StringProperty defaultInstance= new StringProperty (_PBJ_Internal.StringProperty.DefaultInstance); - public static StringProperty DefaultInstance{ - get {return defaultInstance;} - } - public static pbd.MessageDescriptor Descriptor { - get { return _PBJ_Internal.StringProperty.Descriptor; } } - public static class Types { - } - public static bool WithinReservedFieldTagRange(int field_tag) { - return false; - } - public static bool WithinExtensionFieldTagRange(int field_tag) { - return false; - } - public const int ValueFieldTag=10; - public bool HasValue{ get {return super.HasValue&&PBJ._PBJ.ValidateString(super.Value);} } - public string Value{ get { - if (HasValue) { - return PBJ._PBJ.CastString(super.Value); - } else { - return PBJ._PBJ.CastString(); - } - } - } - public override Google.ProtocolBuffers.IMessage _PBJISuper { get { return super; } } - public override PBJ.IMessage.IBuilder WeakCreateBuilderForType() { return new Builder(); } - public static Builder CreateBuilder() { return new Builder(); } - public static Builder CreateBuilder(StringProperty prototype) { - return (Builder)new Builder().MergeFrom(prototype); - } - public static StringProperty ParseFrom(pb::ByteString data) { - return new StringProperty(_PBJ_Internal.StringProperty.ParseFrom(data)); - } - public static StringProperty ParseFrom(pb::ByteString data, pb::ExtensionRegistry er) { - return new StringProperty(_PBJ_Internal.StringProperty.ParseFrom(data,er)); - } - public static StringProperty ParseFrom(byte[] data) { - return new StringProperty(_PBJ_Internal.StringProperty.ParseFrom(data)); - } - public static StringProperty ParseFrom(byte[] data, pb::ExtensionRegistry er) { - return new StringProperty(_PBJ_Internal.StringProperty.ParseFrom(data,er)); - } - public static StringProperty ParseFrom(global::System.IO.Stream data) { - return new StringProperty(_PBJ_Internal.StringProperty.ParseFrom(data)); - } - public static StringProperty ParseFrom(global::System.IO.Stream data, pb::ExtensionRegistry er) { - return new StringProperty(_PBJ_Internal.StringProperty.ParseFrom(data,er)); - } - public static StringProperty ParseFrom(pb::CodedInputStream data) { - return new StringProperty(_PBJ_Internal.StringProperty.ParseFrom(data)); - } - public static StringProperty ParseFrom(pb::CodedInputStream data, pb::ExtensionRegistry er) { - return new StringProperty(_PBJ_Internal.StringProperty.ParseFrom(data,er)); - } - protected override bool _HasAllPBJFields{ get { - return true - ; - } } - public bool IsInitialized { get { - return super.IsInitialized&&_HasAllPBJFields; - } } - public class Builder : global::PBJ.IMessage.IBuilder{ - protected override bool _HasAllPBJFields{ get { - return true - ; - } } - public bool IsInitialized { get { - return super.IsInitialized&&_HasAllPBJFields; - } } - protected _PBJ_Internal.StringProperty.Builder super; - public override Google.ProtocolBuffers.IBuilder _PBJISuper { get { return super; } } - public _PBJ_Internal.StringProperty.Builder _PBJSuper{ get { return super;} } - public Builder() {super = new _PBJ_Internal.StringProperty.Builder();} - public Builder(_PBJ_Internal.StringProperty.Builder other) { - super=other; - } - public Builder Clone() {return new Builder(super.Clone());} - public Builder MergeFrom(StringProperty prototype) { super.MergeFrom(prototype._PBJSuper);return this;} - public Builder Clear() {super.Clear();return this;} - public StringProperty BuildPartial() {return new StringProperty(super.BuildPartial());} - public StringProperty Build() {if (_HasAllPBJFields) return new StringProperty(super.Build());return null;} - public pbd::MessageDescriptor DescriptorForType { - get { return StringProperty.Descriptor; } } - public Builder ClearValue() { super.ClearValue();return this;} - public const int ValueFieldTag=10; - public bool HasValue{ get {return super.HasValue&&PBJ._PBJ.ValidateString(super.Value);} } - public string Value{ get { - if (HasValue) { - return PBJ._PBJ.CastString(super.Value); - } else { - return PBJ._PBJ.CastString(); - } - } - set { - super.Value=(PBJ._PBJ.Construct(value)); - } - } - } - } -} -namespace Sirikata.Protocol { - public class StringMapProperty : PBJ.IMessage { - protected _PBJ_Internal.StringMapProperty super; - public _PBJ_Internal.StringMapProperty _PBJSuper{ get { return super;} } - public StringMapProperty() { - super=new _PBJ_Internal.StringMapProperty(); - } - public StringMapProperty(_PBJ_Internal.StringMapProperty reference) { - super=reference; - } - public static StringMapProperty defaultInstance= new StringMapProperty (_PBJ_Internal.StringMapProperty.DefaultInstance); - public static StringMapProperty DefaultInstance{ - get {return defaultInstance;} - } - public static pbd.MessageDescriptor Descriptor { - get { return _PBJ_Internal.StringMapProperty.Descriptor; } } - public static class Types { - } - public static bool WithinReservedFieldTagRange(int field_tag) { - return false; - } - public static bool WithinExtensionFieldTagRange(int field_tag) { - return false; - } - public const int KeysFieldTag=2; - public int KeysCount { get { return super.KeysCount;} } - public bool HasKeys(int index) {return PBJ._PBJ.ValidateString(super.GetKeys(index));} - public string Keys(int index) { - return (string)PBJ._PBJ.CastString(super.GetKeys(index)); - } - public const int ValuesFieldTag=3; - public int ValuesCount { get { return super.ValuesCount;} } - public bool HasValues(int index) {return PBJ._PBJ.ValidateString(super.GetValues(index));} - public string Values(int index) { - return (string)PBJ._PBJ.CastString(super.GetValues(index)); - } - public override Google.ProtocolBuffers.IMessage _PBJISuper { get { return super; } } - public override PBJ.IMessage.IBuilder WeakCreateBuilderForType() { return new Builder(); } - public static Builder CreateBuilder() { return new Builder(); } - public static Builder CreateBuilder(StringMapProperty prototype) { - return (Builder)new Builder().MergeFrom(prototype); - } - public static StringMapProperty ParseFrom(pb::ByteString data) { - return new StringMapProperty(_PBJ_Internal.StringMapProperty.ParseFrom(data)); - } - public static StringMapProperty ParseFrom(pb::ByteString data, pb::ExtensionRegistry er) { - return new StringMapProperty(_PBJ_Internal.StringMapProperty.ParseFrom(data,er)); - } - public static StringMapProperty ParseFrom(byte[] data) { - return new StringMapProperty(_PBJ_Internal.StringMapProperty.ParseFrom(data)); - } - public static StringMapProperty ParseFrom(byte[] data, pb::ExtensionRegistry er) { - return new StringMapProperty(_PBJ_Internal.StringMapProperty.ParseFrom(data,er)); - } - public static StringMapProperty ParseFrom(global::System.IO.Stream data) { - return new StringMapProperty(_PBJ_Internal.StringMapProperty.ParseFrom(data)); - } - public static StringMapProperty ParseFrom(global::System.IO.Stream data, pb::ExtensionRegistry er) { - return new StringMapProperty(_PBJ_Internal.StringMapProperty.ParseFrom(data,er)); - } - public static StringMapProperty ParseFrom(pb::CodedInputStream data) { - return new StringMapProperty(_PBJ_Internal.StringMapProperty.ParseFrom(data)); - } - public static StringMapProperty ParseFrom(pb::CodedInputStream data, pb::ExtensionRegistry er) { - return new StringMapProperty(_PBJ_Internal.StringMapProperty.ParseFrom(data,er)); - } - protected override bool _HasAllPBJFields{ get { - return true - ; - } } - public bool IsInitialized { get { - return super.IsInitialized&&_HasAllPBJFields; - } } - public class Builder : global::PBJ.IMessage.IBuilder{ - protected override bool _HasAllPBJFields{ get { - return true - ; - } } - public bool IsInitialized { get { - return super.IsInitialized&&_HasAllPBJFields; - } } - protected _PBJ_Internal.StringMapProperty.Builder super; - public override Google.ProtocolBuffers.IBuilder _PBJISuper { get { return super; } } - public _PBJ_Internal.StringMapProperty.Builder _PBJSuper{ get { return super;} } - public Builder() {super = new _PBJ_Internal.StringMapProperty.Builder();} - public Builder(_PBJ_Internal.StringMapProperty.Builder other) { - super=other; - } - public Builder Clone() {return new Builder(super.Clone());} - public Builder MergeFrom(StringMapProperty prototype) { super.MergeFrom(prototype._PBJSuper);return this;} - public Builder Clear() {super.Clear();return this;} - public StringMapProperty BuildPartial() {return new StringMapProperty(super.BuildPartial());} - public StringMapProperty Build() {if (_HasAllPBJFields) return new StringMapProperty(super.Build());return null;} - public pbd::MessageDescriptor DescriptorForType { - get { return StringMapProperty.Descriptor; } } - public Builder ClearKeys() { super.ClearKeys();return this;} - public Builder SetKeys(int index, string value) { - super.SetKeys(index,PBJ._PBJ.Construct(value)); - return this; - } - public const int KeysFieldTag=2; - public int KeysCount { get { return super.KeysCount;} } - public bool HasKeys(int index) {return PBJ._PBJ.ValidateString(super.GetKeys(index));} - public string Keys(int index) { - return (string)PBJ._PBJ.CastString(super.GetKeys(index)); - } - public Builder AddKeys(string value) { - super.AddKeys(PBJ._PBJ.Construct(value)); - return this; - } - public Builder ClearValues() { super.ClearValues();return this;} - public Builder SetValues(int index, string value) { - super.SetValues(index,PBJ._PBJ.Construct(value)); - return this; - } - public const int ValuesFieldTag=3; - public int ValuesCount { get { return super.ValuesCount;} } - public bool HasValues(int index) {return PBJ._PBJ.ValidateString(super.GetValues(index));} - public string Values(int index) { - return (string)PBJ._PBJ.CastString(super.GetValues(index)); - } - public Builder AddValues(string value) { - super.AddValues(PBJ._PBJ.Construct(value)); - return this; - } - } - } -} -namespace Sirikata.Protocol { - public class PhysicalParameters : PBJ.IMessage { - protected _PBJ_Internal.PhysicalParameters super; - public _PBJ_Internal.PhysicalParameters _PBJSuper{ get { return super;} } - public PhysicalParameters() { - super=new _PBJ_Internal.PhysicalParameters(); - } - public PhysicalParameters(_PBJ_Internal.PhysicalParameters reference) { - super=reference; - } - public static PhysicalParameters defaultInstance= new PhysicalParameters (_PBJ_Internal.PhysicalParameters.DefaultInstance); - public static PhysicalParameters DefaultInstance{ - get {return defaultInstance;} - } - public static pbd.MessageDescriptor Descriptor { - get { return _PBJ_Internal.PhysicalParameters.Descriptor; } } - public static class Types { - public enum Mode { - NONPHYSICAL=_PBJ_Internal.PhysicalParameters.Types.Mode.NONPHYSICAL, - STATIC=_PBJ_Internal.PhysicalParameters.Types.Mode.STATIC, - DYNAMICBOX=_PBJ_Internal.PhysicalParameters.Types.Mode.DYNAMICBOX, - DYNAMICSPHERE=_PBJ_Internal.PhysicalParameters.Types.Mode.DYNAMICSPHERE, - DYNAMICCYLINDER=_PBJ_Internal.PhysicalParameters.Types.Mode.DYNAMICCYLINDER, - CHARACTER=_PBJ_Internal.PhysicalParameters.Types.Mode.CHARACTER - }; - } - public static bool WithinReservedFieldTagRange(int field_tag) { - return false; - } - public static bool WithinExtensionFieldTagRange(int field_tag) { - return false; - } - public const int ModeFieldTag=2; - public bool HasMode{ get {return super.HasMode;} } - public Types.Mode Mode{ get { - if (HasMode) { - return (Types.Mode)super.Mode; - } else { - return new Types.Mode(); - } - } - } - public const int DensityFieldTag=3; - public bool HasDensity{ get {return super.HasDensity&&PBJ._PBJ.ValidateFloat(super.Density);} } - public float Density{ get { - if (HasDensity) { - return PBJ._PBJ.CastFloat(super.Density); - } else { - return PBJ._PBJ.CastFloat(); - } - } - } - public const int FrictionFieldTag=4; - public bool HasFriction{ get {return super.HasFriction&&PBJ._PBJ.ValidateFloat(super.Friction);} } - public float Friction{ get { - if (HasFriction) { - return PBJ._PBJ.CastFloat(super.Friction); - } else { - return PBJ._PBJ.CastFloat(); - } - } - } - public const int BounceFieldTag=5; - public bool HasBounce{ get {return super.HasBounce&&PBJ._PBJ.ValidateFloat(super.Bounce);} } - public float Bounce{ get { - if (HasBounce) { - return PBJ._PBJ.CastFloat(super.Bounce); - } else { - return PBJ._PBJ.CastFloat(); - } - } - } - public const int HullFieldTag=6; - public bool HasHull{ get {return super.HullCount>=3;} } - public PBJ.Vector3f Hull{ get { - int index=0; - if (HasHull) { - return PBJ._PBJ.CastVector3f(super.GetHull(index*3+0),super.GetHull(index*3+1),super.GetHull(index*3+2)); - } else { - return PBJ._PBJ.CastVector3f(); - } - } - } - public const int CollideMsgFieldTag=16; - public bool HasCollideMsg{ get {return super.HasCollideMsg&&PBJ._PBJ.ValidateUint32(super.CollideMsg);} } - public uint CollideMsg{ get { - if (HasCollideMsg) { - return PBJ._PBJ.CastUint32(super.CollideMsg); - } else { - return PBJ._PBJ.CastUint32(); - } - } - } - public const int CollideMaskFieldTag=17; - public bool HasCollideMask{ get {return super.HasCollideMask&&PBJ._PBJ.ValidateUint32(super.CollideMask);} } - public uint CollideMask{ get { - if (HasCollideMask) { - return PBJ._PBJ.CastUint32(super.CollideMask); - } else { - return PBJ._PBJ.CastUint32(); - } - } - } - public const int GravityFieldTag=18; - public bool HasGravity{ get {return super.HasGravity&&PBJ._PBJ.ValidateFloat(super.Gravity);} } - public float Gravity{ get { - if (HasGravity) { - return PBJ._PBJ.CastFloat(super.Gravity); - } else { - return PBJ._PBJ.CastFloat(); - } - } - } - public override Google.ProtocolBuffers.IMessage _PBJISuper { get { return super; } } - public override PBJ.IMessage.IBuilder WeakCreateBuilderForType() { return new Builder(); } - public static Builder CreateBuilder() { return new Builder(); } - public static Builder CreateBuilder(PhysicalParameters prototype) { - return (Builder)new Builder().MergeFrom(prototype); - } - public static PhysicalParameters ParseFrom(pb::ByteString data) { - return new PhysicalParameters(_PBJ_Internal.PhysicalParameters.ParseFrom(data)); - } - public static PhysicalParameters ParseFrom(pb::ByteString data, pb::ExtensionRegistry er) { - return new PhysicalParameters(_PBJ_Internal.PhysicalParameters.ParseFrom(data,er)); - } - public static PhysicalParameters ParseFrom(byte[] data) { - return new PhysicalParameters(_PBJ_Internal.PhysicalParameters.ParseFrom(data)); - } - public static PhysicalParameters ParseFrom(byte[] data, pb::ExtensionRegistry er) { - return new PhysicalParameters(_PBJ_Internal.PhysicalParameters.ParseFrom(data,er)); - } - public static PhysicalParameters ParseFrom(global::System.IO.Stream data) { - return new PhysicalParameters(_PBJ_Internal.PhysicalParameters.ParseFrom(data)); - } - public static PhysicalParameters ParseFrom(global::System.IO.Stream data, pb::ExtensionRegistry er) { - return new PhysicalParameters(_PBJ_Internal.PhysicalParameters.ParseFrom(data,er)); - } - public static PhysicalParameters ParseFrom(pb::CodedInputStream data) { - return new PhysicalParameters(_PBJ_Internal.PhysicalParameters.ParseFrom(data)); - } - public static PhysicalParameters ParseFrom(pb::CodedInputStream data, pb::ExtensionRegistry er) { - return new PhysicalParameters(_PBJ_Internal.PhysicalParameters.ParseFrom(data,er)); - } - protected override bool _HasAllPBJFields{ get { - return true - ; - } } - public bool IsInitialized { get { - return super.IsInitialized&&_HasAllPBJFields; - } } - public class Builder : global::PBJ.IMessage.IBuilder{ - protected override bool _HasAllPBJFields{ get { - return true - ; - } } - public bool IsInitialized { get { - return super.IsInitialized&&_HasAllPBJFields; - } } - protected _PBJ_Internal.PhysicalParameters.Builder super; - public override Google.ProtocolBuffers.IBuilder _PBJISuper { get { return super; } } - public _PBJ_Internal.PhysicalParameters.Builder _PBJSuper{ get { return super;} } - public Builder() {super = new _PBJ_Internal.PhysicalParameters.Builder();} - public Builder(_PBJ_Internal.PhysicalParameters.Builder other) { - super=other; - } - public Builder Clone() {return new Builder(super.Clone());} - public Builder MergeFrom(PhysicalParameters prototype) { super.MergeFrom(prototype._PBJSuper);return this;} - public Builder Clear() {super.Clear();return this;} - public PhysicalParameters BuildPartial() {return new PhysicalParameters(super.BuildPartial());} - public PhysicalParameters Build() {if (_HasAllPBJFields) return new PhysicalParameters(super.Build());return null;} - public pbd::MessageDescriptor DescriptorForType { - get { return PhysicalParameters.Descriptor; } } - public Builder ClearMode() { super.ClearMode();return this;} - public const int ModeFieldTag=2; - public bool HasMode{ get {return super.HasMode;} } - public Types.Mode Mode{ get { - if (HasMode) { - return (Types.Mode)super.Mode; - } else { - return new Types.Mode(); - } - } - set { - super.Mode=((_PBJ_Internal.PhysicalParameters.Types.Mode)value); - } - } - public Builder ClearDensity() { super.ClearDensity();return this;} - public const int DensityFieldTag=3; - public bool HasDensity{ get {return super.HasDensity&&PBJ._PBJ.ValidateFloat(super.Density);} } - public float Density{ get { - if (HasDensity) { - return PBJ._PBJ.CastFloat(super.Density); - } else { - return PBJ._PBJ.CastFloat(); - } - } - set { - super.Density=(PBJ._PBJ.Construct(value)); - } - } - public Builder ClearFriction() { super.ClearFriction();return this;} - public const int FrictionFieldTag=4; - public bool HasFriction{ get {return super.HasFriction&&PBJ._PBJ.ValidateFloat(super.Friction);} } - public float Friction{ get { - if (HasFriction) { - return PBJ._PBJ.CastFloat(super.Friction); - } else { - return PBJ._PBJ.CastFloat(); - } - } - set { - super.Friction=(PBJ._PBJ.Construct(value)); - } - } - public Builder ClearBounce() { super.ClearBounce();return this;} - public const int BounceFieldTag=5; - public bool HasBounce{ get {return super.HasBounce&&PBJ._PBJ.ValidateFloat(super.Bounce);} } - public float Bounce{ get { - if (HasBounce) { - return PBJ._PBJ.CastFloat(super.Bounce); - } else { - return PBJ._PBJ.CastFloat(); - } - } - set { - super.Bounce=(PBJ._PBJ.Construct(value)); - } - } - public Builder ClearHull() { super.ClearHull();return this;} - public const int HullFieldTag=6; - public bool HasHull{ get {return super.HullCount>=3;} } - public PBJ.Vector3f Hull{ get { - int index=0; - if (HasHull) { - return PBJ._PBJ.CastVector3f(super.GetHull(index*3+0),super.GetHull(index*3+1),super.GetHull(index*3+2)); - } else { - return PBJ._PBJ.CastVector3f(); - } - } - set { - super.ClearHull(); - float[] _PBJtempArray=PBJ._PBJ.ConstructVector3f(value); - super.AddHull(_PBJtempArray[0]); - super.AddHull(_PBJtempArray[1]); - super.AddHull(_PBJtempArray[2]); - } - } - public Builder ClearCollideMsg() { super.ClearCollideMsg();return this;} - public const int CollideMsgFieldTag=16; - public bool HasCollideMsg{ get {return super.HasCollideMsg&&PBJ._PBJ.ValidateUint32(super.CollideMsg);} } - public uint CollideMsg{ get { - if (HasCollideMsg) { - return PBJ._PBJ.CastUint32(super.CollideMsg); - } else { - return PBJ._PBJ.CastUint32(); - } - } - set { - super.CollideMsg=(PBJ._PBJ.Construct(value)); - } - } - public Builder ClearCollideMask() { super.ClearCollideMask();return this;} - public const int CollideMaskFieldTag=17; - public bool HasCollideMask{ get {return super.HasCollideMask&&PBJ._PBJ.ValidateUint32(super.CollideMask);} } - public uint CollideMask{ get { - if (HasCollideMask) { - return PBJ._PBJ.CastUint32(super.CollideMask); - } else { - return PBJ._PBJ.CastUint32(); - } - } - set { - super.CollideMask=(PBJ._PBJ.Construct(value)); - } - } - public Builder ClearGravity() { super.ClearGravity();return this;} - public const int GravityFieldTag=18; - public bool HasGravity{ get {return super.HasGravity&&PBJ._PBJ.ValidateFloat(super.Gravity);} } - public float Gravity{ get { - if (HasGravity) { - return PBJ._PBJ.CastFloat(super.Gravity); - } else { - return PBJ._PBJ.CastFloat(); - } - } - set { - super.Gravity=(PBJ._PBJ.Construct(value)); - } - } - } - } -} -namespace Sirikata.Protocol { - public class LightInfoProperty : PBJ.IMessage { - protected _PBJ_Internal.LightInfoProperty super; - public _PBJ_Internal.LightInfoProperty _PBJSuper{ get { return super;} } - public LightInfoProperty() { - super=new _PBJ_Internal.LightInfoProperty(); - } - public LightInfoProperty(_PBJ_Internal.LightInfoProperty reference) { - super=reference; - } - public static LightInfoProperty defaultInstance= new LightInfoProperty (_PBJ_Internal.LightInfoProperty.DefaultInstance); - public static LightInfoProperty DefaultInstance{ - get {return defaultInstance;} - } - public static pbd.MessageDescriptor Descriptor { - get { return _PBJ_Internal.LightInfoProperty.Descriptor; } } - public static class Types { - public enum LightTypes { - POINT=_PBJ_Internal.LightInfoProperty.Types.LightTypes.POINT, - SPOTLIGHT=_PBJ_Internal.LightInfoProperty.Types.LightTypes.SPOTLIGHT, - DIRECTIONAL=_PBJ_Internal.LightInfoProperty.Types.LightTypes.DIRECTIONAL - }; - } - public static bool WithinReservedFieldTagRange(int field_tag) { - return false; - } - public static bool WithinExtensionFieldTagRange(int field_tag) { - return false; - } - public const int DiffuseColorFieldTag=3; - public bool HasDiffuseColor{ get {return super.DiffuseColorCount>=3;} } - public PBJ.Vector3f DiffuseColor{ get { - int index=0; - if (HasDiffuseColor) { - return PBJ._PBJ.CastVector3f(super.GetDiffuseColor(index*3+0),super.GetDiffuseColor(index*3+1),super.GetDiffuseColor(index*3+2)); - } else { - return PBJ._PBJ.CastVector3f(); - } - } - } - public const int SpecularColorFieldTag=4; - public bool HasSpecularColor{ get {return super.SpecularColorCount>=3;} } - public PBJ.Vector3f SpecularColor{ get { - int index=0; - if (HasSpecularColor) { - return PBJ._PBJ.CastVector3f(super.GetSpecularColor(index*3+0),super.GetSpecularColor(index*3+1),super.GetSpecularColor(index*3+2)); - } else { - return PBJ._PBJ.CastVector3f(); - } - } - } - public const int PowerFieldTag=5; - public bool HasPower{ get {return super.HasPower&&PBJ._PBJ.ValidateFloat(super.Power);} } - public float Power{ get { - if (HasPower) { - return PBJ._PBJ.CastFloat(super.Power); - } else { - return PBJ._PBJ.CastFloat(); - } - } - } - public const int AmbientColorFieldTag=6; - public bool HasAmbientColor{ get {return super.AmbientColorCount>=3;} } - public PBJ.Vector3f AmbientColor{ get { - int index=0; - if (HasAmbientColor) { - return PBJ._PBJ.CastVector3f(super.GetAmbientColor(index*3+0),super.GetAmbientColor(index*3+1),super.GetAmbientColor(index*3+2)); - } else { - return PBJ._PBJ.CastVector3f(); - } - } - } - public const int ShadowColorFieldTag=7; - public bool HasShadowColor{ get {return super.ShadowColorCount>=3;} } - public PBJ.Vector3f ShadowColor{ get { - int index=0; - if (HasShadowColor) { - return PBJ._PBJ.CastVector3f(super.GetShadowColor(index*3+0),super.GetShadowColor(index*3+1),super.GetShadowColor(index*3+2)); - } else { - return PBJ._PBJ.CastVector3f(); - } - } - } - public const int LightRangeFieldTag=8; - public bool HasLightRange{ get {return super.HasLightRange&&PBJ._PBJ.ValidateDouble(super.LightRange);} } - public double LightRange{ get { - if (HasLightRange) { - return PBJ._PBJ.CastDouble(super.LightRange); - } else { - return PBJ._PBJ.CastDouble(); - } - } - } - public const int ConstantFalloffFieldTag=9; - public bool HasConstantFalloff{ get {return super.HasConstantFalloff&&PBJ._PBJ.ValidateFloat(super.ConstantFalloff);} } - public float ConstantFalloff{ get { - if (HasConstantFalloff) { - return PBJ._PBJ.CastFloat(super.ConstantFalloff); - } else { - return PBJ._PBJ.CastFloat(); - } - } - } - public const int LinearFalloffFieldTag=10; - public bool HasLinearFalloff{ get {return super.HasLinearFalloff&&PBJ._PBJ.ValidateFloat(super.LinearFalloff);} } - public float LinearFalloff{ get { - if (HasLinearFalloff) { - return PBJ._PBJ.CastFloat(super.LinearFalloff); - } else { - return PBJ._PBJ.CastFloat(); - } - } - } - public const int QuadraticFalloffFieldTag=11; - public bool HasQuadraticFalloff{ get {return super.HasQuadraticFalloff&&PBJ._PBJ.ValidateFloat(super.QuadraticFalloff);} } - public float QuadraticFalloff{ get { - if (HasQuadraticFalloff) { - return PBJ._PBJ.CastFloat(super.QuadraticFalloff); - } else { - return PBJ._PBJ.CastFloat(); - } - } - } - public const int ConeInnerRadiansFieldTag=12; - public bool HasConeInnerRadians{ get {return super.HasConeInnerRadians&&PBJ._PBJ.ValidateFloat(super.ConeInnerRadians);} } - public float ConeInnerRadians{ get { - if (HasConeInnerRadians) { - return PBJ._PBJ.CastFloat(super.ConeInnerRadians); - } else { - return PBJ._PBJ.CastFloat(); - } - } - } - public const int ConeOuterRadiansFieldTag=13; - public bool HasConeOuterRadians{ get {return super.HasConeOuterRadians&&PBJ._PBJ.ValidateFloat(super.ConeOuterRadians);} } - public float ConeOuterRadians{ get { - if (HasConeOuterRadians) { - return PBJ._PBJ.CastFloat(super.ConeOuterRadians); - } else { - return PBJ._PBJ.CastFloat(); - } - } - } - public const int ConeFalloffFieldTag=14; - public bool HasConeFalloff{ get {return super.HasConeFalloff&&PBJ._PBJ.ValidateFloat(super.ConeFalloff);} } - public float ConeFalloff{ get { - if (HasConeFalloff) { - return PBJ._PBJ.CastFloat(super.ConeFalloff); - } else { - return PBJ._PBJ.CastFloat(); - } - } - } - public const int TypeFieldTag=15; - public bool HasType{ get {return super.HasType;} } - public Types.LightTypes Type{ get { - if (HasType) { - return (Types.LightTypes)super.Type; - } else { - return new Types.LightTypes(); - } - } - } - public const int CastsShadowFieldTag=16; - public bool HasCastsShadow{ get {return super.HasCastsShadow&&PBJ._PBJ.ValidateBool(super.CastsShadow);} } - public bool CastsShadow{ get { - if (HasCastsShadow) { - return PBJ._PBJ.CastBool(super.CastsShadow); - } else { - return PBJ._PBJ.CastBool(); - } - } - } - public override Google.ProtocolBuffers.IMessage _PBJISuper { get { return super; } } - public override PBJ.IMessage.IBuilder WeakCreateBuilderForType() { return new Builder(); } - public static Builder CreateBuilder() { return new Builder(); } - public static Builder CreateBuilder(LightInfoProperty prototype) { - return (Builder)new Builder().MergeFrom(prototype); - } - public static LightInfoProperty ParseFrom(pb::ByteString data) { - return new LightInfoProperty(_PBJ_Internal.LightInfoProperty.ParseFrom(data)); - } - public static LightInfoProperty ParseFrom(pb::ByteString data, pb::ExtensionRegistry er) { - return new LightInfoProperty(_PBJ_Internal.LightInfoProperty.ParseFrom(data,er)); - } - public static LightInfoProperty ParseFrom(byte[] data) { - return new LightInfoProperty(_PBJ_Internal.LightInfoProperty.ParseFrom(data)); - } - public static LightInfoProperty ParseFrom(byte[] data, pb::ExtensionRegistry er) { - return new LightInfoProperty(_PBJ_Internal.LightInfoProperty.ParseFrom(data,er)); - } - public static LightInfoProperty ParseFrom(global::System.IO.Stream data) { - return new LightInfoProperty(_PBJ_Internal.LightInfoProperty.ParseFrom(data)); - } - public static LightInfoProperty ParseFrom(global::System.IO.Stream data, pb::ExtensionRegistry er) { - return new LightInfoProperty(_PBJ_Internal.LightInfoProperty.ParseFrom(data,er)); - } - public static LightInfoProperty ParseFrom(pb::CodedInputStream data) { - return new LightInfoProperty(_PBJ_Internal.LightInfoProperty.ParseFrom(data)); - } - public static LightInfoProperty ParseFrom(pb::CodedInputStream data, pb::ExtensionRegistry er) { - return new LightInfoProperty(_PBJ_Internal.LightInfoProperty.ParseFrom(data,er)); - } - protected override bool _HasAllPBJFields{ get { - return true - ; - } } - public bool IsInitialized { get { - return super.IsInitialized&&_HasAllPBJFields; - } } - public class Builder : global::PBJ.IMessage.IBuilder{ - protected override bool _HasAllPBJFields{ get { - return true - ; - } } - public bool IsInitialized { get { - return super.IsInitialized&&_HasAllPBJFields; - } } - protected _PBJ_Internal.LightInfoProperty.Builder super; - public override Google.ProtocolBuffers.IBuilder _PBJISuper { get { return super; } } - public _PBJ_Internal.LightInfoProperty.Builder _PBJSuper{ get { return super;} } - public Builder() {super = new _PBJ_Internal.LightInfoProperty.Builder();} - public Builder(_PBJ_Internal.LightInfoProperty.Builder other) { - super=other; - } - public Builder Clone() {return new Builder(super.Clone());} - public Builder MergeFrom(LightInfoProperty prototype) { super.MergeFrom(prototype._PBJSuper);return this;} - public Builder Clear() {super.Clear();return this;} - public LightInfoProperty BuildPartial() {return new LightInfoProperty(super.BuildPartial());} - public LightInfoProperty Build() {if (_HasAllPBJFields) return new LightInfoProperty(super.Build());return null;} - public pbd::MessageDescriptor DescriptorForType { - get { return LightInfoProperty.Descriptor; } } - public Builder ClearDiffuseColor() { super.ClearDiffuseColor();return this;} - public const int DiffuseColorFieldTag=3; - public bool HasDiffuseColor{ get {return super.DiffuseColorCount>=3;} } - public PBJ.Vector3f DiffuseColor{ get { - int index=0; - if (HasDiffuseColor) { - return PBJ._PBJ.CastVector3f(super.GetDiffuseColor(index*3+0),super.GetDiffuseColor(index*3+1),super.GetDiffuseColor(index*3+2)); - } else { - return PBJ._PBJ.CastVector3f(); - } - } - set { - super.ClearDiffuseColor(); - float[] _PBJtempArray=PBJ._PBJ.ConstructVector3f(value); - super.AddDiffuseColor(_PBJtempArray[0]); - super.AddDiffuseColor(_PBJtempArray[1]); - super.AddDiffuseColor(_PBJtempArray[2]); - } - } - public Builder ClearSpecularColor() { super.ClearSpecularColor();return this;} - public const int SpecularColorFieldTag=4; - public bool HasSpecularColor{ get {return super.SpecularColorCount>=3;} } - public PBJ.Vector3f SpecularColor{ get { - int index=0; - if (HasSpecularColor) { - return PBJ._PBJ.CastVector3f(super.GetSpecularColor(index*3+0),super.GetSpecularColor(index*3+1),super.GetSpecularColor(index*3+2)); - } else { - return PBJ._PBJ.CastVector3f(); - } - } - set { - super.ClearSpecularColor(); - float[] _PBJtempArray=PBJ._PBJ.ConstructVector3f(value); - super.AddSpecularColor(_PBJtempArray[0]); - super.AddSpecularColor(_PBJtempArray[1]); - super.AddSpecularColor(_PBJtempArray[2]); - } - } - public Builder ClearPower() { super.ClearPower();return this;} - public const int PowerFieldTag=5; - public bool HasPower{ get {return super.HasPower&&PBJ._PBJ.ValidateFloat(super.Power);} } - public float Power{ get { - if (HasPower) { - return PBJ._PBJ.CastFloat(super.Power); - } else { - return PBJ._PBJ.CastFloat(); - } - } - set { - super.Power=(PBJ._PBJ.Construct(value)); - } - } - public Builder ClearAmbientColor() { super.ClearAmbientColor();return this;} - public const int AmbientColorFieldTag=6; - public bool HasAmbientColor{ get {return super.AmbientColorCount>=3;} } - public PBJ.Vector3f AmbientColor{ get { - int index=0; - if (HasAmbientColor) { - return PBJ._PBJ.CastVector3f(super.GetAmbientColor(index*3+0),super.GetAmbientColor(index*3+1),super.GetAmbientColor(index*3+2)); - } else { - return PBJ._PBJ.CastVector3f(); - } - } - set { - super.ClearAmbientColor(); - float[] _PBJtempArray=PBJ._PBJ.ConstructVector3f(value); - super.AddAmbientColor(_PBJtempArray[0]); - super.AddAmbientColor(_PBJtempArray[1]); - super.AddAmbientColor(_PBJtempArray[2]); - } - } - public Builder ClearShadowColor() { super.ClearShadowColor();return this;} - public const int ShadowColorFieldTag=7; - public bool HasShadowColor{ get {return super.ShadowColorCount>=3;} } - public PBJ.Vector3f ShadowColor{ get { - int index=0; - if (HasShadowColor) { - return PBJ._PBJ.CastVector3f(super.GetShadowColor(index*3+0),super.GetShadowColor(index*3+1),super.GetShadowColor(index*3+2)); - } else { - return PBJ._PBJ.CastVector3f(); - } - } - set { - super.ClearShadowColor(); - float[] _PBJtempArray=PBJ._PBJ.ConstructVector3f(value); - super.AddShadowColor(_PBJtempArray[0]); - super.AddShadowColor(_PBJtempArray[1]); - super.AddShadowColor(_PBJtempArray[2]); - } - } - public Builder ClearLightRange() { super.ClearLightRange();return this;} - public const int LightRangeFieldTag=8; - public bool HasLightRange{ get {return super.HasLightRange&&PBJ._PBJ.ValidateDouble(super.LightRange);} } - public double LightRange{ get { - if (HasLightRange) { - return PBJ._PBJ.CastDouble(super.LightRange); - } else { - return PBJ._PBJ.CastDouble(); - } - } - set { - super.LightRange=(PBJ._PBJ.Construct(value)); - } - } - public Builder ClearConstantFalloff() { super.ClearConstantFalloff();return this;} - public const int ConstantFalloffFieldTag=9; - public bool HasConstantFalloff{ get {return super.HasConstantFalloff&&PBJ._PBJ.ValidateFloat(super.ConstantFalloff);} } - public float ConstantFalloff{ get { - if (HasConstantFalloff) { - return PBJ._PBJ.CastFloat(super.ConstantFalloff); - } else { - return PBJ._PBJ.CastFloat(); - } - } - set { - super.ConstantFalloff=(PBJ._PBJ.Construct(value)); - } - } - public Builder ClearLinearFalloff() { super.ClearLinearFalloff();return this;} - public const int LinearFalloffFieldTag=10; - public bool HasLinearFalloff{ get {return super.HasLinearFalloff&&PBJ._PBJ.ValidateFloat(super.LinearFalloff);} } - public float LinearFalloff{ get { - if (HasLinearFalloff) { - return PBJ._PBJ.CastFloat(super.LinearFalloff); - } else { - return PBJ._PBJ.CastFloat(); - } - } - set { - super.LinearFalloff=(PBJ._PBJ.Construct(value)); - } - } - public Builder ClearQuadraticFalloff() { super.ClearQuadraticFalloff();return this;} - public const int QuadraticFalloffFieldTag=11; - public bool HasQuadraticFalloff{ get {return super.HasQuadraticFalloff&&PBJ._PBJ.ValidateFloat(super.QuadraticFalloff);} } - public float QuadraticFalloff{ get { - if (HasQuadraticFalloff) { - return PBJ._PBJ.CastFloat(super.QuadraticFalloff); - } else { - return PBJ._PBJ.CastFloat(); - } - } - set { - super.QuadraticFalloff=(PBJ._PBJ.Construct(value)); - } - } - public Builder ClearConeInnerRadians() { super.ClearConeInnerRadians();return this;} - public const int ConeInnerRadiansFieldTag=12; - public bool HasConeInnerRadians{ get {return super.HasConeInnerRadians&&PBJ._PBJ.ValidateFloat(super.ConeInnerRadians);} } - public float ConeInnerRadians{ get { - if (HasConeInnerRadians) { - return PBJ._PBJ.CastFloat(super.ConeInnerRadians); - } else { - return PBJ._PBJ.CastFloat(); - } - } - set { - super.ConeInnerRadians=(PBJ._PBJ.Construct(value)); - } - } - public Builder ClearConeOuterRadians() { super.ClearConeOuterRadians();return this;} - public const int ConeOuterRadiansFieldTag=13; - public bool HasConeOuterRadians{ get {return super.HasConeOuterRadians&&PBJ._PBJ.ValidateFloat(super.ConeOuterRadians);} } - public float ConeOuterRadians{ get { - if (HasConeOuterRadians) { - return PBJ._PBJ.CastFloat(super.ConeOuterRadians); - } else { - return PBJ._PBJ.CastFloat(); - } - } - set { - super.ConeOuterRadians=(PBJ._PBJ.Construct(value)); - } - } - public Builder ClearConeFalloff() { super.ClearConeFalloff();return this;} - public const int ConeFalloffFieldTag=14; - public bool HasConeFalloff{ get {return super.HasConeFalloff&&PBJ._PBJ.ValidateFloat(super.ConeFalloff);} } - public float ConeFalloff{ get { - if (HasConeFalloff) { - return PBJ._PBJ.CastFloat(super.ConeFalloff); - } else { - return PBJ._PBJ.CastFloat(); - } - } - set { - super.ConeFalloff=(PBJ._PBJ.Construct(value)); - } - } - public Builder ClearType() { super.ClearType();return this;} - public const int TypeFieldTag=15; - public bool HasType{ get {return super.HasType;} } - public Types.LightTypes Type{ get { - if (HasType) { - return (Types.LightTypes)super.Type; - } else { - return new Types.LightTypes(); - } - } - set { - super.Type=((_PBJ_Internal.LightInfoProperty.Types.LightTypes)value); - } - } - public Builder ClearCastsShadow() { super.ClearCastsShadow();return this;} - public const int CastsShadowFieldTag=16; - public bool HasCastsShadow{ get {return super.HasCastsShadow&&PBJ._PBJ.ValidateBool(super.CastsShadow);} } - public bool CastsShadow{ get { - if (HasCastsShadow) { - return PBJ._PBJ.CastBool(super.CastsShadow); - } else { - return PBJ._PBJ.CastBool(); - } - } - set { - super.CastsShadow=(PBJ._PBJ.Construct(value)); - } - } - } - } -} -namespace Sirikata.Protocol { - public class ParentProperty : PBJ.IMessage { - protected _PBJ_Internal.ParentProperty super; - public _PBJ_Internal.ParentProperty _PBJSuper{ get { return super;} } - public ParentProperty() { - super=new _PBJ_Internal.ParentProperty(); - } - public ParentProperty(_PBJ_Internal.ParentProperty reference) { - super=reference; - } - public static ParentProperty defaultInstance= new ParentProperty (_PBJ_Internal.ParentProperty.DefaultInstance); - public static ParentProperty DefaultInstance{ - get {return defaultInstance;} - } - public static pbd.MessageDescriptor Descriptor { - get { return _PBJ_Internal.ParentProperty.Descriptor; } } - public static class Types { - } - public static bool WithinReservedFieldTagRange(int field_tag) { - return false; - } - public static bool WithinExtensionFieldTagRange(int field_tag) { - return false; - } - public const int ValueFieldTag=10; - public bool HasValue{ get {return super.HasValue&&PBJ._PBJ.ValidateUuid(super.Value);} } - public PBJ.UUID Value{ get { - if (HasValue) { - return PBJ._PBJ.CastUuid(super.Value); - } else { - return PBJ._PBJ.CastUuid(); - } - } - } - public override Google.ProtocolBuffers.IMessage _PBJISuper { get { return super; } } - public override PBJ.IMessage.IBuilder WeakCreateBuilderForType() { return new Builder(); } - public static Builder CreateBuilder() { return new Builder(); } - public static Builder CreateBuilder(ParentProperty prototype) { - return (Builder)new Builder().MergeFrom(prototype); - } - public static ParentProperty ParseFrom(pb::ByteString data) { - return new ParentProperty(_PBJ_Internal.ParentProperty.ParseFrom(data)); - } - public static ParentProperty ParseFrom(pb::ByteString data, pb::ExtensionRegistry er) { - return new ParentProperty(_PBJ_Internal.ParentProperty.ParseFrom(data,er)); - } - public static ParentProperty ParseFrom(byte[] data) { - return new ParentProperty(_PBJ_Internal.ParentProperty.ParseFrom(data)); - } - public static ParentProperty ParseFrom(byte[] data, pb::ExtensionRegistry er) { - return new ParentProperty(_PBJ_Internal.ParentProperty.ParseFrom(data,er)); - } - public static ParentProperty ParseFrom(global::System.IO.Stream data) { - return new ParentProperty(_PBJ_Internal.ParentProperty.ParseFrom(data)); - } - public static ParentProperty ParseFrom(global::System.IO.Stream data, pb::ExtensionRegistry er) { - return new ParentProperty(_PBJ_Internal.ParentProperty.ParseFrom(data,er)); - } - public static ParentProperty ParseFrom(pb::CodedInputStream data) { - return new ParentProperty(_PBJ_Internal.ParentProperty.ParseFrom(data)); - } - public static ParentProperty ParseFrom(pb::CodedInputStream data, pb::ExtensionRegistry er) { - return new ParentProperty(_PBJ_Internal.ParentProperty.ParseFrom(data,er)); - } - protected override bool _HasAllPBJFields{ get { - return true - ; - } } - public bool IsInitialized { get { - return super.IsInitialized&&_HasAllPBJFields; - } } - public class Builder : global::PBJ.IMessage.IBuilder{ - protected override bool _HasAllPBJFields{ get { - return true - ; - } } - public bool IsInitialized { get { - return super.IsInitialized&&_HasAllPBJFields; - } } - protected _PBJ_Internal.ParentProperty.Builder super; - public override Google.ProtocolBuffers.IBuilder _PBJISuper { get { return super; } } - public _PBJ_Internal.ParentProperty.Builder _PBJSuper{ get { return super;} } - public Builder() {super = new _PBJ_Internal.ParentProperty.Builder();} - public Builder(_PBJ_Internal.ParentProperty.Builder other) { - super=other; - } - public Builder Clone() {return new Builder(super.Clone());} - public Builder MergeFrom(ParentProperty prototype) { super.MergeFrom(prototype._PBJSuper);return this;} - public Builder Clear() {super.Clear();return this;} - public ParentProperty BuildPartial() {return new ParentProperty(super.BuildPartial());} - public ParentProperty Build() {if (_HasAllPBJFields) return new ParentProperty(super.Build());return null;} - public pbd::MessageDescriptor DescriptorForType { - get { return ParentProperty.Descriptor; } } - public Builder ClearValue() { super.ClearValue();return this;} - public const int ValueFieldTag=10; - public bool HasValue{ get {return super.HasValue&&PBJ._PBJ.ValidateUuid(super.Value);} } - public PBJ.UUID Value{ get { - if (HasValue) { - return PBJ._PBJ.CastUuid(super.Value); - } else { - return PBJ._PBJ.CastUuid(); - } - } - set { - super.Value=(PBJ._PBJ.Construct(value)); - } - } - } - } -} -namespace Sirikata.Protocol { - public class UUIDListProperty : PBJ.IMessage { - protected _PBJ_Internal.UUIDListProperty super; - public _PBJ_Internal.UUIDListProperty _PBJSuper{ get { return super;} } - public UUIDListProperty() { - super=new _PBJ_Internal.UUIDListProperty(); - } - public UUIDListProperty(_PBJ_Internal.UUIDListProperty reference) { - super=reference; - } - public static UUIDListProperty defaultInstance= new UUIDListProperty (_PBJ_Internal.UUIDListProperty.DefaultInstance); - public static UUIDListProperty DefaultInstance{ - get {return defaultInstance;} - } - public static pbd.MessageDescriptor Descriptor { - get { return _PBJ_Internal.UUIDListProperty.Descriptor; } } - public static class Types { - } - public static bool WithinReservedFieldTagRange(int field_tag) { - return false; - } - public static bool WithinExtensionFieldTagRange(int field_tag) { - return false; - } - public const int ValueFieldTag=10; - public int ValueCount { get { return super.ValueCount;} } - public bool HasValue(int index) {return PBJ._PBJ.ValidateUuid(super.GetValue(index));} - public PBJ.UUID Value(int index) { - return (PBJ.UUID)PBJ._PBJ.CastUuid(super.GetValue(index)); - } - public override Google.ProtocolBuffers.IMessage _PBJISuper { get { return super; } } - public override PBJ.IMessage.IBuilder WeakCreateBuilderForType() { return new Builder(); } - public static Builder CreateBuilder() { return new Builder(); } - public static Builder CreateBuilder(UUIDListProperty prototype) { - return (Builder)new Builder().MergeFrom(prototype); - } - public static UUIDListProperty ParseFrom(pb::ByteString data) { - return new UUIDListProperty(_PBJ_Internal.UUIDListProperty.ParseFrom(data)); - } - public static UUIDListProperty ParseFrom(pb::ByteString data, pb::ExtensionRegistry er) { - return new UUIDListProperty(_PBJ_Internal.UUIDListProperty.ParseFrom(data,er)); - } - public static UUIDListProperty ParseFrom(byte[] data) { - return new UUIDListProperty(_PBJ_Internal.UUIDListProperty.ParseFrom(data)); - } - public static UUIDListProperty ParseFrom(byte[] data, pb::ExtensionRegistry er) { - return new UUIDListProperty(_PBJ_Internal.UUIDListProperty.ParseFrom(data,er)); - } - public static UUIDListProperty ParseFrom(global::System.IO.Stream data) { - return new UUIDListProperty(_PBJ_Internal.UUIDListProperty.ParseFrom(data)); - } - public static UUIDListProperty ParseFrom(global::System.IO.Stream data, pb::ExtensionRegistry er) { - return new UUIDListProperty(_PBJ_Internal.UUIDListProperty.ParseFrom(data,er)); - } - public static UUIDListProperty ParseFrom(pb::CodedInputStream data) { - return new UUIDListProperty(_PBJ_Internal.UUIDListProperty.ParseFrom(data)); - } - public static UUIDListProperty ParseFrom(pb::CodedInputStream data, pb::ExtensionRegistry er) { - return new UUIDListProperty(_PBJ_Internal.UUIDListProperty.ParseFrom(data,er)); - } - protected override bool _HasAllPBJFields{ get { - return true - ; - } } - public bool IsInitialized { get { - return super.IsInitialized&&_HasAllPBJFields; - } } - public class Builder : global::PBJ.IMessage.IBuilder{ - protected override bool _HasAllPBJFields{ get { - return true - ; - } } - public bool IsInitialized { get { - return super.IsInitialized&&_HasAllPBJFields; - } } - protected _PBJ_Internal.UUIDListProperty.Builder super; - public override Google.ProtocolBuffers.IBuilder _PBJISuper { get { return super; } } - public _PBJ_Internal.UUIDListProperty.Builder _PBJSuper{ get { return super;} } - public Builder() {super = new _PBJ_Internal.UUIDListProperty.Builder();} - public Builder(_PBJ_Internal.UUIDListProperty.Builder other) { - super=other; - } - public Builder Clone() {return new Builder(super.Clone());} - public Builder MergeFrom(UUIDListProperty prototype) { super.MergeFrom(prototype._PBJSuper);return this;} - public Builder Clear() {super.Clear();return this;} - public UUIDListProperty BuildPartial() {return new UUIDListProperty(super.BuildPartial());} - public UUIDListProperty Build() {if (_HasAllPBJFields) return new UUIDListProperty(super.Build());return null;} - public pbd::MessageDescriptor DescriptorForType { - get { return UUIDListProperty.Descriptor; } } - public Builder ClearValue() { super.ClearValue();return this;} - public Builder SetValue(int index, PBJ.UUID value) { - super.SetValue(index,PBJ._PBJ.Construct(value)); - return this; - } - public const int ValueFieldTag=10; - public int ValueCount { get { return super.ValueCount;} } - public bool HasValue(int index) {return PBJ._PBJ.ValidateUuid(super.GetValue(index));} - public PBJ.UUID Value(int index) { - return (PBJ.UUID)PBJ._PBJ.CastUuid(super.GetValue(index)); - } - public Builder AddValue(PBJ.UUID value) { - super.AddValue(PBJ._PBJ.Construct(value)); - return this; - } - } - } -} -namespace Sirikata.Protocol { - public class ConnectToSpace : PBJ.IMessage { - protected _PBJ_Internal.ConnectToSpace super; - public _PBJ_Internal.ConnectToSpace _PBJSuper{ get { return super;} } - public ConnectToSpace() { - super=new _PBJ_Internal.ConnectToSpace(); - } - public ConnectToSpace(_PBJ_Internal.ConnectToSpace reference) { - super=reference; - } - public static ConnectToSpace defaultInstance= new ConnectToSpace (_PBJ_Internal.ConnectToSpace.DefaultInstance); - public static ConnectToSpace DefaultInstance{ - get {return defaultInstance;} - } - public static pbd.MessageDescriptor Descriptor { - get { return _PBJ_Internal.ConnectToSpace.Descriptor; } } - public static class Types { - } - public static bool WithinReservedFieldTagRange(int field_tag) { - return false; - } - public static bool WithinExtensionFieldTagRange(int field_tag) { - return false; - } - public const int SpaceIdFieldTag=1; - public bool HasSpaceId{ get {return super.HasSpaceId&&PBJ._PBJ.ValidateUuid(super.SpaceId);} } - public PBJ.UUID SpaceId{ get { - if (HasSpaceId) { - return PBJ._PBJ.CastUuid(super.SpaceId); - } else { - return PBJ._PBJ.CastUuid(); - } - } - } - public const int ObjectUuidEvidenceFieldTag=2; - public bool HasObjectUuidEvidence{ get {return super.HasObjectUuidEvidence&&PBJ._PBJ.ValidateUuid(super.ObjectUuidEvidence);} } - public PBJ.UUID ObjectUuidEvidence{ get { - if (HasObjectUuidEvidence) { - return PBJ._PBJ.CastUuid(super.ObjectUuidEvidence); - } else { - return PBJ._PBJ.CastUuid(); - } - } - } - public const int RequestedObjectLocFieldTag=3; - public bool HasRequestedObjectLoc{ get {return super.HasRequestedObjectLoc;} } - public ObjLoc RequestedObjectLoc{ get { - if (HasRequestedObjectLoc) { - return new ObjLoc(super.RequestedObjectLoc); - } else { - return new ObjLoc(); - } - } - } - public const int BoundingSphereFieldTag=4; - public bool HasBoundingSphere{ get {return super.BoundingSphereCount>=4;} } - public PBJ.BoundingSphere3f BoundingSphere{ get { - int index=0; - if (HasBoundingSphere) { - return PBJ._PBJ.CastBoundingsphere3f(super.GetBoundingSphere(index*4+0),super.GetBoundingSphere(index*4+1),super.GetBoundingSphere(index*4+2),super.GetBoundingSphere(index*4+3)); - } else { - return PBJ._PBJ.CastBoundingsphere3f(); - } - } - } - public override Google.ProtocolBuffers.IMessage _PBJISuper { get { return super; } } - public override PBJ.IMessage.IBuilder WeakCreateBuilderForType() { return new Builder(); } - public static Builder CreateBuilder() { return new Builder(); } - public static Builder CreateBuilder(ConnectToSpace prototype) { - return (Builder)new Builder().MergeFrom(prototype); - } - public static ConnectToSpace ParseFrom(pb::ByteString data) { - return new ConnectToSpace(_PBJ_Internal.ConnectToSpace.ParseFrom(data)); - } - public static ConnectToSpace ParseFrom(pb::ByteString data, pb::ExtensionRegistry er) { - return new ConnectToSpace(_PBJ_Internal.ConnectToSpace.ParseFrom(data,er)); - } - public static ConnectToSpace ParseFrom(byte[] data) { - return new ConnectToSpace(_PBJ_Internal.ConnectToSpace.ParseFrom(data)); - } - public static ConnectToSpace ParseFrom(byte[] data, pb::ExtensionRegistry er) { - return new ConnectToSpace(_PBJ_Internal.ConnectToSpace.ParseFrom(data,er)); - } - public static ConnectToSpace ParseFrom(global::System.IO.Stream data) { - return new ConnectToSpace(_PBJ_Internal.ConnectToSpace.ParseFrom(data)); - } - public static ConnectToSpace ParseFrom(global::System.IO.Stream data, pb::ExtensionRegistry er) { - return new ConnectToSpace(_PBJ_Internal.ConnectToSpace.ParseFrom(data,er)); - } - public static ConnectToSpace ParseFrom(pb::CodedInputStream data) { - return new ConnectToSpace(_PBJ_Internal.ConnectToSpace.ParseFrom(data)); - } - public static ConnectToSpace ParseFrom(pb::CodedInputStream data, pb::ExtensionRegistry er) { - return new ConnectToSpace(_PBJ_Internal.ConnectToSpace.ParseFrom(data,er)); - } - protected override bool _HasAllPBJFields{ get { - return true - ; - } } - public bool IsInitialized { get { - return super.IsInitialized&&_HasAllPBJFields; - } } - public class Builder : global::PBJ.IMessage.IBuilder{ - protected override bool _HasAllPBJFields{ get { - return true - ; - } } - public bool IsInitialized { get { - return super.IsInitialized&&_HasAllPBJFields; - } } - protected _PBJ_Internal.ConnectToSpace.Builder super; - public override Google.ProtocolBuffers.IBuilder _PBJISuper { get { return super; } } - public _PBJ_Internal.ConnectToSpace.Builder _PBJSuper{ get { return super;} } - public Builder() {super = new _PBJ_Internal.ConnectToSpace.Builder();} - public Builder(_PBJ_Internal.ConnectToSpace.Builder other) { - super=other; - } - public Builder Clone() {return new Builder(super.Clone());} - public Builder MergeFrom(ConnectToSpace prototype) { super.MergeFrom(prototype._PBJSuper);return this;} - public Builder Clear() {super.Clear();return this;} - public ConnectToSpace BuildPartial() {return new ConnectToSpace(super.BuildPartial());} - public ConnectToSpace Build() {if (_HasAllPBJFields) return new ConnectToSpace(super.Build());return null;} - public pbd::MessageDescriptor DescriptorForType { - get { return ConnectToSpace.Descriptor; } } - public Builder ClearSpaceId() { super.ClearSpaceId();return this;} - public const int SpaceIdFieldTag=1; - public bool HasSpaceId{ get {return super.HasSpaceId&&PBJ._PBJ.ValidateUuid(super.SpaceId);} } - public PBJ.UUID SpaceId{ get { - if (HasSpaceId) { - return PBJ._PBJ.CastUuid(super.SpaceId); - } else { - return PBJ._PBJ.CastUuid(); - } - } - set { - super.SpaceId=(PBJ._PBJ.Construct(value)); - } - } - public Builder ClearObjectUuidEvidence() { super.ClearObjectUuidEvidence();return this;} - public const int ObjectUuidEvidenceFieldTag=2; - public bool HasObjectUuidEvidence{ get {return super.HasObjectUuidEvidence&&PBJ._PBJ.ValidateUuid(super.ObjectUuidEvidence);} } - public PBJ.UUID ObjectUuidEvidence{ get { - if (HasObjectUuidEvidence) { - return PBJ._PBJ.CastUuid(super.ObjectUuidEvidence); - } else { - return PBJ._PBJ.CastUuid(); - } - } - set { - super.ObjectUuidEvidence=(PBJ._PBJ.Construct(value)); - } - } - public Builder ClearRequestedObjectLoc() { super.ClearRequestedObjectLoc();return this;} - public const int RequestedObjectLocFieldTag=3; - public bool HasRequestedObjectLoc{ get {return super.HasRequestedObjectLoc;} } - public ObjLoc RequestedObjectLoc{ get { - if (HasRequestedObjectLoc) { - return new ObjLoc(super.RequestedObjectLoc); - } else { - return new ObjLoc(); - } - } - set { - super.RequestedObjectLoc=value._PBJSuper; - } - } - public Builder ClearBoundingSphere() { super.ClearBoundingSphere();return this;} - public const int BoundingSphereFieldTag=4; - public bool HasBoundingSphere{ get {return super.BoundingSphereCount>=4;} } - public PBJ.BoundingSphere3f BoundingSphere{ get { - int index=0; - if (HasBoundingSphere) { - return PBJ._PBJ.CastBoundingsphere3f(super.GetBoundingSphere(index*4+0),super.GetBoundingSphere(index*4+1),super.GetBoundingSphere(index*4+2),super.GetBoundingSphere(index*4+3)); - } else { - return PBJ._PBJ.CastBoundingsphere3f(); - } - } - set { - super.ClearBoundingSphere(); - float[] _PBJtempArray=PBJ._PBJ.ConstructBoundingsphere3f(value); - super.AddBoundingSphere(_PBJtempArray[0]); - super.AddBoundingSphere(_PBJtempArray[1]); - super.AddBoundingSphere(_PBJtempArray[2]); - super.AddBoundingSphere(_PBJtempArray[3]); - } - } - } - } -} -namespace Sirikata.Protocol { - public class CreateObject : PBJ.IMessage { - protected _PBJ_Internal.CreateObject super; - public _PBJ_Internal.CreateObject _PBJSuper{ get { return super;} } - public CreateObject() { - super=new _PBJ_Internal.CreateObject(); - } - public CreateObject(_PBJ_Internal.CreateObject reference) { - super=reference; - } - public static CreateObject defaultInstance= new CreateObject (_PBJ_Internal.CreateObject.DefaultInstance); - public static CreateObject DefaultInstance{ - get {return defaultInstance;} - } - public static pbd.MessageDescriptor Descriptor { - get { return _PBJ_Internal.CreateObject.Descriptor; } } - public static class Types { - } - public static bool WithinReservedFieldTagRange(int field_tag) { - return false; - } - public static bool WithinExtensionFieldTagRange(int field_tag) { - return false; - } - public const int ObjectUuidFieldTag=1; - public bool HasObjectUuid{ get {return super.HasObjectUuid&&PBJ._PBJ.ValidateUuid(super.ObjectUuid);} } - public PBJ.UUID ObjectUuid{ get { - if (HasObjectUuid) { - return PBJ._PBJ.CastUuid(super.ObjectUuid); - } else { - return PBJ._PBJ.CastUuid(); - } - } - } - public const int SpacePropertiesFieldTag=2; - public int SpacePropertiesCount { get { return super.SpacePropertiesCount;} } - public bool HasSpaceProperties(int index) {return true;} - public ConnectToSpace SpaceProperties(int index) { - return new ConnectToSpace(super.GetSpaceProperties(index)); - } - public const int MeshFieldTag=3; - public bool HasMesh{ get {return super.HasMesh&&PBJ._PBJ.ValidateString(super.Mesh);} } - public string Mesh{ get { - if (HasMesh) { - return PBJ._PBJ.CastString(super.Mesh); - } else { - return PBJ._PBJ.CastString(); - } - } - } - public const int ScaleFieldTag=4; - public bool HasScale{ get {return super.ScaleCount>=3;} } - public PBJ.Vector3f Scale{ get { - int index=0; - if (HasScale) { - return PBJ._PBJ.CastVector3f(super.GetScale(index*3+0),super.GetScale(index*3+1),super.GetScale(index*3+2)); - } else { - return PBJ._PBJ.CastVector3f(); - } - } - } - public const int WeburlFieldTag=5; - public bool HasWeburl{ get {return super.HasWeburl&&PBJ._PBJ.ValidateString(super.Weburl);} } - public string Weburl{ get { - if (HasWeburl) { - return PBJ._PBJ.CastString(super.Weburl); - } else { - return PBJ._PBJ.CastString(); - } - } - } - public const int LightInfoFieldTag=6; - public bool HasLightInfo{ get {return super.HasLightInfo;} } - public LightInfoProperty LightInfo{ get { - if (HasLightInfo) { - return new LightInfoProperty(super.LightInfo); - } else { - return new LightInfoProperty(); - } - } - } - public const int CameraFieldTag=7; - public bool HasCamera{ get {return super.HasCamera&&PBJ._PBJ.ValidateBool(super.Camera);} } - public bool Camera{ get { - if (HasCamera) { - return PBJ._PBJ.CastBool(super.Camera); - } else { - return PBJ._PBJ.CastBool(); - } - } - } - public const int PhysicalFieldTag=8; - public bool HasPhysical{ get {return super.HasPhysical;} } - public PhysicalParameters Physical{ get { - if (HasPhysical) { - return new PhysicalParameters(super.Physical); - } else { - return new PhysicalParameters(); - } - } - } - public override Google.ProtocolBuffers.IMessage _PBJISuper { get { return super; } } - public override PBJ.IMessage.IBuilder WeakCreateBuilderForType() { return new Builder(); } - public static Builder CreateBuilder() { return new Builder(); } - public static Builder CreateBuilder(CreateObject prototype) { - return (Builder)new Builder().MergeFrom(prototype); - } - public static CreateObject ParseFrom(pb::ByteString data) { - return new CreateObject(_PBJ_Internal.CreateObject.ParseFrom(data)); - } - public static CreateObject ParseFrom(pb::ByteString data, pb::ExtensionRegistry er) { - return new CreateObject(_PBJ_Internal.CreateObject.ParseFrom(data,er)); - } - public static CreateObject ParseFrom(byte[] data) { - return new CreateObject(_PBJ_Internal.CreateObject.ParseFrom(data)); - } - public static CreateObject ParseFrom(byte[] data, pb::ExtensionRegistry er) { - return new CreateObject(_PBJ_Internal.CreateObject.ParseFrom(data,er)); - } - public static CreateObject ParseFrom(global::System.IO.Stream data) { - return new CreateObject(_PBJ_Internal.CreateObject.ParseFrom(data)); - } - public static CreateObject ParseFrom(global::System.IO.Stream data, pb::ExtensionRegistry er) { - return new CreateObject(_PBJ_Internal.CreateObject.ParseFrom(data,er)); - } - public static CreateObject ParseFrom(pb::CodedInputStream data) { - return new CreateObject(_PBJ_Internal.CreateObject.ParseFrom(data)); - } - public static CreateObject ParseFrom(pb::CodedInputStream data, pb::ExtensionRegistry er) { - return new CreateObject(_PBJ_Internal.CreateObject.ParseFrom(data,er)); - } - protected override bool _HasAllPBJFields{ get { - return true - ; - } } - public bool IsInitialized { get { - return super.IsInitialized&&_HasAllPBJFields; - } } - public class Builder : global::PBJ.IMessage.IBuilder{ - protected override bool _HasAllPBJFields{ get { - return true - ; - } } - public bool IsInitialized { get { - return super.IsInitialized&&_HasAllPBJFields; - } } - protected _PBJ_Internal.CreateObject.Builder super; - public override Google.ProtocolBuffers.IBuilder _PBJISuper { get { return super; } } - public _PBJ_Internal.CreateObject.Builder _PBJSuper{ get { return super;} } - public Builder() {super = new _PBJ_Internal.CreateObject.Builder();} - public Builder(_PBJ_Internal.CreateObject.Builder other) { - super=other; - } - public Builder Clone() {return new Builder(super.Clone());} - public Builder MergeFrom(CreateObject prototype) { super.MergeFrom(prototype._PBJSuper);return this;} - public Builder Clear() {super.Clear();return this;} - public CreateObject BuildPartial() {return new CreateObject(super.BuildPartial());} - public CreateObject Build() {if (_HasAllPBJFields) return new CreateObject(super.Build());return null;} - public pbd::MessageDescriptor DescriptorForType { - get { return CreateObject.Descriptor; } } - public Builder ClearObjectUuid() { super.ClearObjectUuid();return this;} - public const int ObjectUuidFieldTag=1; - public bool HasObjectUuid{ get {return super.HasObjectUuid&&PBJ._PBJ.ValidateUuid(super.ObjectUuid);} } - public PBJ.UUID ObjectUuid{ get { - if (HasObjectUuid) { - return PBJ._PBJ.CastUuid(super.ObjectUuid); - } else { - return PBJ._PBJ.CastUuid(); - } - } - set { - super.ObjectUuid=(PBJ._PBJ.Construct(value)); - } - } - public Builder ClearSpaceProperties() { super.ClearSpaceProperties();return this;} - public Builder SetSpaceProperties(int index,ConnectToSpace value) { - super.SetSpaceProperties(index,value._PBJSuper); - return this; - } - public const int SpacePropertiesFieldTag=2; - public int SpacePropertiesCount { get { return super.SpacePropertiesCount;} } - public bool HasSpaceProperties(int index) {return true;} - public ConnectToSpace SpaceProperties(int index) { - return new ConnectToSpace(super.GetSpaceProperties(index)); - } - public Builder AddSpaceProperties(ConnectToSpace value) { - super.AddSpaceProperties(value._PBJSuper); - return this; - } - public Builder ClearMesh() { super.ClearMesh();return this;} - public const int MeshFieldTag=3; - public bool HasMesh{ get {return super.HasMesh&&PBJ._PBJ.ValidateString(super.Mesh);} } - public string Mesh{ get { - if (HasMesh) { - return PBJ._PBJ.CastString(super.Mesh); - } else { - return PBJ._PBJ.CastString(); - } - } - set { - super.Mesh=(PBJ._PBJ.Construct(value)); - } - } - public Builder ClearScale() { super.ClearScale();return this;} - public const int ScaleFieldTag=4; - public bool HasScale{ get {return super.ScaleCount>=3;} } - public PBJ.Vector3f Scale{ get { - int index=0; - if (HasScale) { - return PBJ._PBJ.CastVector3f(super.GetScale(index*3+0),super.GetScale(index*3+1),super.GetScale(index*3+2)); - } else { - return PBJ._PBJ.CastVector3f(); - } - } - set { - super.ClearScale(); - float[] _PBJtempArray=PBJ._PBJ.ConstructVector3f(value); - super.AddScale(_PBJtempArray[0]); - super.AddScale(_PBJtempArray[1]); - super.AddScale(_PBJtempArray[2]); - } - } - public Builder ClearWeburl() { super.ClearWeburl();return this;} - public const int WeburlFieldTag=5; - public bool HasWeburl{ get {return super.HasWeburl&&PBJ._PBJ.ValidateString(super.Weburl);} } - public string Weburl{ get { - if (HasWeburl) { - return PBJ._PBJ.CastString(super.Weburl); - } else { - return PBJ._PBJ.CastString(); - } - } - set { - super.Weburl=(PBJ._PBJ.Construct(value)); - } - } - public Builder ClearLightInfo() { super.ClearLightInfo();return this;} - public const int LightInfoFieldTag=6; - public bool HasLightInfo{ get {return super.HasLightInfo;} } - public LightInfoProperty LightInfo{ get { - if (HasLightInfo) { - return new LightInfoProperty(super.LightInfo); - } else { - return new LightInfoProperty(); - } - } - set { - super.LightInfo=value._PBJSuper; - } - } - public Builder ClearCamera() { super.ClearCamera();return this;} - public const int CameraFieldTag=7; - public bool HasCamera{ get {return super.HasCamera&&PBJ._PBJ.ValidateBool(super.Camera);} } - public bool Camera{ get { - if (HasCamera) { - return PBJ._PBJ.CastBool(super.Camera); - } else { - return PBJ._PBJ.CastBool(); - } - } - set { - super.Camera=(PBJ._PBJ.Construct(value)); - } - } - public Builder ClearPhysical() { super.ClearPhysical();return this;} - public const int PhysicalFieldTag=8; - public bool HasPhysical{ get {return super.HasPhysical;} } - public PhysicalParameters Physical{ get { - if (HasPhysical) { - return new PhysicalParameters(super.Physical); - } else { - return new PhysicalParameters(); - } - } - set { - super.Physical=value._PBJSuper; - } - } - } - } -} diff --git a/OpenSim/Client/Sirikata/Protocol/Subscription.cs b/OpenSim/Client/Sirikata/Protocol/Subscription.cs deleted file mode 100644 index 06ac8a244c..0000000000 --- a/OpenSim/Client/Sirikata/Protocol/Subscription.cs +++ /dev/null @@ -1,856 +0,0 @@ -// Generated by the protocol buffer compiler. DO NOT EDIT! - -using pb = global::Google.ProtocolBuffers; -using pbc = global::Google.ProtocolBuffers.Collections; -using pbd = global::Google.ProtocolBuffers.Descriptors; -using scg = global::System.Collections.Generic; -namespace Sirikata.Subscription.Protocol._PBJ_Internal { - - public static partial class Subscription { - - #region Extension registration - public static void RegisterAllExtensions(pb::ExtensionRegistry registry) { - } - #endregion - #region Static variables - internal static pbd::MessageDescriptor internal__static_Sirikata_Subscription_Protocol__PBJ_Internal_Address__Descriptor; - internal static pb::FieldAccess.FieldAccessorTable internal__static_Sirikata_Subscription_Protocol__PBJ_Internal_Address__FieldAccessorTable; - internal static pbd::MessageDescriptor internal__static_Sirikata_Subscription_Protocol__PBJ_Internal_Subscribe__Descriptor; - internal static pb::FieldAccess.FieldAccessorTable internal__static_Sirikata_Subscription_Protocol__PBJ_Internal_Subscribe__FieldAccessorTable; - internal static pbd::MessageDescriptor internal__static_Sirikata_Subscription_Protocol__PBJ_Internal_Broadcast__Descriptor; - internal static pb::FieldAccess.FieldAccessorTable internal__static_Sirikata_Subscription_Protocol__PBJ_Internal_Broadcast__FieldAccessorTable; - #endregion - #region Descriptor - public static pbd::FileDescriptor Descriptor { - get { return descriptor; } - } - private static pbd::FileDescriptor descriptor; - - static Subscription() { - byte[] descriptorData = global::System.Convert.FromBase64String( - "ChJTdWJzY3JpcHRpb24ucHJvdG8SLFNpcmlrYXRhLlN1YnNjcmlwdGlvbi5Q" + - "cm90b2NvbC5fUEJKX0ludGVybmFsIiwKB0FkZHJlc3MSEAoIaG9zdG5hbWUY" + - "ASABKAkSDwoHc2VydmljZRgCIAEoCSKMAQoJU3Vic2NyaWJlElAKEWJyb2Fk" + - "Y2FzdF9hZGRyZXNzGAcgASgLMjUuU2lyaWthdGEuU3Vic2NyaXB0aW9uLlBy" + - "b3RvY29sLl9QQkpfSW50ZXJuYWwuQWRkcmVzcxIWCg5icm9hZGNhc3RfbmFt" + - "ZRgIIAEoDBIVCg11cGRhdGVfcGVyaW9kGAkgASgQIiMKCUJyb2FkY2FzdBIW" + - "Cg5icm9hZGNhc3RfbmFtZRgHIAEoDA=="); - pbd::FileDescriptor.InternalDescriptorAssigner assigner = delegate(pbd::FileDescriptor root) { - descriptor = root; - internal__static_Sirikata_Subscription_Protocol__PBJ_Internal_Address__Descriptor = Descriptor.MessageTypes[0]; - internal__static_Sirikata_Subscription_Protocol__PBJ_Internal_Address__FieldAccessorTable = - new pb::FieldAccess.FieldAccessorTable(internal__static_Sirikata_Subscription_Protocol__PBJ_Internal_Address__Descriptor, - new string[] { "Hostname", "Service", }); - internal__static_Sirikata_Subscription_Protocol__PBJ_Internal_Subscribe__Descriptor = Descriptor.MessageTypes[1]; - internal__static_Sirikata_Subscription_Protocol__PBJ_Internal_Subscribe__FieldAccessorTable = - new pb::FieldAccess.FieldAccessorTable(internal__static_Sirikata_Subscription_Protocol__PBJ_Internal_Subscribe__Descriptor, - new string[] { "BroadcastAddress", "BroadcastName", "UpdatePeriod", }); - internal__static_Sirikata_Subscription_Protocol__PBJ_Internal_Broadcast__Descriptor = Descriptor.MessageTypes[2]; - internal__static_Sirikata_Subscription_Protocol__PBJ_Internal_Broadcast__FieldAccessorTable = - new pb::FieldAccess.FieldAccessorTable(internal__static_Sirikata_Subscription_Protocol__PBJ_Internal_Broadcast__Descriptor, - new string[] { "BroadcastName", }); - return null; - }; - pbd::FileDescriptor.InternalBuildGeneratedFileFrom(descriptorData, - new pbd::FileDescriptor[] { - }, assigner); - } - #endregion - - } - #region Messages - public sealed partial class Address : pb::GeneratedMessage { - private static readonly Address defaultInstance = new Builder().BuildPartial(); - public static Address DefaultInstance { - get { return defaultInstance; } - } - - public override Address DefaultInstanceForType { - get { return defaultInstance; } - } - - protected override Address ThisMessage { - get { return this; } - } - - public static pbd::MessageDescriptor Descriptor { - get { return global::Sirikata.Subscription.Protocol._PBJ_Internal.Subscription.internal__static_Sirikata_Subscription_Protocol__PBJ_Internal_Address__Descriptor; } - } - - protected override pb::FieldAccess.FieldAccessorTable InternalFieldAccessors { - get { return global::Sirikata.Subscription.Protocol._PBJ_Internal.Subscription.internal__static_Sirikata_Subscription_Protocol__PBJ_Internal_Address__FieldAccessorTable; } - } - - public const int HostnameFieldNumber = 1; - private bool hasHostname; - private string hostname_ = ""; - public bool HasHostname { - get { return hasHostname; } - } - public string Hostname { - get { return hostname_; } - } - - public const int ServiceFieldNumber = 2; - private bool hasService; - private string service_ = ""; - public bool HasService { - get { return hasService; } - } - public string Service { - get { return service_; } - } - - public override bool IsInitialized { - get { - return true; - } - } - - public override void WriteTo(pb::CodedOutputStream output) { - if (HasHostname) { - output.WriteString(1, Hostname); - } - if (HasService) { - output.WriteString(2, Service); - } - UnknownFields.WriteTo(output); - } - - private int memoizedSerializedSize = -1; - public override int SerializedSize { - get { - int size = memoizedSerializedSize; - if (size != -1) return size; - - size = 0; - if (HasHostname) { - size += pb::CodedOutputStream.ComputeStringSize(1, Hostname); - } - if (HasService) { - size += pb::CodedOutputStream.ComputeStringSize(2, Service); - } - size += UnknownFields.SerializedSize; - memoizedSerializedSize = size; - return size; - } - } - - public static Address ParseFrom(pb::ByteString data) { - return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); - } - public static Address ParseFrom(pb::ByteString data, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); - } - public static Address ParseFrom(byte[] data) { - return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); - } - public static Address ParseFrom(byte[] data, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); - } - public static Address ParseFrom(global::System.IO.Stream input) { - return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); - } - public static Address ParseFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); - } - public static Address ParseDelimitedFrom(global::System.IO.Stream input) { - return CreateBuilder().MergeDelimitedFrom(input).BuildParsed(); - } - public static Address ParseDelimitedFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { - return CreateBuilder().MergeDelimitedFrom(input, extensionRegistry).BuildParsed(); - } - public static Address ParseFrom(pb::CodedInputStream input) { - return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); - } - public static Address ParseFrom(pb::CodedInputStream input, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); - } - public static Builder CreateBuilder() { return new Builder(); } - public override Builder ToBuilder() { return CreateBuilder(this); } - public override Builder CreateBuilderForType() { return new Builder(); } - public static Builder CreateBuilder(Address prototype) { - return (Builder) new Builder().MergeFrom(prototype); - } - - public sealed partial class Builder : pb::GeneratedBuilder { - protected override Builder ThisBuilder { - get { return this; } - } - public Builder() {} - - Address result = new Address(); - - protected override Address MessageBeingBuilt { - get { return result; } - } - - public override Builder Clear() { - result = new Address(); - return this; - } - - public override Builder Clone() { - return new Builder().MergeFrom(result); - } - - public override pbd::MessageDescriptor DescriptorForType { - get { return global::Sirikata.Subscription.Protocol._PBJ_Internal.Address.Descriptor; } - } - - public override Address DefaultInstanceForType { - get { return global::Sirikata.Subscription.Protocol._PBJ_Internal.Address.DefaultInstance; } - } - - public override Address BuildPartial() { - if (result == null) { - throw new global::System.InvalidOperationException("build() has already been called on this Builder"); - } - Address returnMe = result; - result = null; - return returnMe; - } - - public override Builder MergeFrom(pb::IMessage other) { - if (other is Address) { - return MergeFrom((Address) other); - } else { - base.MergeFrom(other); - return this; - } - } - - public override Builder MergeFrom(Address other) { - if (other == global::Sirikata.Subscription.Protocol._PBJ_Internal.Address.DefaultInstance) return this; - if (other.HasHostname) { - Hostname = other.Hostname; - } - if (other.HasService) { - Service = other.Service; - } - this.MergeUnknownFields(other.UnknownFields); - return this; - } - - public override Builder MergeFrom(pb::CodedInputStream input) { - return MergeFrom(input, pb::ExtensionRegistry.Empty); - } - - public override Builder MergeFrom(pb::CodedInputStream input, pb::ExtensionRegistry extensionRegistry) { - pb::UnknownFieldSet.Builder unknownFields = null; - while (true) { - uint tag = input.ReadTag(); - switch (tag) { - case 0: { - if (unknownFields != null) { - this.UnknownFields = unknownFields.Build(); - } - return this; - } - default: { - if (pb::WireFormat.IsEndGroupTag(tag)) { - if (unknownFields != null) { - this.UnknownFields = unknownFields.Build(); - } - return this; - } - if (unknownFields == null) { - unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); - } - ParseUnknownField(input, unknownFields, extensionRegistry, tag); - break; - } - case 10: { - Hostname = input.ReadString(); - break; - } - case 18: { - Service = input.ReadString(); - break; - } - } - } - } - - - public bool HasHostname { - get { return result.HasHostname; } - } - public string Hostname { - get { return result.Hostname; } - set { SetHostname(value); } - } - public Builder SetHostname(string value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - result.hasHostname = true; - result.hostname_ = value; - return this; - } - public Builder ClearHostname() { - result.hasHostname = false; - result.hostname_ = ""; - return this; - } - - public bool HasService { - get { return result.HasService; } - } - public string Service { - get { return result.Service; } - set { SetService(value); } - } - public Builder SetService(string value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - result.hasService = true; - result.service_ = value; - return this; - } - public Builder ClearService() { - result.hasService = false; - result.service_ = ""; - return this; - } - } - static Address() { - object.ReferenceEquals(global::Sirikata.Subscription.Protocol._PBJ_Internal.Subscription.Descriptor, null); - } - } - - public sealed partial class Subscribe : pb::GeneratedMessage { - private static readonly Subscribe defaultInstance = new Builder().BuildPartial(); - public static Subscribe DefaultInstance { - get { return defaultInstance; } - } - - public override Subscribe DefaultInstanceForType { - get { return defaultInstance; } - } - - protected override Subscribe ThisMessage { - get { return this; } - } - - public static pbd::MessageDescriptor Descriptor { - get { return global::Sirikata.Subscription.Protocol._PBJ_Internal.Subscription.internal__static_Sirikata_Subscription_Protocol__PBJ_Internal_Subscribe__Descriptor; } - } - - protected override pb::FieldAccess.FieldAccessorTable InternalFieldAccessors { - get { return global::Sirikata.Subscription.Protocol._PBJ_Internal.Subscription.internal__static_Sirikata_Subscription_Protocol__PBJ_Internal_Subscribe__FieldAccessorTable; } - } - - public const int BroadcastAddressFieldNumber = 7; - private bool hasBroadcastAddress; - private global::Sirikata.Subscription.Protocol._PBJ_Internal.Address broadcastAddress_ = global::Sirikata.Subscription.Protocol._PBJ_Internal.Address.DefaultInstance; - public bool HasBroadcastAddress { - get { return hasBroadcastAddress; } - } - public global::Sirikata.Subscription.Protocol._PBJ_Internal.Address BroadcastAddress { - get { return broadcastAddress_; } - } - - public const int BroadcastNameFieldNumber = 8; - private bool hasBroadcastName; - private pb::ByteString broadcastName_ = pb::ByteString.Empty; - public bool HasBroadcastName { - get { return hasBroadcastName; } - } - public pb::ByteString BroadcastName { - get { return broadcastName_; } - } - - public const int UpdatePeriodFieldNumber = 9; - private bool hasUpdatePeriod; - private long updatePeriod_ = 0; - public bool HasUpdatePeriod { - get { return hasUpdatePeriod; } - } - public long UpdatePeriod { - get { return updatePeriod_; } - } - - public override bool IsInitialized { - get { - return true; - } - } - - public override void WriteTo(pb::CodedOutputStream output) { - if (HasBroadcastAddress) { - output.WriteMessage(7, BroadcastAddress); - } - if (HasBroadcastName) { - output.WriteBytes(8, BroadcastName); - } - if (HasUpdatePeriod) { - output.WriteSFixed64(9, UpdatePeriod); - } - UnknownFields.WriteTo(output); - } - - private int memoizedSerializedSize = -1; - public override int SerializedSize { - get { - int size = memoizedSerializedSize; - if (size != -1) return size; - - size = 0; - if (HasBroadcastAddress) { - size += pb::CodedOutputStream.ComputeMessageSize(7, BroadcastAddress); - } - if (HasBroadcastName) { - size += pb::CodedOutputStream.ComputeBytesSize(8, BroadcastName); - } - if (HasUpdatePeriod) { - size += pb::CodedOutputStream.ComputeSFixed64Size(9, UpdatePeriod); - } - size += UnknownFields.SerializedSize; - memoizedSerializedSize = size; - return size; - } - } - - public static Subscribe ParseFrom(pb::ByteString data) { - return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); - } - public static Subscribe ParseFrom(pb::ByteString data, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); - } - public static Subscribe ParseFrom(byte[] data) { - return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); - } - public static Subscribe ParseFrom(byte[] data, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); - } - public static Subscribe ParseFrom(global::System.IO.Stream input) { - return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); - } - public static Subscribe ParseFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); - } - public static Subscribe ParseDelimitedFrom(global::System.IO.Stream input) { - return CreateBuilder().MergeDelimitedFrom(input).BuildParsed(); - } - public static Subscribe ParseDelimitedFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { - return CreateBuilder().MergeDelimitedFrom(input, extensionRegistry).BuildParsed(); - } - public static Subscribe ParseFrom(pb::CodedInputStream input) { - return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); - } - public static Subscribe ParseFrom(pb::CodedInputStream input, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); - } - public static Builder CreateBuilder() { return new Builder(); } - public override Builder ToBuilder() { return CreateBuilder(this); } - public override Builder CreateBuilderForType() { return new Builder(); } - public static Builder CreateBuilder(Subscribe prototype) { - return (Builder) new Builder().MergeFrom(prototype); - } - - public sealed partial class Builder : pb::GeneratedBuilder { - protected override Builder ThisBuilder { - get { return this; } - } - public Builder() {} - - Subscribe result = new Subscribe(); - - protected override Subscribe MessageBeingBuilt { - get { return result; } - } - - public override Builder Clear() { - result = new Subscribe(); - return this; - } - - public override Builder Clone() { - return new Builder().MergeFrom(result); - } - - public override pbd::MessageDescriptor DescriptorForType { - get { return global::Sirikata.Subscription.Protocol._PBJ_Internal.Subscribe.Descriptor; } - } - - public override Subscribe DefaultInstanceForType { - get { return global::Sirikata.Subscription.Protocol._PBJ_Internal.Subscribe.DefaultInstance; } - } - - public override Subscribe BuildPartial() { - if (result == null) { - throw new global::System.InvalidOperationException("build() has already been called on this Builder"); - } - Subscribe returnMe = result; - result = null; - return returnMe; - } - - public override Builder MergeFrom(pb::IMessage other) { - if (other is Subscribe) { - return MergeFrom((Subscribe) other); - } else { - base.MergeFrom(other); - return this; - } - } - - public override Builder MergeFrom(Subscribe other) { - if (other == global::Sirikata.Subscription.Protocol._PBJ_Internal.Subscribe.DefaultInstance) return this; - if (other.HasBroadcastAddress) { - MergeBroadcastAddress(other.BroadcastAddress); - } - if (other.HasBroadcastName) { - BroadcastName = other.BroadcastName; - } - if (other.HasUpdatePeriod) { - UpdatePeriod = other.UpdatePeriod; - } - this.MergeUnknownFields(other.UnknownFields); - return this; - } - - public override Builder MergeFrom(pb::CodedInputStream input) { - return MergeFrom(input, pb::ExtensionRegistry.Empty); - } - - public override Builder MergeFrom(pb::CodedInputStream input, pb::ExtensionRegistry extensionRegistry) { - pb::UnknownFieldSet.Builder unknownFields = null; - while (true) { - uint tag = input.ReadTag(); - switch (tag) { - case 0: { - if (unknownFields != null) { - this.UnknownFields = unknownFields.Build(); - } - return this; - } - default: { - if (pb::WireFormat.IsEndGroupTag(tag)) { - if (unknownFields != null) { - this.UnknownFields = unknownFields.Build(); - } - return this; - } - if (unknownFields == null) { - unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); - } - ParseUnknownField(input, unknownFields, extensionRegistry, tag); - break; - } - case 58: { - global::Sirikata.Subscription.Protocol._PBJ_Internal.Address.Builder subBuilder = global::Sirikata.Subscription.Protocol._PBJ_Internal.Address.CreateBuilder(); - if (HasBroadcastAddress) { - subBuilder.MergeFrom(BroadcastAddress); - } - input.ReadMessage(subBuilder, extensionRegistry); - BroadcastAddress = subBuilder.BuildPartial(); - break; - } - case 66: { - BroadcastName = input.ReadBytes(); - break; - } - case 73: { - UpdatePeriod = input.ReadSFixed64(); - break; - } - } - } - } - - - public bool HasBroadcastAddress { - get { return result.HasBroadcastAddress; } - } - public global::Sirikata.Subscription.Protocol._PBJ_Internal.Address BroadcastAddress { - get { return result.BroadcastAddress; } - set { SetBroadcastAddress(value); } - } - public Builder SetBroadcastAddress(global::Sirikata.Subscription.Protocol._PBJ_Internal.Address value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - result.hasBroadcastAddress = true; - result.broadcastAddress_ = value; - return this; - } - public Builder SetBroadcastAddress(global::Sirikata.Subscription.Protocol._PBJ_Internal.Address.Builder builderForValue) { - pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); - result.hasBroadcastAddress = true; - result.broadcastAddress_ = builderForValue.Build(); - return this; - } - public Builder MergeBroadcastAddress(global::Sirikata.Subscription.Protocol._PBJ_Internal.Address value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - if (result.HasBroadcastAddress && - result.broadcastAddress_ != global::Sirikata.Subscription.Protocol._PBJ_Internal.Address.DefaultInstance) { - result.broadcastAddress_ = global::Sirikata.Subscription.Protocol._PBJ_Internal.Address.CreateBuilder(result.broadcastAddress_).MergeFrom(value).BuildPartial(); - } else { - result.broadcastAddress_ = value; - } - result.hasBroadcastAddress = true; - return this; - } - public Builder ClearBroadcastAddress() { - result.hasBroadcastAddress = false; - result.broadcastAddress_ = global::Sirikata.Subscription.Protocol._PBJ_Internal.Address.DefaultInstance; - return this; - } - - public bool HasBroadcastName { - get { return result.HasBroadcastName; } - } - public pb::ByteString BroadcastName { - get { return result.BroadcastName; } - set { SetBroadcastName(value); } - } - public Builder SetBroadcastName(pb::ByteString value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - result.hasBroadcastName = true; - result.broadcastName_ = value; - return this; - } - public Builder ClearBroadcastName() { - result.hasBroadcastName = false; - result.broadcastName_ = pb::ByteString.Empty; - return this; - } - - public bool HasUpdatePeriod { - get { return result.HasUpdatePeriod; } - } - public long UpdatePeriod { - get { return result.UpdatePeriod; } - set { SetUpdatePeriod(value); } - } - public Builder SetUpdatePeriod(long value) { - result.hasUpdatePeriod = true; - result.updatePeriod_ = value; - return this; - } - public Builder ClearUpdatePeriod() { - result.hasUpdatePeriod = false; - result.updatePeriod_ = 0; - return this; - } - } - static Subscribe() { - object.ReferenceEquals(global::Sirikata.Subscription.Protocol._PBJ_Internal.Subscription.Descriptor, null); - } - } - - public sealed partial class Broadcast : pb::GeneratedMessage { - private static readonly Broadcast defaultInstance = new Builder().BuildPartial(); - public static Broadcast DefaultInstance { - get { return defaultInstance; } - } - - public override Broadcast DefaultInstanceForType { - get { return defaultInstance; } - } - - protected override Broadcast ThisMessage { - get { return this; } - } - - public static pbd::MessageDescriptor Descriptor { - get { return global::Sirikata.Subscription.Protocol._PBJ_Internal.Subscription.internal__static_Sirikata_Subscription_Protocol__PBJ_Internal_Broadcast__Descriptor; } - } - - protected override pb::FieldAccess.FieldAccessorTable InternalFieldAccessors { - get { return global::Sirikata.Subscription.Protocol._PBJ_Internal.Subscription.internal__static_Sirikata_Subscription_Protocol__PBJ_Internal_Broadcast__FieldAccessorTable; } - } - - public const int BroadcastNameFieldNumber = 7; - private bool hasBroadcastName; - private pb::ByteString broadcastName_ = pb::ByteString.Empty; - public bool HasBroadcastName { - get { return hasBroadcastName; } - } - public pb::ByteString BroadcastName { - get { return broadcastName_; } - } - - public override bool IsInitialized { - get { - return true; - } - } - - public override void WriteTo(pb::CodedOutputStream output) { - if (HasBroadcastName) { - output.WriteBytes(7, BroadcastName); - } - UnknownFields.WriteTo(output); - } - - private int memoizedSerializedSize = -1; - public override int SerializedSize { - get { - int size = memoizedSerializedSize; - if (size != -1) return size; - - size = 0; - if (HasBroadcastName) { - size += pb::CodedOutputStream.ComputeBytesSize(7, BroadcastName); - } - size += UnknownFields.SerializedSize; - memoizedSerializedSize = size; - return size; - } - } - - public static Broadcast ParseFrom(pb::ByteString data) { - return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); - } - public static Broadcast ParseFrom(pb::ByteString data, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); - } - public static Broadcast ParseFrom(byte[] data) { - return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); - } - public static Broadcast ParseFrom(byte[] data, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); - } - public static Broadcast ParseFrom(global::System.IO.Stream input) { - return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); - } - public static Broadcast ParseFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); - } - public static Broadcast ParseDelimitedFrom(global::System.IO.Stream input) { - return CreateBuilder().MergeDelimitedFrom(input).BuildParsed(); - } - public static Broadcast ParseDelimitedFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { - return CreateBuilder().MergeDelimitedFrom(input, extensionRegistry).BuildParsed(); - } - public static Broadcast ParseFrom(pb::CodedInputStream input) { - return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); - } - public static Broadcast ParseFrom(pb::CodedInputStream input, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); - } - public static Builder CreateBuilder() { return new Builder(); } - public override Builder ToBuilder() { return CreateBuilder(this); } - public override Builder CreateBuilderForType() { return new Builder(); } - public static Builder CreateBuilder(Broadcast prototype) { - return (Builder) new Builder().MergeFrom(prototype); - } - - public sealed partial class Builder : pb::GeneratedBuilder { - protected override Builder ThisBuilder { - get { return this; } - } - public Builder() {} - - Broadcast result = new Broadcast(); - - protected override Broadcast MessageBeingBuilt { - get { return result; } - } - - public override Builder Clear() { - result = new Broadcast(); - return this; - } - - public override Builder Clone() { - return new Builder().MergeFrom(result); - } - - public override pbd::MessageDescriptor DescriptorForType { - get { return global::Sirikata.Subscription.Protocol._PBJ_Internal.Broadcast.Descriptor; } - } - - public override Broadcast DefaultInstanceForType { - get { return global::Sirikata.Subscription.Protocol._PBJ_Internal.Broadcast.DefaultInstance; } - } - - public override Broadcast BuildPartial() { - if (result == null) { - throw new global::System.InvalidOperationException("build() has already been called on this Builder"); - } - Broadcast returnMe = result; - result = null; - return returnMe; - } - - public override Builder MergeFrom(pb::IMessage other) { - if (other is Broadcast) { - return MergeFrom((Broadcast) other); - } else { - base.MergeFrom(other); - return this; - } - } - - public override Builder MergeFrom(Broadcast other) { - if (other == global::Sirikata.Subscription.Protocol._PBJ_Internal.Broadcast.DefaultInstance) return this; - if (other.HasBroadcastName) { - BroadcastName = other.BroadcastName; - } - this.MergeUnknownFields(other.UnknownFields); - return this; - } - - public override Builder MergeFrom(pb::CodedInputStream input) { - return MergeFrom(input, pb::ExtensionRegistry.Empty); - } - - public override Builder MergeFrom(pb::CodedInputStream input, pb::ExtensionRegistry extensionRegistry) { - pb::UnknownFieldSet.Builder unknownFields = null; - while (true) { - uint tag = input.ReadTag(); - switch (tag) { - case 0: { - if (unknownFields != null) { - this.UnknownFields = unknownFields.Build(); - } - return this; - } - default: { - if (pb::WireFormat.IsEndGroupTag(tag)) { - if (unknownFields != null) { - this.UnknownFields = unknownFields.Build(); - } - return this; - } - if (unknownFields == null) { - unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); - } - ParseUnknownField(input, unknownFields, extensionRegistry, tag); - break; - } - case 58: { - BroadcastName = input.ReadBytes(); - break; - } - } - } - } - - - public bool HasBroadcastName { - get { return result.HasBroadcastName; } - } - public pb::ByteString BroadcastName { - get { return result.BroadcastName; } - set { SetBroadcastName(value); } - } - public Builder SetBroadcastName(pb::ByteString value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - result.hasBroadcastName = true; - result.broadcastName_ = value; - return this; - } - public Builder ClearBroadcastName() { - result.hasBroadcastName = false; - result.broadcastName_ = pb::ByteString.Empty; - return this; - } - } - static Broadcast() { - object.ReferenceEquals(global::Sirikata.Subscription.Protocol._PBJ_Internal.Subscription.Descriptor, null); - } - } - - #endregion - -} diff --git a/OpenSim/Client/Sirikata/Protocol/Subscription.pbj.cs b/OpenSim/Client/Sirikata/Protocol/Subscription.pbj.cs deleted file mode 100644 index c8c2fbf9bc..0000000000 --- a/OpenSim/Client/Sirikata/Protocol/Subscription.pbj.cs +++ /dev/null @@ -1,431 +0,0 @@ -/* - * Copyright (c) Contributors, http://opensimulator.org/ - * See CONTRIBUTORS.TXT for a full list of copyright holders. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * * Neither the name of the OpenSimulator Project nor the - * names of its contributors may be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE DEVELOPERS ``AS IS'' AND ANY - * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED - * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL THE CONTRIBUTORS BE LIABLE FOR ANY - * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES - * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; - * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ - -using pbd = global::Google.ProtocolBuffers.Descriptors; -using pb = global::Google.ProtocolBuffers; -namespace Sirikata.Subscription.Protocol { - public class Address : PBJ.IMessage { - protected _PBJ_Internal.Address super; - public _PBJ_Internal.Address _PBJSuper{ get { return super;} } - public Address() { - super=new _PBJ_Internal.Address(); - } - public Address(_PBJ_Internal.Address reference) { - super=reference; - } - public static Address defaultInstance= new Address (_PBJ_Internal.Address.DefaultInstance); - public static Address DefaultInstance{ - get {return defaultInstance;} - } - public static pbd.MessageDescriptor Descriptor { - get { return _PBJ_Internal.Address.Descriptor; } } - public static class Types { - } - public static bool WithinReservedFieldTagRange(int field_tag) { - return false; - } - public static bool WithinExtensionFieldTagRange(int field_tag) { - return false; - } - public const int HostnameFieldTag=1; - public bool HasHostname{ get {return super.HasHostname&&PBJ._PBJ.ValidateString(super.Hostname);} } - public string Hostname{ get { - if (HasHostname) { - return PBJ._PBJ.CastString(super.Hostname); - } else { - return PBJ._PBJ.CastString(); - } - } - } - public const int ServiceFieldTag=2; - public bool HasService{ get {return super.HasService&&PBJ._PBJ.ValidateString(super.Service);} } - public string Service{ get { - if (HasService) { - return PBJ._PBJ.CastString(super.Service); - } else { - return PBJ._PBJ.CastString(); - } - } - } - public override Google.ProtocolBuffers.IMessage _PBJISuper { get { return super; } } - public override PBJ.IMessage.IBuilder WeakCreateBuilderForType() { return new Builder(); } - public static Builder CreateBuilder() { return new Builder(); } - public static Builder CreateBuilder(Address prototype) { - return (Builder)new Builder().MergeFrom(prototype); - } - public static Address ParseFrom(pb::ByteString data) { - return new Address(_PBJ_Internal.Address.ParseFrom(data)); - } - public static Address ParseFrom(pb::ByteString data, pb::ExtensionRegistry er) { - return new Address(_PBJ_Internal.Address.ParseFrom(data,er)); - } - public static Address ParseFrom(byte[] data) { - return new Address(_PBJ_Internal.Address.ParseFrom(data)); - } - public static Address ParseFrom(byte[] data, pb::ExtensionRegistry er) { - return new Address(_PBJ_Internal.Address.ParseFrom(data,er)); - } - public static Address ParseFrom(global::System.IO.Stream data) { - return new Address(_PBJ_Internal.Address.ParseFrom(data)); - } - public static Address ParseFrom(global::System.IO.Stream data, pb::ExtensionRegistry er) { - return new Address(_PBJ_Internal.Address.ParseFrom(data,er)); - } - public static Address ParseFrom(pb::CodedInputStream data) { - return new Address(_PBJ_Internal.Address.ParseFrom(data)); - } - public static Address ParseFrom(pb::CodedInputStream data, pb::ExtensionRegistry er) { - return new Address(_PBJ_Internal.Address.ParseFrom(data,er)); - } - protected override bool _HasAllPBJFields{ get { - return true - ; - } } - public bool IsInitialized { get { - return super.IsInitialized&&_HasAllPBJFields; - } } - public class Builder : global::PBJ.IMessage.IBuilder{ - protected override bool _HasAllPBJFields{ get { - return true - ; - } } - public bool IsInitialized { get { - return super.IsInitialized&&_HasAllPBJFields; - } } - protected _PBJ_Internal.Address.Builder super; - public override Google.ProtocolBuffers.IBuilder _PBJISuper { get { return super; } } - public _PBJ_Internal.Address.Builder _PBJSuper{ get { return super;} } - public Builder() {super = new _PBJ_Internal.Address.Builder();} - public Builder(_PBJ_Internal.Address.Builder other) { - super=other; - } - public Builder Clone() {return new Builder(super.Clone());} - public Builder MergeFrom(Address prototype) { super.MergeFrom(prototype._PBJSuper);return this;} - public Builder Clear() {super.Clear();return this;} - public Address BuildPartial() {return new Address(super.BuildPartial());} - public Address Build() {if (_HasAllPBJFields) return new Address(super.Build());return null;} - public pbd::MessageDescriptor DescriptorForType { - get { return Address.Descriptor; } } - public Builder ClearHostname() { super.ClearHostname();return this;} - public const int HostnameFieldTag=1; - public bool HasHostname{ get {return super.HasHostname&&PBJ._PBJ.ValidateString(super.Hostname);} } - public string Hostname{ get { - if (HasHostname) { - return PBJ._PBJ.CastString(super.Hostname); - } else { - return PBJ._PBJ.CastString(); - } - } - set { - super.Hostname=(PBJ._PBJ.Construct(value)); - } - } - public Builder ClearService() { super.ClearService();return this;} - public const int ServiceFieldTag=2; - public bool HasService{ get {return super.HasService&&PBJ._PBJ.ValidateString(super.Service);} } - public string Service{ get { - if (HasService) { - return PBJ._PBJ.CastString(super.Service); - } else { - return PBJ._PBJ.CastString(); - } - } - set { - super.Service=(PBJ._PBJ.Construct(value)); - } - } - } - } -} -namespace Sirikata.Subscription.Protocol { - public class Subscribe : PBJ.IMessage { - protected _PBJ_Internal.Subscribe super; - public _PBJ_Internal.Subscribe _PBJSuper{ get { return super;} } - public Subscribe() { - super=new _PBJ_Internal.Subscribe(); - } - public Subscribe(_PBJ_Internal.Subscribe reference) { - super=reference; - } - public static Subscribe defaultInstance= new Subscribe (_PBJ_Internal.Subscribe.DefaultInstance); - public static Subscribe DefaultInstance{ - get {return defaultInstance;} - } - public static pbd.MessageDescriptor Descriptor { - get { return _PBJ_Internal.Subscribe.Descriptor; } } - public static class Types { - } - public static bool WithinReservedFieldTagRange(int field_tag) { - return false||(field_tag>=1&&field_tag<=6)||(field_tag>=1536&&field_tag<=2560)||(field_tag>=229376&&field_tag<=294912); - } - public static bool WithinExtensionFieldTagRange(int field_tag) { - return false; - } - public const int BroadcastAddressFieldTag=7; - public bool HasBroadcastAddress{ get {return super.HasBroadcastAddress;} } - public Address BroadcastAddress{ get { - if (HasBroadcastAddress) { - return new Address(super.BroadcastAddress); - } else { - return new Address(); - } - } - } - public const int BroadcastNameFieldTag=8; - public bool HasBroadcastName{ get {return super.HasBroadcastName&&PBJ._PBJ.ValidateUuid(super.BroadcastName);} } - public PBJ.UUID BroadcastName{ get { - if (HasBroadcastName) { - return PBJ._PBJ.CastUuid(super.BroadcastName); - } else { - return PBJ._PBJ.CastUuid(); - } - } - } - public const int UpdatePeriodFieldTag=9; - public bool HasUpdatePeriod{ get {return super.HasUpdatePeriod&&PBJ._PBJ.ValidateDuration(super.UpdatePeriod);} } - public PBJ.Duration UpdatePeriod{ get { - if (HasUpdatePeriod) { - return PBJ._PBJ.CastDuration(super.UpdatePeriod); - } else { - return PBJ._PBJ.CastDuration(); - } - } - } - public override Google.ProtocolBuffers.IMessage _PBJISuper { get { return super; } } - public override PBJ.IMessage.IBuilder WeakCreateBuilderForType() { return new Builder(); } - public static Builder CreateBuilder() { return new Builder(); } - public static Builder CreateBuilder(Subscribe prototype) { - return (Builder)new Builder().MergeFrom(prototype); - } - public static Subscribe ParseFrom(pb::ByteString data) { - return new Subscribe(_PBJ_Internal.Subscribe.ParseFrom(data)); - } - public static Subscribe ParseFrom(pb::ByteString data, pb::ExtensionRegistry er) { - return new Subscribe(_PBJ_Internal.Subscribe.ParseFrom(data,er)); - } - public static Subscribe ParseFrom(byte[] data) { - return new Subscribe(_PBJ_Internal.Subscribe.ParseFrom(data)); - } - public static Subscribe ParseFrom(byte[] data, pb::ExtensionRegistry er) { - return new Subscribe(_PBJ_Internal.Subscribe.ParseFrom(data,er)); - } - public static Subscribe ParseFrom(global::System.IO.Stream data) { - return new Subscribe(_PBJ_Internal.Subscribe.ParseFrom(data)); - } - public static Subscribe ParseFrom(global::System.IO.Stream data, pb::ExtensionRegistry er) { - return new Subscribe(_PBJ_Internal.Subscribe.ParseFrom(data,er)); - } - public static Subscribe ParseFrom(pb::CodedInputStream data) { - return new Subscribe(_PBJ_Internal.Subscribe.ParseFrom(data)); - } - public static Subscribe ParseFrom(pb::CodedInputStream data, pb::ExtensionRegistry er) { - return new Subscribe(_PBJ_Internal.Subscribe.ParseFrom(data,er)); - } - protected override bool _HasAllPBJFields{ get { - return true - ; - } } - public bool IsInitialized { get { - return super.IsInitialized&&_HasAllPBJFields; - } } - public class Builder : global::PBJ.IMessage.IBuilder{ - protected override bool _HasAllPBJFields{ get { - return true - ; - } } - public bool IsInitialized { get { - return super.IsInitialized&&_HasAllPBJFields; - } } - protected _PBJ_Internal.Subscribe.Builder super; - public override Google.ProtocolBuffers.IBuilder _PBJISuper { get { return super; } } - public _PBJ_Internal.Subscribe.Builder _PBJSuper{ get { return super;} } - public Builder() {super = new _PBJ_Internal.Subscribe.Builder();} - public Builder(_PBJ_Internal.Subscribe.Builder other) { - super=other; - } - public Builder Clone() {return new Builder(super.Clone());} - public Builder MergeFrom(Subscribe prototype) { super.MergeFrom(prototype._PBJSuper);return this;} - public Builder Clear() {super.Clear();return this;} - public Subscribe BuildPartial() {return new Subscribe(super.BuildPartial());} - public Subscribe Build() {if (_HasAllPBJFields) return new Subscribe(super.Build());return null;} - public pbd::MessageDescriptor DescriptorForType { - get { return Subscribe.Descriptor; } } - public Builder ClearBroadcastAddress() { super.ClearBroadcastAddress();return this;} - public const int BroadcastAddressFieldTag=7; - public bool HasBroadcastAddress{ get {return super.HasBroadcastAddress;} } - public Address BroadcastAddress{ get { - if (HasBroadcastAddress) { - return new Address(super.BroadcastAddress); - } else { - return new Address(); - } - } - set { - super.BroadcastAddress=value._PBJSuper; - } - } - public Builder ClearBroadcastName() { super.ClearBroadcastName();return this;} - public const int BroadcastNameFieldTag=8; - public bool HasBroadcastName{ get {return super.HasBroadcastName&&PBJ._PBJ.ValidateUuid(super.BroadcastName);} } - public PBJ.UUID BroadcastName{ get { - if (HasBroadcastName) { - return PBJ._PBJ.CastUuid(super.BroadcastName); - } else { - return PBJ._PBJ.CastUuid(); - } - } - set { - super.BroadcastName=(PBJ._PBJ.Construct(value)); - } - } - public Builder ClearUpdatePeriod() { super.ClearUpdatePeriod();return this;} - public const int UpdatePeriodFieldTag=9; - public bool HasUpdatePeriod{ get {return super.HasUpdatePeriod&&PBJ._PBJ.ValidateDuration(super.UpdatePeriod);} } - public PBJ.Duration UpdatePeriod{ get { - if (HasUpdatePeriod) { - return PBJ._PBJ.CastDuration(super.UpdatePeriod); - } else { - return PBJ._PBJ.CastDuration(); - } - } - set { - super.UpdatePeriod=(PBJ._PBJ.Construct(value)); - } - } - } - } -} -namespace Sirikata.Subscription.Protocol { - public class Broadcast : PBJ.IMessage { - protected _PBJ_Internal.Broadcast super; - public _PBJ_Internal.Broadcast _PBJSuper{ get { return super;} } - public Broadcast() { - super=new _PBJ_Internal.Broadcast(); - } - public Broadcast(_PBJ_Internal.Broadcast reference) { - super=reference; - } - public static Broadcast defaultInstance= new Broadcast (_PBJ_Internal.Broadcast.DefaultInstance); - public static Broadcast DefaultInstance{ - get {return defaultInstance;} - } - public static pbd.MessageDescriptor Descriptor { - get { return _PBJ_Internal.Broadcast.Descriptor; } } - public static class Types { - } - public static bool WithinReservedFieldTagRange(int field_tag) { - return false||(field_tag>=1&&field_tag<=6)||(field_tag>=1536&&field_tag<=2560)||(field_tag>=229376&&field_tag<=294912); - } - public static bool WithinExtensionFieldTagRange(int field_tag) { - return false; - } - public const int BroadcastNameFieldTag=7; - public bool HasBroadcastName{ get {return super.HasBroadcastName&&PBJ._PBJ.ValidateUuid(super.BroadcastName);} } - public PBJ.UUID BroadcastName{ get { - if (HasBroadcastName) { - return PBJ._PBJ.CastUuid(super.BroadcastName); - } else { - return PBJ._PBJ.CastUuid(); - } - } - } - public override Google.ProtocolBuffers.IMessage _PBJISuper { get { return super; } } - public override PBJ.IMessage.IBuilder WeakCreateBuilderForType() { return new Builder(); } - public static Builder CreateBuilder() { return new Builder(); } - public static Builder CreateBuilder(Broadcast prototype) { - return (Builder)new Builder().MergeFrom(prototype); - } - public static Broadcast ParseFrom(pb::ByteString data) { - return new Broadcast(_PBJ_Internal.Broadcast.ParseFrom(data)); - } - public static Broadcast ParseFrom(pb::ByteString data, pb::ExtensionRegistry er) { - return new Broadcast(_PBJ_Internal.Broadcast.ParseFrom(data,er)); - } - public static Broadcast ParseFrom(byte[] data) { - return new Broadcast(_PBJ_Internal.Broadcast.ParseFrom(data)); - } - public static Broadcast ParseFrom(byte[] data, pb::ExtensionRegistry er) { - return new Broadcast(_PBJ_Internal.Broadcast.ParseFrom(data,er)); - } - public static Broadcast ParseFrom(global::System.IO.Stream data) { - return new Broadcast(_PBJ_Internal.Broadcast.ParseFrom(data)); - } - public static Broadcast ParseFrom(global::System.IO.Stream data, pb::ExtensionRegistry er) { - return new Broadcast(_PBJ_Internal.Broadcast.ParseFrom(data,er)); - } - public static Broadcast ParseFrom(pb::CodedInputStream data) { - return new Broadcast(_PBJ_Internal.Broadcast.ParseFrom(data)); - } - public static Broadcast ParseFrom(pb::CodedInputStream data, pb::ExtensionRegistry er) { - return new Broadcast(_PBJ_Internal.Broadcast.ParseFrom(data,er)); - } - protected override bool _HasAllPBJFields{ get { - return true - ; - } } - public bool IsInitialized { get { - return super.IsInitialized&&_HasAllPBJFields; - } } - public class Builder : global::PBJ.IMessage.IBuilder{ - protected override bool _HasAllPBJFields{ get { - return true - ; - } } - public bool IsInitialized { get { - return super.IsInitialized&&_HasAllPBJFields; - } } - protected _PBJ_Internal.Broadcast.Builder super; - public override Google.ProtocolBuffers.IBuilder _PBJISuper { get { return super; } } - public _PBJ_Internal.Broadcast.Builder _PBJSuper{ get { return super;} } - public Builder() {super = new _PBJ_Internal.Broadcast.Builder();} - public Builder(_PBJ_Internal.Broadcast.Builder other) { - super=other; - } - public Builder Clone() {return new Builder(super.Clone());} - public Builder MergeFrom(Broadcast prototype) { super.MergeFrom(prototype._PBJSuper);return this;} - public Builder Clear() {super.Clear();return this;} - public Broadcast BuildPartial() {return new Broadcast(super.BuildPartial());} - public Broadcast Build() {if (_HasAllPBJFields) return new Broadcast(super.Build());return null;} - public pbd::MessageDescriptor DescriptorForType { - get { return Broadcast.Descriptor; } } - public Builder ClearBroadcastName() { super.ClearBroadcastName();return this;} - public const int BroadcastNameFieldTag=7; - public bool HasBroadcastName{ get {return super.HasBroadcastName&&PBJ._PBJ.ValidateUuid(super.BroadcastName);} } - public PBJ.UUID BroadcastName{ get { - if (HasBroadcastName) { - return PBJ._PBJ.CastUuid(super.BroadcastName); - } else { - return PBJ._PBJ.CastUuid(); - } - } - set { - super.BroadcastName=(PBJ._PBJ.Construct(value)); - } - } - } - } -} diff --git a/OpenSim/Client/Sirikata/Protocol/Test.cs b/OpenSim/Client/Sirikata/Protocol/Test.cs deleted file mode 100644 index 0e1372a8b0..0000000000 --- a/OpenSim/Client/Sirikata/Protocol/Test.cs +++ /dev/null @@ -1,3773 +0,0 @@ -// Generated by the protocol buffer compiler. DO NOT EDIT! - -using pb = global::Google.ProtocolBuffers; -using pbc = global::Google.ProtocolBuffers.Collections; -using pbd = global::Google.ProtocolBuffers.Descriptors; -using scg = global::System.Collections.Generic; -namespace Sirikata.PB._PBJ_Internal { - - public static partial class Test { - - #region Extension registration - public static void RegisterAllExtensions(pb::ExtensionRegistry registry) { - registry.Add(global::Sirikata.PB._PBJ_Internal.Test.Extensionbbox); - registry.Add(global::Sirikata.PB._PBJ_Internal.Test.Extensionvector); - } - #endregion - #region Extensions - public const int ExtensionbboxFieldNumber = 100; - public static pb::GeneratedExtensionBase> Extensionbbox; - public const int ExtensionvectorFieldNumber = 101; - public static pb::GeneratedExtensionBase> Extensionvector; - #endregion - - #region Static variables - internal static pbd::MessageDescriptor internal__static_Sirikata_PB__PBJ_Internal_ExternalMessage__Descriptor; - internal static pb::FieldAccess.FieldAccessorTable internal__static_Sirikata_PB__PBJ_Internal_ExternalMessage__FieldAccessorTable; - internal static pbd::MessageDescriptor internal__static_Sirikata_PB__PBJ_Internal_ExternalMessage_SubMessage__Descriptor; - internal static pb::FieldAccess.FieldAccessorTable internal__static_Sirikata_PB__PBJ_Internal_ExternalMessage_SubMessage__FieldAccessorTable; - internal static pbd::MessageDescriptor internal__static_Sirikata_PB__PBJ_Internal_TestMessage__Descriptor; - internal static pb::FieldAccess.FieldAccessorTable internal__static_Sirikata_PB__PBJ_Internal_TestMessage__FieldAccessorTable; - internal static pbd::MessageDescriptor internal__static_Sirikata_PB__PBJ_Internal_TestMessage_SubMessage__Descriptor; - internal static pb::FieldAccess.FieldAccessorTable internal__static_Sirikata_PB__PBJ_Internal_TestMessage_SubMessage__FieldAccessorTable; - #endregion - #region Descriptor - public static pbd::FileDescriptor Descriptor { - get { return descriptor; } - } - private static pbd::FileDescriptor descriptor; - - static Test() { - byte[] descriptorData = global::System.Convert.FromBase64String( - "CgpUZXN0LnByb3RvEhlTaXJpa2F0YS5QQi5fUEJKX0ludGVybmFsIuwCCg9F" + - "eHRlcm5hbE1lc3NhZ2USFQoHaXNfdHJ1ZRgoIAEoCDoEdHJ1ZRIPCgN2MmYY" + - "AiADKAJCAhABEkYKB3N1Yl9tZXMYHiABKAsyNS5TaXJpa2F0YS5QQi5fUEJK" + - "X0ludGVybmFsLkV4dGVybmFsTWVzc2FnZS5TdWJNZXNzYWdlEkkKCnN1Ym1l" + - "c3NlcnMYHyADKAsyNS5TaXJpa2F0YS5QQi5fUEJKX0ludGVybmFsLkV4dGVy" + - "bmFsTWVzc2FnZS5TdWJNZXNzYWdlEgsKA3NoYRggIAEoDBIMCgRzaGFzGCEg" + - "AygMEg8KA3YzZhgEIAMoAkICEAESEAoEdjNmZhgFIAMoAkICEAEaYAoKU3Vi" + - "TWVzc2FnZRIPCgdzdWJ1dWlkGAEgASgMEhUKCXN1YnZlY3RvchgCIAMoAUIC" + - "EAESEwoLc3ViZHVyYXRpb24YAyABKBASFQoJc3Vibm9ybWFsGAQgAygCQgIQ" + - "ASLmCAoLVGVzdE1lc3NhZ2USEQoDeHhkGBQgASgBOgQxMC4zEgsKA3h4ZhgV" + - "IAEoAhINCgV4eHUzMhgWIAEoDRILCgN4eHMYFyABKAkSCwoDeHhiGBggASgM" + - "EgwKBHh4c3MYGSADKAkSDAoEeHhiYhgaIAMoDBIQCgR4eGZmGBsgAygCQgIQ" + - "ARIQCgR4eG5uGB0gAygCQgIQARIMCgR4eGZyGBwgAigCEg0KAW4YASADKAJC" + - "AhABEg8KA3YyZhgCIAMoAkICEAESDwoDdjJkGAMgAygBQgIQARIPCgN2M2YY" + - "BCADKAJCAhABEg8KA3YzZBgFIAMoAUICEAESDwoDdjRmGAYgAygCQgIQARIP" + - "CgN2NGQYByADKAFCAhABEg0KAXEYCCADKAJCAhABEgkKAXUYCSABKAwSCQoB" + - "YRgKIAEoAhIJCgF0GAsgASgGEgkKAWQYDCABKBASCwoDZjMyGA0gASgNEgsK" + - "A2Y2NBgOIAEoBBIPCgNic2YYDyADKAJCAhABEg8KA2JzZBgQIAMoAUICEAES" + - "DwoDYmJmGBEgAygCQgIQARIPCgNiYmQYEiADKAFCAhABEjoKA2UzMhgTIAEo" + - "DjItLlNpcmlrYXRhLlBCLl9QQkpfSW50ZXJuYWwuVGVzdE1lc3NhZ2UuRW51" + - "bTMyEkEKBnN1Ym1lcxgeIAEoCzIxLlNpcmlrYXRhLlBCLl9QQkpfSW50ZXJu" + - "YWwuVGVzdE1lc3NhZ2UuU3ViTWVzc2FnZRJFCgpzdWJtZXNzZXJzGB8gAygL" + - "MjEuU2lyaWthdGEuUEIuX1BCSl9JbnRlcm5hbC5UZXN0TWVzc2FnZS5TdWJN" + - "ZXNzYWdlEgsKA3NoYRggIAEoDBIMCgRzaGFzGCEgAygMEjoKBmV4dG1lcxgi" + - "IAEoCzIqLlNpcmlrYXRhLlBCLl9QQkpfSW50ZXJuYWwuRXh0ZXJuYWxNZXNz" + - "YWdlEj4KCmV4dG1lc3NlcnMYIyADKAsyKi5TaXJpa2F0YS5QQi5fUEJKX0lu" + - "dGVybmFsLkV4dGVybmFsTWVzc2FnZRI9CglleHRtZXNzZXIYJCACKAsyKi5T" + - "aXJpa2F0YS5QQi5fUEJKX0ludGVybmFsLkV4dGVybmFsTWVzc2FnZRpgCgpT" + - "dWJNZXNzYWdlEg8KB3N1YnV1aWQYASABKAwSFQoJc3VidmVjdG9yGAIgAygB" + - "QgIQARITCgtzdWJkdXJhdGlvbhgDIAEoEBIVCglzdWJub3JtYWwYBCADKAJC" + - "AhABIjUKCEZsYWdzZjMyEgwKCFVOSVZFUlNBEAASBgoCV0UQARIJCgVJTUFH" + - "RRACEggKBExPQ0EQAyI5CghGbGFnc2Y2NBINCglVTklWRVJTQUwQABIHCgNX" + - "RUIQARIKCgZJTUFHRVMQAhIJCgVMT0NBTBADIjsKBkVudW0zMhIOCgpVTklW" + - "RVJTQUwxEAASCAoEV0VCMRABEgsKB0lNQUdFUzEQAhIKCgZMT0NBTDEQAyoF" + - "CGQQyAE6QQoNZXh0ZW5zaW9uYmJveBImLlNpcmlrYXRhLlBCLl9QQkpfSW50" + - "ZXJuYWwuVGVzdE1lc3NhZ2UYZCADKAJCAhABOkMKD2V4dGVuc2lvbnZlY3Rv" + - "chImLlNpcmlrYXRhLlBCLl9QQkpfSW50ZXJuYWwuVGVzdE1lc3NhZ2UYZSAD" + - "KAJCAhAB"); - pbd::FileDescriptor.InternalDescriptorAssigner assigner = delegate(pbd::FileDescriptor root) { - descriptor = root; - internal__static_Sirikata_PB__PBJ_Internal_ExternalMessage__Descriptor = Descriptor.MessageTypes[0]; - internal__static_Sirikata_PB__PBJ_Internal_ExternalMessage__FieldAccessorTable = - new pb::FieldAccess.FieldAccessorTable(internal__static_Sirikata_PB__PBJ_Internal_ExternalMessage__Descriptor, - new string[] { "IsTrue", "V2F", "SubMes", "Submessers", "Sha", "Shas", "V3F", "V3Ff", }); - internal__static_Sirikata_PB__PBJ_Internal_ExternalMessage_SubMessage__Descriptor = internal__static_Sirikata_PB__PBJ_Internal_ExternalMessage__Descriptor.NestedTypes[0]; - internal__static_Sirikata_PB__PBJ_Internal_ExternalMessage_SubMessage__FieldAccessorTable = - new pb::FieldAccess.FieldAccessorTable(internal__static_Sirikata_PB__PBJ_Internal_ExternalMessage_SubMessage__Descriptor, - new string[] { "Subuuid", "Subvector", "Subduration", "Subnormal", }); - internal__static_Sirikata_PB__PBJ_Internal_TestMessage__Descriptor = Descriptor.MessageTypes[1]; - internal__static_Sirikata_PB__PBJ_Internal_TestMessage__FieldAccessorTable = - new pb::FieldAccess.FieldAccessorTable(internal__static_Sirikata_PB__PBJ_Internal_TestMessage__Descriptor, - new string[] { "Xxd", "Xxf", "Xxu32", "Xxs", "Xxb", "Xxss", "Xxbb", "Xxff", "Xxnn", "Xxfr", "N", "V2F", "V2D", "V3F", "V3D", "V4F", "V4D", "Q", "U", "A", "T", "D", "F32", "F64", "Bsf", "Bsd", "Bbf", "Bbd", "E32", "Submes", "Submessers", "Sha", "Shas", "Extmes", "Extmessers", "Extmesser", }); - internal__static_Sirikata_PB__PBJ_Internal_TestMessage_SubMessage__Descriptor = internal__static_Sirikata_PB__PBJ_Internal_TestMessage__Descriptor.NestedTypes[0]; - internal__static_Sirikata_PB__PBJ_Internal_TestMessage_SubMessage__FieldAccessorTable = - new pb::FieldAccess.FieldAccessorTable(internal__static_Sirikata_PB__PBJ_Internal_TestMessage_SubMessage__Descriptor, - new string[] { "Subuuid", "Subvector", "Subduration", "Subnormal", }); - global::Sirikata.PB._PBJ_Internal.Test.Extensionbbox = pb::GeneratedRepeatExtension.CreateInstance(global::Sirikata.PB._PBJ_Internal.Test.Descriptor.Extensions[0]); - global::Sirikata.PB._PBJ_Internal.Test.Extensionvector = pb::GeneratedRepeatExtension.CreateInstance(global::Sirikata.PB._PBJ_Internal.Test.Descriptor.Extensions[1]); - return null; - }; - pbd::FileDescriptor.InternalBuildGeneratedFileFrom(descriptorData, - new pbd::FileDescriptor[] { - }, assigner); - } - #endregion - - } - #region Messages - public sealed partial class ExternalMessage : pb::GeneratedMessage { - private static readonly ExternalMessage defaultInstance = new Builder().BuildPartial(); - public static ExternalMessage DefaultInstance { - get { return defaultInstance; } - } - - public override ExternalMessage DefaultInstanceForType { - get { return defaultInstance; } - } - - protected override ExternalMessage ThisMessage { - get { return this; } - } - - public static pbd::MessageDescriptor Descriptor { - get { return global::Sirikata.PB._PBJ_Internal.Test.internal__static_Sirikata_PB__PBJ_Internal_ExternalMessage__Descriptor; } - } - - protected override pb::FieldAccess.FieldAccessorTable InternalFieldAccessors { - get { return global::Sirikata.PB._PBJ_Internal.Test.internal__static_Sirikata_PB__PBJ_Internal_ExternalMessage__FieldAccessorTable; } - } - - #region Nested types - public static class Types { - public sealed partial class SubMessage : pb::GeneratedMessage { - private static readonly SubMessage defaultInstance = new Builder().BuildPartial(); - public static SubMessage DefaultInstance { - get { return defaultInstance; } - } - - public override SubMessage DefaultInstanceForType { - get { return defaultInstance; } - } - - protected override SubMessage ThisMessage { - get { return this; } - } - - public static pbd::MessageDescriptor Descriptor { - get { return global::Sirikata.PB._PBJ_Internal.Test.internal__static_Sirikata_PB__PBJ_Internal_ExternalMessage_SubMessage__Descriptor; } - } - - protected override pb::FieldAccess.FieldAccessorTable InternalFieldAccessors { - get { return global::Sirikata.PB._PBJ_Internal.Test.internal__static_Sirikata_PB__PBJ_Internal_ExternalMessage_SubMessage__FieldAccessorTable; } - } - - public const int SubuuidFieldNumber = 1; - private bool hasSubuuid; - private pb::ByteString subuuid_ = pb::ByteString.Empty; - public bool HasSubuuid { - get { return hasSubuuid; } - } - public pb::ByteString Subuuid { - get { return subuuid_; } - } - - public const int SubvectorFieldNumber = 2; - private int subvectorMemoizedSerializedSize; - private pbc::PopsicleList subvector_ = new pbc::PopsicleList(); - public scg::IList SubvectorList { - get { return pbc::Lists.AsReadOnly(subvector_); } - } - public int SubvectorCount { - get { return subvector_.Count; } - } - public double GetSubvector(int index) { - return subvector_[index]; - } - - public const int SubdurationFieldNumber = 3; - private bool hasSubduration; - private long subduration_ = 0; - public bool HasSubduration { - get { return hasSubduration; } - } - public long Subduration { - get { return subduration_; } - } - - public const int SubnormalFieldNumber = 4; - private int subnormalMemoizedSerializedSize; - private pbc::PopsicleList subnormal_ = new pbc::PopsicleList(); - public scg::IList SubnormalList { - get { return pbc::Lists.AsReadOnly(subnormal_); } - } - public int SubnormalCount { - get { return subnormal_.Count; } - } - public float GetSubnormal(int index) { - return subnormal_[index]; - } - - public override bool IsInitialized { - get { - return true; - } - } - - public override void WriteTo(pb::CodedOutputStream output) { - if (HasSubuuid) { - output.WriteBytes(1, Subuuid); - } - if (subvector_.Count > 0) { - output.WriteRawVarint32(18); - output.WriteRawVarint32((uint) subvectorMemoizedSerializedSize); - foreach (double element in subvector_) { - output.WriteDoubleNoTag(element); - } - } - if (HasSubduration) { - output.WriteSFixed64(3, Subduration); - } - if (subnormal_.Count > 0) { - output.WriteRawVarint32(34); - output.WriteRawVarint32((uint) subnormalMemoizedSerializedSize); - foreach (float element in subnormal_) { - output.WriteFloatNoTag(element); - } - } - UnknownFields.WriteTo(output); - } - - private int memoizedSerializedSize = -1; - public override int SerializedSize { - get { - int size = memoizedSerializedSize; - if (size != -1) return size; - - size = 0; - if (HasSubuuid) { - size += pb::CodedOutputStream.ComputeBytesSize(1, Subuuid); - } - { - int dataSize = 0; - dataSize = 8 * subvector_.Count; - size += dataSize; - if (subvector_.Count!=0) size += 1 + pb::CodedOutputStream.ComputeInt32SizeNoTag(dataSize); - subvectorMemoizedSerializedSize = dataSize; - } - if (HasSubduration) { - size += pb::CodedOutputStream.ComputeSFixed64Size(3, Subduration); - } - { - int dataSize = 0; - dataSize = 4 * subnormal_.Count; - size += dataSize; - if (subnormal_.Count!=0) size += 1 + pb::CodedOutputStream.ComputeInt32SizeNoTag(dataSize); - subnormalMemoizedSerializedSize = dataSize; - } - size += UnknownFields.SerializedSize; - memoizedSerializedSize = size; - return size; - } - } - - public static SubMessage ParseFrom(pb::ByteString data) { - return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); - } - public static SubMessage ParseFrom(pb::ByteString data, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); - } - public static SubMessage ParseFrom(byte[] data) { - return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); - } - public static SubMessage ParseFrom(byte[] data, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); - } - public static SubMessage ParseFrom(global::System.IO.Stream input) { - return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); - } - public static SubMessage ParseFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); - } - public static SubMessage ParseDelimitedFrom(global::System.IO.Stream input) { - return CreateBuilder().MergeDelimitedFrom(input).BuildParsed(); - } - public static SubMessage ParseDelimitedFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { - return CreateBuilder().MergeDelimitedFrom(input, extensionRegistry).BuildParsed(); - } - public static SubMessage ParseFrom(pb::CodedInputStream input) { - return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); - } - public static SubMessage ParseFrom(pb::CodedInputStream input, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); - } - public static Builder CreateBuilder() { return new Builder(); } - public override Builder ToBuilder() { return CreateBuilder(this); } - public override Builder CreateBuilderForType() { return new Builder(); } - public static Builder CreateBuilder(SubMessage prototype) { - return (Builder) new Builder().MergeFrom(prototype); - } - - public sealed partial class Builder : pb::GeneratedBuilder { - protected override Builder ThisBuilder { - get { return this; } - } - public Builder() {} - - SubMessage result = new SubMessage(); - - protected override SubMessage MessageBeingBuilt { - get { return result; } - } - - public override Builder Clear() { - result = new SubMessage(); - return this; - } - - public override Builder Clone() { - return new Builder().MergeFrom(result); - } - - public override pbd::MessageDescriptor DescriptorForType { - get { return global::Sirikata.PB._PBJ_Internal.ExternalMessage.Types.SubMessage.Descriptor; } - } - - public override SubMessage DefaultInstanceForType { - get { return global::Sirikata.PB._PBJ_Internal.ExternalMessage.Types.SubMessage.DefaultInstance; } - } - - public override SubMessage BuildPartial() { - if (result == null) { - throw new global::System.InvalidOperationException("build() has already been called on this Builder"); - } - result.subvector_.MakeReadOnly(); - result.subnormal_.MakeReadOnly(); - SubMessage returnMe = result; - result = null; - return returnMe; - } - - public override Builder MergeFrom(pb::IMessage other) { - if (other is SubMessage) { - return MergeFrom((SubMessage) other); - } else { - base.MergeFrom(other); - return this; - } - } - - public override Builder MergeFrom(SubMessage other) { - if (other == global::Sirikata.PB._PBJ_Internal.ExternalMessage.Types.SubMessage.DefaultInstance) return this; - if (other.HasSubuuid) { - Subuuid = other.Subuuid; - } - if (other.subvector_.Count != 0) { - base.AddRange(other.subvector_, result.subvector_); - } - if (other.HasSubduration) { - Subduration = other.Subduration; - } - if (other.subnormal_.Count != 0) { - base.AddRange(other.subnormal_, result.subnormal_); - } - this.MergeUnknownFields(other.UnknownFields); - return this; - } - - public override Builder MergeFrom(pb::CodedInputStream input) { - return MergeFrom(input, pb::ExtensionRegistry.Empty); - } - - public override Builder MergeFrom(pb::CodedInputStream input, pb::ExtensionRegistry extensionRegistry) { - pb::UnknownFieldSet.Builder unknownFields = null; - while (true) { - uint tag = input.ReadTag(); - switch (tag) { - case 0: { - if (unknownFields != null) { - this.UnknownFields = unknownFields.Build(); - } - return this; - } - default: { - if (pb::WireFormat.IsEndGroupTag(tag)) { - if (unknownFields != null) { - this.UnknownFields = unknownFields.Build(); - } - return this; - } - if (unknownFields == null) { - unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); - } - ParseUnknownField(input, unknownFields, extensionRegistry, tag); - break; - } - case 10: { - Subuuid = input.ReadBytes(); - break; - } - case 18: { - int length = input.ReadInt32(); - int limit = input.PushLimit(length); - while (!input.ReachedLimit) { - AddSubvector(input.ReadDouble()); - } - input.PopLimit(limit); - break; - } - case 25: { - Subduration = input.ReadSFixed64(); - break; - } - case 34: { - int length = input.ReadInt32(); - int limit = input.PushLimit(length); - while (!input.ReachedLimit) { - AddSubnormal(input.ReadFloat()); - } - input.PopLimit(limit); - break; - } - } - } - } - - - public bool HasSubuuid { - get { return result.HasSubuuid; } - } - public pb::ByteString Subuuid { - get { return result.Subuuid; } - set { SetSubuuid(value); } - } - public Builder SetSubuuid(pb::ByteString value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - result.hasSubuuid = true; - result.subuuid_ = value; - return this; - } - public Builder ClearSubuuid() { - result.hasSubuuid = false; - result.subuuid_ = pb::ByteString.Empty; - return this; - } - - public pbc::IPopsicleList SubvectorList { - get { return result.subvector_; } - } - public int SubvectorCount { - get { return result.SubvectorCount; } - } - public double GetSubvector(int index) { - return result.GetSubvector(index); - } - public Builder SetSubvector(int index, double value) { - result.subvector_[index] = value; - return this; - } - public Builder AddSubvector(double value) { - result.subvector_.Add(value); - return this; - } - public Builder AddRangeSubvector(scg::IEnumerable values) { - base.AddRange(values, result.subvector_); - return this; - } - public Builder ClearSubvector() { - result.subvector_.Clear(); - return this; - } - - public bool HasSubduration { - get { return result.HasSubduration; } - } - public long Subduration { - get { return result.Subduration; } - set { SetSubduration(value); } - } - public Builder SetSubduration(long value) { - result.hasSubduration = true; - result.subduration_ = value; - return this; - } - public Builder ClearSubduration() { - result.hasSubduration = false; - result.subduration_ = 0; - return this; - } - - public pbc::IPopsicleList SubnormalList { - get { return result.subnormal_; } - } - public int SubnormalCount { - get { return result.SubnormalCount; } - } - public float GetSubnormal(int index) { - return result.GetSubnormal(index); - } - public Builder SetSubnormal(int index, float value) { - result.subnormal_[index] = value; - return this; - } - public Builder AddSubnormal(float value) { - result.subnormal_.Add(value); - return this; - } - public Builder AddRangeSubnormal(scg::IEnumerable values) { - base.AddRange(values, result.subnormal_); - return this; - } - public Builder ClearSubnormal() { - result.subnormal_.Clear(); - return this; - } - } - static SubMessage() { - object.ReferenceEquals(global::Sirikata.PB._PBJ_Internal.Test.Descriptor, null); - } - } - - } - #endregion - - public const int IsTrueFieldNumber = 40; - private bool hasIsTrue; - private bool isTrue_ = true; - public bool HasIsTrue { - get { return hasIsTrue; } - } - public bool IsTrue { - get { return isTrue_; } - } - - public const int V2FFieldNumber = 2; - private int v2FMemoizedSerializedSize; - private pbc::PopsicleList v2F_ = new pbc::PopsicleList(); - public scg::IList V2FList { - get { return pbc::Lists.AsReadOnly(v2F_); } - } - public int V2FCount { - get { return v2F_.Count; } - } - public float GetV2F(int index) { - return v2F_[index]; - } - - public const int SubMesFieldNumber = 30; - private bool hasSubMes; - private global::Sirikata.PB._PBJ_Internal.ExternalMessage.Types.SubMessage subMes_ = global::Sirikata.PB._PBJ_Internal.ExternalMessage.Types.SubMessage.DefaultInstance; - public bool HasSubMes { - get { return hasSubMes; } - } - public global::Sirikata.PB._PBJ_Internal.ExternalMessage.Types.SubMessage SubMes { - get { return subMes_; } - } - - public const int SubmessersFieldNumber = 31; - private pbc::PopsicleList submessers_ = new pbc::PopsicleList(); - public scg::IList SubmessersList { - get { return submessers_; } - } - public int SubmessersCount { - get { return submessers_.Count; } - } - public global::Sirikata.PB._PBJ_Internal.ExternalMessage.Types.SubMessage GetSubmessers(int index) { - return submessers_[index]; - } - - public const int ShaFieldNumber = 32; - private bool hasSha; - private pb::ByteString sha_ = pb::ByteString.Empty; - public bool HasSha { - get { return hasSha; } - } - public pb::ByteString Sha { - get { return sha_; } - } - - public const int ShasFieldNumber = 33; - private pbc::PopsicleList shas_ = new pbc::PopsicleList(); - public scg::IList ShasList { - get { return pbc::Lists.AsReadOnly(shas_); } - } - public int ShasCount { - get { return shas_.Count; } - } - public pb::ByteString GetShas(int index) { - return shas_[index]; - } - - public const int V3FFieldNumber = 4; - private int v3FMemoizedSerializedSize; - private pbc::PopsicleList v3F_ = new pbc::PopsicleList(); - public scg::IList V3FList { - get { return pbc::Lists.AsReadOnly(v3F_); } - } - public int V3FCount { - get { return v3F_.Count; } - } - public float GetV3F(int index) { - return v3F_[index]; - } - - public const int V3FfFieldNumber = 5; - private int v3FfMemoizedSerializedSize; - private pbc::PopsicleList v3Ff_ = new pbc::PopsicleList(); - public scg::IList V3FfList { - get { return pbc::Lists.AsReadOnly(v3Ff_); } - } - public int V3FfCount { - get { return v3Ff_.Count; } - } - public float GetV3Ff(int index) { - return v3Ff_[index]; - } - - public override bool IsInitialized { - get { - return true; - } - } - - public override void WriteTo(pb::CodedOutputStream output) { - if (v2F_.Count > 0) { - output.WriteRawVarint32(18); - output.WriteRawVarint32((uint) v2FMemoizedSerializedSize); - foreach (float element in v2F_) { - output.WriteFloatNoTag(element); - } - } - if (v3F_.Count > 0) { - output.WriteRawVarint32(34); - output.WriteRawVarint32((uint) v3FMemoizedSerializedSize); - foreach (float element in v3F_) { - output.WriteFloatNoTag(element); - } - } - if (v3Ff_.Count > 0) { - output.WriteRawVarint32(42); - output.WriteRawVarint32((uint) v3FfMemoizedSerializedSize); - foreach (float element in v3Ff_) { - output.WriteFloatNoTag(element); - } - } - if (HasSubMes) { - output.WriteMessage(30, SubMes); - } - foreach (global::Sirikata.PB._PBJ_Internal.ExternalMessage.Types.SubMessage element in SubmessersList) { - output.WriteMessage(31, element); - } - if (HasSha) { - output.WriteBytes(32, Sha); - } - if (shas_.Count > 0) { - foreach (pb::ByteString element in shas_) { - output.WriteBytes(33, element); - } - } - if (HasIsTrue) { - output.WriteBool(40, IsTrue); - } - UnknownFields.WriteTo(output); - } - - private int memoizedSerializedSize = -1; - public override int SerializedSize { - get { - int size = memoizedSerializedSize; - if (size != -1) return size; - - size = 0; - if (HasIsTrue) { - size += pb::CodedOutputStream.ComputeBoolSize(40, IsTrue); - } - { - int dataSize = 0; - dataSize = 4 * v2F_.Count; - size += dataSize; - if (v2F_.Count!=0) size += 1 + pb::CodedOutputStream.ComputeInt32SizeNoTag(dataSize); - v2FMemoizedSerializedSize = dataSize; - } - if (HasSubMes) { - size += pb::CodedOutputStream.ComputeMessageSize(30, SubMes); - } - foreach (global::Sirikata.PB._PBJ_Internal.ExternalMessage.Types.SubMessage element in SubmessersList) { - size += pb::CodedOutputStream.ComputeMessageSize(31, element); - } - if (HasSha) { - size += pb::CodedOutputStream.ComputeBytesSize(32, Sha); - } - { - int dataSize = 0; - foreach (pb::ByteString element in ShasList) { - dataSize += pb::CodedOutputStream.ComputeBytesSizeNoTag(element); - } - size += dataSize; - size += 2 * shas_.Count; - } - { - int dataSize = 0; - dataSize = 4 * v3F_.Count; - size += dataSize; - if (v3F_.Count!=0) size += 1 + pb::CodedOutputStream.ComputeInt32SizeNoTag(dataSize); - v3FMemoizedSerializedSize = dataSize; - } - { - int dataSize = 0; - dataSize = 4 * v3Ff_.Count; - size += dataSize; - if (v3Ff_.Count!=0) size += 1 + pb::CodedOutputStream.ComputeInt32SizeNoTag(dataSize); - v3FfMemoizedSerializedSize = dataSize; - } - size += UnknownFields.SerializedSize; - memoizedSerializedSize = size; - return size; - } - } - - public static ExternalMessage ParseFrom(pb::ByteString data) { - return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); - } - public static ExternalMessage ParseFrom(pb::ByteString data, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); - } - public static ExternalMessage ParseFrom(byte[] data) { - return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); - } - public static ExternalMessage ParseFrom(byte[] data, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); - } - public static ExternalMessage ParseFrom(global::System.IO.Stream input) { - return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); - } - public static ExternalMessage ParseFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); - } - public static ExternalMessage ParseDelimitedFrom(global::System.IO.Stream input) { - return CreateBuilder().MergeDelimitedFrom(input).BuildParsed(); - } - public static ExternalMessage ParseDelimitedFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { - return CreateBuilder().MergeDelimitedFrom(input, extensionRegistry).BuildParsed(); - } - public static ExternalMessage ParseFrom(pb::CodedInputStream input) { - return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); - } - public static ExternalMessage ParseFrom(pb::CodedInputStream input, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); - } - public static Builder CreateBuilder() { return new Builder(); } - public override Builder ToBuilder() { return CreateBuilder(this); } - public override Builder CreateBuilderForType() { return new Builder(); } - public static Builder CreateBuilder(ExternalMessage prototype) { - return (Builder) new Builder().MergeFrom(prototype); - } - - public sealed partial class Builder : pb::GeneratedBuilder { - protected override Builder ThisBuilder { - get { return this; } - } - public Builder() {} - - ExternalMessage result = new ExternalMessage(); - - protected override ExternalMessage MessageBeingBuilt { - get { return result; } - } - - public override Builder Clear() { - result = new ExternalMessage(); - return this; - } - - public override Builder Clone() { - return new Builder().MergeFrom(result); - } - - public override pbd::MessageDescriptor DescriptorForType { - get { return global::Sirikata.PB._PBJ_Internal.ExternalMessage.Descriptor; } - } - - public override ExternalMessage DefaultInstanceForType { - get { return global::Sirikata.PB._PBJ_Internal.ExternalMessage.DefaultInstance; } - } - - public override ExternalMessage BuildPartial() { - if (result == null) { - throw new global::System.InvalidOperationException("build() has already been called on this Builder"); - } - result.v2F_.MakeReadOnly(); - result.submessers_.MakeReadOnly(); - result.shas_.MakeReadOnly(); - result.v3F_.MakeReadOnly(); - result.v3Ff_.MakeReadOnly(); - ExternalMessage returnMe = result; - result = null; - return returnMe; - } - - public override Builder MergeFrom(pb::IMessage other) { - if (other is ExternalMessage) { - return MergeFrom((ExternalMessage) other); - } else { - base.MergeFrom(other); - return this; - } - } - - public override Builder MergeFrom(ExternalMessage other) { - if (other == global::Sirikata.PB._PBJ_Internal.ExternalMessage.DefaultInstance) return this; - if (other.HasIsTrue) { - IsTrue = other.IsTrue; - } - if (other.v2F_.Count != 0) { - base.AddRange(other.v2F_, result.v2F_); - } - if (other.HasSubMes) { - MergeSubMes(other.SubMes); - } - if (other.submessers_.Count != 0) { - base.AddRange(other.submessers_, result.submessers_); - } - if (other.HasSha) { - Sha = other.Sha; - } - if (other.shas_.Count != 0) { - base.AddRange(other.shas_, result.shas_); - } - if (other.v3F_.Count != 0) { - base.AddRange(other.v3F_, result.v3F_); - } - if (other.v3Ff_.Count != 0) { - base.AddRange(other.v3Ff_, result.v3Ff_); - } - this.MergeUnknownFields(other.UnknownFields); - return this; - } - - public override Builder MergeFrom(pb::CodedInputStream input) { - return MergeFrom(input, pb::ExtensionRegistry.Empty); - } - - public override Builder MergeFrom(pb::CodedInputStream input, pb::ExtensionRegistry extensionRegistry) { - pb::UnknownFieldSet.Builder unknownFields = null; - while (true) { - uint tag = input.ReadTag(); - switch (tag) { - case 0: { - if (unknownFields != null) { - this.UnknownFields = unknownFields.Build(); - } - return this; - } - default: { - if (pb::WireFormat.IsEndGroupTag(tag)) { - if (unknownFields != null) { - this.UnknownFields = unknownFields.Build(); - } - return this; - } - if (unknownFields == null) { - unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); - } - ParseUnknownField(input, unknownFields, extensionRegistry, tag); - break; - } - case 18: { - int length = input.ReadInt32(); - int limit = input.PushLimit(length); - while (!input.ReachedLimit) { - AddV2F(input.ReadFloat()); - } - input.PopLimit(limit); - break; - } - case 34: { - int length = input.ReadInt32(); - int limit = input.PushLimit(length); - while (!input.ReachedLimit) { - AddV3F(input.ReadFloat()); - } - input.PopLimit(limit); - break; - } - case 42: { - int length = input.ReadInt32(); - int limit = input.PushLimit(length); - while (!input.ReachedLimit) { - AddV3Ff(input.ReadFloat()); - } - input.PopLimit(limit); - break; - } - case 242: { - global::Sirikata.PB._PBJ_Internal.ExternalMessage.Types.SubMessage.Builder subBuilder = global::Sirikata.PB._PBJ_Internal.ExternalMessage.Types.SubMessage.CreateBuilder(); - if (HasSubMes) { - subBuilder.MergeFrom(SubMes); - } - input.ReadMessage(subBuilder, extensionRegistry); - SubMes = subBuilder.BuildPartial(); - break; - } - case 250: { - global::Sirikata.PB._PBJ_Internal.ExternalMessage.Types.SubMessage.Builder subBuilder = global::Sirikata.PB._PBJ_Internal.ExternalMessage.Types.SubMessage.CreateBuilder(); - input.ReadMessage(subBuilder, extensionRegistry); - AddSubmessers(subBuilder.BuildPartial()); - break; - } - case 258: { - Sha = input.ReadBytes(); - break; - } - case 266: { - AddShas(input.ReadBytes()); - break; - } - case 320: { - IsTrue = input.ReadBool(); - break; - } - } - } - } - - - public bool HasIsTrue { - get { return result.HasIsTrue; } - } - public bool IsTrue { - get { return result.IsTrue; } - set { SetIsTrue(value); } - } - public Builder SetIsTrue(bool value) { - result.hasIsTrue = true; - result.isTrue_ = value; - return this; - } - public Builder ClearIsTrue() { - result.hasIsTrue = false; - result.isTrue_ = true; - return this; - } - - public pbc::IPopsicleList V2FList { - get { return result.v2F_; } - } - public int V2FCount { - get { return result.V2FCount; } - } - public float GetV2F(int index) { - return result.GetV2F(index); - } - public Builder SetV2F(int index, float value) { - result.v2F_[index] = value; - return this; - } - public Builder AddV2F(float value) { - result.v2F_.Add(value); - return this; - } - public Builder AddRangeV2F(scg::IEnumerable values) { - base.AddRange(values, result.v2F_); - return this; - } - public Builder ClearV2F() { - result.v2F_.Clear(); - return this; - } - - public bool HasSubMes { - get { return result.HasSubMes; } - } - public global::Sirikata.PB._PBJ_Internal.ExternalMessage.Types.SubMessage SubMes { - get { return result.SubMes; } - set { SetSubMes(value); } - } - public Builder SetSubMes(global::Sirikata.PB._PBJ_Internal.ExternalMessage.Types.SubMessage value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - result.hasSubMes = true; - result.subMes_ = value; - return this; - } - public Builder SetSubMes(global::Sirikata.PB._PBJ_Internal.ExternalMessage.Types.SubMessage.Builder builderForValue) { - pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); - result.hasSubMes = true; - result.subMes_ = builderForValue.Build(); - return this; - } - public Builder MergeSubMes(global::Sirikata.PB._PBJ_Internal.ExternalMessage.Types.SubMessage value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - if (result.HasSubMes && - result.subMes_ != global::Sirikata.PB._PBJ_Internal.ExternalMessage.Types.SubMessage.DefaultInstance) { - result.subMes_ = global::Sirikata.PB._PBJ_Internal.ExternalMessage.Types.SubMessage.CreateBuilder(result.subMes_).MergeFrom(value).BuildPartial(); - } else { - result.subMes_ = value; - } - result.hasSubMes = true; - return this; - } - public Builder ClearSubMes() { - result.hasSubMes = false; - result.subMes_ = global::Sirikata.PB._PBJ_Internal.ExternalMessage.Types.SubMessage.DefaultInstance; - return this; - } - - public pbc::IPopsicleList SubmessersList { - get { return result.submessers_; } - } - public int SubmessersCount { - get { return result.SubmessersCount; } - } - public global::Sirikata.PB._PBJ_Internal.ExternalMessage.Types.SubMessage GetSubmessers(int index) { - return result.GetSubmessers(index); - } - public Builder SetSubmessers(int index, global::Sirikata.PB._PBJ_Internal.ExternalMessage.Types.SubMessage value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - result.submessers_[index] = value; - return this; - } - public Builder SetSubmessers(int index, global::Sirikata.PB._PBJ_Internal.ExternalMessage.Types.SubMessage.Builder builderForValue) { - pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); - result.submessers_[index] = builderForValue.Build(); - return this; - } - public Builder AddSubmessers(global::Sirikata.PB._PBJ_Internal.ExternalMessage.Types.SubMessage value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - result.submessers_.Add(value); - return this; - } - public Builder AddSubmessers(global::Sirikata.PB._PBJ_Internal.ExternalMessage.Types.SubMessage.Builder builderForValue) { - pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); - result.submessers_.Add(builderForValue.Build()); - return this; - } - public Builder AddRangeSubmessers(scg::IEnumerable values) { - base.AddRange(values, result.submessers_); - return this; - } - public Builder ClearSubmessers() { - result.submessers_.Clear(); - return this; - } - - public bool HasSha { - get { return result.HasSha; } - } - public pb::ByteString Sha { - get { return result.Sha; } - set { SetSha(value); } - } - public Builder SetSha(pb::ByteString value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - result.hasSha = true; - result.sha_ = value; - return this; - } - public Builder ClearSha() { - result.hasSha = false; - result.sha_ = pb::ByteString.Empty; - return this; - } - - public pbc::IPopsicleList ShasList { - get { return result.shas_; } - } - public int ShasCount { - get { return result.ShasCount; } - } - public pb::ByteString GetShas(int index) { - return result.GetShas(index); - } - public Builder SetShas(int index, pb::ByteString value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - result.shas_[index] = value; - return this; - } - public Builder AddShas(pb::ByteString value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - result.shas_.Add(value); - return this; - } - public Builder AddRangeShas(scg::IEnumerable values) { - base.AddRange(values, result.shas_); - return this; - } - public Builder ClearShas() { - result.shas_.Clear(); - return this; - } - - public pbc::IPopsicleList V3FList { - get { return result.v3F_; } - } - public int V3FCount { - get { return result.V3FCount; } - } - public float GetV3F(int index) { - return result.GetV3F(index); - } - public Builder SetV3F(int index, float value) { - result.v3F_[index] = value; - return this; - } - public Builder AddV3F(float value) { - result.v3F_.Add(value); - return this; - } - public Builder AddRangeV3F(scg::IEnumerable values) { - base.AddRange(values, result.v3F_); - return this; - } - public Builder ClearV3F() { - result.v3F_.Clear(); - return this; - } - - public pbc::IPopsicleList V3FfList { - get { return result.v3Ff_; } - } - public int V3FfCount { - get { return result.V3FfCount; } - } - public float GetV3Ff(int index) { - return result.GetV3Ff(index); - } - public Builder SetV3Ff(int index, float value) { - result.v3Ff_[index] = value; - return this; - } - public Builder AddV3Ff(float value) { - result.v3Ff_.Add(value); - return this; - } - public Builder AddRangeV3Ff(scg::IEnumerable values) { - base.AddRange(values, result.v3Ff_); - return this; - } - public Builder ClearV3Ff() { - result.v3Ff_.Clear(); - return this; - } - } - static ExternalMessage() { - object.ReferenceEquals(global::Sirikata.PB._PBJ_Internal.Test.Descriptor, null); - } - } - - public sealed partial class TestMessage : pb::ExtendableMessage { - private static readonly TestMessage defaultInstance = new Builder().BuildPartial(); - public static TestMessage DefaultInstance { - get { return defaultInstance; } - } - - public override TestMessage DefaultInstanceForType { - get { return defaultInstance; } - } - - protected override TestMessage ThisMessage { - get { return this; } - } - - public static pbd::MessageDescriptor Descriptor { - get { return global::Sirikata.PB._PBJ_Internal.Test.internal__static_Sirikata_PB__PBJ_Internal_TestMessage__Descriptor; } - } - - protected override pb::FieldAccess.FieldAccessorTable InternalFieldAccessors { - get { return global::Sirikata.PB._PBJ_Internal.Test.internal__static_Sirikata_PB__PBJ_Internal_TestMessage__FieldAccessorTable; } - } - - #region Nested types - public static class Types { - public enum Flagsf32 { - UNIVERSA = 0, - WE = 1, - IMAGE = 2, - LOCA = 3, - } - - public enum Flagsf64 { - UNIVERSAL = 0, - WEB = 1, - IMAGES = 2, - LOCAL = 3, - } - - public enum Enum32 { - UNIVERSAL1 = 0, - WEB1 = 1, - IMAGES1 = 2, - LOCAL1 = 3, - } - - public sealed partial class SubMessage : pb::GeneratedMessage { - private static readonly SubMessage defaultInstance = new Builder().BuildPartial(); - public static SubMessage DefaultInstance { - get { return defaultInstance; } - } - - public override SubMessage DefaultInstanceForType { - get { return defaultInstance; } - } - - protected override SubMessage ThisMessage { - get { return this; } - } - - public static pbd::MessageDescriptor Descriptor { - get { return global::Sirikata.PB._PBJ_Internal.Test.internal__static_Sirikata_PB__PBJ_Internal_TestMessage_SubMessage__Descriptor; } - } - - protected override pb::FieldAccess.FieldAccessorTable InternalFieldAccessors { - get { return global::Sirikata.PB._PBJ_Internal.Test.internal__static_Sirikata_PB__PBJ_Internal_TestMessage_SubMessage__FieldAccessorTable; } - } - - public const int SubuuidFieldNumber = 1; - private bool hasSubuuid; - private pb::ByteString subuuid_ = pb::ByteString.Empty; - public bool HasSubuuid { - get { return hasSubuuid; } - } - public pb::ByteString Subuuid { - get { return subuuid_; } - } - - public const int SubvectorFieldNumber = 2; - private int subvectorMemoizedSerializedSize; - private pbc::PopsicleList subvector_ = new pbc::PopsicleList(); - public scg::IList SubvectorList { - get { return pbc::Lists.AsReadOnly(subvector_); } - } - public int SubvectorCount { - get { return subvector_.Count; } - } - public double GetSubvector(int index) { - return subvector_[index]; - } - - public const int SubdurationFieldNumber = 3; - private bool hasSubduration; - private long subduration_ = 0; - public bool HasSubduration { - get { return hasSubduration; } - } - public long Subduration { - get { return subduration_; } - } - - public const int SubnormalFieldNumber = 4; - private int subnormalMemoizedSerializedSize; - private pbc::PopsicleList subnormal_ = new pbc::PopsicleList(); - public scg::IList SubnormalList { - get { return pbc::Lists.AsReadOnly(subnormal_); } - } - public int SubnormalCount { - get { return subnormal_.Count; } - } - public float GetSubnormal(int index) { - return subnormal_[index]; - } - - public override bool IsInitialized { - get { - return true; - } - } - - public override void WriteTo(pb::CodedOutputStream output) { - if (HasSubuuid) { - output.WriteBytes(1, Subuuid); - } - if (subvector_.Count > 0) { - output.WriteRawVarint32(18); - output.WriteRawVarint32((uint) subvectorMemoizedSerializedSize); - foreach (double element in subvector_) { - output.WriteDoubleNoTag(element); - } - } - if (HasSubduration) { - output.WriteSFixed64(3, Subduration); - } - if (subnormal_.Count > 0) { - output.WriteRawVarint32(34); - output.WriteRawVarint32((uint) subnormalMemoizedSerializedSize); - foreach (float element in subnormal_) { - output.WriteFloatNoTag(element); - } - } - UnknownFields.WriteTo(output); - } - - private int memoizedSerializedSize = -1; - public override int SerializedSize { - get { - int size = memoizedSerializedSize; - if (size != -1) return size; - - size = 0; - if (HasSubuuid) { - size += pb::CodedOutputStream.ComputeBytesSize(1, Subuuid); - } - { - int dataSize = 0; - dataSize = 8 * subvector_.Count; - size += dataSize; - if (subvector_.Count!=0) size += 1 + pb::CodedOutputStream.ComputeInt32SizeNoTag(dataSize); - subvectorMemoizedSerializedSize = dataSize; - } - if (HasSubduration) { - size += pb::CodedOutputStream.ComputeSFixed64Size(3, Subduration); - } - { - int dataSize = 0; - dataSize = 4 * subnormal_.Count; - size += dataSize; - if (subnormal_.Count!=0) size += 1 + pb::CodedOutputStream.ComputeInt32SizeNoTag(dataSize); - subnormalMemoizedSerializedSize = dataSize; - } - size += UnknownFields.SerializedSize; - memoizedSerializedSize = size; - return size; - } - } - - public static SubMessage ParseFrom(pb::ByteString data) { - return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); - } - public static SubMessage ParseFrom(pb::ByteString data, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); - } - public static SubMessage ParseFrom(byte[] data) { - return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); - } - public static SubMessage ParseFrom(byte[] data, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); - } - public static SubMessage ParseFrom(global::System.IO.Stream input) { - return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); - } - public static SubMessage ParseFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); - } - public static SubMessage ParseDelimitedFrom(global::System.IO.Stream input) { - return CreateBuilder().MergeDelimitedFrom(input).BuildParsed(); - } - public static SubMessage ParseDelimitedFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { - return CreateBuilder().MergeDelimitedFrom(input, extensionRegistry).BuildParsed(); - } - public static SubMessage ParseFrom(pb::CodedInputStream input) { - return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); - } - public static SubMessage ParseFrom(pb::CodedInputStream input, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); - } - public static Builder CreateBuilder() { return new Builder(); } - public override Builder ToBuilder() { return CreateBuilder(this); } - public override Builder CreateBuilderForType() { return new Builder(); } - public static Builder CreateBuilder(SubMessage prototype) { - return (Builder) new Builder().MergeFrom(prototype); - } - - public sealed partial class Builder : pb::GeneratedBuilder { - protected override Builder ThisBuilder { - get { return this; } - } - public Builder() {} - - SubMessage result = new SubMessage(); - - protected override SubMessage MessageBeingBuilt { - get { return result; } - } - - public override Builder Clear() { - result = new SubMessage(); - return this; - } - - public override Builder Clone() { - return new Builder().MergeFrom(result); - } - - public override pbd::MessageDescriptor DescriptorForType { - get { return global::Sirikata.PB._PBJ_Internal.TestMessage.Types.SubMessage.Descriptor; } - } - - public override SubMessage DefaultInstanceForType { - get { return global::Sirikata.PB._PBJ_Internal.TestMessage.Types.SubMessage.DefaultInstance; } - } - - public override SubMessage BuildPartial() { - if (result == null) { - throw new global::System.InvalidOperationException("build() has already been called on this Builder"); - } - result.subvector_.MakeReadOnly(); - result.subnormal_.MakeReadOnly(); - SubMessage returnMe = result; - result = null; - return returnMe; - } - - public override Builder MergeFrom(pb::IMessage other) { - if (other is SubMessage) { - return MergeFrom((SubMessage) other); - } else { - base.MergeFrom(other); - return this; - } - } - - public override Builder MergeFrom(SubMessage other) { - if (other == global::Sirikata.PB._PBJ_Internal.TestMessage.Types.SubMessage.DefaultInstance) return this; - if (other.HasSubuuid) { - Subuuid = other.Subuuid; - } - if (other.subvector_.Count != 0) { - base.AddRange(other.subvector_, result.subvector_); - } - if (other.HasSubduration) { - Subduration = other.Subduration; - } - if (other.subnormal_.Count != 0) { - base.AddRange(other.subnormal_, result.subnormal_); - } - this.MergeUnknownFields(other.UnknownFields); - return this; - } - - public override Builder MergeFrom(pb::CodedInputStream input) { - return MergeFrom(input, pb::ExtensionRegistry.Empty); - } - - public override Builder MergeFrom(pb::CodedInputStream input, pb::ExtensionRegistry extensionRegistry) { - pb::UnknownFieldSet.Builder unknownFields = null; - while (true) { - uint tag = input.ReadTag(); - switch (tag) { - case 0: { - if (unknownFields != null) { - this.UnknownFields = unknownFields.Build(); - } - return this; - } - default: { - if (pb::WireFormat.IsEndGroupTag(tag)) { - if (unknownFields != null) { - this.UnknownFields = unknownFields.Build(); - } - return this; - } - if (unknownFields == null) { - unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); - } - ParseUnknownField(input, unknownFields, extensionRegistry, tag); - break; - } - case 10: { - Subuuid = input.ReadBytes(); - break; - } - case 18: { - int length = input.ReadInt32(); - int limit = input.PushLimit(length); - while (!input.ReachedLimit) { - AddSubvector(input.ReadDouble()); - } - input.PopLimit(limit); - break; - } - case 25: { - Subduration = input.ReadSFixed64(); - break; - } - case 34: { - int length = input.ReadInt32(); - int limit = input.PushLimit(length); - while (!input.ReachedLimit) { - AddSubnormal(input.ReadFloat()); - } - input.PopLimit(limit); - break; - } - } - } - } - - - public bool HasSubuuid { - get { return result.HasSubuuid; } - } - public pb::ByteString Subuuid { - get { return result.Subuuid; } - set { SetSubuuid(value); } - } - public Builder SetSubuuid(pb::ByteString value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - result.hasSubuuid = true; - result.subuuid_ = value; - return this; - } - public Builder ClearSubuuid() { - result.hasSubuuid = false; - result.subuuid_ = pb::ByteString.Empty; - return this; - } - - public pbc::IPopsicleList SubvectorList { - get { return result.subvector_; } - } - public int SubvectorCount { - get { return result.SubvectorCount; } - } - public double GetSubvector(int index) { - return result.GetSubvector(index); - } - public Builder SetSubvector(int index, double value) { - result.subvector_[index] = value; - return this; - } - public Builder AddSubvector(double value) { - result.subvector_.Add(value); - return this; - } - public Builder AddRangeSubvector(scg::IEnumerable values) { - base.AddRange(values, result.subvector_); - return this; - } - public Builder ClearSubvector() { - result.subvector_.Clear(); - return this; - } - - public bool HasSubduration { - get { return result.HasSubduration; } - } - public long Subduration { - get { return result.Subduration; } - set { SetSubduration(value); } - } - public Builder SetSubduration(long value) { - result.hasSubduration = true; - result.subduration_ = value; - return this; - } - public Builder ClearSubduration() { - result.hasSubduration = false; - result.subduration_ = 0; - return this; - } - - public pbc::IPopsicleList SubnormalList { - get { return result.subnormal_; } - } - public int SubnormalCount { - get { return result.SubnormalCount; } - } - public float GetSubnormal(int index) { - return result.GetSubnormal(index); - } - public Builder SetSubnormal(int index, float value) { - result.subnormal_[index] = value; - return this; - } - public Builder AddSubnormal(float value) { - result.subnormal_.Add(value); - return this; - } - public Builder AddRangeSubnormal(scg::IEnumerable values) { - base.AddRange(values, result.subnormal_); - return this; - } - public Builder ClearSubnormal() { - result.subnormal_.Clear(); - return this; - } - } - static SubMessage() { - object.ReferenceEquals(global::Sirikata.PB._PBJ_Internal.Test.Descriptor, null); - } - } - - } - #endregion - - public const int XxdFieldNumber = 20; - private bool hasXxd; - private double xxd_ = 10.3D; - public bool HasXxd { - get { return hasXxd; } - } - public double Xxd { - get { return xxd_; } - } - - public const int XxfFieldNumber = 21; - private bool hasXxf; - private float xxf_ = 0F; - public bool HasXxf { - get { return hasXxf; } - } - public float Xxf { - get { return xxf_; } - } - - public const int Xxu32FieldNumber = 22; - private bool hasXxu32; - private uint xxu32_ = 0; - public bool HasXxu32 { - get { return hasXxu32; } - } - [global::System.CLSCompliant(false)] - public uint Xxu32 { - get { return xxu32_; } - } - - public const int XxsFieldNumber = 23; - private bool hasXxs; - private string xxs_ = ""; - public bool HasXxs { - get { return hasXxs; } - } - public string Xxs { - get { return xxs_; } - } - - public const int XxbFieldNumber = 24; - private bool hasXxb; - private pb::ByteString xxb_ = pb::ByteString.Empty; - public bool HasXxb { - get { return hasXxb; } - } - public pb::ByteString Xxb { - get { return xxb_; } - } - - public const int XxssFieldNumber = 25; - private pbc::PopsicleList xxss_ = new pbc::PopsicleList(); - public scg::IList XxssList { - get { return pbc::Lists.AsReadOnly(xxss_); } - } - public int XxssCount { - get { return xxss_.Count; } - } - public string GetXxss(int index) { - return xxss_[index]; - } - - public const int XxbbFieldNumber = 26; - private pbc::PopsicleList xxbb_ = new pbc::PopsicleList(); - public scg::IList XxbbList { - get { return pbc::Lists.AsReadOnly(xxbb_); } - } - public int XxbbCount { - get { return xxbb_.Count; } - } - public pb::ByteString GetXxbb(int index) { - return xxbb_[index]; - } - - public const int XxffFieldNumber = 27; - private int xxffMemoizedSerializedSize; - private pbc::PopsicleList xxff_ = new pbc::PopsicleList(); - public scg::IList XxffList { - get { return pbc::Lists.AsReadOnly(xxff_); } - } - public int XxffCount { - get { return xxff_.Count; } - } - public float GetXxff(int index) { - return xxff_[index]; - } - - public const int XxnnFieldNumber = 29; - private int xxnnMemoizedSerializedSize; - private pbc::PopsicleList xxnn_ = new pbc::PopsicleList(); - public scg::IList XxnnList { - get { return pbc::Lists.AsReadOnly(xxnn_); } - } - public int XxnnCount { - get { return xxnn_.Count; } - } - public float GetXxnn(int index) { - return xxnn_[index]; - } - - public const int XxfrFieldNumber = 28; - private bool hasXxfr; - private float xxfr_ = 0F; - public bool HasXxfr { - get { return hasXxfr; } - } - public float Xxfr { - get { return xxfr_; } - } - - public const int NFieldNumber = 1; - private int nMemoizedSerializedSize; - private pbc::PopsicleList n_ = new pbc::PopsicleList(); - public scg::IList NList { - get { return pbc::Lists.AsReadOnly(n_); } - } - public int NCount { - get { return n_.Count; } - } - public float GetN(int index) { - return n_[index]; - } - - public const int V2FFieldNumber = 2; - private int v2FMemoizedSerializedSize; - private pbc::PopsicleList v2F_ = new pbc::PopsicleList(); - public scg::IList V2FList { - get { return pbc::Lists.AsReadOnly(v2F_); } - } - public int V2FCount { - get { return v2F_.Count; } - } - public float GetV2F(int index) { - return v2F_[index]; - } - - public const int V2DFieldNumber = 3; - private int v2DMemoizedSerializedSize; - private pbc::PopsicleList v2D_ = new pbc::PopsicleList(); - public scg::IList V2DList { - get { return pbc::Lists.AsReadOnly(v2D_); } - } - public int V2DCount { - get { return v2D_.Count; } - } - public double GetV2D(int index) { - return v2D_[index]; - } - - public const int V3FFieldNumber = 4; - private int v3FMemoizedSerializedSize; - private pbc::PopsicleList v3F_ = new pbc::PopsicleList(); - public scg::IList V3FList { - get { return pbc::Lists.AsReadOnly(v3F_); } - } - public int V3FCount { - get { return v3F_.Count; } - } - public float GetV3F(int index) { - return v3F_[index]; - } - - public const int V3DFieldNumber = 5; - private int v3DMemoizedSerializedSize; - private pbc::PopsicleList v3D_ = new pbc::PopsicleList(); - public scg::IList V3DList { - get { return pbc::Lists.AsReadOnly(v3D_); } - } - public int V3DCount { - get { return v3D_.Count; } - } - public double GetV3D(int index) { - return v3D_[index]; - } - - public const int V4FFieldNumber = 6; - private int v4FMemoizedSerializedSize; - private pbc::PopsicleList v4F_ = new pbc::PopsicleList(); - public scg::IList V4FList { - get { return pbc::Lists.AsReadOnly(v4F_); } - } - public int V4FCount { - get { return v4F_.Count; } - } - public float GetV4F(int index) { - return v4F_[index]; - } - - public const int V4DFieldNumber = 7; - private int v4DMemoizedSerializedSize; - private pbc::PopsicleList v4D_ = new pbc::PopsicleList(); - public scg::IList V4DList { - get { return pbc::Lists.AsReadOnly(v4D_); } - } - public int V4DCount { - get { return v4D_.Count; } - } - public double GetV4D(int index) { - return v4D_[index]; - } - - public const int QFieldNumber = 8; - private int qMemoizedSerializedSize; - private pbc::PopsicleList q_ = new pbc::PopsicleList(); - public scg::IList QList { - get { return pbc::Lists.AsReadOnly(q_); } - } - public int QCount { - get { return q_.Count; } - } - public float GetQ(int index) { - return q_[index]; - } - - public const int UFieldNumber = 9; - private bool hasU; - private pb::ByteString u_ = pb::ByteString.Empty; - public bool HasU { - get { return hasU; } - } - public pb::ByteString U { - get { return u_; } - } - - public const int AFieldNumber = 10; - private bool hasA; - private float a_ = 0F; - public bool HasA { - get { return hasA; } - } - public float A { - get { return a_; } - } - - public const int TFieldNumber = 11; - private bool hasT; - private ulong t_ = 0; - public bool HasT { - get { return hasT; } - } - [global::System.CLSCompliant(false)] - public ulong T { - get { return t_; } - } - - public const int DFieldNumber = 12; - private bool hasD; - private long d_ = 0; - public bool HasD { - get { return hasD; } - } - public long D { - get { return d_; } - } - - public const int F32FieldNumber = 13; - private bool hasF32; - private uint f32_ = 0; - public bool HasF32 { - get { return hasF32; } - } - [global::System.CLSCompliant(false)] - public uint F32 { - get { return f32_; } - } - - public const int F64FieldNumber = 14; - private bool hasF64; - private ulong f64_ = 0UL; - public bool HasF64 { - get { return hasF64; } - } - [global::System.CLSCompliant(false)] - public ulong F64 { - get { return f64_; } - } - - public const int BsfFieldNumber = 15; - private int bsfMemoizedSerializedSize; - private pbc::PopsicleList bsf_ = new pbc::PopsicleList(); - public scg::IList BsfList { - get { return pbc::Lists.AsReadOnly(bsf_); } - } - public int BsfCount { - get { return bsf_.Count; } - } - public float GetBsf(int index) { - return bsf_[index]; - } - - public const int BsdFieldNumber = 16; - private int bsdMemoizedSerializedSize; - private pbc::PopsicleList bsd_ = new pbc::PopsicleList(); - public scg::IList BsdList { - get { return pbc::Lists.AsReadOnly(bsd_); } - } - public int BsdCount { - get { return bsd_.Count; } - } - public double GetBsd(int index) { - return bsd_[index]; - } - - public const int BbfFieldNumber = 17; - private int bbfMemoizedSerializedSize; - private pbc::PopsicleList bbf_ = new pbc::PopsicleList(); - public scg::IList BbfList { - get { return pbc::Lists.AsReadOnly(bbf_); } - } - public int BbfCount { - get { return bbf_.Count; } - } - public float GetBbf(int index) { - return bbf_[index]; - } - - public const int BbdFieldNumber = 18; - private int bbdMemoizedSerializedSize; - private pbc::PopsicleList bbd_ = new pbc::PopsicleList(); - public scg::IList BbdList { - get { return pbc::Lists.AsReadOnly(bbd_); } - } - public int BbdCount { - get { return bbd_.Count; } - } - public double GetBbd(int index) { - return bbd_[index]; - } - - public const int E32FieldNumber = 19; - private bool hasE32; - private global::Sirikata.PB._PBJ_Internal.TestMessage.Types.Enum32 e32_ = global::Sirikata.PB._PBJ_Internal.TestMessage.Types.Enum32.UNIVERSAL1; - public bool HasE32 { - get { return hasE32; } - } - public global::Sirikata.PB._PBJ_Internal.TestMessage.Types.Enum32 E32 { - get { return e32_; } - } - - public const int SubmesFieldNumber = 30; - private bool hasSubmes; - private global::Sirikata.PB._PBJ_Internal.TestMessage.Types.SubMessage submes_ = global::Sirikata.PB._PBJ_Internal.TestMessage.Types.SubMessage.DefaultInstance; - public bool HasSubmes { - get { return hasSubmes; } - } - public global::Sirikata.PB._PBJ_Internal.TestMessage.Types.SubMessage Submes { - get { return submes_; } - } - - public const int SubmessersFieldNumber = 31; - private pbc::PopsicleList submessers_ = new pbc::PopsicleList(); - public scg::IList SubmessersList { - get { return submessers_; } - } - public int SubmessersCount { - get { return submessers_.Count; } - } - public global::Sirikata.PB._PBJ_Internal.TestMessage.Types.SubMessage GetSubmessers(int index) { - return submessers_[index]; - } - - public const int ShaFieldNumber = 32; - private bool hasSha; - private pb::ByteString sha_ = pb::ByteString.Empty; - public bool HasSha { - get { return hasSha; } - } - public pb::ByteString Sha { - get { return sha_; } - } - - public const int ShasFieldNumber = 33; - private pbc::PopsicleList shas_ = new pbc::PopsicleList(); - public scg::IList ShasList { - get { return pbc::Lists.AsReadOnly(shas_); } - } - public int ShasCount { - get { return shas_.Count; } - } - public pb::ByteString GetShas(int index) { - return shas_[index]; - } - - public const int ExtmesFieldNumber = 34; - private bool hasExtmes; - private global::Sirikata.PB._PBJ_Internal.ExternalMessage extmes_ = global::Sirikata.PB._PBJ_Internal.ExternalMessage.DefaultInstance; - public bool HasExtmes { - get { return hasExtmes; } - } - public global::Sirikata.PB._PBJ_Internal.ExternalMessage Extmes { - get { return extmes_; } - } - - public const int ExtmessersFieldNumber = 35; - private pbc::PopsicleList extmessers_ = new pbc::PopsicleList(); - public scg::IList ExtmessersList { - get { return extmessers_; } - } - public int ExtmessersCount { - get { return extmessers_.Count; } - } - public global::Sirikata.PB._PBJ_Internal.ExternalMessage GetExtmessers(int index) { - return extmessers_[index]; - } - - public const int ExtmesserFieldNumber = 36; - private bool hasExtmesser; - private global::Sirikata.PB._PBJ_Internal.ExternalMessage extmesser_ = global::Sirikata.PB._PBJ_Internal.ExternalMessage.DefaultInstance; - public bool HasExtmesser { - get { return hasExtmesser; } - } - public global::Sirikata.PB._PBJ_Internal.ExternalMessage Extmesser { - get { return extmesser_; } - } - - public override bool IsInitialized { - get { - if (!hasXxfr) return false; - if (!hasExtmesser) return false; - if (!ExtensionsAreInitialized) return false; - return true; - } - } - - public override void WriteTo(pb::CodedOutputStream output) { - pb::ExtendableMessage.ExtensionWriter extensionWriter = CreateExtensionWriter(this); - if (n_.Count > 0) { - output.WriteRawVarint32(10); - output.WriteRawVarint32((uint) nMemoizedSerializedSize); - foreach (float element in n_) { - output.WriteFloatNoTag(element); - } - } - if (v2F_.Count > 0) { - output.WriteRawVarint32(18); - output.WriteRawVarint32((uint) v2FMemoizedSerializedSize); - foreach (float element in v2F_) { - output.WriteFloatNoTag(element); - } - } - if (v2D_.Count > 0) { - output.WriteRawVarint32(26); - output.WriteRawVarint32((uint) v2DMemoizedSerializedSize); - foreach (double element in v2D_) { - output.WriteDoubleNoTag(element); - } - } - if (v3F_.Count > 0) { - output.WriteRawVarint32(34); - output.WriteRawVarint32((uint) v3FMemoizedSerializedSize); - foreach (float element in v3F_) { - output.WriteFloatNoTag(element); - } - } - if (v3D_.Count > 0) { - output.WriteRawVarint32(42); - output.WriteRawVarint32((uint) v3DMemoizedSerializedSize); - foreach (double element in v3D_) { - output.WriteDoubleNoTag(element); - } - } - if (v4F_.Count > 0) { - output.WriteRawVarint32(50); - output.WriteRawVarint32((uint) v4FMemoizedSerializedSize); - foreach (float element in v4F_) { - output.WriteFloatNoTag(element); - } - } - if (v4D_.Count > 0) { - output.WriteRawVarint32(58); - output.WriteRawVarint32((uint) v4DMemoizedSerializedSize); - foreach (double element in v4D_) { - output.WriteDoubleNoTag(element); - } - } - if (q_.Count > 0) { - output.WriteRawVarint32(66); - output.WriteRawVarint32((uint) qMemoizedSerializedSize); - foreach (float element in q_) { - output.WriteFloatNoTag(element); - } - } - if (HasU) { - output.WriteBytes(9, U); - } - if (HasA) { - output.WriteFloat(10, A); - } - if (HasT) { - output.WriteFixed64(11, T); - } - if (HasD) { - output.WriteSFixed64(12, D); - } - if (HasF32) { - output.WriteUInt32(13, F32); - } - if (HasF64) { - output.WriteUInt64(14, F64); - } - if (bsf_.Count > 0) { - output.WriteRawVarint32(122); - output.WriteRawVarint32((uint) bsfMemoizedSerializedSize); - foreach (float element in bsf_) { - output.WriteFloatNoTag(element); - } - } - if (bsd_.Count > 0) { - output.WriteRawVarint32(130); - output.WriteRawVarint32((uint) bsdMemoizedSerializedSize); - foreach (double element in bsd_) { - output.WriteDoubleNoTag(element); - } - } - if (bbf_.Count > 0) { - output.WriteRawVarint32(138); - output.WriteRawVarint32((uint) bbfMemoizedSerializedSize); - foreach (float element in bbf_) { - output.WriteFloatNoTag(element); - } - } - if (bbd_.Count > 0) { - output.WriteRawVarint32(146); - output.WriteRawVarint32((uint) bbdMemoizedSerializedSize); - foreach (double element in bbd_) { - output.WriteDoubleNoTag(element); - } - } - if (HasE32) { - output.WriteEnum(19, (int) E32); - } - if (HasXxd) { - output.WriteDouble(20, Xxd); - } - if (HasXxf) { - output.WriteFloat(21, Xxf); - } - if (HasXxu32) { - output.WriteUInt32(22, Xxu32); - } - if (HasXxs) { - output.WriteString(23, Xxs); - } - if (HasXxb) { - output.WriteBytes(24, Xxb); - } - if (xxss_.Count > 0) { - foreach (string element in xxss_) { - output.WriteString(25, element); - } - } - if (xxbb_.Count > 0) { - foreach (pb::ByteString element in xxbb_) { - output.WriteBytes(26, element); - } - } - if (xxff_.Count > 0) { - output.WriteRawVarint32(218); - output.WriteRawVarint32((uint) xxffMemoizedSerializedSize); - foreach (float element in xxff_) { - output.WriteFloatNoTag(element); - } - } - if (HasXxfr) { - output.WriteFloat(28, Xxfr); - } - if (xxnn_.Count > 0) { - output.WriteRawVarint32(234); - output.WriteRawVarint32((uint) xxnnMemoizedSerializedSize); - foreach (float element in xxnn_) { - output.WriteFloatNoTag(element); - } - } - if (HasSubmes) { - output.WriteMessage(30, Submes); - } - foreach (global::Sirikata.PB._PBJ_Internal.TestMessage.Types.SubMessage element in SubmessersList) { - output.WriteMessage(31, element); - } - if (HasSha) { - output.WriteBytes(32, Sha); - } - if (shas_.Count > 0) { - foreach (pb::ByteString element in shas_) { - output.WriteBytes(33, element); - } - } - if (HasExtmes) { - output.WriteMessage(34, Extmes); - } - foreach (global::Sirikata.PB._PBJ_Internal.ExternalMessage element in ExtmessersList) { - output.WriteMessage(35, element); - } - if (HasExtmesser) { - output.WriteMessage(36, Extmesser); - } - extensionWriter.WriteUntil(200, output); - UnknownFields.WriteTo(output); - } - - private int memoizedSerializedSize = -1; - public override int SerializedSize { - get { - int size = memoizedSerializedSize; - if (size != -1) return size; - - size = 0; - if (HasXxd) { - size += pb::CodedOutputStream.ComputeDoubleSize(20, Xxd); - } - if (HasXxf) { - size += pb::CodedOutputStream.ComputeFloatSize(21, Xxf); - } - if (HasXxu32) { - size += pb::CodedOutputStream.ComputeUInt32Size(22, Xxu32); - } - if (HasXxs) { - size += pb::CodedOutputStream.ComputeStringSize(23, Xxs); - } - if (HasXxb) { - size += pb::CodedOutputStream.ComputeBytesSize(24, Xxb); - } - { - int dataSize = 0; - foreach (string element in XxssList) { - dataSize += pb::CodedOutputStream.ComputeStringSizeNoTag(element); - } - size += dataSize; - size += 2 * xxss_.Count; - } - { - int dataSize = 0; - foreach (pb::ByteString element in XxbbList) { - dataSize += pb::CodedOutputStream.ComputeBytesSizeNoTag(element); - } - size += dataSize; - size += 2 * xxbb_.Count; - } - { - int dataSize = 0; - dataSize = 4 * xxff_.Count; - size += dataSize; - if (xxff_.Count!=0) size += 2 + pb::CodedOutputStream.ComputeInt32SizeNoTag(dataSize); - xxffMemoizedSerializedSize = dataSize; - } - { - int dataSize = 0; - dataSize = 4 * xxnn_.Count; - size += dataSize; - if (xxnn_.Count!=0) size += 2 + pb::CodedOutputStream.ComputeInt32SizeNoTag(dataSize); - xxnnMemoizedSerializedSize = dataSize; - } - if (HasXxfr) { - size += pb::CodedOutputStream.ComputeFloatSize(28, Xxfr); - } - { - int dataSize = 0; - dataSize = 4 * n_.Count; - size += dataSize; - if (n_.Count!=0) size += 1 + pb::CodedOutputStream.ComputeInt32SizeNoTag(dataSize); - nMemoizedSerializedSize = dataSize; - } - { - int dataSize = 0; - dataSize = 4 * v2F_.Count; - size += dataSize; - if (v2F_.Count!=0) size += 1 + pb::CodedOutputStream.ComputeInt32SizeNoTag(dataSize); - v2FMemoizedSerializedSize = dataSize; - } - { - int dataSize = 0; - dataSize = 8 * v2D_.Count; - size += dataSize; - if (v2D_.Count!=0) size += 1 + pb::CodedOutputStream.ComputeInt32SizeNoTag(dataSize); - v2DMemoizedSerializedSize = dataSize; - } - { - int dataSize = 0; - dataSize = 4 * v3F_.Count; - size += dataSize; - if (v3F_.Count!=0) size += 1 + pb::CodedOutputStream.ComputeInt32SizeNoTag(dataSize); - v3FMemoizedSerializedSize = dataSize; - } - { - int dataSize = 0; - dataSize = 8 * v3D_.Count; - size += dataSize; - if (v3D_.Count!=0) size += 1 + pb::CodedOutputStream.ComputeInt32SizeNoTag(dataSize); - v3DMemoizedSerializedSize = dataSize; - } - { - int dataSize = 0; - dataSize = 4 * v4F_.Count; - size += dataSize; - if (v4F_.Count!=0) size += 1 + pb::CodedOutputStream.ComputeInt32SizeNoTag(dataSize); - v4FMemoizedSerializedSize = dataSize; - } - { - int dataSize = 0; - dataSize = 8 * v4D_.Count; - size += dataSize; - if (v4D_.Count!=0) size += 1 + pb::CodedOutputStream.ComputeInt32SizeNoTag(dataSize); - v4DMemoizedSerializedSize = dataSize; - } - { - int dataSize = 0; - dataSize = 4 * q_.Count; - size += dataSize; - if (q_.Count!=0) size += 1 + pb::CodedOutputStream.ComputeInt32SizeNoTag(dataSize); - qMemoizedSerializedSize = dataSize; - } - if (HasU) { - size += pb::CodedOutputStream.ComputeBytesSize(9, U); - } - if (HasA) { - size += pb::CodedOutputStream.ComputeFloatSize(10, A); - } - if (HasT) { - size += pb::CodedOutputStream.ComputeFixed64Size(11, T); - } - if (HasD) { - size += pb::CodedOutputStream.ComputeSFixed64Size(12, D); - } - if (HasF32) { - size += pb::CodedOutputStream.ComputeUInt32Size(13, F32); - } - if (HasF64) { - size += pb::CodedOutputStream.ComputeUInt64Size(14, F64); - } - { - int dataSize = 0; - dataSize = 4 * bsf_.Count; - size += dataSize; - if (bsf_.Count!=0) size += 1 + pb::CodedOutputStream.ComputeInt32SizeNoTag(dataSize); - bsfMemoizedSerializedSize = dataSize; - } - { - int dataSize = 0; - dataSize = 8 * bsd_.Count; - size += dataSize; - if (bsd_.Count!=0) size += 2 + pb::CodedOutputStream.ComputeInt32SizeNoTag(dataSize); - bsdMemoizedSerializedSize = dataSize; - } - { - int dataSize = 0; - dataSize = 4 * bbf_.Count; - size += dataSize; - if (bbf_.Count!=0) size += 2 + pb::CodedOutputStream.ComputeInt32SizeNoTag(dataSize); - bbfMemoizedSerializedSize = dataSize; - } - { - int dataSize = 0; - dataSize = 8 * bbd_.Count; - size += dataSize; - if (bbd_.Count!=0) size += 2 + pb::CodedOutputStream.ComputeInt32SizeNoTag(dataSize); - bbdMemoizedSerializedSize = dataSize; - } - if (HasE32) { - size += pb::CodedOutputStream.ComputeEnumSize(19, (int) E32); - } - if (HasSubmes) { - size += pb::CodedOutputStream.ComputeMessageSize(30, Submes); - } - foreach (global::Sirikata.PB._PBJ_Internal.TestMessage.Types.SubMessage element in SubmessersList) { - size += pb::CodedOutputStream.ComputeMessageSize(31, element); - } - if (HasSha) { - size += pb::CodedOutputStream.ComputeBytesSize(32, Sha); - } - { - int dataSize = 0; - foreach (pb::ByteString element in ShasList) { - dataSize += pb::CodedOutputStream.ComputeBytesSizeNoTag(element); - } - size += dataSize; - size += 2 * shas_.Count; - } - if (HasExtmes) { - size += pb::CodedOutputStream.ComputeMessageSize(34, Extmes); - } - foreach (global::Sirikata.PB._PBJ_Internal.ExternalMessage element in ExtmessersList) { - size += pb::CodedOutputStream.ComputeMessageSize(35, element); - } - if (HasExtmesser) { - size += pb::CodedOutputStream.ComputeMessageSize(36, Extmesser); - } - size += ExtensionsSerializedSize; - size += UnknownFields.SerializedSize; - memoizedSerializedSize = size; - return size; - } - } - - public static TestMessage ParseFrom(pb::ByteString data) { - return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); - } - public static TestMessage ParseFrom(pb::ByteString data, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); - } - public static TestMessage ParseFrom(byte[] data) { - return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); - } - public static TestMessage ParseFrom(byte[] data, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); - } - public static TestMessage ParseFrom(global::System.IO.Stream input) { - return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); - } - public static TestMessage ParseFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); - } - public static TestMessage ParseDelimitedFrom(global::System.IO.Stream input) { - return CreateBuilder().MergeDelimitedFrom(input).BuildParsed(); - } - public static TestMessage ParseDelimitedFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { - return CreateBuilder().MergeDelimitedFrom(input, extensionRegistry).BuildParsed(); - } - public static TestMessage ParseFrom(pb::CodedInputStream input) { - return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); - } - public static TestMessage ParseFrom(pb::CodedInputStream input, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); - } - public static Builder CreateBuilder() { return new Builder(); } - public override Builder ToBuilder() { return CreateBuilder(this); } - public override Builder CreateBuilderForType() { return new Builder(); } - public static Builder CreateBuilder(TestMessage prototype) { - return (Builder) new Builder().MergeFrom(prototype); - } - - public sealed partial class Builder : pb::ExtendableBuilder { - protected override Builder ThisBuilder { - get { return this; } - } - public Builder() {} - - TestMessage result = new TestMessage(); - - protected override TestMessage MessageBeingBuilt { - get { return result; } - } - - public override Builder Clear() { - result = new TestMessage(); - return this; - } - - public override Builder Clone() { - return new Builder().MergeFrom(result); - } - - public override pbd::MessageDescriptor DescriptorForType { - get { return global::Sirikata.PB._PBJ_Internal.TestMessage.Descriptor; } - } - - public override TestMessage DefaultInstanceForType { - get { return global::Sirikata.PB._PBJ_Internal.TestMessage.DefaultInstance; } - } - - public override TestMessage BuildPartial() { - if (result == null) { - throw new global::System.InvalidOperationException("build() has already been called on this Builder"); - } - result.xxss_.MakeReadOnly(); - result.xxbb_.MakeReadOnly(); - result.xxff_.MakeReadOnly(); - result.xxnn_.MakeReadOnly(); - result.n_.MakeReadOnly(); - result.v2F_.MakeReadOnly(); - result.v2D_.MakeReadOnly(); - result.v3F_.MakeReadOnly(); - result.v3D_.MakeReadOnly(); - result.v4F_.MakeReadOnly(); - result.v4D_.MakeReadOnly(); - result.q_.MakeReadOnly(); - result.bsf_.MakeReadOnly(); - result.bsd_.MakeReadOnly(); - result.bbf_.MakeReadOnly(); - result.bbd_.MakeReadOnly(); - result.submessers_.MakeReadOnly(); - result.shas_.MakeReadOnly(); - result.extmessers_.MakeReadOnly(); - TestMessage returnMe = result; - result = null; - return returnMe; - } - - public override Builder MergeFrom(pb::IMessage other) { - if (other is TestMessage) { - return MergeFrom((TestMessage) other); - } else { - base.MergeFrom(other); - return this; - } - } - - public override Builder MergeFrom(TestMessage other) { - if (other == global::Sirikata.PB._PBJ_Internal.TestMessage.DefaultInstance) return this; - if (other.HasXxd) { - Xxd = other.Xxd; - } - if (other.HasXxf) { - Xxf = other.Xxf; - } - if (other.HasXxu32) { - Xxu32 = other.Xxu32; - } - if (other.HasXxs) { - Xxs = other.Xxs; - } - if (other.HasXxb) { - Xxb = other.Xxb; - } - if (other.xxss_.Count != 0) { - base.AddRange(other.xxss_, result.xxss_); - } - if (other.xxbb_.Count != 0) { - base.AddRange(other.xxbb_, result.xxbb_); - } - if (other.xxff_.Count != 0) { - base.AddRange(other.xxff_, result.xxff_); - } - if (other.xxnn_.Count != 0) { - base.AddRange(other.xxnn_, result.xxnn_); - } - if (other.HasXxfr) { - Xxfr = other.Xxfr; - } - if (other.n_.Count != 0) { - base.AddRange(other.n_, result.n_); - } - if (other.v2F_.Count != 0) { - base.AddRange(other.v2F_, result.v2F_); - } - if (other.v2D_.Count != 0) { - base.AddRange(other.v2D_, result.v2D_); - } - if (other.v3F_.Count != 0) { - base.AddRange(other.v3F_, result.v3F_); - } - if (other.v3D_.Count != 0) { - base.AddRange(other.v3D_, result.v3D_); - } - if (other.v4F_.Count != 0) { - base.AddRange(other.v4F_, result.v4F_); - } - if (other.v4D_.Count != 0) { - base.AddRange(other.v4D_, result.v4D_); - } - if (other.q_.Count != 0) { - base.AddRange(other.q_, result.q_); - } - if (other.HasU) { - U = other.U; - } - if (other.HasA) { - A = other.A; - } - if (other.HasT) { - T = other.T; - } - if (other.HasD) { - D = other.D; - } - if (other.HasF32) { - F32 = other.F32; - } - if (other.HasF64) { - F64 = other.F64; - } - if (other.bsf_.Count != 0) { - base.AddRange(other.bsf_, result.bsf_); - } - if (other.bsd_.Count != 0) { - base.AddRange(other.bsd_, result.bsd_); - } - if (other.bbf_.Count != 0) { - base.AddRange(other.bbf_, result.bbf_); - } - if (other.bbd_.Count != 0) { - base.AddRange(other.bbd_, result.bbd_); - } - if (other.HasE32) { - E32 = other.E32; - } - if (other.HasSubmes) { - MergeSubmes(other.Submes); - } - if (other.submessers_.Count != 0) { - base.AddRange(other.submessers_, result.submessers_); - } - if (other.HasSha) { - Sha = other.Sha; - } - if (other.shas_.Count != 0) { - base.AddRange(other.shas_, result.shas_); - } - if (other.HasExtmes) { - MergeExtmes(other.Extmes); - } - if (other.extmessers_.Count != 0) { - base.AddRange(other.extmessers_, result.extmessers_); - } - if (other.HasExtmesser) { - MergeExtmesser(other.Extmesser); - } - this.MergeExtensionFields(other); - this.MergeUnknownFields(other.UnknownFields); - return this; - } - - public override Builder MergeFrom(pb::CodedInputStream input) { - return MergeFrom(input, pb::ExtensionRegistry.Empty); - } - - public override Builder MergeFrom(pb::CodedInputStream input, pb::ExtensionRegistry extensionRegistry) { - pb::UnknownFieldSet.Builder unknownFields = null; - while (true) { - uint tag = input.ReadTag(); - switch (tag) { - case 0: { - if (unknownFields != null) { - this.UnknownFields = unknownFields.Build(); - } - return this; - } - default: { - if (pb::WireFormat.IsEndGroupTag(tag)) { - if (unknownFields != null) { - this.UnknownFields = unknownFields.Build(); - } - return this; - } - if (unknownFields == null) { - unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); - } - ParseUnknownField(input, unknownFields, extensionRegistry, tag); - break; - } - case 10: { - int length = input.ReadInt32(); - int limit = input.PushLimit(length); - while (!input.ReachedLimit) { - AddN(input.ReadFloat()); - } - input.PopLimit(limit); - break; - } - case 18: { - int length = input.ReadInt32(); - int limit = input.PushLimit(length); - while (!input.ReachedLimit) { - AddV2F(input.ReadFloat()); - } - input.PopLimit(limit); - break; - } - case 26: { - int length = input.ReadInt32(); - int limit = input.PushLimit(length); - while (!input.ReachedLimit) { - AddV2D(input.ReadDouble()); - } - input.PopLimit(limit); - break; - } - case 34: { - int length = input.ReadInt32(); - int limit = input.PushLimit(length); - while (!input.ReachedLimit) { - AddV3F(input.ReadFloat()); - } - input.PopLimit(limit); - break; - } - case 42: { - int length = input.ReadInt32(); - int limit = input.PushLimit(length); - while (!input.ReachedLimit) { - AddV3D(input.ReadDouble()); - } - input.PopLimit(limit); - break; - } - case 50: { - int length = input.ReadInt32(); - int limit = input.PushLimit(length); - while (!input.ReachedLimit) { - AddV4F(input.ReadFloat()); - } - input.PopLimit(limit); - break; - } - case 58: { - int length = input.ReadInt32(); - int limit = input.PushLimit(length); - while (!input.ReachedLimit) { - AddV4D(input.ReadDouble()); - } - input.PopLimit(limit); - break; - } - case 66: { - int length = input.ReadInt32(); - int limit = input.PushLimit(length); - while (!input.ReachedLimit) { - AddQ(input.ReadFloat()); - } - input.PopLimit(limit); - break; - } - case 74: { - U = input.ReadBytes(); - break; - } - case 85: { - A = input.ReadFloat(); - break; - } - case 89: { - T = input.ReadFixed64(); - break; - } - case 97: { - D = input.ReadSFixed64(); - break; - } - case 104: { - F32 = input.ReadUInt32(); - break; - } - case 112: { - F64 = input.ReadUInt64(); - break; - } - case 122: { - int length = input.ReadInt32(); - int limit = input.PushLimit(length); - while (!input.ReachedLimit) { - AddBsf(input.ReadFloat()); - } - input.PopLimit(limit); - break; - } - case 130: { - int length = input.ReadInt32(); - int limit = input.PushLimit(length); - while (!input.ReachedLimit) { - AddBsd(input.ReadDouble()); - } - input.PopLimit(limit); - break; - } - case 138: { - int length = input.ReadInt32(); - int limit = input.PushLimit(length); - while (!input.ReachedLimit) { - AddBbf(input.ReadFloat()); - } - input.PopLimit(limit); - break; - } - case 146: { - int length = input.ReadInt32(); - int limit = input.PushLimit(length); - while (!input.ReachedLimit) { - AddBbd(input.ReadDouble()); - } - input.PopLimit(limit); - break; - } - case 152: { - int rawValue = input.ReadEnum(); - if (!global::System.Enum.IsDefined(typeof(global::Sirikata.PB._PBJ_Internal.TestMessage.Types.Enum32), rawValue)) { - if (unknownFields == null) { - unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); - } - unknownFields.MergeVarintField(19, (ulong) rawValue); - } else { - E32 = (global::Sirikata.PB._PBJ_Internal.TestMessage.Types.Enum32) rawValue; - } - break; - } - case 161: { - Xxd = input.ReadDouble(); - break; - } - case 173: { - Xxf = input.ReadFloat(); - break; - } - case 176: { - Xxu32 = input.ReadUInt32(); - break; - } - case 186: { - Xxs = input.ReadString(); - break; - } - case 194: { - Xxb = input.ReadBytes(); - break; - } - case 202: { - AddXxss(input.ReadString()); - break; - } - case 210: { - AddXxbb(input.ReadBytes()); - break; - } - case 218: { - int length = input.ReadInt32(); - int limit = input.PushLimit(length); - while (!input.ReachedLimit) { - AddXxff(input.ReadFloat()); - } - input.PopLimit(limit); - break; - } - case 229: { - Xxfr = input.ReadFloat(); - break; - } - case 234: { - int length = input.ReadInt32(); - int limit = input.PushLimit(length); - while (!input.ReachedLimit) { - AddXxnn(input.ReadFloat()); - } - input.PopLimit(limit); - break; - } - case 242: { - global::Sirikata.PB._PBJ_Internal.TestMessage.Types.SubMessage.Builder subBuilder = global::Sirikata.PB._PBJ_Internal.TestMessage.Types.SubMessage.CreateBuilder(); - if (HasSubmes) { - subBuilder.MergeFrom(Submes); - } - input.ReadMessage(subBuilder, extensionRegistry); - Submes = subBuilder.BuildPartial(); - break; - } - case 250: { - global::Sirikata.PB._PBJ_Internal.TestMessage.Types.SubMessage.Builder subBuilder = global::Sirikata.PB._PBJ_Internal.TestMessage.Types.SubMessage.CreateBuilder(); - input.ReadMessage(subBuilder, extensionRegistry); - AddSubmessers(subBuilder.BuildPartial()); - break; - } - case 258: { - Sha = input.ReadBytes(); - break; - } - case 266: { - AddShas(input.ReadBytes()); - break; - } - case 274: { - global::Sirikata.PB._PBJ_Internal.ExternalMessage.Builder subBuilder = global::Sirikata.PB._PBJ_Internal.ExternalMessage.CreateBuilder(); - if (HasExtmes) { - subBuilder.MergeFrom(Extmes); - } - input.ReadMessage(subBuilder, extensionRegistry); - Extmes = subBuilder.BuildPartial(); - break; - } - case 282: { - global::Sirikata.PB._PBJ_Internal.ExternalMessage.Builder subBuilder = global::Sirikata.PB._PBJ_Internal.ExternalMessage.CreateBuilder(); - input.ReadMessage(subBuilder, extensionRegistry); - AddExtmessers(subBuilder.BuildPartial()); - break; - } - case 290: { - global::Sirikata.PB._PBJ_Internal.ExternalMessage.Builder subBuilder = global::Sirikata.PB._PBJ_Internal.ExternalMessage.CreateBuilder(); - if (HasExtmesser) { - subBuilder.MergeFrom(Extmesser); - } - input.ReadMessage(subBuilder, extensionRegistry); - Extmesser = subBuilder.BuildPartial(); - break; - } - } - } - } - - - public bool HasXxd { - get { return result.HasXxd; } - } - public double Xxd { - get { return result.Xxd; } - set { SetXxd(value); } - } - public Builder SetXxd(double value) { - result.hasXxd = true; - result.xxd_ = value; - return this; - } - public Builder ClearXxd() { - result.hasXxd = false; - result.xxd_ = 10.3D; - return this; - } - - public bool HasXxf { - get { return result.HasXxf; } - } - public float Xxf { - get { return result.Xxf; } - set { SetXxf(value); } - } - public Builder SetXxf(float value) { - result.hasXxf = true; - result.xxf_ = value; - return this; - } - public Builder ClearXxf() { - result.hasXxf = false; - result.xxf_ = 0F; - return this; - } - - public bool HasXxu32 { - get { return result.HasXxu32; } - } - [global::System.CLSCompliant(false)] - public uint Xxu32 { - get { return result.Xxu32; } - set { SetXxu32(value); } - } - [global::System.CLSCompliant(false)] - public Builder SetXxu32(uint value) { - result.hasXxu32 = true; - result.xxu32_ = value; - return this; - } - public Builder ClearXxu32() { - result.hasXxu32 = false; - result.xxu32_ = 0; - return this; - } - - public bool HasXxs { - get { return result.HasXxs; } - } - public string Xxs { - get { return result.Xxs; } - set { SetXxs(value); } - } - public Builder SetXxs(string value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - result.hasXxs = true; - result.xxs_ = value; - return this; - } - public Builder ClearXxs() { - result.hasXxs = false; - result.xxs_ = ""; - return this; - } - - public bool HasXxb { - get { return result.HasXxb; } - } - public pb::ByteString Xxb { - get { return result.Xxb; } - set { SetXxb(value); } - } - public Builder SetXxb(pb::ByteString value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - result.hasXxb = true; - result.xxb_ = value; - return this; - } - public Builder ClearXxb() { - result.hasXxb = false; - result.xxb_ = pb::ByteString.Empty; - return this; - } - - public pbc::IPopsicleList XxssList { - get { return result.xxss_; } - } - public int XxssCount { - get { return result.XxssCount; } - } - public string GetXxss(int index) { - return result.GetXxss(index); - } - public Builder SetXxss(int index, string value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - result.xxss_[index] = value; - return this; - } - public Builder AddXxss(string value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - result.xxss_.Add(value); - return this; - } - public Builder AddRangeXxss(scg::IEnumerable values) { - base.AddRange(values, result.xxss_); - return this; - } - public Builder ClearXxss() { - result.xxss_.Clear(); - return this; - } - - public pbc::IPopsicleList XxbbList { - get { return result.xxbb_; } - } - public int XxbbCount { - get { return result.XxbbCount; } - } - public pb::ByteString GetXxbb(int index) { - return result.GetXxbb(index); - } - public Builder SetXxbb(int index, pb::ByteString value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - result.xxbb_[index] = value; - return this; - } - public Builder AddXxbb(pb::ByteString value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - result.xxbb_.Add(value); - return this; - } - public Builder AddRangeXxbb(scg::IEnumerable values) { - base.AddRange(values, result.xxbb_); - return this; - } - public Builder ClearXxbb() { - result.xxbb_.Clear(); - return this; - } - - public pbc::IPopsicleList XxffList { - get { return result.xxff_; } - } - public int XxffCount { - get { return result.XxffCount; } - } - public float GetXxff(int index) { - return result.GetXxff(index); - } - public Builder SetXxff(int index, float value) { - result.xxff_[index] = value; - return this; - } - public Builder AddXxff(float value) { - result.xxff_.Add(value); - return this; - } - public Builder AddRangeXxff(scg::IEnumerable values) { - base.AddRange(values, result.xxff_); - return this; - } - public Builder ClearXxff() { - result.xxff_.Clear(); - return this; - } - - public pbc::IPopsicleList XxnnList { - get { return result.xxnn_; } - } - public int XxnnCount { - get { return result.XxnnCount; } - } - public float GetXxnn(int index) { - return result.GetXxnn(index); - } - public Builder SetXxnn(int index, float value) { - result.xxnn_[index] = value; - return this; - } - public Builder AddXxnn(float value) { - result.xxnn_.Add(value); - return this; - } - public Builder AddRangeXxnn(scg::IEnumerable values) { - base.AddRange(values, result.xxnn_); - return this; - } - public Builder ClearXxnn() { - result.xxnn_.Clear(); - return this; - } - - public bool HasXxfr { - get { return result.HasXxfr; } - } - public float Xxfr { - get { return result.Xxfr; } - set { SetXxfr(value); } - } - public Builder SetXxfr(float value) { - result.hasXxfr = true; - result.xxfr_ = value; - return this; - } - public Builder ClearXxfr() { - result.hasXxfr = false; - result.xxfr_ = 0F; - return this; - } - - public pbc::IPopsicleList NList { - get { return result.n_; } - } - public int NCount { - get { return result.NCount; } - } - public float GetN(int index) { - return result.GetN(index); - } - public Builder SetN(int index, float value) { - result.n_[index] = value; - return this; - } - public Builder AddN(float value) { - result.n_.Add(value); - return this; - } - public Builder AddRangeN(scg::IEnumerable values) { - base.AddRange(values, result.n_); - return this; - } - public Builder ClearN() { - result.n_.Clear(); - return this; - } - - public pbc::IPopsicleList V2FList { - get { return result.v2F_; } - } - public int V2FCount { - get { return result.V2FCount; } - } - public float GetV2F(int index) { - return result.GetV2F(index); - } - public Builder SetV2F(int index, float value) { - result.v2F_[index] = value; - return this; - } - public Builder AddV2F(float value) { - result.v2F_.Add(value); - return this; - } - public Builder AddRangeV2F(scg::IEnumerable values) { - base.AddRange(values, result.v2F_); - return this; - } - public Builder ClearV2F() { - result.v2F_.Clear(); - return this; - } - - public pbc::IPopsicleList V2DList { - get { return result.v2D_; } - } - public int V2DCount { - get { return result.V2DCount; } - } - public double GetV2D(int index) { - return result.GetV2D(index); - } - public Builder SetV2D(int index, double value) { - result.v2D_[index] = value; - return this; - } - public Builder AddV2D(double value) { - result.v2D_.Add(value); - return this; - } - public Builder AddRangeV2D(scg::IEnumerable values) { - base.AddRange(values, result.v2D_); - return this; - } - public Builder ClearV2D() { - result.v2D_.Clear(); - return this; - } - - public pbc::IPopsicleList V3FList { - get { return result.v3F_; } - } - public int V3FCount { - get { return result.V3FCount; } - } - public float GetV3F(int index) { - return result.GetV3F(index); - } - public Builder SetV3F(int index, float value) { - result.v3F_[index] = value; - return this; - } - public Builder AddV3F(float value) { - result.v3F_.Add(value); - return this; - } - public Builder AddRangeV3F(scg::IEnumerable values) { - base.AddRange(values, result.v3F_); - return this; - } - public Builder ClearV3F() { - result.v3F_.Clear(); - return this; - } - - public pbc::IPopsicleList V3DList { - get { return result.v3D_; } - } - public int V3DCount { - get { return result.V3DCount; } - } - public double GetV3D(int index) { - return result.GetV3D(index); - } - public Builder SetV3D(int index, double value) { - result.v3D_[index] = value; - return this; - } - public Builder AddV3D(double value) { - result.v3D_.Add(value); - return this; - } - public Builder AddRangeV3D(scg::IEnumerable values) { - base.AddRange(values, result.v3D_); - return this; - } - public Builder ClearV3D() { - result.v3D_.Clear(); - return this; - } - - public pbc::IPopsicleList V4FList { - get { return result.v4F_; } - } - public int V4FCount { - get { return result.V4FCount; } - } - public float GetV4F(int index) { - return result.GetV4F(index); - } - public Builder SetV4F(int index, float value) { - result.v4F_[index] = value; - return this; - } - public Builder AddV4F(float value) { - result.v4F_.Add(value); - return this; - } - public Builder AddRangeV4F(scg::IEnumerable values) { - base.AddRange(values, result.v4F_); - return this; - } - public Builder ClearV4F() { - result.v4F_.Clear(); - return this; - } - - public pbc::IPopsicleList V4DList { - get { return result.v4D_; } - } - public int V4DCount { - get { return result.V4DCount; } - } - public double GetV4D(int index) { - return result.GetV4D(index); - } - public Builder SetV4D(int index, double value) { - result.v4D_[index] = value; - return this; - } - public Builder AddV4D(double value) { - result.v4D_.Add(value); - return this; - } - public Builder AddRangeV4D(scg::IEnumerable values) { - base.AddRange(values, result.v4D_); - return this; - } - public Builder ClearV4D() { - result.v4D_.Clear(); - return this; - } - - public pbc::IPopsicleList QList { - get { return result.q_; } - } - public int QCount { - get { return result.QCount; } - } - public float GetQ(int index) { - return result.GetQ(index); - } - public Builder SetQ(int index, float value) { - result.q_[index] = value; - return this; - } - public Builder AddQ(float value) { - result.q_.Add(value); - return this; - } - public Builder AddRangeQ(scg::IEnumerable values) { - base.AddRange(values, result.q_); - return this; - } - public Builder ClearQ() { - result.q_.Clear(); - return this; - } - - public bool HasU { - get { return result.HasU; } - } - public pb::ByteString U { - get { return result.U; } - set { SetU(value); } - } - public Builder SetU(pb::ByteString value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - result.hasU = true; - result.u_ = value; - return this; - } - public Builder ClearU() { - result.hasU = false; - result.u_ = pb::ByteString.Empty; - return this; - } - - public bool HasA { - get { return result.HasA; } - } - public float A { - get { return result.A; } - set { SetA(value); } - } - public Builder SetA(float value) { - result.hasA = true; - result.a_ = value; - return this; - } - public Builder ClearA() { - result.hasA = false; - result.a_ = 0F; - return this; - } - - public bool HasT { - get { return result.HasT; } - } - [global::System.CLSCompliant(false)] - public ulong T { - get { return result.T; } - set { SetT(value); } - } - [global::System.CLSCompliant(false)] - public Builder SetT(ulong value) { - result.hasT = true; - result.t_ = value; - return this; - } - public Builder ClearT() { - result.hasT = false; - result.t_ = 0; - return this; - } - - public bool HasD { - get { return result.HasD; } - } - public long D { - get { return result.D; } - set { SetD(value); } - } - public Builder SetD(long value) { - result.hasD = true; - result.d_ = value; - return this; - } - public Builder ClearD() { - result.hasD = false; - result.d_ = 0; - return this; - } - - public bool HasF32 { - get { return result.HasF32; } - } - [global::System.CLSCompliant(false)] - public uint F32 { - get { return result.F32; } - set { SetF32(value); } - } - [global::System.CLSCompliant(false)] - public Builder SetF32(uint value) { - result.hasF32 = true; - result.f32_ = value; - return this; - } - public Builder ClearF32() { - result.hasF32 = false; - result.f32_ = 0; - return this; - } - - public bool HasF64 { - get { return result.HasF64; } - } - [global::System.CLSCompliant(false)] - public ulong F64 { - get { return result.F64; } - set { SetF64(value); } - } - [global::System.CLSCompliant(false)] - public Builder SetF64(ulong value) { - result.hasF64 = true; - result.f64_ = value; - return this; - } - public Builder ClearF64() { - result.hasF64 = false; - result.f64_ = 0UL; - return this; - } - - public pbc::IPopsicleList BsfList { - get { return result.bsf_; } - } - public int BsfCount { - get { return result.BsfCount; } - } - public float GetBsf(int index) { - return result.GetBsf(index); - } - public Builder SetBsf(int index, float value) { - result.bsf_[index] = value; - return this; - } - public Builder AddBsf(float value) { - result.bsf_.Add(value); - return this; - } - public Builder AddRangeBsf(scg::IEnumerable values) { - base.AddRange(values, result.bsf_); - return this; - } - public Builder ClearBsf() { - result.bsf_.Clear(); - return this; - } - - public pbc::IPopsicleList BsdList { - get { return result.bsd_; } - } - public int BsdCount { - get { return result.BsdCount; } - } - public double GetBsd(int index) { - return result.GetBsd(index); - } - public Builder SetBsd(int index, double value) { - result.bsd_[index] = value; - return this; - } - public Builder AddBsd(double value) { - result.bsd_.Add(value); - return this; - } - public Builder AddRangeBsd(scg::IEnumerable values) { - base.AddRange(values, result.bsd_); - return this; - } - public Builder ClearBsd() { - result.bsd_.Clear(); - return this; - } - - public pbc::IPopsicleList BbfList { - get { return result.bbf_; } - } - public int BbfCount { - get { return result.BbfCount; } - } - public float GetBbf(int index) { - return result.GetBbf(index); - } - public Builder SetBbf(int index, float value) { - result.bbf_[index] = value; - return this; - } - public Builder AddBbf(float value) { - result.bbf_.Add(value); - return this; - } - public Builder AddRangeBbf(scg::IEnumerable values) { - base.AddRange(values, result.bbf_); - return this; - } - public Builder ClearBbf() { - result.bbf_.Clear(); - return this; - } - - public pbc::IPopsicleList BbdList { - get { return result.bbd_; } - } - public int BbdCount { - get { return result.BbdCount; } - } - public double GetBbd(int index) { - return result.GetBbd(index); - } - public Builder SetBbd(int index, double value) { - result.bbd_[index] = value; - return this; - } - public Builder AddBbd(double value) { - result.bbd_.Add(value); - return this; - } - public Builder AddRangeBbd(scg::IEnumerable values) { - base.AddRange(values, result.bbd_); - return this; - } - public Builder ClearBbd() { - result.bbd_.Clear(); - return this; - } - - public bool HasE32 { - get { return result.HasE32; } - } - public global::Sirikata.PB._PBJ_Internal.TestMessage.Types.Enum32 E32 { - get { return result.E32; } - set { SetE32(value); } - } - public Builder SetE32(global::Sirikata.PB._PBJ_Internal.TestMessage.Types.Enum32 value) { - result.hasE32 = true; - result.e32_ = value; - return this; - } - public Builder ClearE32() { - result.hasE32 = false; - result.e32_ = global::Sirikata.PB._PBJ_Internal.TestMessage.Types.Enum32.UNIVERSAL1; - return this; - } - - public bool HasSubmes { - get { return result.HasSubmes; } - } - public global::Sirikata.PB._PBJ_Internal.TestMessage.Types.SubMessage Submes { - get { return result.Submes; } - set { SetSubmes(value); } - } - public Builder SetSubmes(global::Sirikata.PB._PBJ_Internal.TestMessage.Types.SubMessage value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - result.hasSubmes = true; - result.submes_ = value; - return this; - } - public Builder SetSubmes(global::Sirikata.PB._PBJ_Internal.TestMessage.Types.SubMessage.Builder builderForValue) { - pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); - result.hasSubmes = true; - result.submes_ = builderForValue.Build(); - return this; - } - public Builder MergeSubmes(global::Sirikata.PB._PBJ_Internal.TestMessage.Types.SubMessage value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - if (result.HasSubmes && - result.submes_ != global::Sirikata.PB._PBJ_Internal.TestMessage.Types.SubMessage.DefaultInstance) { - result.submes_ = global::Sirikata.PB._PBJ_Internal.TestMessage.Types.SubMessage.CreateBuilder(result.submes_).MergeFrom(value).BuildPartial(); - } else { - result.submes_ = value; - } - result.hasSubmes = true; - return this; - } - public Builder ClearSubmes() { - result.hasSubmes = false; - result.submes_ = global::Sirikata.PB._PBJ_Internal.TestMessage.Types.SubMessage.DefaultInstance; - return this; - } - - public pbc::IPopsicleList SubmessersList { - get { return result.submessers_; } - } - public int SubmessersCount { - get { return result.SubmessersCount; } - } - public global::Sirikata.PB._PBJ_Internal.TestMessage.Types.SubMessage GetSubmessers(int index) { - return result.GetSubmessers(index); - } - public Builder SetSubmessers(int index, global::Sirikata.PB._PBJ_Internal.TestMessage.Types.SubMessage value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - result.submessers_[index] = value; - return this; - } - public Builder SetSubmessers(int index, global::Sirikata.PB._PBJ_Internal.TestMessage.Types.SubMessage.Builder builderForValue) { - pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); - result.submessers_[index] = builderForValue.Build(); - return this; - } - public Builder AddSubmessers(global::Sirikata.PB._PBJ_Internal.TestMessage.Types.SubMessage value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - result.submessers_.Add(value); - return this; - } - public Builder AddSubmessers(global::Sirikata.PB._PBJ_Internal.TestMessage.Types.SubMessage.Builder builderForValue) { - pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); - result.submessers_.Add(builderForValue.Build()); - return this; - } - public Builder AddRangeSubmessers(scg::IEnumerable values) { - base.AddRange(values, result.submessers_); - return this; - } - public Builder ClearSubmessers() { - result.submessers_.Clear(); - return this; - } - - public bool HasSha { - get { return result.HasSha; } - } - public pb::ByteString Sha { - get { return result.Sha; } - set { SetSha(value); } - } - public Builder SetSha(pb::ByteString value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - result.hasSha = true; - result.sha_ = value; - return this; - } - public Builder ClearSha() { - result.hasSha = false; - result.sha_ = pb::ByteString.Empty; - return this; - } - - public pbc::IPopsicleList ShasList { - get { return result.shas_; } - } - public int ShasCount { - get { return result.ShasCount; } - } - public pb::ByteString GetShas(int index) { - return result.GetShas(index); - } - public Builder SetShas(int index, pb::ByteString value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - result.shas_[index] = value; - return this; - } - public Builder AddShas(pb::ByteString value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - result.shas_.Add(value); - return this; - } - public Builder AddRangeShas(scg::IEnumerable values) { - base.AddRange(values, result.shas_); - return this; - } - public Builder ClearShas() { - result.shas_.Clear(); - return this; - } - - public bool HasExtmes { - get { return result.HasExtmes; } - } - public global::Sirikata.PB._PBJ_Internal.ExternalMessage Extmes { - get { return result.Extmes; } - set { SetExtmes(value); } - } - public Builder SetExtmes(global::Sirikata.PB._PBJ_Internal.ExternalMessage value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - result.hasExtmes = true; - result.extmes_ = value; - return this; - } - public Builder SetExtmes(global::Sirikata.PB._PBJ_Internal.ExternalMessage.Builder builderForValue) { - pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); - result.hasExtmes = true; - result.extmes_ = builderForValue.Build(); - return this; - } - public Builder MergeExtmes(global::Sirikata.PB._PBJ_Internal.ExternalMessage value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - if (result.HasExtmes && - result.extmes_ != global::Sirikata.PB._PBJ_Internal.ExternalMessage.DefaultInstance) { - result.extmes_ = global::Sirikata.PB._PBJ_Internal.ExternalMessage.CreateBuilder(result.extmes_).MergeFrom(value).BuildPartial(); - } else { - result.extmes_ = value; - } - result.hasExtmes = true; - return this; - } - public Builder ClearExtmes() { - result.hasExtmes = false; - result.extmes_ = global::Sirikata.PB._PBJ_Internal.ExternalMessage.DefaultInstance; - return this; - } - - public pbc::IPopsicleList ExtmessersList { - get { return result.extmessers_; } - } - public int ExtmessersCount { - get { return result.ExtmessersCount; } - } - public global::Sirikata.PB._PBJ_Internal.ExternalMessage GetExtmessers(int index) { - return result.GetExtmessers(index); - } - public Builder SetExtmessers(int index, global::Sirikata.PB._PBJ_Internal.ExternalMessage value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - result.extmessers_[index] = value; - return this; - } - public Builder SetExtmessers(int index, global::Sirikata.PB._PBJ_Internal.ExternalMessage.Builder builderForValue) { - pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); - result.extmessers_[index] = builderForValue.Build(); - return this; - } - public Builder AddExtmessers(global::Sirikata.PB._PBJ_Internal.ExternalMessage value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - result.extmessers_.Add(value); - return this; - } - public Builder AddExtmessers(global::Sirikata.PB._PBJ_Internal.ExternalMessage.Builder builderForValue) { - pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); - result.extmessers_.Add(builderForValue.Build()); - return this; - } - public Builder AddRangeExtmessers(scg::IEnumerable values) { - base.AddRange(values, result.extmessers_); - return this; - } - public Builder ClearExtmessers() { - result.extmessers_.Clear(); - return this; - } - - public bool HasExtmesser { - get { return result.HasExtmesser; } - } - public global::Sirikata.PB._PBJ_Internal.ExternalMessage Extmesser { - get { return result.Extmesser; } - set { SetExtmesser(value); } - } - public Builder SetExtmesser(global::Sirikata.PB._PBJ_Internal.ExternalMessage value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - result.hasExtmesser = true; - result.extmesser_ = value; - return this; - } - public Builder SetExtmesser(global::Sirikata.PB._PBJ_Internal.ExternalMessage.Builder builderForValue) { - pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); - result.hasExtmesser = true; - result.extmesser_ = builderForValue.Build(); - return this; - } - public Builder MergeExtmesser(global::Sirikata.PB._PBJ_Internal.ExternalMessage value) { - pb::ThrowHelper.ThrowIfNull(value, "value"); - if (result.HasExtmesser && - result.extmesser_ != global::Sirikata.PB._PBJ_Internal.ExternalMessage.DefaultInstance) { - result.extmesser_ = global::Sirikata.PB._PBJ_Internal.ExternalMessage.CreateBuilder(result.extmesser_).MergeFrom(value).BuildPartial(); - } else { - result.extmesser_ = value; - } - result.hasExtmesser = true; - return this; - } - public Builder ClearExtmesser() { - result.hasExtmesser = false; - result.extmesser_ = global::Sirikata.PB._PBJ_Internal.ExternalMessage.DefaultInstance; - return this; - } - } - static TestMessage() { - object.ReferenceEquals(global::Sirikata.PB._PBJ_Internal.Test.Descriptor, null); - } - } - - #endregion - -} diff --git a/OpenSim/Client/Sirikata/Protocol/Test.pbj.cs b/OpenSim/Client/Sirikata/Protocol/Test.pbj.cs deleted file mode 100644 index bcd02fa3d5..0000000000 --- a/OpenSim/Client/Sirikata/Protocol/Test.pbj.cs +++ /dev/null @@ -1,1761 +0,0 @@ -/* - * Copyright (c) Contributors, http://opensimulator.org/ - * See CONTRIBUTORS.TXT for a full list of copyright holders. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * * Neither the name of the OpenSimulator Project nor the - * names of its contributors may be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE DEVELOPERS ``AS IS'' AND ANY - * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED - * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL THE CONTRIBUTORS BE LIABLE FOR ANY - * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES - * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; - * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ - -using pbd = global::Google.ProtocolBuffers.Descriptors; -using pb = global::Google.ProtocolBuffers; -namespace Sirikata.PB { - public class ExternalMessage : PBJ.IMessage { - protected _PBJ_Internal.ExternalMessage super; - public _PBJ_Internal.ExternalMessage _PBJSuper{ get { return super;} } - public ExternalMessage() { - super=new _PBJ_Internal.ExternalMessage(); - } - public ExternalMessage(_PBJ_Internal.ExternalMessage reference) { - super=reference; - } - public static ExternalMessage defaultInstance= new ExternalMessage (_PBJ_Internal.ExternalMessage.DefaultInstance); - public static ExternalMessage DefaultInstance{ - get {return defaultInstance;} - } - public static pbd.MessageDescriptor Descriptor { - get { return _PBJ_Internal.ExternalMessage.Descriptor; } } - public static class Types { - public class SubMessage : PBJ.IMessage { - protected _PBJ_Internal.ExternalMessage.Types.SubMessage super; - public _PBJ_Internal.ExternalMessage.Types.SubMessage _PBJSuper{ get { return super;} } - public SubMessage() { - super=new _PBJ_Internal.ExternalMessage.Types.SubMessage(); - } - public SubMessage(_PBJ_Internal.ExternalMessage.Types.SubMessage reference) { - super=reference; - } - public static SubMessage defaultInstance= new SubMessage (_PBJ_Internal.ExternalMessage.Types.SubMessage.DefaultInstance); - public static SubMessage DefaultInstance{ - get {return defaultInstance;} - } - public static pbd.MessageDescriptor Descriptor { - get { return _PBJ_Internal.ExternalMessage.Types.SubMessage.Descriptor; } } - public static class Types { - } - public static bool WithinReservedFieldTagRange(int field_tag) { - return false; - } - public static bool WithinExtensionFieldTagRange(int field_tag) { - return false; - } - public const int SubuuidFieldTag=1; - public bool HasSubuuid{ get {return super.HasSubuuid&&PBJ._PBJ.ValidateUuid(super.Subuuid);} } - public PBJ.UUID Subuuid{ get { - if (HasSubuuid) { - return PBJ._PBJ.CastUuid(super.Subuuid); - } else { - return PBJ._PBJ.CastUuid(); - } - } - } - public const int SubvectorFieldTag=2; - public bool HasSubvector{ get {return super.SubvectorCount>=3;} } - public PBJ.Vector3d Subvector{ get { - int index=0; - if (HasSubvector) { - return PBJ._PBJ.CastVector3d(super.GetSubvector(index*3+0),super.GetSubvector(index*3+1),super.GetSubvector(index*3+2)); - } else { - return PBJ._PBJ.CastVector3d(); - } - } - } - public const int SubdurationFieldTag=3; - public bool HasSubduration{ get {return super.HasSubduration&&PBJ._PBJ.ValidateDuration(super.Subduration);} } - public PBJ.Duration Subduration{ get { - if (HasSubduration) { - return PBJ._PBJ.CastDuration(super.Subduration); - } else { - return PBJ._PBJ.CastDuration(); - } - } - } - public const int SubnormalFieldTag=4; - public bool HasSubnormal{ get {return super.SubnormalCount>=2;} } - public PBJ.Vector3f Subnormal{ get { - int index=0; - if (HasSubnormal) { - return PBJ._PBJ.CastNormal(super.GetSubnormal(index*2+0),super.GetSubnormal(index*2+1)); - } else { - return PBJ._PBJ.CastNormal(); - } - } - } - public override Google.ProtocolBuffers.IMessage _PBJISuper { get { return super; } } - public override PBJ.IMessage.IBuilder WeakCreateBuilderForType() { return new Builder(); } - public static Builder CreateBuilder() { return new Builder(); } - public static Builder CreateBuilder(SubMessage prototype) { - return (Builder)new Builder().MergeFrom(prototype); - } - public static SubMessage ParseFrom(pb::ByteString data) { - return new SubMessage(_PBJ_Internal.ExternalMessage.Types.SubMessage.ParseFrom(data)); - } - public static SubMessage ParseFrom(pb::ByteString data, pb::ExtensionRegistry er) { - return new SubMessage(_PBJ_Internal.ExternalMessage.Types.SubMessage.ParseFrom(data,er)); - } - public static SubMessage ParseFrom(byte[] data) { - return new SubMessage(_PBJ_Internal.ExternalMessage.Types.SubMessage.ParseFrom(data)); - } - public static SubMessage ParseFrom(byte[] data, pb::ExtensionRegistry er) { - return new SubMessage(_PBJ_Internal.ExternalMessage.Types.SubMessage.ParseFrom(data,er)); - } - public static SubMessage ParseFrom(global::System.IO.Stream data) { - return new SubMessage(_PBJ_Internal.ExternalMessage.Types.SubMessage.ParseFrom(data)); - } - public static SubMessage ParseFrom(global::System.IO.Stream data, pb::ExtensionRegistry er) { - return new SubMessage(_PBJ_Internal.ExternalMessage.Types.SubMessage.ParseFrom(data,er)); - } - public static SubMessage ParseFrom(pb::CodedInputStream data) { - return new SubMessage(_PBJ_Internal.ExternalMessage.Types.SubMessage.ParseFrom(data)); - } - public static SubMessage ParseFrom(pb::CodedInputStream data, pb::ExtensionRegistry er) { - return new SubMessage(_PBJ_Internal.ExternalMessage.Types.SubMessage.ParseFrom(data,er)); - } - protected override bool _HasAllPBJFields{ get { - return true - ; - } } - public bool IsInitialized { get { - return super.IsInitialized&&_HasAllPBJFields; - } } - public class Builder : global::PBJ.IMessage.IBuilder{ - protected override bool _HasAllPBJFields{ get { - return true - ; - } } - public bool IsInitialized { get { - return super.IsInitialized&&_HasAllPBJFields; - } } - protected _PBJ_Internal.ExternalMessage.Types.SubMessage.Builder super; - public override Google.ProtocolBuffers.IBuilder _PBJISuper { get { return super; } } - public _PBJ_Internal.ExternalMessage.Types.SubMessage.Builder _PBJSuper{ get { return super;} } - public Builder() {super = new _PBJ_Internal.ExternalMessage.Types.SubMessage.Builder();} - public Builder(_PBJ_Internal.ExternalMessage.Types.SubMessage.Builder other) { - super=other; - } - public Builder Clone() {return new Builder(super.Clone());} - public Builder MergeFrom(SubMessage prototype) { super.MergeFrom(prototype._PBJSuper);return this;} - public Builder Clear() {super.Clear();return this;} - public SubMessage BuildPartial() {return new SubMessage(super.BuildPartial());} - public SubMessage Build() {if (_HasAllPBJFields) return new SubMessage(super.Build());return null;} - public pbd::MessageDescriptor DescriptorForType { - get { return SubMessage.Descriptor; } } - public Builder ClearSubuuid() { super.ClearSubuuid();return this;} - public const int SubuuidFieldTag=1; - public bool HasSubuuid{ get {return super.HasSubuuid&&PBJ._PBJ.ValidateUuid(super.Subuuid);} } - public PBJ.UUID Subuuid{ get { - if (HasSubuuid) { - return PBJ._PBJ.CastUuid(super.Subuuid); - } else { - return PBJ._PBJ.CastUuid(); - } - } - set { - super.Subuuid=(PBJ._PBJ.Construct(value)); - } - } - public Builder ClearSubvector() { super.ClearSubvector();return this;} - public const int SubvectorFieldTag=2; - public bool HasSubvector{ get {return super.SubvectorCount>=3;} } - public PBJ.Vector3d Subvector{ get { - int index=0; - if (HasSubvector) { - return PBJ._PBJ.CastVector3d(super.GetSubvector(index*3+0),super.GetSubvector(index*3+1),super.GetSubvector(index*3+2)); - } else { - return PBJ._PBJ.CastVector3d(); - } - } - set { - super.ClearSubvector(); - double[] _PBJtempArray=PBJ._PBJ.ConstructVector3d(value); - super.AddSubvector(_PBJtempArray[0]); - super.AddSubvector(_PBJtempArray[1]); - super.AddSubvector(_PBJtempArray[2]); - } - } - public Builder ClearSubduration() { super.ClearSubduration();return this;} - public const int SubdurationFieldTag=3; - public bool HasSubduration{ get {return super.HasSubduration&&PBJ._PBJ.ValidateDuration(super.Subduration);} } - public PBJ.Duration Subduration{ get { - if (HasSubduration) { - return PBJ._PBJ.CastDuration(super.Subduration); - } else { - return PBJ._PBJ.CastDuration(); - } - } - set { - super.Subduration=(PBJ._PBJ.Construct(value)); - } - } - public Builder ClearSubnormal() { super.ClearSubnormal();return this;} - public const int SubnormalFieldTag=4; - public bool HasSubnormal{ get {return super.SubnormalCount>=2;} } - public PBJ.Vector3f Subnormal{ get { - int index=0; - if (HasSubnormal) { - return PBJ._PBJ.CastNormal(super.GetSubnormal(index*2+0),super.GetSubnormal(index*2+1)); - } else { - return PBJ._PBJ.CastNormal(); - } - } - set { - super.ClearSubnormal(); - float[] _PBJtempArray=PBJ._PBJ.ConstructNormal(value); - super.AddSubnormal(_PBJtempArray[0]); - super.AddSubnormal(_PBJtempArray[1]); - } - } - } - } - } - public static bool WithinReservedFieldTagRange(int field_tag) { - return false; - } - public static bool WithinExtensionFieldTagRange(int field_tag) { - return false; - } - public const int IsTrueFieldTag=40; - public bool HasIsTrue{ get {return super.HasIsTrue&&PBJ._PBJ.ValidateBool(super.IsTrue);} } - public bool IsTrue{ get { - if (HasIsTrue) { - return PBJ._PBJ.CastBool(super.IsTrue); - } else { - return true; - } - } - } - public const int V2FFieldTag=2; - public bool HasV2F{ get {return super.V2FCount>=2;} } - public PBJ.Vector2f V2F{ get { - int index=0; - if (HasV2F) { - return PBJ._PBJ.CastVector2f(super.GetV2F(index*2+0),super.GetV2F(index*2+1)); - } else { - return PBJ._PBJ.CastVector2f(); - } - } - } - public const int SubMesFieldTag=30; - public bool HasSubMes{ get {return super.HasSubMes;} } - public Types.SubMessage SubMes{ get { - if (HasSubMes) { - return new Types.SubMessage(super.SubMes); - } else { - return new Types.SubMessage(); - } - } - } - public const int SubmessersFieldTag=31; - public int SubmessersCount { get { return super.SubmessersCount;} } - public bool HasSubmessers(int index) {return true;} - public Types.SubMessage Submessers(int index) { - return new Types.SubMessage(super.GetSubmessers(index)); - } - public const int ShaFieldTag=32; - public bool HasSha{ get {return super.HasSha&&PBJ._PBJ.ValidateSha256(super.Sha);} } - public PBJ.SHA256 Sha{ get { - if (HasSha) { - return PBJ._PBJ.CastSha256(super.Sha); - } else { - return PBJ._PBJ.CastSha256(); - } - } - } - public const int ShasFieldTag=33; - public int ShasCount { get { return super.ShasCount;} } - public bool HasShas(int index) {return PBJ._PBJ.ValidateSha256(super.GetShas(index));} - public PBJ.SHA256 Shas(int index) { - return (PBJ.SHA256)PBJ._PBJ.CastSha256(super.GetShas(index)); - } - public const int V3FFieldTag=4; - public bool HasV3F{ get {return super.V3FCount>=3;} } - public PBJ.Vector3f V3F{ get { - int index=0; - if (HasV3F) { - return PBJ._PBJ.CastVector3f(super.GetV3F(index*3+0),super.GetV3F(index*3+1),super.GetV3F(index*3+2)); - } else { - return PBJ._PBJ.CastVector3f(); - } - } - } - public const int V3FfFieldTag=5; - public int V3FfCount { get { return super.V3FfCount/3;} } - public bool HasV3Ff(int index) { return true; } - public PBJ.Vector3f GetV3Ff(int index) { - if (HasV3Ff(index)) { - return PBJ._PBJ.CastVector3f(super.GetV3Ff(index*3+0),super.GetV3Ff(index*3+1),super.GetV3Ff(index*3+2)); - } else { - return PBJ._PBJ.CastVector3f(); - } - } - public override Google.ProtocolBuffers.IMessage _PBJISuper { get { return super; } } - public override PBJ.IMessage.IBuilder WeakCreateBuilderForType() { return new Builder(); } - public static Builder CreateBuilder() { return new Builder(); } - public static Builder CreateBuilder(ExternalMessage prototype) { - return (Builder)new Builder().MergeFrom(prototype); - } - public static ExternalMessage ParseFrom(pb::ByteString data) { - return new ExternalMessage(_PBJ_Internal.ExternalMessage.ParseFrom(data)); - } - public static ExternalMessage ParseFrom(pb::ByteString data, pb::ExtensionRegistry er) { - return new ExternalMessage(_PBJ_Internal.ExternalMessage.ParseFrom(data,er)); - } - public static ExternalMessage ParseFrom(byte[] data) { - return new ExternalMessage(_PBJ_Internal.ExternalMessage.ParseFrom(data)); - } - public static ExternalMessage ParseFrom(byte[] data, pb::ExtensionRegistry er) { - return new ExternalMessage(_PBJ_Internal.ExternalMessage.ParseFrom(data,er)); - } - public static ExternalMessage ParseFrom(global::System.IO.Stream data) { - return new ExternalMessage(_PBJ_Internal.ExternalMessage.ParseFrom(data)); - } - public static ExternalMessage ParseFrom(global::System.IO.Stream data, pb::ExtensionRegistry er) { - return new ExternalMessage(_PBJ_Internal.ExternalMessage.ParseFrom(data,er)); - } - public static ExternalMessage ParseFrom(pb::CodedInputStream data) { - return new ExternalMessage(_PBJ_Internal.ExternalMessage.ParseFrom(data)); - } - public static ExternalMessage ParseFrom(pb::CodedInputStream data, pb::ExtensionRegistry er) { - return new ExternalMessage(_PBJ_Internal.ExternalMessage.ParseFrom(data,er)); - } - protected override bool _HasAllPBJFields{ get { - return true - &&HasV3F - ; - } } - public bool IsInitialized { get { - return super.IsInitialized&&_HasAllPBJFields; - } } - public class Builder : global::PBJ.IMessage.IBuilder{ - protected override bool _HasAllPBJFields{ get { - return true - &&HasV3F - ; - } } - public bool IsInitialized { get { - return super.IsInitialized&&_HasAllPBJFields; - } } - protected _PBJ_Internal.ExternalMessage.Builder super; - public override Google.ProtocolBuffers.IBuilder _PBJISuper { get { return super; } } - public _PBJ_Internal.ExternalMessage.Builder _PBJSuper{ get { return super;} } - public Builder() {super = new _PBJ_Internal.ExternalMessage.Builder();} - public Builder(_PBJ_Internal.ExternalMessage.Builder other) { - super=other; - } - public Builder Clone() {return new Builder(super.Clone());} - public Builder MergeFrom(ExternalMessage prototype) { super.MergeFrom(prototype._PBJSuper);return this;} - public Builder Clear() {super.Clear();return this;} - public ExternalMessage BuildPartial() {return new ExternalMessage(super.BuildPartial());} - public ExternalMessage Build() {if (_HasAllPBJFields) return new ExternalMessage(super.Build());return null;} - public pbd::MessageDescriptor DescriptorForType { - get { return ExternalMessage.Descriptor; } } - public Builder ClearIsTrue() { super.ClearIsTrue();return this;} - public const int IsTrueFieldTag=40; - public bool HasIsTrue{ get {return super.HasIsTrue&&PBJ._PBJ.ValidateBool(super.IsTrue);} } - public bool IsTrue{ get { - if (HasIsTrue) { - return PBJ._PBJ.CastBool(super.IsTrue); - } else { - return true; - } - } - set { - super.IsTrue=(PBJ._PBJ.Construct(value)); - } - } - public Builder ClearV2F() { super.ClearV2F();return this;} - public const int V2FFieldTag=2; - public bool HasV2F{ get {return super.V2FCount>=2;} } - public PBJ.Vector2f V2F{ get { - int index=0; - if (HasV2F) { - return PBJ._PBJ.CastVector2f(super.GetV2F(index*2+0),super.GetV2F(index*2+1)); - } else { - return PBJ._PBJ.CastVector2f(); - } - } - set { - super.ClearV2F(); - float[] _PBJtempArray=PBJ._PBJ.ConstructVector2f(value); - super.AddV2F(_PBJtempArray[0]); - super.AddV2F(_PBJtempArray[1]); - } - } - public Builder ClearSubMes() { super.ClearSubMes();return this;} - public const int SubMesFieldTag=30; - public bool HasSubMes{ get {return super.HasSubMes;} } - public Types.SubMessage SubMes{ get { - if (HasSubMes) { - return new Types.SubMessage(super.SubMes); - } else { - return new Types.SubMessage(); - } - } - set { - super.SubMes=value._PBJSuper; - } - } - public Builder ClearSubmessers() { super.ClearSubmessers();return this;} - public Builder SetSubmessers(int index,Types.SubMessage value) { - super.SetSubmessers(index,value._PBJSuper); - return this; - } - public const int SubmessersFieldTag=31; - public int SubmessersCount { get { return super.SubmessersCount;} } - public bool HasSubmessers(int index) {return true;} - public Types.SubMessage Submessers(int index) { - return new Types.SubMessage(super.GetSubmessers(index)); - } - public Builder AddSubmessers(Types.SubMessage value) { - super.AddSubmessers(value._PBJSuper); - return this; - } - public Builder ClearSha() { super.ClearSha();return this;} - public const int ShaFieldTag=32; - public bool HasSha{ get {return super.HasSha&&PBJ._PBJ.ValidateSha256(super.Sha);} } - public PBJ.SHA256 Sha{ get { - if (HasSha) { - return PBJ._PBJ.CastSha256(super.Sha); - } else { - return PBJ._PBJ.CastSha256(); - } - } - set { - super.Sha=(PBJ._PBJ.Construct(value)); - } - } - public Builder ClearShas() { super.ClearShas();return this;} - public Builder SetShas(int index, PBJ.SHA256 value) { - super.SetShas(index,PBJ._PBJ.Construct(value)); - return this; - } - public const int ShasFieldTag=33; - public int ShasCount { get { return super.ShasCount;} } - public bool HasShas(int index) {return PBJ._PBJ.ValidateSha256(super.GetShas(index));} - public PBJ.SHA256 Shas(int index) { - return (PBJ.SHA256)PBJ._PBJ.CastSha256(super.GetShas(index)); - } - public Builder AddShas(PBJ.SHA256 value) { - super.AddShas(PBJ._PBJ.Construct(value)); - return this; - } - public Builder ClearV3F() { super.ClearV3F();return this;} - public const int V3FFieldTag=4; - public bool HasV3F{ get {return super.V3FCount>=3;} } - public PBJ.Vector3f V3F{ get { - int index=0; - if (HasV3F) { - return PBJ._PBJ.CastVector3f(super.GetV3F(index*3+0),super.GetV3F(index*3+1),super.GetV3F(index*3+2)); - } else { - return PBJ._PBJ.CastVector3f(); - } - } - set { - super.ClearV3F(); - float[] _PBJtempArray=PBJ._PBJ.ConstructVector3f(value); - super.AddV3F(_PBJtempArray[0]); - super.AddV3F(_PBJtempArray[1]); - super.AddV3F(_PBJtempArray[2]); - } - } - public Builder ClearV3Ff() { super.ClearV3Ff();return this;} - public const int V3FfFieldTag=5; - public int V3FfCount { get { return super.V3FfCount/3;} } - public bool HasV3Ff(int index) { return true; } - public PBJ.Vector3f GetV3Ff(int index) { - if (HasV3Ff(index)) { - return PBJ._PBJ.CastVector3f(super.GetV3Ff(index*3+0),super.GetV3Ff(index*3+1),super.GetV3Ff(index*3+2)); - } else { - return PBJ._PBJ.CastVector3f(); - } - } - public Builder AddV3Ff(PBJ.Vector3f value) { - float[] _PBJtempArray=PBJ._PBJ.ConstructVector3f(value); - super.AddV3Ff(_PBJtempArray[0]); - super.AddV3Ff(_PBJtempArray[1]); - super.AddV3Ff(_PBJtempArray[2]); - return this; - } - public Builder SetV3Ff(int index,PBJ.Vector3f value) { - float[] _PBJtempArray=PBJ._PBJ.ConstructVector3f(value); - super.SetV3Ff(index*3+0,_PBJtempArray[0]); - super.SetV3Ff(index*3+1,_PBJtempArray[1]); - super.SetV3Ff(index*3+2,_PBJtempArray[2]); - return this; - } - } - } -} -namespace Sirikata.PB { - public class TestMessage : PBJ.IMessage { - protected _PBJ_Internal.TestMessage super; - public _PBJ_Internal.TestMessage _PBJSuper{ get { return super;} } - public TestMessage() { - super=new _PBJ_Internal.TestMessage(); - } - public TestMessage(_PBJ_Internal.TestMessage reference) { - super=reference; - } - public static TestMessage defaultInstance= new TestMessage (_PBJ_Internal.TestMessage.DefaultInstance); - public static TestMessage DefaultInstance{ - get {return defaultInstance;} - } - public static pbd.MessageDescriptor Descriptor { - get { return _PBJ_Internal.TestMessage.Descriptor; } } - public static class Types { - public enum Flagsf32 { - UNIVERSA=_PBJ_Internal.TestMessage.Types.Flagsf32.UNIVERSA, - WE=_PBJ_Internal.TestMessage.Types.Flagsf32.WE, - IMAGE=_PBJ_Internal.TestMessage.Types.Flagsf32.IMAGE, - LOCA=_PBJ_Internal.TestMessage.Types.Flagsf32.LOCA - }; - public enum Flagsf64 { - UNIVERSAL=_PBJ_Internal.TestMessage.Types.Flagsf64.UNIVERSAL, - WEB=_PBJ_Internal.TestMessage.Types.Flagsf64.WEB, - IMAGES=_PBJ_Internal.TestMessage.Types.Flagsf64.IMAGES, - LOCAL=_PBJ_Internal.TestMessage.Types.Flagsf64.LOCAL - }; - public enum Enum32 { - UNIVERSAL1=_PBJ_Internal.TestMessage.Types.Enum32.UNIVERSAL1, - WEB1=_PBJ_Internal.TestMessage.Types.Enum32.WEB1, - IMAGES1=_PBJ_Internal.TestMessage.Types.Enum32.IMAGES1, - LOCAL1=_PBJ_Internal.TestMessage.Types.Enum32.LOCAL1 - }; - public class SubMessage : PBJ.IMessage { - protected _PBJ_Internal.TestMessage.Types.SubMessage super; - public _PBJ_Internal.TestMessage.Types.SubMessage _PBJSuper{ get { return super;} } - public SubMessage() { - super=new _PBJ_Internal.TestMessage.Types.SubMessage(); - } - public SubMessage(_PBJ_Internal.TestMessage.Types.SubMessage reference) { - super=reference; - } - public static SubMessage defaultInstance= new SubMessage (_PBJ_Internal.TestMessage.Types.SubMessage.DefaultInstance); - public static SubMessage DefaultInstance{ - get {return defaultInstance;} - } - public static pbd.MessageDescriptor Descriptor { - get { return _PBJ_Internal.TestMessage.Types.SubMessage.Descriptor; } } - public static class Types { - } - public static bool WithinReservedFieldTagRange(int field_tag) { - return false; - } - public static bool WithinExtensionFieldTagRange(int field_tag) { - return false; - } - public const int SubuuidFieldTag=1; - public bool HasSubuuid{ get {return super.HasSubuuid&&PBJ._PBJ.ValidateUuid(super.Subuuid);} } - public PBJ.UUID Subuuid{ get { - if (HasSubuuid) { - return PBJ._PBJ.CastUuid(super.Subuuid); - } else { - return PBJ._PBJ.CastUuid(); - } - } - } - public const int SubvectorFieldTag=2; - public bool HasSubvector{ get {return super.SubvectorCount>=3;} } - public PBJ.Vector3d Subvector{ get { - int index=0; - if (HasSubvector) { - return PBJ._PBJ.CastVector3d(super.GetSubvector(index*3+0),super.GetSubvector(index*3+1),super.GetSubvector(index*3+2)); - } else { - return PBJ._PBJ.CastVector3d(); - } - } - } - public const int SubdurationFieldTag=3; - public bool HasSubduration{ get {return super.HasSubduration&&PBJ._PBJ.ValidateDuration(super.Subduration);} } - public PBJ.Duration Subduration{ get { - if (HasSubduration) { - return PBJ._PBJ.CastDuration(super.Subduration); - } else { - return PBJ._PBJ.CastDuration(); - } - } - } - public const int SubnormalFieldTag=4; - public bool HasSubnormal{ get {return super.SubnormalCount>=2;} } - public PBJ.Vector3f Subnormal{ get { - int index=0; - if (HasSubnormal) { - return PBJ._PBJ.CastNormal(super.GetSubnormal(index*2+0),super.GetSubnormal(index*2+1)); - } else { - return PBJ._PBJ.CastNormal(); - } - } - } - public override Google.ProtocolBuffers.IMessage _PBJISuper { get { return super; } } - public override PBJ.IMessage.IBuilder WeakCreateBuilderForType() { return new Builder(); } - public static Builder CreateBuilder() { return new Builder(); } - public static Builder CreateBuilder(SubMessage prototype) { - return (Builder)new Builder().MergeFrom(prototype); - } - public static SubMessage ParseFrom(pb::ByteString data) { - return new SubMessage(_PBJ_Internal.TestMessage.Types.SubMessage.ParseFrom(data)); - } - public static SubMessage ParseFrom(pb::ByteString data, pb::ExtensionRegistry er) { - return new SubMessage(_PBJ_Internal.TestMessage.Types.SubMessage.ParseFrom(data,er)); - } - public static SubMessage ParseFrom(byte[] data) { - return new SubMessage(_PBJ_Internal.TestMessage.Types.SubMessage.ParseFrom(data)); - } - public static SubMessage ParseFrom(byte[] data, pb::ExtensionRegistry er) { - return new SubMessage(_PBJ_Internal.TestMessage.Types.SubMessage.ParseFrom(data,er)); - } - public static SubMessage ParseFrom(global::System.IO.Stream data) { - return new SubMessage(_PBJ_Internal.TestMessage.Types.SubMessage.ParseFrom(data)); - } - public static SubMessage ParseFrom(global::System.IO.Stream data, pb::ExtensionRegistry er) { - return new SubMessage(_PBJ_Internal.TestMessage.Types.SubMessage.ParseFrom(data,er)); - } - public static SubMessage ParseFrom(pb::CodedInputStream data) { - return new SubMessage(_PBJ_Internal.TestMessage.Types.SubMessage.ParseFrom(data)); - } - public static SubMessage ParseFrom(pb::CodedInputStream data, pb::ExtensionRegistry er) { - return new SubMessage(_PBJ_Internal.TestMessage.Types.SubMessage.ParseFrom(data,er)); - } - protected override bool _HasAllPBJFields{ get { - return true - ; - } } - public bool IsInitialized { get { - return super.IsInitialized&&_HasAllPBJFields; - } } - public class Builder : global::PBJ.IMessage.IBuilder{ - protected override bool _HasAllPBJFields{ get { - return true - ; - } } - public bool IsInitialized { get { - return super.IsInitialized&&_HasAllPBJFields; - } } - protected _PBJ_Internal.TestMessage.Types.SubMessage.Builder super; - public override Google.ProtocolBuffers.IBuilder _PBJISuper { get { return super; } } - public _PBJ_Internal.TestMessage.Types.SubMessage.Builder _PBJSuper{ get { return super;} } - public Builder() {super = new _PBJ_Internal.TestMessage.Types.SubMessage.Builder();} - public Builder(_PBJ_Internal.TestMessage.Types.SubMessage.Builder other) { - super=other; - } - public Builder Clone() {return new Builder(super.Clone());} - public Builder MergeFrom(SubMessage prototype) { super.MergeFrom(prototype._PBJSuper);return this;} - public Builder Clear() {super.Clear();return this;} - public SubMessage BuildPartial() {return new SubMessage(super.BuildPartial());} - public SubMessage Build() {if (_HasAllPBJFields) return new SubMessage(super.Build());return null;} - public pbd::MessageDescriptor DescriptorForType { - get { return SubMessage.Descriptor; } } - public Builder ClearSubuuid() { super.ClearSubuuid();return this;} - public const int SubuuidFieldTag=1; - public bool HasSubuuid{ get {return super.HasSubuuid&&PBJ._PBJ.ValidateUuid(super.Subuuid);} } - public PBJ.UUID Subuuid{ get { - if (HasSubuuid) { - return PBJ._PBJ.CastUuid(super.Subuuid); - } else { - return PBJ._PBJ.CastUuid(); - } - } - set { - super.Subuuid=(PBJ._PBJ.Construct(value)); - } - } - public Builder ClearSubvector() { super.ClearSubvector();return this;} - public const int SubvectorFieldTag=2; - public bool HasSubvector{ get {return super.SubvectorCount>=3;} } - public PBJ.Vector3d Subvector{ get { - int index=0; - if (HasSubvector) { - return PBJ._PBJ.CastVector3d(super.GetSubvector(index*3+0),super.GetSubvector(index*3+1),super.GetSubvector(index*3+2)); - } else { - return PBJ._PBJ.CastVector3d(); - } - } - set { - super.ClearSubvector(); - double[] _PBJtempArray=PBJ._PBJ.ConstructVector3d(value); - super.AddSubvector(_PBJtempArray[0]); - super.AddSubvector(_PBJtempArray[1]); - super.AddSubvector(_PBJtempArray[2]); - } - } - public Builder ClearSubduration() { super.ClearSubduration();return this;} - public const int SubdurationFieldTag=3; - public bool HasSubduration{ get {return super.HasSubduration&&PBJ._PBJ.ValidateDuration(super.Subduration);} } - public PBJ.Duration Subduration{ get { - if (HasSubduration) { - return PBJ._PBJ.CastDuration(super.Subduration); - } else { - return PBJ._PBJ.CastDuration(); - } - } - set { - super.Subduration=(PBJ._PBJ.Construct(value)); - } - } - public Builder ClearSubnormal() { super.ClearSubnormal();return this;} - public const int SubnormalFieldTag=4; - public bool HasSubnormal{ get {return super.SubnormalCount>=2;} } - public PBJ.Vector3f Subnormal{ get { - int index=0; - if (HasSubnormal) { - return PBJ._PBJ.CastNormal(super.GetSubnormal(index*2+0),super.GetSubnormal(index*2+1)); - } else { - return PBJ._PBJ.CastNormal(); - } - } - set { - super.ClearSubnormal(); - float[] _PBJtempArray=PBJ._PBJ.ConstructNormal(value); - super.AddSubnormal(_PBJtempArray[0]); - super.AddSubnormal(_PBJtempArray[1]); - } - } - } - } - } - public static bool WithinReservedFieldTagRange(int field_tag) { - return false; - } - public static bool WithinExtensionFieldTagRange(int field_tag) { - return false||(field_tag>=100&&field_tag<=199); - } - public const int XxdFieldTag=20; - public bool HasXxd{ get {return super.HasXxd&&PBJ._PBJ.ValidateDouble(super.Xxd);} } - public double Xxd{ get { - if (HasXxd) { - return PBJ._PBJ.CastDouble(super.Xxd); - } else { - return 10.3; - } - } - } - public const int XxfFieldTag=21; - public bool HasXxf{ get {return super.HasXxf&&PBJ._PBJ.ValidateFloat(super.Xxf);} } - public float Xxf{ get { - if (HasXxf) { - return PBJ._PBJ.CastFloat(super.Xxf); - } else { - return PBJ._PBJ.CastFloat(); - } - } - } - public const int Xxu32FieldTag=22; - public bool HasXxu32{ get {return super.HasXxu32&&PBJ._PBJ.ValidateUint32(super.Xxu32);} } - public uint Xxu32{ get { - if (HasXxu32) { - return PBJ._PBJ.CastUint32(super.Xxu32); - } else { - return PBJ._PBJ.CastUint32(); - } - } - } - public const int XxsFieldTag=23; - public bool HasXxs{ get {return super.HasXxs&&PBJ._PBJ.ValidateString(super.Xxs);} } - public string Xxs{ get { - if (HasXxs) { - return PBJ._PBJ.CastString(super.Xxs); - } else { - return PBJ._PBJ.CastString(); - } - } - } - public const int XxbFieldTag=24; - public bool HasXxb{ get {return super.HasXxb&&PBJ._PBJ.ValidateBytes(super.Xxb);} } - public pb::ByteString Xxb{ get { - if (HasXxb) { - return PBJ._PBJ.CastBytes(super.Xxb); - } else { - return PBJ._PBJ.CastBytes(); - } - } - } - public const int XxssFieldTag=25; - public int XxssCount { get { return super.XxssCount;} } - public bool HasXxss(int index) {return PBJ._PBJ.ValidateString(super.GetXxss(index));} - public string Xxss(int index) { - return (string)PBJ._PBJ.CastString(super.GetXxss(index)); - } - public const int XxbbFieldTag=26; - public int XxbbCount { get { return super.XxbbCount;} } - public bool HasXxbb(int index) {return PBJ._PBJ.ValidateBytes(super.GetXxbb(index));} - public pb::ByteString Xxbb(int index) { - return (pb::ByteString)PBJ._PBJ.CastBytes(super.GetXxbb(index)); - } - public const int XxffFieldTag=27; - public int XxffCount { get { return super.XxffCount;} } - public bool HasXxff(int index) {return PBJ._PBJ.ValidateFloat(super.GetXxff(index));} - public float Xxff(int index) { - return (float)PBJ._PBJ.CastFloat(super.GetXxff(index)); - } - public const int XxnnFieldTag=29; - public int XxnnCount { get { return super.XxnnCount/2;} } - public bool HasXxnn(int index) { return true; } - public PBJ.Vector3f GetXxnn(int index) { - if (HasXxnn(index)) { - return PBJ._PBJ.CastNormal(super.GetXxnn(index*2+0),super.GetXxnn(index*2+1)); - } else { - return PBJ._PBJ.CastNormal(); - } - } - public const int XxfrFieldTag=28; - public bool HasXxfr{ get {return super.HasXxfr&&PBJ._PBJ.ValidateFloat(super.Xxfr);} } - public float Xxfr{ get { - if (HasXxfr) { - return PBJ._PBJ.CastFloat(super.Xxfr); - } else { - return PBJ._PBJ.CastFloat(); - } - } - } - public const int NFieldTag=1; - public bool HasN{ get {return super.NCount>=2;} } - public PBJ.Vector3f N{ get { - int index=0; - if (HasN) { - return PBJ._PBJ.CastNormal(super.GetN(index*2+0),super.GetN(index*2+1)); - } else { - return PBJ._PBJ.CastNormal(); - } - } - } - public const int V2FFieldTag=2; - public bool HasV2F{ get {return super.V2FCount>=2;} } - public PBJ.Vector2f V2F{ get { - int index=0; - if (HasV2F) { - return PBJ._PBJ.CastVector2f(super.GetV2F(index*2+0),super.GetV2F(index*2+1)); - } else { - return PBJ._PBJ.CastVector2f(); - } - } - } - public const int V2DFieldTag=3; - public bool HasV2D{ get {return super.V2DCount>=2;} } - public PBJ.Vector2d V2D{ get { - int index=0; - if (HasV2D) { - return PBJ._PBJ.CastVector2d(super.GetV2D(index*2+0),super.GetV2D(index*2+1)); - } else { - return PBJ._PBJ.CastVector2d(); - } - } - } - public const int V3FFieldTag=4; - public bool HasV3F{ get {return super.V3FCount>=3;} } - public PBJ.Vector3f V3F{ get { - int index=0; - if (HasV3F) { - return PBJ._PBJ.CastVector3f(super.GetV3F(index*3+0),super.GetV3F(index*3+1),super.GetV3F(index*3+2)); - } else { - return PBJ._PBJ.CastVector3f(); - } - } - } - public const int V3DFieldTag=5; - public bool HasV3D{ get {return super.V3DCount>=3;} } - public PBJ.Vector3d V3D{ get { - int index=0; - if (HasV3D) { - return PBJ._PBJ.CastVector3d(super.GetV3D(index*3+0),super.GetV3D(index*3+1),super.GetV3D(index*3+2)); - } else { - return PBJ._PBJ.CastVector3d(); - } - } - } - public const int V4FFieldTag=6; - public bool HasV4F{ get {return super.V4FCount>=4;} } - public PBJ.Vector4f V4F{ get { - int index=0; - if (HasV4F) { - return PBJ._PBJ.CastVector4f(super.GetV4F(index*4+0),super.GetV4F(index*4+1),super.GetV4F(index*4+2),super.GetV4F(index*4+3)); - } else { - return PBJ._PBJ.CastVector4f(); - } - } - } - public const int V4DFieldTag=7; - public bool HasV4D{ get {return super.V4DCount>=4;} } - public PBJ.Vector4d V4D{ get { - int index=0; - if (HasV4D) { - return PBJ._PBJ.CastVector4d(super.GetV4D(index*4+0),super.GetV4D(index*4+1),super.GetV4D(index*4+2),super.GetV4D(index*4+3)); - } else { - return PBJ._PBJ.CastVector4d(); - } - } - } - public const int QFieldTag=8; - public bool HasQ{ get {return super.QCount>=3;} } - public PBJ.Quaternion Q{ get { - int index=0; - if (HasQ) { - return PBJ._PBJ.CastQuaternion(super.GetQ(index*3+0),super.GetQ(index*3+1),super.GetQ(index*3+2)); - } else { - return PBJ._PBJ.CastQuaternion(); - } - } - } - public const int UFieldTag=9; - public bool HasU{ get {return super.HasU&&PBJ._PBJ.ValidateUuid(super.U);} } - public PBJ.UUID U{ get { - if (HasU) { - return PBJ._PBJ.CastUuid(super.U); - } else { - return PBJ._PBJ.CastUuid(); - } - } - } - public const int AFieldTag=10; - public bool HasA{ get {return super.HasA&&PBJ._PBJ.ValidateAngle(super.A);} } - public float A{ get { - if (HasA) { - return PBJ._PBJ.CastAngle(super.A); - } else { - return PBJ._PBJ.CastAngle(); - } - } - } - public const int TFieldTag=11; - public bool HasT{ get {return super.HasT&&PBJ._PBJ.ValidateTime(super.T);} } - public PBJ.Time T{ get { - if (HasT) { - return PBJ._PBJ.CastTime(super.T); - } else { - return PBJ._PBJ.CastTime(); - } - } - } - public const int DFieldTag=12; - public bool HasD{ get {return super.HasD&&PBJ._PBJ.ValidateDuration(super.D);} } - public PBJ.Duration D{ get { - if (HasD) { - return PBJ._PBJ.CastDuration(super.D); - } else { - return PBJ._PBJ.CastDuration(); - } - } - } - public const int F32FieldTag=13; - public bool HasF32 { get { - if (!super.HasF32) return false; - return PBJ._PBJ.ValidateFlags(super.F32,(ulong)Types.Flagsf32.UNIVERSA|(ulong)Types.Flagsf32.WE|(ulong)Types.Flagsf32.IMAGE|(ulong)Types.Flagsf32.LOCA); - } } - public uint F32{ get { - if (HasF32) { - return (uint)PBJ._PBJ.CastFlags(super.F32,(ulong)Types.Flagsf32.UNIVERSA|(ulong)Types.Flagsf32.WE|(ulong)Types.Flagsf32.IMAGE|(ulong)Types.Flagsf32.LOCA); - } else { - return (uint)PBJ._PBJ.CastFlags((ulong)Types.Flagsf32.UNIVERSA|(ulong)Types.Flagsf32.WE|(ulong)Types.Flagsf32.IMAGE|(ulong)Types.Flagsf32.LOCA); - } - } - } - public const int F64FieldTag=14; - public bool HasF64 { get { - if (!super.HasF64) return false; - return PBJ._PBJ.ValidateFlags(super.F64,(ulong)Types.Flagsf64.UNIVERSAL|(ulong)Types.Flagsf64.WEB|(ulong)Types.Flagsf64.IMAGES|(ulong)Types.Flagsf64.LOCAL); - } } - public ulong F64{ get { - if (HasF64) { - return (ulong)PBJ._PBJ.CastFlags(super.F64,(ulong)Types.Flagsf64.UNIVERSAL|(ulong)Types.Flagsf64.WEB|(ulong)Types.Flagsf64.IMAGES|(ulong)Types.Flagsf64.LOCAL); - } else { - return (ulong)PBJ._PBJ.CastFlags((ulong)Types.Flagsf64.UNIVERSAL|(ulong)Types.Flagsf64.WEB|(ulong)Types.Flagsf64.IMAGES|(ulong)Types.Flagsf64.LOCAL); - } - } - } - public const int BsfFieldTag=15; - public bool HasBsf{ get {return super.BsfCount>=4;} } - public PBJ.BoundingSphere3f Bsf{ get { - int index=0; - if (HasBsf) { - return PBJ._PBJ.CastBoundingsphere3f(super.GetBsf(index*4+0),super.GetBsf(index*4+1),super.GetBsf(index*4+2),super.GetBsf(index*4+3)); - } else { - return PBJ._PBJ.CastBoundingsphere3f(); - } - } - } - public const int BsdFieldTag=16; - public bool HasBsd{ get {return super.BsdCount>=4;} } - public PBJ.BoundingSphere3d Bsd{ get { - int index=0; - if (HasBsd) { - return PBJ._PBJ.CastBoundingsphere3d(super.GetBsd(index*4+0),super.GetBsd(index*4+1),super.GetBsd(index*4+2),super.GetBsd(index*4+3)); - } else { - return PBJ._PBJ.CastBoundingsphere3d(); - } - } - } - public const int BbfFieldTag=17; - public bool HasBbf{ get {return super.BbfCount>=6;} } - public PBJ.BoundingBox3f3f Bbf{ get { - int index=0; - if (HasBbf) { - return PBJ._PBJ.CastBoundingbox3f3f(super.GetBbf(index*6+0),super.GetBbf(index*6+1),super.GetBbf(index*6+2),super.GetBbf(index*6+3),super.GetBbf(index*6+4),super.GetBbf(index*6+5)); - } else { - return PBJ._PBJ.CastBoundingbox3f3f(); - } - } - } - public const int BbdFieldTag=18; - public bool HasBbd{ get {return super.BbdCount>=6;} } - public PBJ.BoundingBox3d3f Bbd{ get { - int index=0; - if (HasBbd) { - return PBJ._PBJ.CastBoundingbox3d3f(super.GetBbd(index*6+0),super.GetBbd(index*6+1),super.GetBbd(index*6+2),super.GetBbd(index*6+3),super.GetBbd(index*6+4),super.GetBbd(index*6+5)); - } else { - return PBJ._PBJ.CastBoundingbox3d3f(); - } - } - } - public const int E32FieldTag=19; - public bool HasE32{ get {return super.HasE32;} } - public Types.Enum32 E32{ get { - if (HasE32) { - return (Types.Enum32)super.E32; - } else { - return new Types.Enum32(); - } - } - } - public const int SubmesFieldTag=30; - public bool HasSubmes{ get {return super.HasSubmes;} } - public Types.SubMessage Submes{ get { - if (HasSubmes) { - return new Types.SubMessage(super.Submes); - } else { - return new Types.SubMessage(); - } - } - } - public const int SubmessersFieldTag=31; - public int SubmessersCount { get { return super.SubmessersCount;} } - public bool HasSubmessers(int index) {return true;} - public Types.SubMessage Submessers(int index) { - return new Types.SubMessage(super.GetSubmessers(index)); - } - public const int ShaFieldTag=32; - public bool HasSha{ get {return super.HasSha&&PBJ._PBJ.ValidateSha256(super.Sha);} } - public PBJ.SHA256 Sha{ get { - if (HasSha) { - return PBJ._PBJ.CastSha256(super.Sha); - } else { - return PBJ._PBJ.CastSha256(); - } - } - } - public const int ShasFieldTag=33; - public int ShasCount { get { return super.ShasCount;} } - public bool HasShas(int index) {return PBJ._PBJ.ValidateSha256(super.GetShas(index));} - public PBJ.SHA256 Shas(int index) { - return (PBJ.SHA256)PBJ._PBJ.CastSha256(super.GetShas(index)); - } - public const int ExtmesFieldTag=34; - public bool HasExtmes{ get {return super.HasExtmes;} } - public ExternalMessage Extmes{ get { - if (HasExtmes) { - return new ExternalMessage(super.Extmes); - } else { - return new ExternalMessage(); - } - } - } - public const int ExtmessersFieldTag=35; - public int ExtmessersCount { get { return super.ExtmessersCount;} } - public bool HasExtmessers(int index) {return true;} - public ExternalMessage Extmessers(int index) { - return new ExternalMessage(super.GetExtmessers(index)); - } - public const int ExtmesserFieldTag=36; - public bool HasExtmesser{ get {return super.HasExtmesser;} } - public ExternalMessage Extmesser{ get { - if (HasExtmesser) { - return new ExternalMessage(super.Extmesser); - } else { - return new ExternalMessage(); - } - } - } - public override Google.ProtocolBuffers.IMessage _PBJISuper { get { return super; } } - public override PBJ.IMessage.IBuilder WeakCreateBuilderForType() { return new Builder(); } - public static Builder CreateBuilder() { return new Builder(); } - public static Builder CreateBuilder(TestMessage prototype) { - return (Builder)new Builder().MergeFrom(prototype); - } - public static TestMessage ParseFrom(pb::ByteString data) { - return new TestMessage(_PBJ_Internal.TestMessage.ParseFrom(data)); - } - public static TestMessage ParseFrom(pb::ByteString data, pb::ExtensionRegistry er) { - return new TestMessage(_PBJ_Internal.TestMessage.ParseFrom(data,er)); - } - public static TestMessage ParseFrom(byte[] data) { - return new TestMessage(_PBJ_Internal.TestMessage.ParseFrom(data)); - } - public static TestMessage ParseFrom(byte[] data, pb::ExtensionRegistry er) { - return new TestMessage(_PBJ_Internal.TestMessage.ParseFrom(data,er)); - } - public static TestMessage ParseFrom(global::System.IO.Stream data) { - return new TestMessage(_PBJ_Internal.TestMessage.ParseFrom(data)); - } - public static TestMessage ParseFrom(global::System.IO.Stream data, pb::ExtensionRegistry er) { - return new TestMessage(_PBJ_Internal.TestMessage.ParseFrom(data,er)); - } - public static TestMessage ParseFrom(pb::CodedInputStream data) { - return new TestMessage(_PBJ_Internal.TestMessage.ParseFrom(data)); - } - public static TestMessage ParseFrom(pb::CodedInputStream data, pb::ExtensionRegistry er) { - return new TestMessage(_PBJ_Internal.TestMessage.ParseFrom(data,er)); - } - protected override bool _HasAllPBJFields{ get { - return true - &&HasV3F - ; - } } - public bool IsInitialized { get { - return super.IsInitialized&&_HasAllPBJFields; - } } - public class Builder : global::PBJ.IMessage.IBuilder{ - protected override bool _HasAllPBJFields{ get { - return true - &&HasV3F - ; - } } - public bool IsInitialized { get { - return super.IsInitialized&&_HasAllPBJFields; - } } - protected _PBJ_Internal.TestMessage.Builder super; - public override Google.ProtocolBuffers.IBuilder _PBJISuper { get { return super; } } - public _PBJ_Internal.TestMessage.Builder _PBJSuper{ get { return super;} } - public Builder() {super = new _PBJ_Internal.TestMessage.Builder();} - public Builder(_PBJ_Internal.TestMessage.Builder other) { - super=other; - } - public Builder Clone() {return new Builder(super.Clone());} - public Builder MergeFrom(TestMessage prototype) { super.MergeFrom(prototype._PBJSuper);return this;} - public Builder Clear() {super.Clear();return this;} - public TestMessage BuildPartial() {return new TestMessage(super.BuildPartial());} - public TestMessage Build() {if (_HasAllPBJFields) return new TestMessage(super.Build());return null;} - public pbd::MessageDescriptor DescriptorForType { - get { return TestMessage.Descriptor; } } - public Builder ClearXxd() { super.ClearXxd();return this;} - public const int XxdFieldTag=20; - public bool HasXxd{ get {return super.HasXxd&&PBJ._PBJ.ValidateDouble(super.Xxd);} } - public double Xxd{ get { - if (HasXxd) { - return PBJ._PBJ.CastDouble(super.Xxd); - } else { - return 10.3; - } - } - set { - super.Xxd=(PBJ._PBJ.Construct(value)); - } - } - public Builder ClearXxf() { super.ClearXxf();return this;} - public const int XxfFieldTag=21; - public bool HasXxf{ get {return super.HasXxf&&PBJ._PBJ.ValidateFloat(super.Xxf);} } - public float Xxf{ get { - if (HasXxf) { - return PBJ._PBJ.CastFloat(super.Xxf); - } else { - return PBJ._PBJ.CastFloat(); - } - } - set { - super.Xxf=(PBJ._PBJ.Construct(value)); - } - } - public Builder ClearXxu32() { super.ClearXxu32();return this;} - public const int Xxu32FieldTag=22; - public bool HasXxu32{ get {return super.HasXxu32&&PBJ._PBJ.ValidateUint32(super.Xxu32);} } - public uint Xxu32{ get { - if (HasXxu32) { - return PBJ._PBJ.CastUint32(super.Xxu32); - } else { - return PBJ._PBJ.CastUint32(); - } - } - set { - super.Xxu32=(PBJ._PBJ.Construct(value)); - } - } - public Builder ClearXxs() { super.ClearXxs();return this;} - public const int XxsFieldTag=23; - public bool HasXxs{ get {return super.HasXxs&&PBJ._PBJ.ValidateString(super.Xxs);} } - public string Xxs{ get { - if (HasXxs) { - return PBJ._PBJ.CastString(super.Xxs); - } else { - return PBJ._PBJ.CastString(); - } - } - set { - super.Xxs=(PBJ._PBJ.Construct(value)); - } - } - public Builder ClearXxb() { super.ClearXxb();return this;} - public const int XxbFieldTag=24; - public bool HasXxb{ get {return super.HasXxb&&PBJ._PBJ.ValidateBytes(super.Xxb);} } - public pb::ByteString Xxb{ get { - if (HasXxb) { - return PBJ._PBJ.CastBytes(super.Xxb); - } else { - return PBJ._PBJ.CastBytes(); - } - } - set { - super.Xxb=(PBJ._PBJ.Construct(value)); - } - } - public Builder ClearXxss() { super.ClearXxss();return this;} - public Builder SetXxss(int index, string value) { - super.SetXxss(index,PBJ._PBJ.Construct(value)); - return this; - } - public const int XxssFieldTag=25; - public int XxssCount { get { return super.XxssCount;} } - public bool HasXxss(int index) {return PBJ._PBJ.ValidateString(super.GetXxss(index));} - public string Xxss(int index) { - return (string)PBJ._PBJ.CastString(super.GetXxss(index)); - } - public Builder AddXxss(string value) { - super.AddXxss(PBJ._PBJ.Construct(value)); - return this; - } - public Builder ClearXxbb() { super.ClearXxbb();return this;} - public Builder SetXxbb(int index, pb::ByteString value) { - super.SetXxbb(index,PBJ._PBJ.Construct(value)); - return this; - } - public const int XxbbFieldTag=26; - public int XxbbCount { get { return super.XxbbCount;} } - public bool HasXxbb(int index) {return PBJ._PBJ.ValidateBytes(super.GetXxbb(index));} - public pb::ByteString Xxbb(int index) { - return (pb::ByteString)PBJ._PBJ.CastBytes(super.GetXxbb(index)); - } - public Builder AddXxbb(pb::ByteString value) { - super.AddXxbb(PBJ._PBJ.Construct(value)); - return this; - } - public Builder ClearXxff() { super.ClearXxff();return this;} - public Builder SetXxff(int index, float value) { - super.SetXxff(index,PBJ._PBJ.Construct(value)); - return this; - } - public const int XxffFieldTag=27; - public int XxffCount { get { return super.XxffCount;} } - public bool HasXxff(int index) {return PBJ._PBJ.ValidateFloat(super.GetXxff(index));} - public float Xxff(int index) { - return (float)PBJ._PBJ.CastFloat(super.GetXxff(index)); - } - public Builder AddXxff(float value) { - super.AddXxff(PBJ._PBJ.Construct(value)); - return this; - } - public Builder ClearXxnn() { super.ClearXxnn();return this;} - public const int XxnnFieldTag=29; - public int XxnnCount { get { return super.XxnnCount/2;} } - public bool HasXxnn(int index) { return true; } - public PBJ.Vector3f GetXxnn(int index) { - if (HasXxnn(index)) { - return PBJ._PBJ.CastNormal(super.GetXxnn(index*2+0),super.GetXxnn(index*2+1)); - } else { - return PBJ._PBJ.CastNormal(); - } - } - public Builder AddXxnn(PBJ.Vector3f value) { - float[] _PBJtempArray=PBJ._PBJ.ConstructNormal(value); - super.AddXxnn(_PBJtempArray[0]); - super.AddXxnn(_PBJtempArray[1]); - return this; - } - public Builder SetXxnn(int index,PBJ.Vector3f value) { - float[] _PBJtempArray=PBJ._PBJ.ConstructNormal(value); - super.SetXxnn(index*2+0,_PBJtempArray[0]); - super.SetXxnn(index*2+1,_PBJtempArray[1]); - return this; - } - public Builder ClearXxfr() { super.ClearXxfr();return this;} - public const int XxfrFieldTag=28; - public bool HasXxfr{ get {return super.HasXxfr&&PBJ._PBJ.ValidateFloat(super.Xxfr);} } - public float Xxfr{ get { - if (HasXxfr) { - return PBJ._PBJ.CastFloat(super.Xxfr); - } else { - return PBJ._PBJ.CastFloat(); - } - } - set { - super.Xxfr=(PBJ._PBJ.Construct(value)); - } - } - public Builder ClearN() { super.ClearN();return this;} - public const int NFieldTag=1; - public bool HasN{ get {return super.NCount>=2;} } - public PBJ.Vector3f N{ get { - int index=0; - if (HasN) { - return PBJ._PBJ.CastNormal(super.GetN(index*2+0),super.GetN(index*2+1)); - } else { - return PBJ._PBJ.CastNormal(); - } - } - set { - super.ClearN(); - float[] _PBJtempArray=PBJ._PBJ.ConstructNormal(value); - super.AddN(_PBJtempArray[0]); - super.AddN(_PBJtempArray[1]); - } - } - public Builder ClearV2F() { super.ClearV2F();return this;} - public const int V2FFieldTag=2; - public bool HasV2F{ get {return super.V2FCount>=2;} } - public PBJ.Vector2f V2F{ get { - int index=0; - if (HasV2F) { - return PBJ._PBJ.CastVector2f(super.GetV2F(index*2+0),super.GetV2F(index*2+1)); - } else { - return PBJ._PBJ.CastVector2f(); - } - } - set { - super.ClearV2F(); - float[] _PBJtempArray=PBJ._PBJ.ConstructVector2f(value); - super.AddV2F(_PBJtempArray[0]); - super.AddV2F(_PBJtempArray[1]); - } - } - public Builder ClearV2D() { super.ClearV2D();return this;} - public const int V2DFieldTag=3; - public bool HasV2D{ get {return super.V2DCount>=2;} } - public PBJ.Vector2d V2D{ get { - int index=0; - if (HasV2D) { - return PBJ._PBJ.CastVector2d(super.GetV2D(index*2+0),super.GetV2D(index*2+1)); - } else { - return PBJ._PBJ.CastVector2d(); - } - } - set { - super.ClearV2D(); - double[] _PBJtempArray=PBJ._PBJ.ConstructVector2d(value); - super.AddV2D(_PBJtempArray[0]); - super.AddV2D(_PBJtempArray[1]); - } - } - public Builder ClearV3F() { super.ClearV3F();return this;} - public const int V3FFieldTag=4; - public bool HasV3F{ get {return super.V3FCount>=3;} } - public PBJ.Vector3f V3F{ get { - int index=0; - if (HasV3F) { - return PBJ._PBJ.CastVector3f(super.GetV3F(index*3+0),super.GetV3F(index*3+1),super.GetV3F(index*3+2)); - } else { - return PBJ._PBJ.CastVector3f(); - } - } - set { - super.ClearV3F(); - float[] _PBJtempArray=PBJ._PBJ.ConstructVector3f(value); - super.AddV3F(_PBJtempArray[0]); - super.AddV3F(_PBJtempArray[1]); - super.AddV3F(_PBJtempArray[2]); - } - } - public Builder ClearV3D() { super.ClearV3D();return this;} - public const int V3DFieldTag=5; - public bool HasV3D{ get {return super.V3DCount>=3;} } - public PBJ.Vector3d V3D{ get { - int index=0; - if (HasV3D) { - return PBJ._PBJ.CastVector3d(super.GetV3D(index*3+0),super.GetV3D(index*3+1),super.GetV3D(index*3+2)); - } else { - return PBJ._PBJ.CastVector3d(); - } - } - set { - super.ClearV3D(); - double[] _PBJtempArray=PBJ._PBJ.ConstructVector3d(value); - super.AddV3D(_PBJtempArray[0]); - super.AddV3D(_PBJtempArray[1]); - super.AddV3D(_PBJtempArray[2]); - } - } - public Builder ClearV4F() { super.ClearV4F();return this;} - public const int V4FFieldTag=6; - public bool HasV4F{ get {return super.V4FCount>=4;} } - public PBJ.Vector4f V4F{ get { - int index=0; - if (HasV4F) { - return PBJ._PBJ.CastVector4f(super.GetV4F(index*4+0),super.GetV4F(index*4+1),super.GetV4F(index*4+2),super.GetV4F(index*4+3)); - } else { - return PBJ._PBJ.CastVector4f(); - } - } - set { - super.ClearV4F(); - float[] _PBJtempArray=PBJ._PBJ.ConstructVector4f(value); - super.AddV4F(_PBJtempArray[0]); - super.AddV4F(_PBJtempArray[1]); - super.AddV4F(_PBJtempArray[2]); - super.AddV4F(_PBJtempArray[3]); - } - } - public Builder ClearV4D() { super.ClearV4D();return this;} - public const int V4DFieldTag=7; - public bool HasV4D{ get {return super.V4DCount>=4;} } - public PBJ.Vector4d V4D{ get { - int index=0; - if (HasV4D) { - return PBJ._PBJ.CastVector4d(super.GetV4D(index*4+0),super.GetV4D(index*4+1),super.GetV4D(index*4+2),super.GetV4D(index*4+3)); - } else { - return PBJ._PBJ.CastVector4d(); - } - } - set { - super.ClearV4D(); - double[] _PBJtempArray=PBJ._PBJ.ConstructVector4d(value); - super.AddV4D(_PBJtempArray[0]); - super.AddV4D(_PBJtempArray[1]); - super.AddV4D(_PBJtempArray[2]); - super.AddV4D(_PBJtempArray[3]); - } - } - public Builder ClearQ() { super.ClearQ();return this;} - public const int QFieldTag=8; - public bool HasQ{ get {return super.QCount>=3;} } - public PBJ.Quaternion Q{ get { - int index=0; - if (HasQ) { - return PBJ._PBJ.CastQuaternion(super.GetQ(index*3+0),super.GetQ(index*3+1),super.GetQ(index*3+2)); - } else { - return PBJ._PBJ.CastQuaternion(); - } - } - set { - super.ClearQ(); - float[] _PBJtempArray=PBJ._PBJ.ConstructQuaternion(value); - super.AddQ(_PBJtempArray[0]); - super.AddQ(_PBJtempArray[1]); - super.AddQ(_PBJtempArray[2]); - } - } - public Builder ClearU() { super.ClearU();return this;} - public const int UFieldTag=9; - public bool HasU{ get {return super.HasU&&PBJ._PBJ.ValidateUuid(super.U);} } - public PBJ.UUID U{ get { - if (HasU) { - return PBJ._PBJ.CastUuid(super.U); - } else { - return PBJ._PBJ.CastUuid(); - } - } - set { - super.U=(PBJ._PBJ.Construct(value)); - } - } - public Builder ClearA() { super.ClearA();return this;} - public const int AFieldTag=10; - public bool HasA{ get {return super.HasA&&PBJ._PBJ.ValidateAngle(super.A);} } - public float A{ get { - if (HasA) { - return PBJ._PBJ.CastAngle(super.A); - } else { - return PBJ._PBJ.CastAngle(); - } - } - set { - super.A=(PBJ._PBJ.Construct(value)); - } - } - public Builder ClearT() { super.ClearT();return this;} - public const int TFieldTag=11; - public bool HasT{ get {return super.HasT&&PBJ._PBJ.ValidateTime(super.T);} } - public PBJ.Time T{ get { - if (HasT) { - return PBJ._PBJ.CastTime(super.T); - } else { - return PBJ._PBJ.CastTime(); - } - } - set { - super.T=(PBJ._PBJ.Construct(value)); - } - } - public Builder ClearD() { super.ClearD();return this;} - public const int DFieldTag=12; - public bool HasD{ get {return super.HasD&&PBJ._PBJ.ValidateDuration(super.D);} } - public PBJ.Duration D{ get { - if (HasD) { - return PBJ._PBJ.CastDuration(super.D); - } else { - return PBJ._PBJ.CastDuration(); - } - } - set { - super.D=(PBJ._PBJ.Construct(value)); - } - } - public Builder ClearF32() { super.ClearF32();return this;} - public const int F32FieldTag=13; - public bool HasF32 { get { - if (!super.HasF32) return false; - return PBJ._PBJ.ValidateFlags(super.F32,(ulong)Types.Flagsf32.UNIVERSA|(ulong)Types.Flagsf32.WE|(ulong)Types.Flagsf32.IMAGE|(ulong)Types.Flagsf32.LOCA); - } } - public uint F32{ get { - if (HasF32) { - return (uint)PBJ._PBJ.CastFlags(super.F32,(ulong)Types.Flagsf32.UNIVERSA|(ulong)Types.Flagsf32.WE|(ulong)Types.Flagsf32.IMAGE|(ulong)Types.Flagsf32.LOCA); - } else { - return (uint)PBJ._PBJ.CastFlags((ulong)Types.Flagsf32.UNIVERSA|(ulong)Types.Flagsf32.WE|(ulong)Types.Flagsf32.IMAGE|(ulong)Types.Flagsf32.LOCA); - } - } - set { - super.F32=((value)); - } - } - public Builder ClearF64() { super.ClearF64();return this;} - public const int F64FieldTag=14; - public bool HasF64 { get { - if (!super.HasF64) return false; - return PBJ._PBJ.ValidateFlags(super.F64,(ulong)Types.Flagsf64.UNIVERSAL|(ulong)Types.Flagsf64.WEB|(ulong)Types.Flagsf64.IMAGES|(ulong)Types.Flagsf64.LOCAL); - } } - public ulong F64{ get { - if (HasF64) { - return (ulong)PBJ._PBJ.CastFlags(super.F64,(ulong)Types.Flagsf64.UNIVERSAL|(ulong)Types.Flagsf64.WEB|(ulong)Types.Flagsf64.IMAGES|(ulong)Types.Flagsf64.LOCAL); - } else { - return (ulong)PBJ._PBJ.CastFlags((ulong)Types.Flagsf64.UNIVERSAL|(ulong)Types.Flagsf64.WEB|(ulong)Types.Flagsf64.IMAGES|(ulong)Types.Flagsf64.LOCAL); - } - } - set { - super.F64=((value)); - } - } - public Builder ClearBsf() { super.ClearBsf();return this;} - public const int BsfFieldTag=15; - public bool HasBsf{ get {return super.BsfCount>=4;} } - public PBJ.BoundingSphere3f Bsf{ get { - int index=0; - if (HasBsf) { - return PBJ._PBJ.CastBoundingsphere3f(super.GetBsf(index*4+0),super.GetBsf(index*4+1),super.GetBsf(index*4+2),super.GetBsf(index*4+3)); - } else { - return PBJ._PBJ.CastBoundingsphere3f(); - } - } - set { - super.ClearBsf(); - float[] _PBJtempArray=PBJ._PBJ.ConstructBoundingsphere3f(value); - super.AddBsf(_PBJtempArray[0]); - super.AddBsf(_PBJtempArray[1]); - super.AddBsf(_PBJtempArray[2]); - super.AddBsf(_PBJtempArray[3]); - } - } - public Builder ClearBsd() { super.ClearBsd();return this;} - public const int BsdFieldTag=16; - public bool HasBsd{ get {return super.BsdCount>=4;} } - public PBJ.BoundingSphere3d Bsd{ get { - int index=0; - if (HasBsd) { - return PBJ._PBJ.CastBoundingsphere3d(super.GetBsd(index*4+0),super.GetBsd(index*4+1),super.GetBsd(index*4+2),super.GetBsd(index*4+3)); - } else { - return PBJ._PBJ.CastBoundingsphere3d(); - } - } - set { - super.ClearBsd(); - double[] _PBJtempArray=PBJ._PBJ.ConstructBoundingsphere3d(value); - super.AddBsd(_PBJtempArray[0]); - super.AddBsd(_PBJtempArray[1]); - super.AddBsd(_PBJtempArray[2]); - super.AddBsd(_PBJtempArray[3]); - } - } - public Builder ClearBbf() { super.ClearBbf();return this;} - public const int BbfFieldTag=17; - public bool HasBbf{ get {return super.BbfCount>=6;} } - public PBJ.BoundingBox3f3f Bbf{ get { - int index=0; - if (HasBbf) { - return PBJ._PBJ.CastBoundingbox3f3f(super.GetBbf(index*6+0),super.GetBbf(index*6+1),super.GetBbf(index*6+2),super.GetBbf(index*6+3),super.GetBbf(index*6+4),super.GetBbf(index*6+5)); - } else { - return PBJ._PBJ.CastBoundingbox3f3f(); - } - } - set { - super.ClearBbf(); - float[] _PBJtempArray=PBJ._PBJ.ConstructBoundingbox3f3f(value); - super.AddBbf(_PBJtempArray[0]); - super.AddBbf(_PBJtempArray[1]); - super.AddBbf(_PBJtempArray[2]); - super.AddBbf(_PBJtempArray[3]); - super.AddBbf(_PBJtempArray[4]); - super.AddBbf(_PBJtempArray[5]); - } - } - public Builder ClearBbd() { super.ClearBbd();return this;} - public const int BbdFieldTag=18; - public bool HasBbd{ get {return super.BbdCount>=6;} } - public PBJ.BoundingBox3d3f Bbd{ get { - int index=0; - if (HasBbd) { - return PBJ._PBJ.CastBoundingbox3d3f(super.GetBbd(index*6+0),super.GetBbd(index*6+1),super.GetBbd(index*6+2),super.GetBbd(index*6+3),super.GetBbd(index*6+4),super.GetBbd(index*6+5)); - } else { - return PBJ._PBJ.CastBoundingbox3d3f(); - } - } - set { - super.ClearBbd(); - double[] _PBJtempArray=PBJ._PBJ.ConstructBoundingbox3d3f(value); - super.AddBbd(_PBJtempArray[0]); - super.AddBbd(_PBJtempArray[1]); - super.AddBbd(_PBJtempArray[2]); - super.AddBbd(_PBJtempArray[3]); - super.AddBbd(_PBJtempArray[4]); - super.AddBbd(_PBJtempArray[5]); - } - } - public Builder ClearE32() { super.ClearE32();return this;} - public const int E32FieldTag=19; - public bool HasE32{ get {return super.HasE32;} } - public Types.Enum32 E32{ get { - if (HasE32) { - return (Types.Enum32)super.E32; - } else { - return new Types.Enum32(); - } - } - set { - super.E32=((_PBJ_Internal.TestMessage.Types.Enum32)value); - } - } - public Builder ClearSubmes() { super.ClearSubmes();return this;} - public const int SubmesFieldTag=30; - public bool HasSubmes{ get {return super.HasSubmes;} } - public Types.SubMessage Submes{ get { - if (HasSubmes) { - return new Types.SubMessage(super.Submes); - } else { - return new Types.SubMessage(); - } - } - set { - super.Submes=value._PBJSuper; - } - } - public Builder ClearSubmessers() { super.ClearSubmessers();return this;} - public Builder SetSubmessers(int index,Types.SubMessage value) { - super.SetSubmessers(index,value._PBJSuper); - return this; - } - public const int SubmessersFieldTag=31; - public int SubmessersCount { get { return super.SubmessersCount;} } - public bool HasSubmessers(int index) {return true;} - public Types.SubMessage Submessers(int index) { - return new Types.SubMessage(super.GetSubmessers(index)); - } - public Builder AddSubmessers(Types.SubMessage value) { - super.AddSubmessers(value._PBJSuper); - return this; - } - public Builder ClearSha() { super.ClearSha();return this;} - public const int ShaFieldTag=32; - public bool HasSha{ get {return super.HasSha&&PBJ._PBJ.ValidateSha256(super.Sha);} } - public PBJ.SHA256 Sha{ get { - if (HasSha) { - return PBJ._PBJ.CastSha256(super.Sha); - } else { - return PBJ._PBJ.CastSha256(); - } - } - set { - super.Sha=(PBJ._PBJ.Construct(value)); - } - } - public Builder ClearShas() { super.ClearShas();return this;} - public Builder SetShas(int index, PBJ.SHA256 value) { - super.SetShas(index,PBJ._PBJ.Construct(value)); - return this; - } - public const int ShasFieldTag=33; - public int ShasCount { get { return super.ShasCount;} } - public bool HasShas(int index) {return PBJ._PBJ.ValidateSha256(super.GetShas(index));} - public PBJ.SHA256 Shas(int index) { - return (PBJ.SHA256)PBJ._PBJ.CastSha256(super.GetShas(index)); - } - public Builder AddShas(PBJ.SHA256 value) { - super.AddShas(PBJ._PBJ.Construct(value)); - return this; - } - public Builder ClearExtmes() { super.ClearExtmes();return this;} - public const int ExtmesFieldTag=34; - public bool HasExtmes{ get {return super.HasExtmes;} } - public ExternalMessage Extmes{ get { - if (HasExtmes) { - return new ExternalMessage(super.Extmes); - } else { - return new ExternalMessage(); - } - } - set { - super.Extmes=value._PBJSuper; - } - } - public Builder ClearExtmessers() { super.ClearExtmessers();return this;} - public Builder SetExtmessers(int index,ExternalMessage value) { - super.SetExtmessers(index,value._PBJSuper); - return this; - } - public const int ExtmessersFieldTag=35; - public int ExtmessersCount { get { return super.ExtmessersCount;} } - public bool HasExtmessers(int index) {return true;} - public ExternalMessage Extmessers(int index) { - return new ExternalMessage(super.GetExtmessers(index)); - } - public Builder AddExtmessers(ExternalMessage value) { - super.AddExtmessers(value._PBJSuper); - return this; - } - public Builder ClearExtmesser() { super.ClearExtmesser();return this;} - public const int ExtmesserFieldTag=36; - public bool HasExtmesser{ get {return super.HasExtmesser;} } - public ExternalMessage Extmesser{ get { - if (HasExtmesser) { - return new ExternalMessage(super.Extmesser); - } else { - return new ExternalMessage(); - } - } - set { - super.Extmesser=value._PBJSuper; - } - } - } - } -} -namespace Sirikata.PB { -} diff --git a/OpenSim/Client/Sirikata/Protocol/Time.cs b/OpenSim/Client/Sirikata/Protocol/Time.cs deleted file mode 100644 index 4ad49cc22c..0000000000 --- a/OpenSim/Client/Sirikata/Protocol/Time.cs +++ /dev/null @@ -1,454 +0,0 @@ -// Generated by the protocol buffer compiler. DO NOT EDIT! - -using pb = global::Google.ProtocolBuffers; -using pbc = global::Google.ProtocolBuffers.Collections; -using pbd = global::Google.ProtocolBuffers.Descriptors; -using scg = global::System.Collections.Generic; -namespace Sirikata.Network.Protocol._PBJ_Internal { - - public static partial class Time { - - #region Extension registration - public static void RegisterAllExtensions(pb::ExtensionRegistry registry) { - } - #endregion - #region Static variables - internal static pbd::MessageDescriptor internal__static_Sirikata_Network_Protocol__PBJ_Internal_TimeSync__Descriptor; - internal static pb::FieldAccess.FieldAccessorTable internal__static_Sirikata_Network_Protocol__PBJ_Internal_TimeSync__FieldAccessorTable; - #endregion - #region Descriptor - public static pbd::FileDescriptor Descriptor { - get { return descriptor; } - } - private static pbd::FileDescriptor descriptor; - - static Time() { - byte[] descriptorData = global::System.Convert.FromBase64String( - "CgpUaW1lLnByb3RvEidTaXJpa2F0YS5OZXR3b3JrLlByb3RvY29sLl9QQkpf" + - "SW50ZXJuYWwirQEKCFRpbWVTeW5jEhMKC2NsaWVudF90aW1lGAkgASgGEhMK" + - "C3NlcnZlcl90aW1lGAogASgGEhIKCnN5bmNfcm91bmQYCyABKAQSFgoOcmV0" + - "dXJuX29wdGlvbnMYDiABKA0SEwoKcm91bmRfdHJpcBiBFCABKAYiNgoNUmV0" + - "dXJuT3B0aW9ucxISCg5SRVBMWV9SRUxJQUJMRRABEhEKDVJFUExZX09SREVS" + - "RUQQAg=="); - pbd::FileDescriptor.InternalDescriptorAssigner assigner = delegate(pbd::FileDescriptor root) { - descriptor = root; - internal__static_Sirikata_Network_Protocol__PBJ_Internal_TimeSync__Descriptor = Descriptor.MessageTypes[0]; - internal__static_Sirikata_Network_Protocol__PBJ_Internal_TimeSync__FieldAccessorTable = - new pb::FieldAccess.FieldAccessorTable(internal__static_Sirikata_Network_Protocol__PBJ_Internal_TimeSync__Descriptor, - new string[] { "ClientTime", "ServerTime", "SyncRound", "ReturnOptions", "RoundTrip", }); - return null; - }; - pbd::FileDescriptor.InternalBuildGeneratedFileFrom(descriptorData, - new pbd::FileDescriptor[] { - }, assigner); - } - #endregion - - } - #region Messages - public sealed partial class TimeSync : pb::GeneratedMessage { - private static readonly TimeSync defaultInstance = new Builder().BuildPartial(); - public static TimeSync DefaultInstance { - get { return defaultInstance; } - } - - public override TimeSync DefaultInstanceForType { - get { return defaultInstance; } - } - - protected override TimeSync ThisMessage { - get { return this; } - } - - public static pbd::MessageDescriptor Descriptor { - get { return global::Sirikata.Network.Protocol._PBJ_Internal.Time.internal__static_Sirikata_Network_Protocol__PBJ_Internal_TimeSync__Descriptor; } - } - - protected override pb::FieldAccess.FieldAccessorTable InternalFieldAccessors { - get { return global::Sirikata.Network.Protocol._PBJ_Internal.Time.internal__static_Sirikata_Network_Protocol__PBJ_Internal_TimeSync__FieldAccessorTable; } - } - - #region Nested types - public static class Types { - public enum ReturnOptions { - REPLY_RELIABLE = 1, - REPLY_ORDERED = 2, - } - - } - #endregion - - public const int ClientTimeFieldNumber = 9; - private bool hasClientTime; - private ulong clientTime_ = 0; - public bool HasClientTime { - get { return hasClientTime; } - } - [global::System.CLSCompliant(false)] - public ulong ClientTime { - get { return clientTime_; } - } - - public const int ServerTimeFieldNumber = 10; - private bool hasServerTime; - private ulong serverTime_ = 0; - public bool HasServerTime { - get { return hasServerTime; } - } - [global::System.CLSCompliant(false)] - public ulong ServerTime { - get { return serverTime_; } - } - - public const int SyncRoundFieldNumber = 11; - private bool hasSyncRound; - private ulong syncRound_ = 0UL; - public bool HasSyncRound { - get { return hasSyncRound; } - } - [global::System.CLSCompliant(false)] - public ulong SyncRound { - get { return syncRound_; } - } - - public const int ReturnOptionsFieldNumber = 14; - private bool hasReturnOptions; - private uint returnOptions_ = 0; - public bool HasReturnOptions { - get { return hasReturnOptions; } - } - [global::System.CLSCompliant(false)] - public uint ReturnOptions { - get { return returnOptions_; } - } - - public const int RoundTripFieldNumber = 2561; - private bool hasRoundTrip; - private ulong roundTrip_ = 0; - public bool HasRoundTrip { - get { return hasRoundTrip; } - } - [global::System.CLSCompliant(false)] - public ulong RoundTrip { - get { return roundTrip_; } - } - - public override bool IsInitialized { - get { - return true; - } - } - - public override void WriteTo(pb::CodedOutputStream output) { - if (HasClientTime) { - output.WriteFixed64(9, ClientTime); - } - if (HasServerTime) { - output.WriteFixed64(10, ServerTime); - } - if (HasSyncRound) { - output.WriteUInt64(11, SyncRound); - } - if (HasReturnOptions) { - output.WriteUInt32(14, ReturnOptions); - } - if (HasRoundTrip) { - output.WriteFixed64(2561, RoundTrip); - } - UnknownFields.WriteTo(output); - } - - private int memoizedSerializedSize = -1; - public override int SerializedSize { - get { - int size = memoizedSerializedSize; - if (size != -1) return size; - - size = 0; - if (HasClientTime) { - size += pb::CodedOutputStream.ComputeFixed64Size(9, ClientTime); - } - if (HasServerTime) { - size += pb::CodedOutputStream.ComputeFixed64Size(10, ServerTime); - } - if (HasSyncRound) { - size += pb::CodedOutputStream.ComputeUInt64Size(11, SyncRound); - } - if (HasReturnOptions) { - size += pb::CodedOutputStream.ComputeUInt32Size(14, ReturnOptions); - } - if (HasRoundTrip) { - size += pb::CodedOutputStream.ComputeFixed64Size(2561, RoundTrip); - } - size += UnknownFields.SerializedSize; - memoizedSerializedSize = size; - return size; - } - } - - public static TimeSync ParseFrom(pb::ByteString data) { - return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); - } - public static TimeSync ParseFrom(pb::ByteString data, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); - } - public static TimeSync ParseFrom(byte[] data) { - return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); - } - public static TimeSync ParseFrom(byte[] data, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); - } - public static TimeSync ParseFrom(global::System.IO.Stream input) { - return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); - } - public static TimeSync ParseFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); - } - public static TimeSync ParseDelimitedFrom(global::System.IO.Stream input) { - return CreateBuilder().MergeDelimitedFrom(input).BuildParsed(); - } - public static TimeSync ParseDelimitedFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { - return CreateBuilder().MergeDelimitedFrom(input, extensionRegistry).BuildParsed(); - } - public static TimeSync ParseFrom(pb::CodedInputStream input) { - return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); - } - public static TimeSync ParseFrom(pb::CodedInputStream input, pb::ExtensionRegistry extensionRegistry) { - return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); - } - public static Builder CreateBuilder() { return new Builder(); } - public override Builder ToBuilder() { return CreateBuilder(this); } - public override Builder CreateBuilderForType() { return new Builder(); } - public static Builder CreateBuilder(TimeSync prototype) { - return (Builder) new Builder().MergeFrom(prototype); - } - - public sealed partial class Builder : pb::GeneratedBuilder { - protected override Builder ThisBuilder { - get { return this; } - } - public Builder() {} - - TimeSync result = new TimeSync(); - - protected override TimeSync MessageBeingBuilt { - get { return result; } - } - - public override Builder Clear() { - result = new TimeSync(); - return this; - } - - public override Builder Clone() { - return new Builder().MergeFrom(result); - } - - public override pbd::MessageDescriptor DescriptorForType { - get { return global::Sirikata.Network.Protocol._PBJ_Internal.TimeSync.Descriptor; } - } - - public override TimeSync DefaultInstanceForType { - get { return global::Sirikata.Network.Protocol._PBJ_Internal.TimeSync.DefaultInstance; } - } - - public override TimeSync BuildPartial() { - if (result == null) { - throw new global::System.InvalidOperationException("build() has already been called on this Builder"); - } - TimeSync returnMe = result; - result = null; - return returnMe; - } - - public override Builder MergeFrom(pb::IMessage other) { - if (other is TimeSync) { - return MergeFrom((TimeSync) other); - } else { - base.MergeFrom(other); - return this; - } - } - - public override Builder MergeFrom(TimeSync other) { - if (other == global::Sirikata.Network.Protocol._PBJ_Internal.TimeSync.DefaultInstance) return this; - if (other.HasClientTime) { - ClientTime = other.ClientTime; - } - if (other.HasServerTime) { - ServerTime = other.ServerTime; - } - if (other.HasSyncRound) { - SyncRound = other.SyncRound; - } - if (other.HasReturnOptions) { - ReturnOptions = other.ReturnOptions; - } - if (other.HasRoundTrip) { - RoundTrip = other.RoundTrip; - } - this.MergeUnknownFields(other.UnknownFields); - return this; - } - - public override Builder MergeFrom(pb::CodedInputStream input) { - return MergeFrom(input, pb::ExtensionRegistry.Empty); - } - - public override Builder MergeFrom(pb::CodedInputStream input, pb::ExtensionRegistry extensionRegistry) { - pb::UnknownFieldSet.Builder unknownFields = null; - while (true) { - uint tag = input.ReadTag(); - switch (tag) { - case 0: { - if (unknownFields != null) { - this.UnknownFields = unknownFields.Build(); - } - return this; - } - default: { - if (pb::WireFormat.IsEndGroupTag(tag)) { - if (unknownFields != null) { - this.UnknownFields = unknownFields.Build(); - } - return this; - } - if (unknownFields == null) { - unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); - } - ParseUnknownField(input, unknownFields, extensionRegistry, tag); - break; - } - case 73: { - ClientTime = input.ReadFixed64(); - break; - } - case 81: { - ServerTime = input.ReadFixed64(); - break; - } - case 88: { - SyncRound = input.ReadUInt64(); - break; - } - case 112: { - ReturnOptions = input.ReadUInt32(); - break; - } - case 20489: { - RoundTrip = input.ReadFixed64(); - break; - } - } - } - } - - - public bool HasClientTime { - get { return result.HasClientTime; } - } - [global::System.CLSCompliant(false)] - public ulong ClientTime { - get { return result.ClientTime; } - set { SetClientTime(value); } - } - [global::System.CLSCompliant(false)] - public Builder SetClientTime(ulong value) { - result.hasClientTime = true; - result.clientTime_ = value; - return this; - } - public Builder ClearClientTime() { - result.hasClientTime = false; - result.clientTime_ = 0; - return this; - } - - public bool HasServerTime { - get { return result.HasServerTime; } - } - [global::System.CLSCompliant(false)] - public ulong ServerTime { - get { return result.ServerTime; } - set { SetServerTime(value); } - } - [global::System.CLSCompliant(false)] - public Builder SetServerTime(ulong value) { - result.hasServerTime = true; - result.serverTime_ = value; - return this; - } - public Builder ClearServerTime() { - result.hasServerTime = false; - result.serverTime_ = 0; - return this; - } - - public bool HasSyncRound { - get { return result.HasSyncRound; } - } - [global::System.CLSCompliant(false)] - public ulong SyncRound { - get { return result.SyncRound; } - set { SetSyncRound(value); } - } - [global::System.CLSCompliant(false)] - public Builder SetSyncRound(ulong value) { - result.hasSyncRound = true; - result.syncRound_ = value; - return this; - } - public Builder ClearSyncRound() { - result.hasSyncRound = false; - result.syncRound_ = 0UL; - return this; - } - - public bool HasReturnOptions { - get { return result.HasReturnOptions; } - } - [global::System.CLSCompliant(false)] - public uint ReturnOptions { - get { return result.ReturnOptions; } - set { SetReturnOptions(value); } - } - [global::System.CLSCompliant(false)] - public Builder SetReturnOptions(uint value) { - result.hasReturnOptions = true; - result.returnOptions_ = value; - return this; - } - public Builder ClearReturnOptions() { - result.hasReturnOptions = false; - result.returnOptions_ = 0; - return this; - } - - public bool HasRoundTrip { - get { return result.HasRoundTrip; } - } - [global::System.CLSCompliant(false)] - public ulong RoundTrip { - get { return result.RoundTrip; } - set { SetRoundTrip(value); } - } - [global::System.CLSCompliant(false)] - public Builder SetRoundTrip(ulong value) { - result.hasRoundTrip = true; - result.roundTrip_ = value; - return this; - } - public Builder ClearRoundTrip() { - result.hasRoundTrip = false; - result.roundTrip_ = 0; - return this; - } - } - static TimeSync() { - object.ReferenceEquals(global::Sirikata.Network.Protocol._PBJ_Internal.Time.Descriptor, null); - } - } - - #endregion - -} diff --git a/OpenSim/Client/Sirikata/Protocol/Time.pbj.cs b/OpenSim/Client/Sirikata/Protocol/Time.pbj.cs deleted file mode 100644 index 15b4ae7e5d..0000000000 --- a/OpenSim/Client/Sirikata/Protocol/Time.pbj.cs +++ /dev/null @@ -1,245 +0,0 @@ -/* - * Copyright (c) Contributors, http://opensimulator.org/ - * See CONTRIBUTORS.TXT for a full list of copyright holders. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * * Neither the name of the OpenSimulator Project nor the - * names of its contributors may be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE DEVELOPERS ``AS IS'' AND ANY - * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED - * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL THE CONTRIBUTORS BE LIABLE FOR ANY - * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES - * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; - * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ - -using pbd = global::Google.ProtocolBuffers.Descriptors; -using pb = global::Google.ProtocolBuffers; -namespace Sirikata.Network.Protocol { - public class TimeSync : PBJ.IMessage { - protected _PBJ_Internal.TimeSync super; - public _PBJ_Internal.TimeSync _PBJSuper{ get { return super;} } - public TimeSync() { - super=new _PBJ_Internal.TimeSync(); - } - public TimeSync(_PBJ_Internal.TimeSync reference) { - super=reference; - } - public static TimeSync defaultInstance= new TimeSync (_PBJ_Internal.TimeSync.DefaultInstance); - public static TimeSync DefaultInstance{ - get {return defaultInstance;} - } - public static pbd.MessageDescriptor Descriptor { - get { return _PBJ_Internal.TimeSync.Descriptor; } } - public static class Types { - public enum ReturnOptions { - REPLY_RELIABLE=_PBJ_Internal.TimeSync.Types.ReturnOptions.REPLY_RELIABLE, - REPLY_ORDERED=_PBJ_Internal.TimeSync.Types.ReturnOptions.REPLY_ORDERED - }; - } - public static bool WithinReservedFieldTagRange(int field_tag) { - return false||(field_tag>=1&&field_tag<=8)||(field_tag>=1536&&field_tag<=2560)||(field_tag>=229376&&field_tag<=294912); - } - public static bool WithinExtensionFieldTagRange(int field_tag) { - return false; - } - public const int ClientTimeFieldTag=9; - public bool HasClientTime{ get {return super.HasClientTime&&PBJ._PBJ.ValidateTime(super.ClientTime);} } - public PBJ.Time ClientTime{ get { - if (HasClientTime) { - return PBJ._PBJ.CastTime(super.ClientTime); - } else { - return PBJ._PBJ.CastTime(); - } - } - } - public const int ServerTimeFieldTag=10; - public bool HasServerTime{ get {return super.HasServerTime&&PBJ._PBJ.ValidateTime(super.ServerTime);} } - public PBJ.Time ServerTime{ get { - if (HasServerTime) { - return PBJ._PBJ.CastTime(super.ServerTime); - } else { - return PBJ._PBJ.CastTime(); - } - } - } - public const int SyncRoundFieldTag=11; - public bool HasSyncRound{ get {return super.HasSyncRound&&PBJ._PBJ.ValidateUint64(super.SyncRound);} } - public ulong SyncRound{ get { - if (HasSyncRound) { - return PBJ._PBJ.CastUint64(super.SyncRound); - } else { - return PBJ._PBJ.CastUint64(); - } - } - } - public const int ReturnOptionsFieldTag=14; - public bool HasReturnOptions { get { - if (!super.HasReturnOptions) return false; - return PBJ._PBJ.ValidateFlags(super.ReturnOptions,(ulong)Types.ReturnOptions.REPLY_RELIABLE|(ulong)Types.ReturnOptions.REPLY_ORDERED); - } } - public uint ReturnOptions{ get { - if (HasReturnOptions) { - return (uint)PBJ._PBJ.CastFlags(super.ReturnOptions,(ulong)Types.ReturnOptions.REPLY_RELIABLE|(ulong)Types.ReturnOptions.REPLY_ORDERED); - } else { - return (uint)PBJ._PBJ.CastFlags((ulong)Types.ReturnOptions.REPLY_RELIABLE|(ulong)Types.ReturnOptions.REPLY_ORDERED); - } - } - } - public const int RoundTripFieldTag=2561; - public bool HasRoundTrip{ get {return super.HasRoundTrip&&PBJ._PBJ.ValidateTime(super.RoundTrip);} } - public PBJ.Time RoundTrip{ get { - if (HasRoundTrip) { - return PBJ._PBJ.CastTime(super.RoundTrip); - } else { - return PBJ._PBJ.CastTime(); - } - } - } - public override Google.ProtocolBuffers.IMessage _PBJISuper { get { return super; } } - public override PBJ.IMessage.IBuilder WeakCreateBuilderForType() { return new Builder(); } - public static Builder CreateBuilder() { return new Builder(); } - public static Builder CreateBuilder(TimeSync prototype) { - return (Builder)new Builder().MergeFrom(prototype); - } - public static TimeSync ParseFrom(pb::ByteString data) { - return new TimeSync(_PBJ_Internal.TimeSync.ParseFrom(data)); - } - public static TimeSync ParseFrom(pb::ByteString data, pb::ExtensionRegistry er) { - return new TimeSync(_PBJ_Internal.TimeSync.ParseFrom(data,er)); - } - public static TimeSync ParseFrom(byte[] data) { - return new TimeSync(_PBJ_Internal.TimeSync.ParseFrom(data)); - } - public static TimeSync ParseFrom(byte[] data, pb::ExtensionRegistry er) { - return new TimeSync(_PBJ_Internal.TimeSync.ParseFrom(data,er)); - } - public static TimeSync ParseFrom(global::System.IO.Stream data) { - return new TimeSync(_PBJ_Internal.TimeSync.ParseFrom(data)); - } - public static TimeSync ParseFrom(global::System.IO.Stream data, pb::ExtensionRegistry er) { - return new TimeSync(_PBJ_Internal.TimeSync.ParseFrom(data,er)); - } - public static TimeSync ParseFrom(pb::CodedInputStream data) { - return new TimeSync(_PBJ_Internal.TimeSync.ParseFrom(data)); - } - public static TimeSync ParseFrom(pb::CodedInputStream data, pb::ExtensionRegistry er) { - return new TimeSync(_PBJ_Internal.TimeSync.ParseFrom(data,er)); - } - protected override bool _HasAllPBJFields{ get { - return true - ; - } } - public bool IsInitialized { get { - return super.IsInitialized&&_HasAllPBJFields; - } } - public class Builder : global::PBJ.IMessage.IBuilder{ - protected override bool _HasAllPBJFields{ get { - return true - ; - } } - public bool IsInitialized { get { - return super.IsInitialized&&_HasAllPBJFields; - } } - protected _PBJ_Internal.TimeSync.Builder super; - public override Google.ProtocolBuffers.IBuilder _PBJISuper { get { return super; } } - public _PBJ_Internal.TimeSync.Builder _PBJSuper{ get { return super;} } - public Builder() {super = new _PBJ_Internal.TimeSync.Builder();} - public Builder(_PBJ_Internal.TimeSync.Builder other) { - super=other; - } - public Builder Clone() {return new Builder(super.Clone());} - public Builder MergeFrom(TimeSync prototype) { super.MergeFrom(prototype._PBJSuper);return this;} - public Builder Clear() {super.Clear();return this;} - public TimeSync BuildPartial() {return new TimeSync(super.BuildPartial());} - public TimeSync Build() {if (_HasAllPBJFields) return new TimeSync(super.Build());return null;} - public pbd::MessageDescriptor DescriptorForType { - get { return TimeSync.Descriptor; } } - public Builder ClearClientTime() { super.ClearClientTime();return this;} - public const int ClientTimeFieldTag=9; - public bool HasClientTime{ get {return super.HasClientTime&&PBJ._PBJ.ValidateTime(super.ClientTime);} } - public PBJ.Time ClientTime{ get { - if (HasClientTime) { - return PBJ._PBJ.CastTime(super.ClientTime); - } else { - return PBJ._PBJ.CastTime(); - } - } - set { - super.ClientTime=(PBJ._PBJ.Construct(value)); - } - } - public Builder ClearServerTime() { super.ClearServerTime();return this;} - public const int ServerTimeFieldTag=10; - public bool HasServerTime{ get {return super.HasServerTime&&PBJ._PBJ.ValidateTime(super.ServerTime);} } - public PBJ.Time ServerTime{ get { - if (HasServerTime) { - return PBJ._PBJ.CastTime(super.ServerTime); - } else { - return PBJ._PBJ.CastTime(); - } - } - set { - super.ServerTime=(PBJ._PBJ.Construct(value)); - } - } - public Builder ClearSyncRound() { super.ClearSyncRound();return this;} - public const int SyncRoundFieldTag=11; - public bool HasSyncRound{ get {return super.HasSyncRound&&PBJ._PBJ.ValidateUint64(super.SyncRound);} } - public ulong SyncRound{ get { - if (HasSyncRound) { - return PBJ._PBJ.CastUint64(super.SyncRound); - } else { - return PBJ._PBJ.CastUint64(); - } - } - set { - super.SyncRound=(PBJ._PBJ.Construct(value)); - } - } - public Builder ClearReturnOptions() { super.ClearReturnOptions();return this;} - public const int ReturnOptionsFieldTag=14; - public bool HasReturnOptions { get { - if (!super.HasReturnOptions) return false; - return PBJ._PBJ.ValidateFlags(super.ReturnOptions,(ulong)Types.ReturnOptions.REPLY_RELIABLE|(ulong)Types.ReturnOptions.REPLY_ORDERED); - } } - public uint ReturnOptions{ get { - if (HasReturnOptions) { - return (uint)PBJ._PBJ.CastFlags(super.ReturnOptions,(ulong)Types.ReturnOptions.REPLY_RELIABLE|(ulong)Types.ReturnOptions.REPLY_ORDERED); - } else { - return (uint)PBJ._PBJ.CastFlags((ulong)Types.ReturnOptions.REPLY_RELIABLE|(ulong)Types.ReturnOptions.REPLY_ORDERED); - } - } - set { - super.ReturnOptions=((value)); - } - } - public Builder ClearRoundTrip() { super.ClearRoundTrip();return this;} - public const int RoundTripFieldTag=2561; - public bool HasRoundTrip{ get {return super.HasRoundTrip&&PBJ._PBJ.ValidateTime(super.RoundTrip);} } - public PBJ.Time RoundTrip{ get { - if (HasRoundTrip) { - return PBJ._PBJ.CastTime(super.RoundTrip); - } else { - return PBJ._PBJ.CastTime(); - } - } - set { - super.RoundTrip=(PBJ._PBJ.Construct(value)); - } - } - } - } -} diff --git a/OpenSim/Client/Sirikata/SirikataModule.cs b/OpenSim/Client/Sirikata/SirikataModule.cs deleted file mode 100644 index 01dc9d70cc..0000000000 --- a/OpenSim/Client/Sirikata/SirikataModule.cs +++ /dev/null @@ -1,139 +0,0 @@ -/* - * Copyright (c) Contributors, http://opensimulator.org/ - * See CONTRIBUTORS.TXT for a full list of copyright holders. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * * Neither the name of the OpenSimulator Project nor the - * names of its contributors may be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE DEVELOPERS ``AS IS'' AND ANY - * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED - * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL THE CONTRIBUTORS BE LIABLE FOR ANY - * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES - * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; - * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ -// THIS MODULE USES CODE FROM SIRIKATA, THE SIRIKATA LICENSE IS BELOW -/* -Sirikata is Licensed using the revised BSD license. -If you have any questions, contact Patrick Horn at - - - Copyright (c) 2008, the Sirikata developers (see AUTHORS file for credit). - All rights reserved. - - Redistribution and use in source and binary forms, with or without - modification, are permitted provided that the following conditions are - met: - * Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in - the documentation and/or other materials provided with the - distribution. - * Neither the name of Sirikata nor the names of its contributors may - be used to endorse or promote products derived from this software - without specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS -IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED -TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A -PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER -OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, -EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, -PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR -PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF -LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING -NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -*/ - -using System; -using System.Collections.Generic; -using System.Net; -using System.Net.Sockets; -using Nini.Config; -using OpenMetaverse; -using OpenSim.Client.Sirikata.ClientStack; -using OpenSim.Framework; -using OpenSim.Framework.Servers; -using OpenSim.Framework.Servers.HttpServer; -using OpenSim.Region.Framework.Interfaces; -using OpenSim.Region.Framework.Scenes; - -namespace OpenSim.Client.Sirikata -{ - class SirikataModule : IRegionModule - { - private bool m_enabled = false; - - private TcpListener m_listener; - private bool m_running = true; - - private List m_scenes = new List(); - private Dictionary m_clients = new Dictionary(); - - #region Implementation of IRegionModule - - public void Initialise(Scene scene, IConfigSource source) - { - lock (m_scenes) - m_scenes.Add(scene); - } - - public void PostInitialise() - { - if (!m_enabled) - return; - - m_listener = new TcpListener(IPAddress.Any, 5943); - - } - - private void ListenLoop() - { - while (m_running) - { - m_listener.BeginAcceptTcpClient(AcceptSocket, m_listener); - } - } - - private void AcceptSocket(IAsyncResult ar) - { - TcpListener listener = (TcpListener) ar.AsyncState; - TcpClient client = listener.EndAcceptTcpClient(ar); - - SirikataClientView clientView = new SirikataClientView(client); - - lock (m_clients) - m_clients.Add(clientView.SessionId, clientView); - } - - public void Close() - { - - } - - public string Name - { - get { return "Sirikata ClientStack Module"; } - } - - public bool IsSharedModule - { - get { return true; } - } - - #endregion - } -} diff --git a/OpenSim/Client/VWoHTTP/ClientStack/VWHClientView.cs b/OpenSim/Client/VWoHTTP/ClientStack/VWHClientView.cs index 33b0d46091..44d1f49880 100644 --- a/OpenSim/Client/VWoHTTP/ClientStack/VWHClientView.cs +++ b/OpenSim/Client/VWoHTTP/ClientStack/VWHClientView.cs @@ -252,7 +252,7 @@ namespace OpenSim.Client.VWoHTTP.ClientStack public event TeleportLandmarkRequest OnTeleportLandmarkRequest = delegate { }; public event DeRezObject OnDeRezObject = delegate { }; public event Action OnRegionHandShakeReply = delegate { }; - public event GenericCall2 OnRequestWearables = delegate { }; + public event GenericCall1 OnRequestWearables = delegate { }; public event GenericCall1 OnCompleteMovementToRegion = delegate { }; public event UpdateAgent OnPreAgentUpdate; public event UpdateAgent OnAgentUpdate = delegate { }; @@ -587,7 +587,12 @@ namespace OpenSim.Client.VWoHTTP.ClientStack throw new System.NotImplementedException(); } - public void SendTeleportLocationStart() + public void SendTeleportStart(uint flags) + { + throw new System.NotImplementedException(); + } + + public void SendTeleportProgress(uint flags, string message) { throw new System.NotImplementedException(); } diff --git a/OpenSim/Data/DBGuids.cs b/OpenSim/Data/DBGuids.cs index fb6832b8d1..ad1c19c6ee 100644 --- a/OpenSim/Data/DBGuids.cs +++ b/OpenSim/Data/DBGuids.cs @@ -1,4 +1,31 @@ -using System; +/* + * Copyright (c) Contributors, http://opensimulator.org/ + * See CONTRIBUTORS.TXT for a full list of copyright holders. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * * Neither the name of the OpenSimulator Project nor the + * names of its contributors may be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE DEVELOPERS ``AS IS'' AND ANY + * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED + * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + * DISCLAIMED. IN NO EVENT SHALL THE CONTRIBUTORS BE LIABLE FOR ANY + * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES + * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND + * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS + * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +using System; using System.Collections.Generic; using System.Text; using OpenMetaverse; @@ -17,7 +44,7 @@ namespace OpenSim.Data /// public static UUID FromDB(object id) { - if( (id == null) || (id == DBNull.Value)) + if ((id == null) || (id == DBNull.Value)) return UUID.Zero; if (id.GetType() == typeof(Guid)) diff --git a/OpenSim/Data/IAssetData.cs b/OpenSim/Data/IAssetData.cs index 90d5eeb489..f31b215c0f 100644 --- a/OpenSim/Data/IAssetData.cs +++ b/OpenSim/Data/IAssetData.cs @@ -40,15 +40,4 @@ namespace OpenSim.Data void Initialise(string connect); bool Delete(string id); } - - public class AssetDataInitialiser : PluginInitialiserBase - { - private string connect; - public AssetDataInitialiser (string s) { connect = s; } - public override void Initialise (IPlugin plugin) - { - IAssetDataPlugin p = plugin as IAssetDataPlugin; - p.Initialise (connect); - } - } } diff --git a/OpenSim/Data/IInventoryData.cs b/OpenSim/Data/IInventoryData.cs index 90f74b713b..74d5d37bf9 100644 --- a/OpenSim/Data/IInventoryData.cs +++ b/OpenSim/Data/IInventoryData.cs @@ -155,15 +155,4 @@ namespace OpenSim.Data /// List fetchActiveGestures(UUID avatarID); } - - public class InventoryDataInitialiser : PluginInitialiserBase - { - private string connect; - public InventoryDataInitialiser (string s) { connect = s; } - public override void Initialise (IPlugin plugin) - { - IInventoryDataPlugin p = plugin as IInventoryDataPlugin; - p.Initialise (connect); - } - } } diff --git a/OpenSim/Data/IRegionData.cs b/OpenSim/Data/IRegionData.cs index 8259f9b316..46dc4fbe8a 100644 --- a/OpenSim/Data/IRegionData.cs +++ b/OpenSim/Data/IRegionData.cs @@ -62,6 +62,7 @@ namespace OpenSim.Data List GetDefaultRegions(UUID scopeID); List GetFallbackRegions(UUID scopeID, int x, int y); + List GetHyperlinks(UUID scopeID); } [Flags] @@ -78,4 +79,26 @@ namespace OpenSim.Data Authenticate = 256, // Require authentication Hyperlink = 512 // Record represents a HG link } + + public class RegionDataDistanceCompare : IComparer + { + private Vector2 m_origin; + + public RegionDataDistanceCompare(int x, int y) + { + m_origin = new Vector2(x, y); + } + + public int Compare(RegionData regionA, RegionData regionB) + { + Vector2 vectorA = new Vector2(regionA.posX, regionA.posY); + Vector2 vectorB = new Vector2(regionB.posX, regionB.posY); + return Math.Sign(VectorDistance(m_origin, vectorA) - VectorDistance(m_origin, vectorB)); + } + + private float VectorDistance(Vector2 x, Vector2 y) + { + return (x - y).Length(); + } + } } diff --git a/OpenSim/Data/MSSQL/MSSQLEstateData.cs b/OpenSim/Data/MSSQL/MSSQLEstateData.cs index 80bf10638d..e9a0935048 100644 --- a/OpenSim/Data/MSSQL/MSSQLEstateData.cs +++ b/OpenSim/Data/MSSQL/MSSQLEstateData.cs @@ -50,6 +50,15 @@ namespace OpenSim.Data.MSSQL #region Public methods + public MSSQLEstateStore() + { + } + + public MSSQLEstateStore(string connectionString) + { + Initialise(connectionString); + } + /// /// Initialises the estatedata class. /// diff --git a/OpenSim/Data/MSSQL/MSSQLRegionData.cs b/OpenSim/Data/MSSQL/MSSQLRegionData.cs index 66c3f8117f..cdf8ec09fb 100644 --- a/OpenSim/Data/MSSQL/MSSQLRegionData.cs +++ b/OpenSim/Data/MSSQL/MSSQLRegionData.cs @@ -310,23 +310,26 @@ namespace OpenSim.Data.MSSQL public List GetDefaultRegions(UUID scopeID) { - string sql = "SELECT * FROM [" + m_Realm + "] WHERE (flags & 1) <> 0"; - if (scopeID != UUID.Zero) - sql += " AND ScopeID = @scopeID"; - - using (SqlConnection conn = new SqlConnection(m_ConnectionString)) - using (SqlCommand cmd = new SqlCommand(sql, conn)) - { - cmd.Parameters.Add(m_database.CreateParameter("@scopeID", scopeID)); - conn.Open(); - return RunCommand(cmd); - } - + return Get((int)RegionFlags.DefaultRegion, scopeID); } public List GetFallbackRegions(UUID scopeID, int x, int y) { - string sql = "SELECT * FROM [" + m_Realm + "] WHERE (flags & 2) <> 0"; + List regions = Get((int)RegionFlags.FallbackRegion, scopeID); + RegionDataDistanceCompare distanceComparer = new RegionDataDistanceCompare(x, y); + regions.Sort(distanceComparer); + + return regions; + } + + public List GetHyperlinks(UUID scopeID) + { + return Get((int)RegionFlags.Hyperlink, scopeID); + } + + private List Get(int regionFlags, UUID scopeID) + { + string sql = "SELECT * FROM [" + m_Realm + "] WHERE (flags & " + regionFlags.ToString() + ") <> 0"; if (scopeID != UUID.Zero) sql += " AND ScopeID = @scopeID"; @@ -335,7 +338,6 @@ namespace OpenSim.Data.MSSQL { cmd.Parameters.Add(m_database.CreateParameter("@scopeID", scopeID)); conn.Open(); - // TODO: distance-sort results return RunCommand(cmd); } } diff --git a/OpenSim/Data/MSSQL/MSSQLLegacyRegionData.cs b/OpenSim/Data/MSSQL/MSSQLSimulationData.cs similarity index 98% rename from OpenSim/Data/MSSQL/MSSQLLegacyRegionData.cs rename to OpenSim/Data/MSSQL/MSSQLSimulationData.cs index ffb053f7ac..e053842233 100644 --- a/OpenSim/Data/MSSQL/MSSQLLegacyRegionData.cs +++ b/OpenSim/Data/MSSQL/MSSQLSimulationData.cs @@ -43,7 +43,7 @@ namespace OpenSim.Data.MSSQL /// /// A MSSQL Interface for the Region Server. /// - public class MSSQLRegionDataStore : IRegionDataStore + public class MSSQLSimulationData : ISimulationDataStore { private const string _migrationStore = "RegionStore"; @@ -55,6 +55,16 @@ namespace OpenSim.Data.MSSQL /// private MSSQLManager _Database; private string m_connectionString; + + public MSSQLSimulationData() + { + } + + public MSSQLSimulationData(string connectionString) + { + Initialise(connectionString); + } + /// /// Initialises the region datastore /// @@ -89,7 +99,6 @@ namespace OpenSim.Data.MSSQL Dictionary objects = new Dictionary(); SceneObjectGroup grp = null; - string sql = "SELECT *, " + "sort = CASE WHEN prims.UUID = prims.SceneGroupID THEN 0 ELSE 1 END " + "FROM prims " + @@ -232,7 +241,7 @@ namespace OpenSim.Data.MSSQL /// public void StoreObject(SceneObjectGroup obj, UUID regionUUID) { - _Log.InfoFormat("[MSSQL]: Adding/Changing SceneObjectGroup: {0} to region: {1}, object has {2} prims.", obj.UUID, regionUUID, obj.Children.Count); + _Log.DebugFormat("[MSSQL]: Adding/Changing SceneObjectGroup: {0} to region: {1}, object has {2} prims.", obj.UUID, regionUUID, obj.Parts.Length); using (SqlConnection conn = new SqlConnection(m_connectionString)) { @@ -241,7 +250,7 @@ namespace OpenSim.Data.MSSQL try { - foreach (SceneObjectPart sceneObjectPart in obj.Children.Values) + foreach (SceneObjectPart sceneObjectPart in obj.Parts) { //Update prim using (SqlCommand sqlCommand = conn.CreateCommand()) @@ -291,7 +300,6 @@ namespace OpenSim.Data.MSSQL } } } - } /// @@ -327,7 +335,7 @@ IF EXISTS (SELECT UUID FROM prims WHERE UUID = @UUID) ScriptAccessPin = @ScriptAccessPin, AllowedDrop = @AllowedDrop, DieAtEdge = @DieAtEdge, SalePrice = @SalePrice, SaleType = @SaleType, ColorR = @ColorR, ColorG = @ColorG, ColorB = @ColorB, ColorA = @ColorA, ParticleSystem = @ParticleSystem, ClickAction = @ClickAction, Material = @Material, CollisionSound = @CollisionSound, CollisionSoundVolume = @CollisionSoundVolume, PassTouches = @PassTouches, - LinkNumber = @LinkNumber + LinkNumber = @LinkNumber, MediaURL = @MediaURL WHERE UUID = @UUID END ELSE @@ -342,7 +350,7 @@ ELSE PayPrice, PayButton1, PayButton2, PayButton3, PayButton4, LoopedSound, LoopedSoundGain, TextureAnimation, OmegaX, OmegaY, OmegaZ, CameraEyeOffsetX, CameraEyeOffsetY, CameraEyeOffsetZ, CameraAtOffsetX, CameraAtOffsetY, CameraAtOffsetZ, ForceMouselook, ScriptAccessPin, AllowedDrop, DieAtEdge, SalePrice, SaleType, ColorR, ColorG, ColorB, ColorA, - ParticleSystem, ClickAction, Material, CollisionSound, CollisionSoundVolume, PassTouches, LinkNumber + ParticleSystem, ClickAction, Material, CollisionSound, CollisionSoundVolume, PassTouches, LinkNumber, MediaURL ) VALUES ( @UUID, @CreationDate, @Name, @Text, @Description, @SitName, @TouchName, @ObjectFlags, @OwnerMask, @NextOwnerMask, @GroupMask, @EveryoneMask, @BaseMask, @PositionX, @PositionY, @PositionZ, @GroupPositionX, @GroupPositionY, @GroupPositionZ, @VelocityX, @@ -352,7 +360,7 @@ ELSE @PayPrice, @PayButton1, @PayButton2, @PayButton3, @PayButton4, @LoopedSound, @LoopedSoundGain, @TextureAnimation, @OmegaX, @OmegaY, @OmegaZ, @CameraEyeOffsetX, @CameraEyeOffsetY, @CameraEyeOffsetZ, @CameraAtOffsetX, @CameraAtOffsetY, @CameraAtOffsetZ, @ForceMouselook, @ScriptAccessPin, @AllowedDrop, @DieAtEdge, @SalePrice, @SaleType, @ColorR, @ColorG, @ColorB, @ColorA, - @ParticleSystem, @ClickAction, @Material, @CollisionSound, @CollisionSoundVolume, @PassTouches, @LinkNumber + @ParticleSystem, @ClickAction, @Material, @CollisionSound, @CollisionSoundVolume, @PassTouches, @LinkNumber, @MediaURL ) END"; @@ -385,7 +393,7 @@ IF EXISTS (SELECT UUID FROM primshapes WHERE UUID = @UUID) PathSkew = @PathSkew, PathCurve = @PathCurve, PathRadiusOffset = @PathRadiusOffset, PathRevolutions = @PathRevolutions, PathTaperX = @PathTaperX, PathTaperY = @PathTaperY, PathTwist = @PathTwist, PathTwistBegin = @PathTwistBegin, ProfileBegin = @ProfileBegin, ProfileEnd = @ProfileEnd, ProfileCurve = @ProfileCurve, ProfileHollow = @ProfileHollow, - Texture = @Texture, ExtraParams = @ExtraParams, State = @State + Texture = @Texture, ExtraParams = @ExtraParams, State = @State, Media = @Media WHERE UUID = @UUID END ELSE @@ -394,11 +402,11 @@ ELSE primshapes ( UUID, Shape, ScaleX, ScaleY, ScaleZ, PCode, PathBegin, PathEnd, PathScaleX, PathScaleY, PathShearX, PathShearY, PathSkew, PathCurve, PathRadiusOffset, PathRevolutions, PathTaperX, PathTaperY, PathTwist, PathTwistBegin, ProfileBegin, - ProfileEnd, ProfileCurve, ProfileHollow, Texture, ExtraParams, State + ProfileEnd, ProfileCurve, ProfileHollow, Texture, ExtraParams, State, Media ) VALUES ( @UUID, @Shape, @ScaleX, @ScaleY, @ScaleZ, @PCode, @PathBegin, @PathEnd, @PathScaleX, @PathScaleY, @PathShearX, @PathShearY, @PathSkew, @PathCurve, @PathRadiusOffset, @PathRevolutions, @PathTaperX, @PathTaperY, @PathTwist, @PathTwistBegin, @ProfileBegin, - @ProfileEnd, @ProfileCurve, @ProfileHollow, @Texture, @ExtraParams, @State + @ProfileEnd, @ProfileCurve, @ProfileHollow, @Texture, @ExtraParams, @State, @Media ) END"; @@ -640,9 +648,9 @@ ELSE //Insert new values string sql = @"INSERT INTO [land] -([UUID],[RegionUUID],[LocalLandID],[Bitmap],[Name],[Description],[OwnerUUID],[IsGroupOwned],[Area],[AuctionID],[Category],[ClaimDate],[ClaimPrice],[GroupUUID],[SalePrice],[LandStatus],[LandFlags],[LandingType],[MediaAutoScale],[MediaTextureUUID],[MediaURL],[MusicURL],[PassHours],[PassPrice],[SnapshotUUID],[UserLocationX],[UserLocationY],[UserLocationZ],[UserLookAtX],[UserLookAtY],[UserLookAtZ],[AuthbuyerID],[OtherCleanTime],[Dwell]) +([UUID],[RegionUUID],[LocalLandID],[Bitmap],[Name],[Description],[OwnerUUID],[IsGroupOwned],[Area],[AuctionID],[Category],[ClaimDate],[ClaimPrice],[GroupUUID],[SalePrice],[LandStatus],[LandFlags],[LandingType],[MediaAutoScale],[MediaTextureUUID],[MediaURL],[MusicURL],[PassHours],[PassPrice],[SnapshotUUID],[UserLocationX],[UserLocationY],[UserLocationZ],[UserLookAtX],[UserLookAtY],[UserLookAtZ],[AuthbuyerID],[OtherCleanTime]) VALUES -(@UUID,@RegionUUID,@LocalLandID,@Bitmap,@Name,@Description,@OwnerUUID,@IsGroupOwned,@Area,@AuctionID,@Category,@ClaimDate,@ClaimPrice,@GroupUUID,@SalePrice,@LandStatus,@LandFlags,@LandingType,@MediaAutoScale,@MediaTextureUUID,@MediaURL,@MusicURL,@PassHours,@PassPrice,@SnapshotUUID,@UserLocationX,@UserLocationY,@UserLocationZ,@UserLookAtX,@UserLookAtY,@UserLookAtZ,@AuthbuyerID,@OtherCleanTime,@Dwell)"; +(@UUID,@RegionUUID,@LocalLandID,@Bitmap,@Name,@Description,@OwnerUUID,@IsGroupOwned,@Area,@AuctionID,@Category,@ClaimDate,@ClaimPrice,@GroupUUID,@SalePrice,@LandStatus,@LandFlags,@LandingType,@MediaAutoScale,@MediaTextureUUID,@MediaURL,@MusicURL,@PassHours,@PassPrice,@SnapshotUUID,@UserLocationX,@UserLocationY,@UserLocationZ,@UserLookAtX,@UserLookAtY,@UserLookAtZ,@AuthbuyerID,@OtherCleanTime)"; using (SqlConnection conn = new SqlConnection(m_connectionString)) using (SqlCommand cmd = new SqlCommand(sql, conn)) @@ -697,6 +705,9 @@ VALUES //Return default LL windlight settings return new RegionLightShareData(); } + public void RemoveRegionWindlightSettings(UUID regionID) + { + } public void StoreRegionWindlightSettings(RegionLightShareData wl) { //This connector doesn't support the windlight module yet @@ -956,7 +967,6 @@ VALUES newData.SnapshotID = new UUID((Guid)row["SnapshotUUID"]); newData.OtherCleanTime = Convert.ToInt32(row["OtherCleanTime"]); - newData.Dwell = Convert.ToInt32(row["Dwell"]); try { @@ -1017,7 +1027,7 @@ VALUES prim.SitName = (string)primRow["SitName"]; prim.TouchName = (string)primRow["TouchName"]; // permissions - prim.ObjectFlags = Convert.ToUInt32(primRow["ObjectFlags"]); + prim.Flags = (PrimFlags)Convert.ToUInt32(primRow["ObjectFlags"]); prim.CreatorID = new UUID((Guid)primRow["CreatorID"]); prim.OwnerID = new UUID((Guid)primRow["OwnerID"]); prim.GroupID = new UUID((Guid)primRow["GroupID"]); @@ -1127,6 +1137,9 @@ VALUES if (Convert.ToInt16(primRow["PassTouches"]) != 0) prim.PassTouches = true; prim.LinkNum = Convert.ToInt32(primRow["LinkNumber"]); + + if (!(primRow["MediaURL"] is System.DBNull)) + prim.MediaUrl = (string)primRow["MediaURL"]; return prim; } @@ -1180,6 +1193,9 @@ VALUES { } + if (!(shapeRow["Media"] is System.DBNull)) + baseShape.Media = PrimitiveBaseShape.MediaList.FromXml((string)shapeRow["Media"]); + return baseShape; } @@ -1353,7 +1369,6 @@ VALUES parameters.Add(_Database.CreateParameter("UserLookAtZ", land.UserLookAt.Z)); parameters.Add(_Database.CreateParameter("AuthBuyerID", land.AuthBuyerID)); parameters.Add(_Database.CreateParameter("OtherCleanTime", land.OtherCleanTime)); - parameters.Add(_Database.CreateParameter("Dwell", land.Dwell)); return parameters.ToArray(); } @@ -1402,7 +1417,7 @@ VALUES parameters.Add(_Database.CreateParameter("SitName", prim.SitName)); parameters.Add(_Database.CreateParameter("TouchName", prim.TouchName)); // permissions - parameters.Add(_Database.CreateParameter("ObjectFlags", prim.ObjectFlags)); + parameters.Add(_Database.CreateParameter("ObjectFlags", (uint)prim.Flags)); parameters.Add(_Database.CreateParameter("CreatorID", prim.CreatorID)); parameters.Add(_Database.CreateParameter("OwnerID", prim.OwnerID)); parameters.Add(_Database.CreateParameter("GroupID", prim.GroupID)); @@ -1510,6 +1525,7 @@ VALUES else parameters.Add(_Database.CreateParameter("PassTouches", 0)); parameters.Add(_Database.CreateParameter("LinkNumber", prim.LinkNum)); + parameters.Add(_Database.CreateParameter("MediaURL", prim.MediaUrl)); return parameters.ToArray(); } @@ -1557,6 +1573,7 @@ VALUES parameters.Add(_Database.CreateParameter("Texture", s.TextureEntry)); parameters.Add(_Database.CreateParameter("ExtraParams", s.ExtraParams)); parameters.Add(_Database.CreateParameter("State", s.State)); + parameters.Add(_Database.CreateParameter("Media", null == s.Media ? null : s.Media.ToXml())); return parameters.ToArray(); } diff --git a/OpenSim/Data/MSSQL/Resources/RegionStore.migrations b/OpenSim/Data/MSSQL/Resources/RegionStore.migrations index e912d646a0..e2e8cbb117 100644 --- a/OpenSim/Data/MSSQL/Resources/RegionStore.migrations +++ b/OpenSim/Data/MSSQL/Resources/RegionStore.migrations @@ -1,4 +1,4 @@ - + :VERSION 1 CREATE TABLE [dbo].[prims]( @@ -925,5 +925,12 @@ ALTER TABLE regionsettings ADD loaded_creation_datetime int NOT NULL default 0 COMMIT +:VERSION 24 +-- Added post 0.7 +BEGIN TRANSACTION +ALTER TABLE prims ADD COLUMN MediaURL varchar(255) +ALTER TABLE primshapes ADD COLUMN Media TEXT + +COMMIT \ No newline at end of file diff --git a/OpenSim/Data/Migration.cs b/OpenSim/Data/Migration.cs index c177097ebd..d60647015f 100644 --- a/OpenSim/Data/Migration.cs +++ b/OpenSim/Data/Migration.cs @@ -122,7 +122,7 @@ namespace OpenSim.Data int ver = FindVersion(_conn, "migrations"); if (ver <= 0) // -1 = no table, 0 = no version record { - if( ver < 0 ) + if (ver < 0) ExecuteScript("create table migrations(name varchar(100), version int)"); InsertVersion("migrations", 1); } @@ -204,7 +204,7 @@ namespace OpenSim.Data catch (Exception e) { m_log.DebugFormat("[MIGRATIONS]: Cmd was {0}", e.Message.Replace("\n", " ")); - m_log.Debug("[MIGRATIONS]: An error has occurred in the migration. This may mean you could see errors trying to run OpenSim. If you see database related errors, you will need to fix the issue manually. Continuing."); + m_log.Debug("[MIGRATIONS]: An error has occurred in the migration. If you're running OpenSim for the first time then you can probably safely ignore this, since certain migration commands attempt to fetch data out of old tables. However, if you're using an existing database and you see database related errors while running OpenSim then you will need to fix these problems manually. Continuing."); ExecuteScript("ROLLBACK;"); } @@ -288,7 +288,7 @@ namespace OpenSim.Data SortedList migrations = new SortedList(); string[] names = _assem.GetManifestResourceNames(); - if( names.Length == 0 ) // should never happen + if (names.Length == 0) // should never happen return migrations; Array.Sort(names); // we want all the migrations ordered @@ -297,7 +297,7 @@ namespace OpenSim.Data Match m = null; string sFile = Array.FindLast(names, nm => { m = _match_new.Match(nm); return m.Success; }); // ; nm.StartsWith(sPrefix, StringComparison.InvariantCultureIgnoreCase - if( (m != null) && !String.IsNullOrEmpty(sFile) ) + if ((m != null) && !String.IsNullOrEmpty(sFile)) { /* The filename should be '.migrations[.NNN]' where NNN * is the last version number defined in the file. If the '.NNN' part is recognized, the code can skip @@ -312,7 +312,7 @@ namespace OpenSim.Data if (m.Groups.Count > 1 && int.TryParse(m.Groups[1].Value, out nLastVerFound)) { - if( nLastVerFound <= after ) + if (nLastVerFound <= after) goto scan_old_style; } @@ -329,7 +329,7 @@ namespace OpenSim.Data sb.Length = 0; } - if ( (nVersion > 0) && (nVersion > after) && (script.Count > 0) && !migrations.ContainsKey(nVersion)) // script to the versioned script list + if ((nVersion > 0) && (nVersion > after) && (script.Count > 0) && !migrations.ContainsKey(nVersion)) // script to the versioned script list { migrations[nVersion] = script.ToArray(); } @@ -345,7 +345,7 @@ namespace OpenSim.Data string sLine = resourceReader.ReadLine(); nLineNo++; - if( String.IsNullOrEmpty(sLine) || sLine.StartsWith("#") ) // ignore a comment or empty line + if (String.IsNullOrEmpty(sLine) || sLine.StartsWith("#")) // ignore a comment or empty line continue; if (sLine.Trim().Equals(":GO", StringComparison.InvariantCultureIgnoreCase)) @@ -392,7 +392,7 @@ scan_old_style: if (m.Success) { int version = int.Parse(m.Groups[1].ToString()); - if ( (version > after) && !migrations.ContainsKey(version) ) + if ((version > after) && !migrations.ContainsKey(version)) { using (Stream resource = _assem.GetManifestResourceStream(s)) { @@ -407,9 +407,8 @@ scan_old_style: } if (migrations.Count < 1) - { - m_log.InfoFormat("[MIGRATIONS]: {0} up to date, no migrations to apply", _type); - } + m_log.DebugFormat("[MIGRATIONS]: {0} data tables already up to date at revision {1}", _type, after); + return migrations; } } diff --git a/OpenSim/Data/MySQL/MySQLAssetData.cs b/OpenSim/Data/MySQL/MySQLAssetData.cs index fe5152ad85..ed92f3ebc2 100644 --- a/OpenSim/Data/MySQL/MySQLAssetData.cs +++ b/OpenSim/Data/MySQL/MySQLAssetData.cs @@ -214,9 +214,6 @@ namespace OpenSim.Data.MySQL private void UpdateAccessTime(AssetBase asset) { - // Writing to the database every time Get() is called on an asset is killing us. Seriously. -jph - return; - lock (m_dbLock) { using (MySqlConnection dbcon = new MySqlConnection(m_connectionString)) diff --git a/OpenSim/Data/MySQL/MySQLEstateData.cs b/OpenSim/Data/MySQL/MySQLEstateData.cs index 9158f7a427..c42c687ed9 100644 --- a/OpenSim/Data/MySQL/MySQLEstateData.cs +++ b/OpenSim/Data/MySQL/MySQLEstateData.cs @@ -54,6 +54,15 @@ namespace OpenSim.Data.MySQL private Dictionary m_FieldMap = new Dictionary(); + public MySQLEstateStore() + { + } + + public MySQLEstateStore(string connectionString) + { + Initialise(connectionString); + } + public void Initialise(string connectionString) { m_connectionString = connectionString; diff --git a/OpenSim/Data/MySQL/MySQLGenericTableHandler.cs b/OpenSim/Data/MySQL/MySQLGenericTableHandler.cs index 6cbb2ee9a2..7c23a47d04 100644 --- a/OpenSim/Data/MySQL/MySQLGenericTableHandler.cs +++ b/OpenSim/Data/MySQL/MySQLGenericTableHandler.cs @@ -148,6 +148,10 @@ namespace OpenSim.Data.MySQL foreach (string name in m_Fields.Keys) { + if (reader[name] is DBNull) + { + continue; + } if (m_Fields[name].FieldType == typeof(bool)) { int v = Convert.ToInt32(reader[name]); diff --git a/OpenSim/Data/MySQL/MySQLInventoryData.cs b/OpenSim/Data/MySQL/MySQLInventoryData.cs index 0aea30ffb9..2dca3eb6a9 100644 --- a/OpenSim/Data/MySQL/MySQLInventoryData.cs +++ b/OpenSim/Data/MySQL/MySQLInventoryData.cs @@ -286,7 +286,7 @@ namespace OpenSim.Data.MySQL InventoryItemBase item = new InventoryItemBase(); // TODO: this is to handle a case where NULLs creep in there, which we are not sure is endemic to the system, or legacy. It would be nice to live fix these. - // ( DBGuid.FromDB() reads db NULLs as well, returns UUID.Zero ) + // (DBGuid.FromDB() reads db NULLs as well, returns UUID.Zero) item.CreatorId = reader["creatorID"].ToString(); // Be a bit safer in parsing these because the diff --git a/OpenSim/Data/MySQL/MySQLPresenceData.cs b/OpenSim/Data/MySQL/MySQLPresenceData.cs index 71caa1aa2a..2390febd7f 100644 --- a/OpenSim/Data/MySQL/MySQLPresenceData.cs +++ b/OpenSim/Data/MySQL/MySQLPresenceData.cs @@ -78,9 +78,12 @@ namespace OpenSim.Data.MySQL if (pd.Length == 0) return false; + if (regionID == UUID.Zero) + return false; + MySqlCommand cmd = new MySqlCommand(); - cmd.CommandText = String.Format("update {0} set RegionID=?RegionID where `SessionID`=?SessionID", m_Realm); + cmd.CommandText = String.Format("update {0} set RegionID=?RegionID, LastSeen=NOW() where `SessionID`=?SessionID", m_Realm); cmd.Parameters.AddWithValue("?SessionID", sessionID.ToString()); cmd.Parameters.AddWithValue("?RegionID", regionID.ToString()); @@ -90,6 +93,5 @@ namespace OpenSim.Data.MySQL return true; } - } } diff --git a/OpenSim/Data/MySQL/MySQLRegionData.cs b/OpenSim/Data/MySQL/MySQLRegionData.cs index c7bddacd16..efefad9704 100644 --- a/OpenSim/Data/MySQL/MySQLRegionData.cs +++ b/OpenSim/Data/MySQL/MySQLRegionData.cs @@ -62,6 +62,8 @@ namespace OpenSim.Data.MySQL if (scopeID != UUID.Zero) command += " and ScopeID = ?scopeID"; + command += " order by regionName"; + using (MySqlCommand cmd = new MySqlCommand(command)) { cmd.Parameters.AddWithValue("?regionName", regionName); @@ -210,6 +212,9 @@ namespace OpenSim.Data.MySQL if (data.Data.ContainsKey("locY")) data.Data.Remove("locY"); + if (data.RegionName.Length > 32) + data.RegionName = data.RegionName.Substring(0, 32); + string[] fields = new List(data.Data.Keys).ToArray(); using (MySqlCommand cmd = new MySqlCommand()) @@ -281,22 +286,28 @@ namespace OpenSim.Data.MySQL return false; } + public List GetDefaultRegions(UUID scopeID) { - string command = "select * from `"+m_Realm+"` where (flags & 1) <> 0"; - if (scopeID != UUID.Zero) - command += " and ScopeID = ?scopeID"; - - MySqlCommand cmd = new MySqlCommand(command); - - cmd.Parameters.AddWithValue("?scopeID", scopeID.ToString()); - - return RunCommand(cmd); + return Get((int)RegionFlags.DefaultRegion, scopeID); } public List GetFallbackRegions(UUID scopeID, int x, int y) { - string command = "select * from `"+m_Realm+"` where (flags & 2) <> 0"; + List regions = Get((int)RegionFlags.FallbackRegion, scopeID); + RegionDataDistanceCompare distanceComparer = new RegionDataDistanceCompare(x, y); + regions.Sort(distanceComparer); + return regions; + } + + public List GetHyperlinks(UUID scopeID) + { + return Get((int)RegionFlags.Hyperlink, scopeID); + } + + private List Get(int regionFlags, UUID scopeID) + { + string command = "select * from `" + m_Realm + "` where (flags & " + regionFlags.ToString() + ") <> 0"; if (scopeID != UUID.Zero) command += " and ScopeID = ?scopeID"; @@ -304,7 +315,6 @@ namespace OpenSim.Data.MySQL cmd.Parameters.AddWithValue("?scopeID", scopeID.ToString()); - // TODO: distance-sort results return RunCommand(cmd); } } diff --git a/OpenSim/Data/MySQL/MySQLLegacyRegionData.cs b/OpenSim/Data/MySQL/MySQLSimulationData.cs similarity index 96% rename from OpenSim/Data/MySQL/MySQLLegacyRegionData.cs rename to OpenSim/Data/MySQL/MySQLSimulationData.cs index 97b77f3c8e..2e25918d04 100644 --- a/OpenSim/Data/MySQL/MySQLLegacyRegionData.cs +++ b/OpenSim/Data/MySQL/MySQLSimulationData.cs @@ -45,13 +45,22 @@ namespace OpenSim.Data.MySQL /// /// A MySQL Interface for the Region Server /// - public class MySQLDataStore : IRegionDataStore + public class MySQLSimulationData : ISimulationDataStore { private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); private string m_connectionString; private object m_dbLock = new object(); + public MySQLSimulationData() + { + } + + public MySQLSimulationData(string connectionString) + { + Initialise(connectionString); + } + public void Initialise(string connectionString) { m_connectionString = connectionString; @@ -135,7 +144,7 @@ namespace OpenSim.Data.MySQL dbcon.Open(); MySqlCommand cmd = dbcon.CreateCommand(); - foreach (SceneObjectPart prim in obj.Children.Values) + foreach (SceneObjectPart prim in obj.Parts) { cmd.Parameters.Clear(); @@ -174,7 +183,7 @@ namespace OpenSim.Data.MySQL "ParticleSystem, ClickAction, Material, " + "CollisionSound, CollisionSoundVolume, " + "PassTouches, " + - "LinkNumber) values (" + "?UUID, " + + "LinkNumber, MediaURL) values (" + "?UUID, " + "?CreationDate, ?Name, ?Text, " + "?Description, ?SitName, ?TouchName, " + "?ObjectFlags, ?OwnerMask, ?NextOwnerMask, " + @@ -205,7 +214,7 @@ namespace OpenSim.Data.MySQL "?SaleType, ?ColorR, ?ColorG, " + "?ColorB, ?ColorA, ?ParticleSystem, " + "?ClickAction, ?Material, ?CollisionSound, " + - "?CollisionSoundVolume, ?PassTouches, ?LinkNumber)"; + "?CollisionSoundVolume, ?PassTouches, ?LinkNumber, ?MediaURL)"; FillPrimCommand(cmd, prim, obj.UUID, regionUUID); @@ -222,7 +231,7 @@ namespace OpenSim.Data.MySQL "PathTaperX, PathTaperY, PathTwist, " + "PathTwistBegin, ProfileBegin, ProfileEnd, " + "ProfileCurve, ProfileHollow, Texture, " + - "ExtraParams, State) values (?UUID, " + + "ExtraParams, State, Media) values (?UUID, " + "?Shape, ?ScaleX, ?ScaleY, ?ScaleZ, " + "?PCode, ?PathBegin, ?PathEnd, " + "?PathScaleX, ?PathScaleY, " + @@ -233,12 +242,13 @@ namespace OpenSim.Data.MySQL "?PathTwistBegin, ?ProfileBegin, " + "?ProfileEnd, ?ProfileCurve, " + "?ProfileHollow, ?Texture, ?ExtraParams, " + - "?State)"; + "?State, ?Media)"; FillShapeCommand(cmd, prim); ExecuteNonQuery(cmd); } + cmd.Dispose(); } } @@ -246,6 +256,8 @@ namespace OpenSim.Data.MySQL public void RemoveObject(UUID obj, UUID regionUUID) { +// m_log.DebugFormat("[REGION DB]: Deleting scene object {0} from {1} in database", obj, regionUUID); + List uuids = new List(); // Formerly, this used to check the region UUID. @@ -412,6 +424,7 @@ namespace OpenSim.Data.MySQL cmd.CommandText = "SELECT * FROM prims LEFT JOIN primshapes ON prims.UUID = primshapes.UUID WHERE RegionUUID = ?RegionUUID"; cmd.Parameters.AddWithValue("RegionUUID", regionID.ToString()); + cmd.CommandTimeout = 3600; using (IDataReader reader = ExecuteReader(cmd)) { @@ -818,7 +831,8 @@ namespace OpenSim.Data.MySQL "MusicURL, PassHours, PassPrice, SnapshotUUID, " + "UserLocationX, UserLocationY, UserLocationZ, " + "UserLookAtX, UserLookAtY, UserLookAtZ, " + - "AuthbuyerID, OtherCleanTime, Dwell) values (" + + "AuthbuyerID, OtherCleanTime, MediaType, MediaDescription, " + + "MediaSize, MediaLoop, ObscureMusic, ObscureMedia) values (" + "?UUID, ?RegionUUID, " + "?LocalLandID, ?Bitmap, ?Name, ?Description, " + "?OwnerUUID, ?IsGroupOwned, ?Area, ?AuctionID, " + @@ -828,7 +842,8 @@ namespace OpenSim.Data.MySQL "?MusicURL, ?PassHours, ?PassPrice, ?SnapshotUUID, " + "?UserLocationX, ?UserLocationY, ?UserLocationZ, " + "?UserLookAtX, ?UserLookAtY, ?UserLookAtZ, " + - "?AuthbuyerID, ?OtherCleanTime, ?Dwell)"; + "?AuthbuyerID, ?OtherCleanTime, ?MediaType, ?MediaDescription, "+ + "CONCAT(?MediaWidth, ',', ?MediaHeight), ?MediaLoop, ?ObscureMusic, ?ObscureMedia)"; FillLandCommand(cmd, parcel.LandData, parcel.RegionUUID); @@ -865,7 +880,7 @@ namespace OpenSim.Data.MySQL string command = "select * from `regionwindlight` where region_id = ?regionID"; - using(MySqlCommand cmd = new MySqlCommand(command)) + using (MySqlCommand cmd = new MySqlCommand(command)) { cmd.Connection = dbcon; @@ -944,6 +959,7 @@ namespace OpenSim.Data.MySQL nWP.cloudScrollY = Convert.ToSingle(result["cloud_scroll_y"]); nWP.cloudScrollYLock = Convert.ToBoolean(result["cloud_scroll_y_lock"]); nWP.drawClassicClouds = Convert.ToBoolean(result["draw_classic_clouds"]); + nWP.valid = true; } } } @@ -1091,6 +1107,21 @@ namespace OpenSim.Data.MySQL } } + public void RemoveRegionWindlightSettings(UUID regionID) + { + using (MySqlConnection dbcon = new MySqlConnection(m_connectionString)) + { + dbcon.Open(); + + using (MySqlCommand cmd = dbcon.CreateCommand()) + { + cmd.CommandText = "delete from `regionwindlight` where `region_id`=?regionID"; + cmd.Parameters.AddWithValue("?regionID", regionID.ToString()); + ExecuteNonQuery(cmd); + } + } + } + public void StoreRegionSettings(RegionSettings rs) { lock (m_dbLock) @@ -1201,7 +1232,7 @@ namespace OpenSim.Data.MySQL // depending on the MySQL connector version, CHAR(36) may be already converted to Guid! prim.UUID = DBGuid.FromDB(row["UUID"]); - prim.CreatorID = DBGuid.FromDB(row["CreatorID"]); + prim.CreatorIdentification = (string)row["CreatorID"]; prim.OwnerID = DBGuid.FromDB(row["OwnerID"]); prim.GroupID = DBGuid.FromDB(row["GroupID"]); prim.LastOwnerID = DBGuid.FromDB(row["LastOwnerID"]); @@ -1223,7 +1254,7 @@ namespace OpenSim.Data.MySQL prim.SitName = (string)row["SitName"]; prim.TouchName = (string)row["TouchName"]; // Permissions - prim.ObjectFlags = (uint)(int)row["ObjectFlags"]; + prim.Flags = (PrimFlags)(int)row["ObjectFlags"]; prim.OwnerMask = (uint)(int)row["OwnerMask"]; prim.NextOwnerMask = (uint)(int)row["NextOwnerMask"]; prim.GroupMask = (uint)(int)row["GroupMask"]; @@ -1326,6 +1357,9 @@ namespace OpenSim.Data.MySQL prim.PassTouches = ((sbyte)row["PassTouches"] != 0); prim.LinkNum = (int)row["LinkNumber"]; + + if (!(row["MediaURL"] is System.DBNull)) + prim.MediaUrl = (string)row["MediaURL"]; return prim; } @@ -1351,7 +1385,7 @@ namespace OpenSim.Data.MySQL taskItem.Name = (String)row["name"]; taskItem.Description = (String)row["description"]; taskItem.CreationDate = Convert.ToUInt32(row["creationDate"]); - taskItem.CreatorID = DBGuid.FromDB(row["creatorID"]); + taskItem.CreatorIdentification = (String)row["creatorID"]; taskItem.OwnerID = DBGuid.FromDB(row["ownerID"]); taskItem.LastOwnerID = DBGuid.FromDB(row["lastOwnerID"]); taskItem.GroupID = DBGuid.FromDB(row["groupID"]); @@ -1465,7 +1499,6 @@ namespace OpenSim.Data.MySQL UUID.TryParse((string)row["AuthBuyerID"], out authedbuyer); UUID.TryParse((string)row["SnapshotUUID"], out snapshotID); newData.OtherCleanTime = Convert.ToInt32(row["OtherCleanTime"]); - newData.Dwell = Convert.ToInt32(row["Dwell"]); newData.AuthBuyerID = authedbuyer; newData.SnapshotID = snapshotID; @@ -1485,6 +1518,14 @@ namespace OpenSim.Data.MySQL m_log.ErrorFormat("[PARCEL]: unable to get parcel telehub settings for {1}", newData.Name); } + newData.MediaDescription = (string) row["MediaDescription"]; + newData.MediaType = (string) row["MediaType"]; + newData.MediaWidth = Convert.ToInt32((((string) row["MediaSize"]).Split(','))[0]); + newData.MediaHeight = Convert.ToInt32((((string) row["MediaSize"]).Split(','))[1]); + newData.MediaLoop = Convert.ToBoolean(row["MediaLoop"]); + newData.ObscureMusic = Convert.ToBoolean(row["ObscureMusic"]); + newData.ObscureMedia = Convert.ToBoolean(row["ObscureMedia"]); + newData.ParcelAccessList = new List(); return newData; @@ -1553,8 +1594,8 @@ namespace OpenSim.Data.MySQL cmd.Parameters.AddWithValue("SitName", prim.SitName); cmd.Parameters.AddWithValue("TouchName", prim.TouchName); // permissions - cmd.Parameters.AddWithValue("ObjectFlags", prim.ObjectFlags); - cmd.Parameters.AddWithValue("CreatorID", prim.CreatorID.ToString()); + cmd.Parameters.AddWithValue("ObjectFlags", (uint)prim.Flags); + cmd.Parameters.AddWithValue("CreatorID", prim.CreatorIdentification.ToString()); cmd.Parameters.AddWithValue("OwnerID", prim.OwnerID.ToString()); cmd.Parameters.AddWithValue("GroupID", prim.GroupID.ToString()); cmd.Parameters.AddWithValue("LastOwnerID", prim.LastOwnerID.ToString()); @@ -1663,6 +1704,7 @@ namespace OpenSim.Data.MySQL cmd.Parameters.AddWithValue("PassTouches", 0); cmd.Parameters.AddWithValue("LinkNumber", prim.LinkNum); + cmd.Parameters.AddWithValue("MediaURL", prim.MediaUrl); } /// @@ -1683,7 +1725,7 @@ namespace OpenSim.Data.MySQL cmd.Parameters.AddWithValue("name", taskItem.Name); cmd.Parameters.AddWithValue("description", taskItem.Description); cmd.Parameters.AddWithValue("creationDate", taskItem.CreationDate); - cmd.Parameters.AddWithValue("creatorID", taskItem.CreatorID); + cmd.Parameters.AddWithValue("creatorID", taskItem.CreatorIdentification); cmd.Parameters.AddWithValue("ownerID", taskItem.OwnerID); cmd.Parameters.AddWithValue("lastOwnerID", taskItem.LastOwnerID); cmd.Parameters.AddWithValue("groupID", taskItem.GroupID); @@ -1787,7 +1829,14 @@ namespace OpenSim.Data.MySQL cmd.Parameters.AddWithValue("UserLookAtZ", land.UserLookAt.Z); cmd.Parameters.AddWithValue("AuthBuyerID", land.AuthBuyerID); cmd.Parameters.AddWithValue("OtherCleanTime", land.OtherCleanTime); - cmd.Parameters.AddWithValue("Dwell", land.Dwell); + cmd.Parameters.AddWithValue("MediaDescription", land.MediaDescription); + cmd.Parameters.AddWithValue("MediaType", land.MediaType); + cmd.Parameters.AddWithValue("MediaWidth", land.MediaWidth); + cmd.Parameters.AddWithValue("MediaHeight", land.MediaHeight); + cmd.Parameters.AddWithValue("MediaLoop", land.MediaLoop); + cmd.Parameters.AddWithValue("ObscureMusic", land.ObscureMusic); + cmd.Parameters.AddWithValue("ObscureMedia", land.ObscureMedia); + } /// @@ -1842,6 +1891,9 @@ namespace OpenSim.Data.MySQL s.ExtraParams = (byte[])row["ExtraParams"]; s.State = (byte)(int)row["State"]; + + if (!(row["Media"] is System.DBNull)) + s.Media = PrimitiveBaseShape.MediaList.FromXml((string)row["Media"]); return s; } @@ -1885,6 +1937,7 @@ namespace OpenSim.Data.MySQL cmd.Parameters.AddWithValue("Texture", s.TextureEntry); cmd.Parameters.AddWithValue("ExtraParams", s.ExtraParams); cmd.Parameters.AddWithValue("State", s.State); + cmd.Parameters.AddWithValue("Media", null == s.Media ? null : s.Media.ToXml()); } public void StorePrimInventory(UUID primID, ICollection items) diff --git a/OpenSim/Data/MySQL/Resources/Avatar.migrations b/OpenSim/Data/MySQL/Resources/Avatar.migrations index 8d0eee68a1..f7cf1766fc 100644 --- a/OpenSim/Data/MySQL/Resources/Avatar.migrations +++ b/OpenSim/Data/MySQL/Resources/Avatar.migrations @@ -10,3 +10,11 @@ CREATE TABLE Avatars ( KEY(PrincipalID)); COMMIT; + +:VERSION 2 + +BEGIN; + +alter table Avatars change column Value Value text; + +COMMIT; diff --git a/OpenSim/Data/MySQL/Resources/InventoryStore.migrations b/OpenSim/Data/MySQL/Resources/InventoryStore.migrations index 3e9bad5f95..993a5a0f1f 100644 --- a/OpenSim/Data/MySQL/Resources/InventoryStore.migrations +++ b/OpenSim/Data/MySQL/Resources/InventoryStore.migrations @@ -99,3 +99,11 @@ BEGIN; alter table inventoryitems modify column creatorID varchar(128) not NULL default '00000000-0000-0000-0000-000000000000'; COMMIT; + +:VERSION 6 # ------------ + +BEGIN; + +alter table inventoryitems modify column creatorID varchar(255) not NULL default '00000000-0000-0000-0000-000000000000'; + +COMMIT; diff --git a/OpenSim/Data/MySQL/Resources/Presence.migrations b/OpenSim/Data/MySQL/Resources/Presence.migrations index 91f7de55f7..be4030efb0 100644 --- a/OpenSim/Data/MySQL/Resources/Presence.migrations +++ b/OpenSim/Data/MySQL/Resources/Presence.migrations @@ -13,3 +13,11 @@ CREATE UNIQUE INDEX SessionID ON Presence(SessionID); CREATE INDEX UserID ON Presence(UserID); COMMIT; + +:VERSION 2 # -------------------------- + +BEGIN; + +ALTER TABLE `Presence` ADD COLUMN LastSeen timestamp; + +COMMIT; diff --git a/OpenSim/Data/MySQL/Resources/RegionStore.migrations b/OpenSim/Data/MySQL/Resources/RegionStore.migrations index 3f644f903f..ba8d5388a6 100644 --- a/OpenSim/Data/MySQL/Resources/RegionStore.migrations +++ b/OpenSim/Data/MySQL/Resources/RegionStore.migrations @@ -1,4 +1,4 @@ - + :VERSION 1 #--------------------- BEGIN; @@ -800,3 +800,29 @@ BEGIN; ALTER TABLE `regionwindlight` CHANGE COLUMN `cloud_scroll_x` `cloud_scroll_x` FLOAT(4,2) NOT NULL DEFAULT '0.20' AFTER `cloud_detail_density`, CHANGE COLUMN `cloud_scroll_y` `cloud_scroll_y` FLOAT(4,2) NOT NULL DEFAULT '0.01' AFTER `cloud_scroll_x_lock`; COMMIT; +:VERSION 35 #--------------------- + +BEGIN; +ALTER TABLE prims ADD COLUMN MediaURL varchar(255); +ALTER TABLE primshapes ADD COLUMN Media TEXT; +COMMIT; + +:VERSION 36 #--------------------- + +BEGIN; +ALTER TABLE `land` ADD COLUMN `MediaType` VARCHAR(32) NOT NULL DEFAULT 'none/none' ; +ALTER TABLE `land` ADD COLUMN `MediaDescription` VARCHAR(255) NOT NULL DEFAULT ''; +ALTER TABLE `land` ADD COLUMN `MediaSize` VARCHAR(16) NOT NULL DEFAULT '0,0'; +ALTER TABLE `land` ADD COLUMN `MediaLoop` BOOLEAN NOT NULL DEFAULT FALSE; +ALTER TABLE `land` ADD COLUMN `ObscureMusic` BOOLEAN NOT NULL DEFAULT FALSE; +ALTER TABLE `land` ADD COLUMN `ObscureMedia` BOOLEAN NOT NULL DEFAULT FALSE; +COMMIT; + +:VERSION 37 #--------------------- + +BEGIN; + +ALTER TABLE `prims` MODIFY COLUMN `CreatorID` VARCHAR(255) NOT NULL DEFAULT ''; +ALTER TABLE `primitems` MODIFY COLUMN `CreatorID` VARCHAR(255) NOT NULL DEFAULT ''; + +COMMIT; diff --git a/OpenSim/Data/Null/NullInventoryData.cs b/OpenSim/Data/Null/NullInventoryData.cs index 8f196e2018..fe9ed017a1 100644 --- a/OpenSim/Data/Null/NullInventoryData.cs +++ b/OpenSim/Data/Null/NullInventoryData.cs @@ -1,4 +1,31 @@ -using System; +/* + * Copyright (c) Contributors, http://opensimulator.org/ + * See CONTRIBUTORS.TXT for a full list of copyright holders. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * * Neither the name of the OpenSimulator Project nor the + * names of its contributors may be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE DEVELOPERS ``AS IS'' AND ANY + * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED + * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + * DISCLAIMED. IN NO EVENT SHALL THE CONTRIBUTORS BE LIABLE FOR ANY + * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES + * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND + * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS + * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +using System; using System.Collections.Generic; using OpenMetaverse; diff --git a/OpenSim/Data/Null/NullRegionData.cs b/OpenSim/Data/Null/NullRegionData.cs index d596698127..2065355890 100644 --- a/OpenSim/Data/Null/NullRegionData.cs +++ b/OpenSim/Data/Null/NullRegionData.cs @@ -164,34 +164,36 @@ namespace OpenSim.Data.Null public List GetDefaultRegions(UUID scopeID) { - if (Instance != this) - return Instance.GetDefaultRegions(scopeID); - - List ret = new List(); - - foreach (RegionData r in m_regionData.Values) - { - if ((Convert.ToInt32(r.Data["flags"]) & 1) != 0) - ret.Add(r); - } - - return ret; + return Get((int)RegionFlags.DefaultRegion, scopeID); } public List GetFallbackRegions(UUID scopeID, int x, int y) + { + List regions = Get((int)RegionFlags.FallbackRegion, scopeID); + RegionDataDistanceCompare distanceComparer = new RegionDataDistanceCompare(x, y); + regions.Sort(distanceComparer); + return regions; + } + + public List GetHyperlinks(UUID scopeID) + { + return Get((int)RegionFlags.Hyperlink, scopeID); + } + + private List Get(int regionFlags, UUID scopeID) { if (Instance != this) - return Instance.GetFallbackRegions(scopeID, x, y); + return Instance.Get(regionFlags, scopeID); List ret = new List(); foreach (RegionData r in m_regionData.Values) { - if ((Convert.ToInt32(r.Data["flags"]) & 2) != 0) + if ((Convert.ToInt32(r.Data["flags"]) & regionFlags) != 0) ret.Add(r); } return ret; } } -} \ No newline at end of file +} diff --git a/OpenSim/Data/Null/NullDataStore.cs b/OpenSim/Data/Null/NullSimulationData.cs similarity index 96% rename from OpenSim/Data/Null/NullDataStore.cs rename to OpenSim/Data/Null/NullSimulationData.cs index 44284f0ac3..4238a07916 100644 --- a/OpenSim/Data/Null/NullDataStore.cs +++ b/OpenSim/Data/Null/NullSimulationData.cs @@ -36,7 +36,7 @@ namespace OpenSim.Data.Null /// /// NULL DataStore, do not store anything /// - public class NullDataStore : IRegionDataStore + public class NullSimulationData : ISimulationDataStore { public void Initialise(string dbfile) { @@ -56,6 +56,9 @@ namespace OpenSim.Data.Null //Return default LL windlight settings return new RegionLightShareData(); } + public void RemoveRegionWindlightSettings(UUID regionID) + { + } public void StoreRegionWindlightSettings(RegionLightShareData wl) { //This connector doesn't support the windlight module yet @@ -73,7 +76,6 @@ namespace OpenSim.Data.Null { } - // see IRegionDatastore public void StorePrimInventory(UUID primID, ICollection items) { } diff --git a/OpenSim/Data/SQLite/Resources/019_RegionStore.sql b/OpenSim/Data/SQLite/Resources/019_RegionStore.sql deleted file mode 100644 index d62f8484b8..0000000000 --- a/OpenSim/Data/SQLite/Resources/019_RegionStore.sql +++ /dev/null @@ -1,5 +0,0 @@ -BEGIN; - -ALTER TABLE regionsettings ADD COLUMN map_tile_ID varchar(36) NOT NULL default '00000000-0000-0000-0000-000000000000'; - -COMMIT; \ No newline at end of file diff --git a/OpenSim/Data/SQLite/Resources/RegionStore.migrations b/OpenSim/Data/SQLite/Resources/RegionStore.migrations index c461bf0727..5e2045b1b9 100644 --- a/OpenSim/Data/SQLite/Resources/RegionStore.migrations +++ b/OpenSim/Data/SQLite/Resources/RegionStore.migrations @@ -446,3 +446,24 @@ update land where AuthbuyerID not like '%-%'; COMMIT; + +:VERSION 19 +BEGIN; +ALTER TABLE regionsettings ADD COLUMN map_tile_ID varchar(36) NOT NULL default '00000000-0000-0000-0000-000000000000'; +COMMIT; + +:VERSION 20 +BEGIN; +ALTER TABLE prims ADD COLUMN MediaURL varchar(255); +ALTER TABLE primshapes ADD COLUMN Media TEXT; +COMMIT; + +:VERSION 21 +BEGIN; +ALTER TABLE `land` ADD COLUMN `MediaType` VARCHAR(32) NOT NULL DEFAULT 'none/none'; +ALTER TABLE `land` ADD COLUMN `MediaDescription` VARCHAR(255) NOT NULL DEFAULT ''; +ALTER TABLE `land` ADD COLUMN `MediaSize` VARCHAR(16) NOT NULL DEFAULT '0,0'; +ALTER TABLE `land` ADD COLUMN `MediaLoop` BOOLEAN NOT NULL DEFAULT FALSE; +ALTER TABLE `land` ADD COLUMN `ObscureMusic` BOOLEAN NOT NULL DEFAULT FALSE; +ALTER TABLE `land` ADD COLUMN `ObscureMedia` BOOLEAN NOT NULL DEFAULT FALSE; +COMMIT; \ No newline at end of file diff --git a/OpenSim/Data/SQLite/SQLiteAssetData.cs b/OpenSim/Data/SQLite/SQLiteAssetData.cs index 16e560c6df..5b71897ced 100644 --- a/OpenSim/Data/SQLite/SQLiteAssetData.cs +++ b/OpenSim/Data/SQLite/SQLiteAssetData.cs @@ -30,7 +30,12 @@ using System.Data; using System.Reflection; using System.Collections.Generic; using log4net; -using Mono.Data.Sqlite; +#if CSharpSqlite + using Community.CsharpSqlite.Sqlite; +#else + using Mono.Data.Sqlite; +#endif + using OpenMetaverse; using OpenSim.Framework; diff --git a/OpenSim/Data/SQLite/SQLiteAuthenticationData.cs b/OpenSim/Data/SQLite/SQLiteAuthenticationData.cs index a1412ff0fa..c54bd743b3 100644 --- a/OpenSim/Data/SQLite/SQLiteAuthenticationData.cs +++ b/OpenSim/Data/SQLite/SQLiteAuthenticationData.cs @@ -33,7 +33,12 @@ using System.Reflection; using log4net; using OpenMetaverse; using OpenSim.Framework; -using Mono.Data.Sqlite; +using log4net; +#if CSharpSqlite + using Community.CsharpSqlite.Sqlite; +#else + using Mono.Data.Sqlite; +#endif namespace OpenSim.Data.SQLite { diff --git a/OpenSim/Data/SQLite/SQLiteAvatarData.cs b/OpenSim/Data/SQLite/SQLiteAvatarData.cs index c093884db4..60a1a3e9f7 100644 --- a/OpenSim/Data/SQLite/SQLiteAvatarData.cs +++ b/OpenSim/Data/SQLite/SQLiteAvatarData.cs @@ -33,7 +33,11 @@ using System.Threading; using log4net; using OpenMetaverse; using OpenSim.Framework; -using Mono.Data.Sqlite; +#if CSharpSqlite + using Community.CsharpSqlite.Sqlite; +#else + using Mono.Data.Sqlite; +#endif namespace OpenSim.Data.SQLite { diff --git a/OpenSim/Data/SQLite/SQLiteEstateData.cs b/OpenSim/Data/SQLite/SQLiteEstateData.cs index fcf041e41f..63252aa3d3 100644 --- a/OpenSim/Data/SQLite/SQLiteEstateData.cs +++ b/OpenSim/Data/SQLite/SQLiteEstateData.cs @@ -30,7 +30,11 @@ using System.Collections.Generic; using System.Data; using System.Reflection; using log4net; -using Mono.Data.Sqlite; +#if CSharpSqlite + using Community.CsharpSqlite.Sqlite; +#else + using Mono.Data.Sqlite; +#endif using OpenMetaverse; using OpenSim.Framework; using OpenSim.Region.Framework.Interfaces; @@ -49,6 +53,15 @@ namespace OpenSim.Data.SQLite private Dictionary m_FieldMap = new Dictionary(); + public SQLiteEstateStore() + { + } + + public SQLiteEstateStore(string connectionString) + { + Initialise(connectionString); + } + public void Initialise(string connectionString) { m_connectionString = connectionString; @@ -96,10 +109,17 @@ namespace OpenSim.Data.SQLite { EstateSettings es = new EstateSettings(); es.OnSave += StoreEstateSettings; + IDataReader r = null; + try + { + r = cmd.ExecuteReader(); + } + catch (SqliteException) + { + m_log.Error("[SQLITE]: There was an issue loading the estate settings. This can happen the first time running OpenSimulator with CSharpSqlite the first time. OpenSimulator will probably crash, restart it and it should be good to go."); + } - IDataReader r = cmd.ExecuteReader(); - - if (r.Read()) + if (r != null && r.Read()) { foreach (string name in FieldList) { diff --git a/OpenSim/Data/SQLite/SQLiteFramework.cs b/OpenSim/Data/SQLite/SQLiteFramework.cs index cf114d1a07..4992bcc7de 100644 --- a/OpenSim/Data/SQLite/SQLiteFramework.cs +++ b/OpenSim/Data/SQLite/SQLiteFramework.cs @@ -31,7 +31,11 @@ using System.Collections.Generic; using System.Data; using OpenMetaverse; using OpenSim.Framework; -using Mono.Data.Sqlite; +#if CSharpSqlite + using Community.CsharpSqlite.Sqlite; +#else + using Mono.Data.Sqlite; +#endif namespace OpenSim.Data.SQLite { diff --git a/OpenSim/Data/SQLite/SQLiteFriendsData.cs b/OpenSim/Data/SQLite/SQLiteFriendsData.cs index b06853ce68..4bfd228364 100644 --- a/OpenSim/Data/SQLite/SQLiteFriendsData.cs +++ b/OpenSim/Data/SQLite/SQLiteFriendsData.cs @@ -31,7 +31,11 @@ using System.Collections.Generic; using System.Data; using OpenMetaverse; using OpenSim.Framework; -using Mono.Data.Sqlite; +#if CSharpSqlite + using Community.CsharpSqlite.Sqlite; +#else + using Mono.Data.Sqlite; +#endif namespace OpenSim.Data.SQLite { diff --git a/OpenSim/Data/SQLite/SQLiteGenericTableHandler.cs b/OpenSim/Data/SQLite/SQLiteGenericTableHandler.cs index 9b8e2fa7f3..0d7b001e3f 100644 --- a/OpenSim/Data/SQLite/SQLiteGenericTableHandler.cs +++ b/OpenSim/Data/SQLite/SQLiteGenericTableHandler.cs @@ -30,7 +30,11 @@ using System.Collections.Generic; using System.Data; using System.Reflection; using log4net; -using Mono.Data.Sqlite; +#if CSharpSqlite + using Community.CsharpSqlite.Sqlite; +#else + using Mono.Data.Sqlite; +#endif using OpenMetaverse; using OpenSim.Framework; using OpenSim.Region.Framework.Interfaces; diff --git a/OpenSim/Data/SQLite/SQLiteInventoryStore.cs b/OpenSim/Data/SQLite/SQLiteInventoryStore.cs index ece2495c2b..7dc07ec1ac 100644 --- a/OpenSim/Data/SQLite/SQLiteInventoryStore.cs +++ b/OpenSim/Data/SQLite/SQLiteInventoryStore.cs @@ -30,7 +30,11 @@ using System.Collections.Generic; using System.Data; using System.Reflection; using log4net; -using Mono.Data.Sqlite; +#if CSharpSqlite + using Community.CsharpSqlite.Sqlite; +#else + using Mono.Data.Sqlite; +#endif using OpenMetaverse; using OpenSim.Framework; @@ -152,7 +156,7 @@ namespace OpenSim.Data.SQLite item.InvType = Convert.ToInt32(row["invType"]); item.Folder = new UUID((string) row["parentFolderID"]); item.Owner = new UUID((string) row["avatarID"]); - item.CreatorId = (string)row["creatorsID"]; + item.CreatorIdentification = (string)row["creatorsID"]; item.Name = (string) row["inventoryName"]; item.Description = (string) row["inventoryDescription"]; @@ -197,7 +201,7 @@ namespace OpenSim.Data.SQLite row["invType"] = item.InvType; row["parentFolderID"] = item.Folder.ToString(); row["avatarID"] = item.Owner.ToString(); - row["creatorsID"] = item.CreatorId.ToString(); + row["creatorsID"] = item.CreatorIdentification.ToString(); row["inventoryName"] = item.Name; row["inventoryDescription"] = item.Description; @@ -731,12 +735,12 @@ namespace OpenSim.Data.SQLite **********************************************************************/ protected void CreateDataSetMapping(IDataAdapter da, string tableName) - { + { ITableMapping dbMapping = da.TableMappings.Add(tableName, tableName); foreach (DataColumn col in ds.Tables[tableName].Columns) - { + { dbMapping.ColumnMappings.Add(col.ColumnName, col.ColumnName); - } + } } /// diff --git a/OpenSim/Data/SQLite/SQLiteRegionData.cs b/OpenSim/Data/SQLite/SQLiteSimulationData.cs similarity index 97% rename from OpenSim/Data/SQLite/SQLiteRegionData.cs rename to OpenSim/Data/SQLite/SQLiteSimulationData.cs index 218d7f9c34..97baaea04b 100644 --- a/OpenSim/Data/SQLite/SQLiteRegionData.cs +++ b/OpenSim/Data/SQLite/SQLiteSimulationData.cs @@ -32,8 +32,13 @@ using System.Drawing; using System.IO; using System.Reflection; using log4net; -using Mono.Data.Sqlite; +#if CSharpSqlite + using Community.CsharpSqlite.Sqlite; +#else + using Mono.Data.Sqlite; +#endif using OpenMetaverse; +using OpenMetaverse.StructuredData; using OpenSim.Framework; using OpenSim.Region.Framework.Interfaces; using OpenSim.Region.Framework.Scenes; @@ -43,7 +48,7 @@ namespace OpenSim.Data.SQLite /// /// A RegionData Interface to the SQLite database /// - public class SQLiteRegionData : IRegionDataStore + public class SQLiteSimulationData : ISimulationDataStore { private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); @@ -69,6 +74,15 @@ namespace OpenSim.Data.SQLite private String m_connectionString; + public SQLiteSimulationData() + { + } + + public SQLiteSimulationData(string connectionString) + { + Initialise(connectionString); + } + // Temporary attribute while this is experimental /*********************************************************************** @@ -78,7 +92,6 @@ namespace OpenSim.Data.SQLite **********************************************************************/ /// - /// See IRegionDataStore /// /// Initialises RegionData Interface /// Loads and initialises a new SQLite connection and maintains it. @@ -176,7 +189,7 @@ namespace OpenSim.Data.SQLite { m_log.Info("[SQLITE REGION DB]: Caught fill error on primitems table"); } - + try { terrainDa.Fill(ds.Tables["terrain"]); @@ -310,6 +323,9 @@ namespace OpenSim.Data.SQLite //Return default LL windlight settings return new RegionLightShareData(); } + public void RemoveRegionWindlightSettings(UUID regionID) + { + } public void StoreRegionWindlightSettings(RegionLightShareData wl) { //This connector doesn't support the windlight module yet @@ -359,7 +375,7 @@ namespace OpenSim.Data.SQLite lock (ds) { - foreach (SceneObjectPart prim in obj.Children.Values) + foreach (SceneObjectPart prim in obj.Parts) { // m_log.Info("[REGION DB]: Adding obj: " + obj.UUID + " to region: " + regionUUID); addPrim(prim, obj.UUID, regionUUID); @@ -510,7 +526,7 @@ namespace OpenSim.Data.SQLite "[SQLITE REGION DB]: No shape found for prim in storage, so setting default box shape"); prim.Shape = PrimitiveBaseShape.Default; } - + createdObjects[new UUID(objID)].AddPart(prim); LoadItems(prim); } @@ -534,17 +550,17 @@ namespace OpenSim.Data.SQLite /// /// the prim private void LoadItems(SceneObjectPart prim) - { -// m_log.DebugFormat("[SQLITE REGION DB]: Loading inventory for {0} {1}", prim.Name, prim.UUID); - + { +// m_log.DebugFormat("[SQLITE REGION DB]: 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 inventory = new List(); -// m_log.DebugFormat( -// "[SQLITE REGION DB]: Found {0} items for {1} {2}", dbItemRows.Length, prim.Name, prim.UUID); - +// m_log.DebugFormat( +// "[SQLITE REGION DB]: Found {0} items for {1} {2}", dbItemRows.Length, prim.Name, prim.UUID); + foreach (DataRow row in dbItemRows) { TaskInventoryItem item = buildItem(row); @@ -681,6 +697,7 @@ namespace OpenSim.Data.SQLite DataRow landRow = land.Rows.Find(globalID.ToString()); if (landRow != null) { + landRow.Delete(); land.Rows.Remove(landRow); } List rowsToDelete = new List(); @@ -691,10 +708,9 @@ namespace OpenSim.Data.SQLite } for (int iter = 0; iter < rowsToDelete.Count; iter++) { + rowsToDelete[iter].Delete(); landaccesslist.Rows.Remove(rowsToDelete[iter]); } - - } Commit(); } @@ -741,6 +757,7 @@ namespace OpenSim.Data.SQLite } for (int iter = 0; iter < rowsToDelete.Count; iter++) { + rowsToDelete[iter].Delete(); landaccesslist.Rows.Remove(rowsToDelete[iter]); } rowsToDelete.Clear(); @@ -804,7 +821,7 @@ namespace OpenSim.Data.SQLite try { regionSettingsDa.Update(ds, "regionsettings"); - } + } catch (SqliteException SqlEx) { throw new Exception( @@ -975,6 +992,8 @@ namespace OpenSim.Data.SQLite createCol(prims, "VolumeDetect", typeof(Int16)); + createCol(prims, "MediaURL", typeof(String)); + // Add in contraints prims.PrimaryKey = new DataColumn[] {prims.Columns["UUID"]}; @@ -1021,6 +1040,7 @@ namespace OpenSim.Data.SQLite // way to specify this as a blob atm createCol(shapes, "Texture", typeof (Byte[])); createCol(shapes, "ExtraParams", typeof (Byte[])); + createCol(shapes, "Media", typeof(String)); shapes.PrimaryKey = new DataColumn[] {shapes.Columns["UUID"]}; @@ -1107,7 +1127,6 @@ namespace OpenSim.Data.SQLite createCol(land, "UserLookAtZ", typeof (Double)); createCol(land, "AuthbuyerID", typeof(String)); createCol(land, "OtherCleanTime", typeof(Int32)); - createCol(land, "Dwell", typeof(Int32)); land.PrimaryKey = new DataColumn[] {land.Columns["UUID"]}; @@ -1189,10 +1208,10 @@ namespace OpenSim.Data.SQLite private SceneObjectPart buildPrim(DataRow row) { // Code commented. Uncomment to test the unit test inline. - - // The unit test mentions this commented code for the purposes + + // The unit test mentions this commented code for the purposes // of debugging a unit test failure - + // SceneObjectGroup sog = new SceneObjectGroup(); // SceneObjectPart sop = new SceneObjectPart(); // sop.LocalId = 1; @@ -1209,7 +1228,7 @@ namespace OpenSim.Data.SQLite // TODO: this doesn't work yet because something more // interesting has to be done to actually get these values // back out. Not enough time to figure it out yet. - + SceneObjectPart prim = new SceneObjectPart(); prim.UUID = new UUID((String) row["UUID"]); // explicit conversion of integers is required, which sort @@ -1227,7 +1246,7 @@ namespace OpenSim.Data.SQLite prim.TouchName = (String) row["TouchName"]; // permissions prim.ObjectFlags = Convert.ToUInt32(row["ObjectFlags"]); - prim.CreatorID = new UUID((String) row["CreatorID"]); + prim.CreatorIdentification = (String) row["CreatorID"]; prim.OwnerID = new UUID((String) row["OwnerID"]); prim.GroupID = new UUID((String) row["GroupID"]); prim.LastOwnerID = new UUID((String) row["LastOwnerID"]); @@ -1340,6 +1359,12 @@ namespace OpenSim.Data.SQLite if (Convert.ToInt16(row["VolumeDetect"]) != 0) prim.VolumeDetectActive = true; + if (!(row["MediaURL"] is System.DBNull)) + { + //m_log.DebugFormat("[SQLITE]: MediaUrl type [{0}]", row["MediaURL"].GetType()); + prim.MediaUrl = (string)row["MediaURL"]; + } + return prim; } @@ -1363,7 +1388,7 @@ namespace OpenSim.Data.SQLite taskItem.Name = (String)row["name"]; taskItem.Description = (String)row["description"]; taskItem.CreationDate = Convert.ToUInt32(row["creationDate"]); - taskItem.CreatorID = new UUID((String)row["creatorID"]); + taskItem.CreatorIdentification = (String)row["creatorID"]; taskItem.OwnerID = new UUID((String)row["ownerID"]); taskItem.LastOwnerID = new UUID((String)row["lastOwnerID"]); taskItem.GroupID = new UUID((String)row["groupID"]); @@ -1439,7 +1464,6 @@ namespace OpenSim.Data.SQLite UUID.TryParse((string)row["AuthbuyerID"], out authBuyerID); newData.OtherCleanTime = Convert.ToInt32(row["OtherCleanTime"]); - newData.Dwell = Convert.ToInt32(row["Dwell"]); return newData; } @@ -1562,7 +1586,7 @@ namespace OpenSim.Data.SQLite row["TouchName"] = prim.TouchName; // permissions row["ObjectFlags"] = prim.ObjectFlags; - row["CreatorID"] = prim.CreatorID.ToString(); + row["CreatorID"] = prim.CreatorIdentification.ToString(); row["OwnerID"] = prim.OwnerID.ToString(); row["GroupID"] = prim.GroupID.ToString(); row["LastOwnerID"] = prim.LastOwnerID.ToString(); @@ -1614,7 +1638,6 @@ namespace OpenSim.Data.SQLite row["PayButton3"] = prim.PayPrice[3]; row["PayButton4"] = prim.PayPrice[4]; - row["TextureAnimation"] = Convert.ToBase64String(prim.TextureAnimation); row["ParticleSystem"] = Convert.ToBase64String(prim.ParticleSystem); @@ -1675,6 +1698,7 @@ namespace OpenSim.Data.SQLite else row["VolumeDetect"] = 0; + row["MediaURL"] = prim.MediaUrl; } /// @@ -1695,7 +1719,7 @@ namespace OpenSim.Data.SQLite row["name"] = taskItem.Name; row["description"] = taskItem.Description; row["creationDate"] = taskItem.CreationDate; - row["creatorID"] = taskItem.CreatorID.ToString(); + row["creatorID"] = taskItem.CreatorIdentification.ToString(); row["ownerID"] = taskItem.OwnerID.ToString(); row["lastOwnerID"] = taskItem.LastOwnerID.ToString(); row["groupID"] = taskItem.GroupID.ToString(); @@ -1751,7 +1775,12 @@ namespace OpenSim.Data.SQLite row["UserLookAtZ"] = land.UserLookAt.Z; row["AuthbuyerID"] = land.AuthBuyerID.ToString(); row["OtherCleanTime"] = land.OtherCleanTime; - row["Dwell"] = land.Dwell; + row["MediaType"] = land.MediaType; + row["MediaDescription"] = land.MediaDescription; + row["MediaSize"] = land.MediaWidth.ToString() + "," + land.MediaHeight.ToString(); + row["MediaLoop"] = land.MediaLoop.ToString(); + row["ObscureMusic"] = land.ObscureMusic.ToString(); + row["ObscureMedia"] = land.ObscureMedia.ToString(); } /// @@ -1849,6 +1878,10 @@ namespace OpenSim.Data.SQLite s.TextureEntry = textureEntry; s.ExtraParams = (byte[]) row["ExtraParams"]; + + if (!(row["Media"] is System.DBNull)) + s.Media = PrimitiveBaseShape.MediaList.FromXml((string)row["Media"]); + return s; } @@ -1892,17 +1925,19 @@ namespace OpenSim.Data.SQLite row["Texture"] = s.TextureEntry; row["ExtraParams"] = s.ExtraParams; + + if (s.Media != null) + row["Media"] = s.Media.ToXml(); } /// - /// + /// Persistently store a prim. /// /// /// /// private void addPrim(SceneObjectPart prim, UUID sceneGroupID, UUID regionUUID) { - DataTable prims = ds.Tables["prims"]; DataTable shapes = ds.Tables["primshapes"]; @@ -1932,7 +1967,6 @@ namespace OpenSim.Data.SQLite } /// - /// see IRegionDatastore /// /// /// @@ -2229,7 +2263,6 @@ namespace OpenSim.Data.SQLite delete.Parameters.Add(createSqliteParameter("AccessUUID", typeof(String))); da.DeleteCommand = delete; da.DeleteCommand.Connection = conn; - } private void setupRegionSettingsCommands(SqliteDataAdapter da, SqliteConnection conn) @@ -2301,7 +2334,7 @@ namespace OpenSim.Data.SQLite return DbType.String; } } - + static void PrintDataSet(DataSet ds) { // Print out any name and extended properties. diff --git a/OpenSim/Data/SQLite/SQLiteUserAccountData.cs b/OpenSim/Data/SQLite/SQLiteUserAccountData.cs index 893f105604..7a5de5073d 100644 --- a/OpenSim/Data/SQLite/SQLiteUserAccountData.cs +++ b/OpenSim/Data/SQLite/SQLiteUserAccountData.cs @@ -31,7 +31,11 @@ using System.Collections.Generic; using System.Data; using OpenMetaverse; using OpenSim.Framework; -using Mono.Data.Sqlite; +#if CSharpSqlite + using Community.CsharpSqlite.Sqlite; +#else + using Mono.Data.Sqlite; +#endif namespace OpenSim.Data.SQLite { @@ -66,7 +70,7 @@ namespace OpenSim.Data.SQLite if (words.Length == 1) { - cmd.CommandText = String.Format("select * from {0} where ScopeID='{1}' or ScopeID='00000000-0000-0000-0000-000000000000') and (FirstName like '{2}%' or LastName like '{2}%')", + cmd.CommandText = String.Format("select * from {0} where (ScopeID='{1}' or ScopeID='00000000-0000-0000-0000-000000000000') and (FirstName like '{2}%' or LastName like '{2}%')", m_Realm, scopeID.ToString(), words[0]); } else diff --git a/OpenSim/Data/SQLite/SQLiteUtils.cs b/OpenSim/Data/SQLite/SQLiteUtils.cs index 07c6b69a3b..ca5861fefd 100644 --- a/OpenSim/Data/SQLite/SQLiteUtils.cs +++ b/OpenSim/Data/SQLite/SQLiteUtils.cs @@ -27,7 +27,11 @@ using System; using System.Data; -using Mono.Data.Sqlite; +#if CSharpSqlite + using Community.CsharpSqlite.Sqlite; +#else + using Mono.Data.Sqlite; +#endif namespace OpenSim.Data.SQLite { diff --git a/OpenSim/Data/SQLite/SQLiteXInventoryData.cs b/OpenSim/Data/SQLite/SQLiteXInventoryData.cs index ca651e1998..ccbd86e119 100644 --- a/OpenSim/Data/SQLite/SQLiteXInventoryData.cs +++ b/OpenSim/Data/SQLite/SQLiteXInventoryData.cs @@ -29,7 +29,11 @@ using System; using System.Data; using System.Reflection; using System.Collections.Generic; -using Mono.Data.Sqlite; +#if CSharpSqlite + using Community.CsharpSqlite.Sqlite; +#else + using Mono.Data.Sqlite; +#endif using log4net; using OpenMetaverse; using OpenSim.Framework; diff --git a/OpenSim/Data/SQLiteLegacy/SQLiteEstateData.cs b/OpenSim/Data/SQLiteLegacy/SQLiteEstateData.cs index bf8ee147b5..547ea6b07d 100644 --- a/OpenSim/Data/SQLiteLegacy/SQLiteEstateData.cs +++ b/OpenSim/Data/SQLiteLegacy/SQLiteEstateData.cs @@ -49,6 +49,15 @@ namespace OpenSim.Data.SQLiteLegacy private Dictionary m_FieldMap = new Dictionary(); + public SQLiteEstateStore() + { + } + + public SQLiteEstateStore(string connectionString) + { + Initialise(connectionString); + } + public void Initialise(string connectionString) { m_connectionString = connectionString; diff --git a/OpenSim/Data/SQLiteLegacy/SQLiteInventoryStore.cs b/OpenSim/Data/SQLiteLegacy/SQLiteInventoryStore.cs index 726703b79d..8ca48f94b1 100644 --- a/OpenSim/Data/SQLiteLegacy/SQLiteInventoryStore.cs +++ b/OpenSim/Data/SQLiteLegacy/SQLiteInventoryStore.cs @@ -150,7 +150,7 @@ namespace OpenSim.Data.SQLiteLegacy item.InvType = Convert.ToInt32(row["invType"]); item.Folder = new UUID((string) row["parentFolderID"]); item.Owner = new UUID((string) row["avatarID"]); - item.CreatorId = (string)row["creatorsID"]; + item.CreatorIdentification = (string)row["creatorsID"]; item.Name = (string) row["inventoryName"]; item.Description = (string) row["inventoryDescription"]; @@ -195,7 +195,7 @@ namespace OpenSim.Data.SQLiteLegacy row["invType"] = item.InvType; row["parentFolderID"] = item.Folder.ToString(); row["avatarID"] = item.Owner.ToString(); - row["creatorsID"] = item.CreatorId.ToString(); + row["creatorsID"] = item.CreatorIdentification.ToString(); row["inventoryName"] = item.Name; row["inventoryDescription"] = item.Description; diff --git a/OpenSim/Data/SQLiteLegacy/SQLiteRegionData.cs b/OpenSim/Data/SQLiteLegacy/SQLiteSimulationData.cs similarity index 99% rename from OpenSim/Data/SQLiteLegacy/SQLiteRegionData.cs rename to OpenSim/Data/SQLiteLegacy/SQLiteSimulationData.cs index 8a8f2c6623..acb6b4beca 100644 --- a/OpenSim/Data/SQLiteLegacy/SQLiteRegionData.cs +++ b/OpenSim/Data/SQLiteLegacy/SQLiteSimulationData.cs @@ -43,7 +43,7 @@ namespace OpenSim.Data.SQLiteLegacy /// /// A RegionData Interface to the SQLite database /// - public class SQLiteRegionData : IRegionDataStore + public class SQLiteSimulationData : ISimulationDataStore { private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); @@ -69,6 +69,15 @@ namespace OpenSim.Data.SQLiteLegacy private String m_connectionString; + public SQLiteSimulationData() + { + } + + public SQLiteSimulationData(string connectionString) + { + Initialise(connectionString); + } + // Temporary attribute while this is experimental /*********************************************************************** @@ -78,7 +87,6 @@ namespace OpenSim.Data.SQLiteLegacy **********************************************************************/ /// - /// See IRegionDataStore /// /// Initialises RegionData Interface /// Loads and initialises a new SQLite connection and maintains it. @@ -278,6 +286,9 @@ namespace OpenSim.Data.SQLiteLegacy //Return default LL windlight settings return new RegionLightShareData(); } + public void RemoveRegionWindlightSettings(UUID regionID) + { + } public void StoreRegionWindlightSettings(RegionLightShareData wl) { //This connector doesn't support the windlight module yet @@ -327,7 +338,7 @@ namespace OpenSim.Data.SQLiteLegacy lock (ds) { - foreach (SceneObjectPart prim in obj.Children.Values) + foreach (SceneObjectPart prim in obj.Parts) { // m_log.Info("[REGION DB]: Adding obj: " + obj.UUID + " to region: " + regionUUID); addPrim(prim, obj.UUID, regionUUID); @@ -646,6 +657,7 @@ namespace OpenSim.Data.SQLiteLegacy DataRow landRow = land.Rows.Find(globalID.ToString()); if (landRow != null) { + landRow.Delete(); land.Rows.Remove(landRow); } List rowsToDelete = new List(); @@ -656,6 +668,7 @@ namespace OpenSim.Data.SQLiteLegacy } for (int iter = 0; iter < rowsToDelete.Count; iter++) { + rowsToDelete[iter].Delete(); landaccesslist.Rows.Remove(rowsToDelete[iter]); } @@ -706,6 +719,7 @@ namespace OpenSim.Data.SQLiteLegacy } for (int iter = 0; iter < rowsToDelete.Count; iter++) { + rowsToDelete[iter].Delete(); landaccesslist.Rows.Remove(rowsToDelete[iter]); } rowsToDelete.Clear(); @@ -1069,7 +1083,6 @@ namespace OpenSim.Data.SQLiteLegacy createCol(land, "UserLookAtZ", typeof (Double)); createCol(land, "AuthbuyerID", typeof(String)); createCol(land, "OtherCleanTime", typeof(Int32)); - createCol(land, "Dwell", typeof(Int32)); land.PrimaryKey = new DataColumn[] {land.Columns["UUID"]}; @@ -1187,8 +1200,8 @@ namespace OpenSim.Data.SQLiteLegacy prim.SitName = (String) row["SitName"]; prim.TouchName = (String) row["TouchName"]; // permissions - prim.ObjectFlags = Convert.ToUInt32(row["ObjectFlags"]); - prim.CreatorID = new UUID((String) row["CreatorID"]); + prim.Flags = (PrimFlags)Convert.ToUInt32(row["ObjectFlags"]); + prim.CreatorIdentification = (String) row["CreatorID"]; prim.OwnerID = new UUID((String) row["OwnerID"]); prim.GroupID = new UUID((String) row["GroupID"]); prim.LastOwnerID = new UUID((String) row["LastOwnerID"]); @@ -1324,7 +1337,7 @@ namespace OpenSim.Data.SQLiteLegacy taskItem.Name = (String)row["name"]; taskItem.Description = (String)row["description"]; taskItem.CreationDate = Convert.ToUInt32(row["creationDate"]); - taskItem.CreatorID = new UUID((String)row["creatorID"]); + taskItem.CreatorIdentification = (String)row["creatorID"]; taskItem.OwnerID = new UUID((String)row["ownerID"]); taskItem.LastOwnerID = new UUID((String)row["lastOwnerID"]); taskItem.GroupID = new UUID((String)row["groupID"]); @@ -1400,7 +1413,6 @@ namespace OpenSim.Data.SQLiteLegacy UUID.TryParse((string)row["AuthbuyerID"], out authBuyerID); newData.OtherCleanTime = Convert.ToInt32(row["OtherCleanTime"]); - newData.Dwell = Convert.ToInt32(row["Dwell"]); return newData; } @@ -1521,8 +1533,8 @@ namespace OpenSim.Data.SQLiteLegacy row["SitName"] = prim.SitName; row["TouchName"] = prim.TouchName; // permissions - row["ObjectFlags"] = prim.ObjectFlags; - row["CreatorID"] = prim.CreatorID.ToString(); + row["ObjectFlags"] = (uint)prim.Flags; + row["CreatorID"] = prim.CreatorIdentification.ToString(); row["OwnerID"] = prim.OwnerID.ToString(); row["GroupID"] = prim.GroupID.ToString(); row["LastOwnerID"] = prim.LastOwnerID.ToString(); @@ -1655,7 +1667,7 @@ namespace OpenSim.Data.SQLiteLegacy row["name"] = taskItem.Name; row["description"] = taskItem.Description; row["creationDate"] = taskItem.CreationDate; - row["creatorID"] = taskItem.CreatorID.ToString(); + row["creatorID"] = taskItem.CreatorIdentification.ToString(); row["ownerID"] = taskItem.OwnerID.ToString(); row["lastOwnerID"] = taskItem.LastOwnerID.ToString(); row["groupID"] = taskItem.GroupID.ToString(); @@ -1711,7 +1723,6 @@ namespace OpenSim.Data.SQLiteLegacy row["UserLookAtZ"] = land.UserLookAt.Z; row["AuthbuyerID"] = land.AuthBuyerID.ToString(); row["OtherCleanTime"] = land.OtherCleanTime; - row["Dwell"] = land.Dwell; } /// @@ -1891,7 +1902,6 @@ namespace OpenSim.Data.SQLiteLegacy } /// - /// see IRegionDatastore /// /// /// diff --git a/OpenSim/Data/Tests/BasicDataServiceTest.cs b/OpenSim/Data/Tests/BasicDataServiceTest.cs index c261126722..7d85f0c8eb 100644 --- a/OpenSim/Data/Tests/BasicDataServiceTest.cs +++ b/OpenSim/Data/Tests/BasicDataServiceTest.cs @@ -1,4 +1,31 @@ -using System; +/* + * Copyright (c) Contributors, http://opensimulator.org/ + * See CONTRIBUTORS.TXT for a full list of copyright holders. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * * Neither the name of the OpenSimulator Project nor the + * names of its contributors may be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE DEVELOPERS ``AS IS'' AND ANY + * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED + * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + * DISCLAIMED. IN NO EVENT SHALL THE CONTRIBUTORS BE LIABLE FOR ANY + * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES + * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND + * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS + * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +using System; using System.IO; using System.Collections.Generic; using log4net.Config; @@ -41,13 +68,13 @@ namespace OpenSim.Data.Tests { m_connStr = !String.IsNullOrEmpty(conn) ? conn : DefaultTestConns.Get(typeof(TConn)); - m_log = LogManager.GetLogger(this.GetType()); + m_log = LogManager.GetLogger(this.GetType()); OpenSim.Tests.Common.TestLogging.LogToConsole(); // TODO: Is that right? } /// /// To be overridden in derived classes. Do whatever init with the m_service, like setting the conn string to it. - /// You'd probably want to to cast the 'service' to a more specific type and store it in a member var. + /// You'd probably want to to cast the 'service' to a more specific type and store it in a member var. /// This framework takes care of disposing it, if it's disposable. /// /// The service being tested @@ -118,12 +145,12 @@ namespace OpenSim.Data.Tests { if (m_service != null) { - if( m_service is IDisposable) + if (m_service is IDisposable) ((IDisposable)m_service).Dispose(); m_service = null; } - if( !String.IsNullOrEmpty(m_file) && File.Exists(m_file) ) + if (!String.IsNullOrEmpty(m_file) && File.Exists(m_file)) File.Delete(m_file); } @@ -204,7 +231,7 @@ namespace OpenSim.Data.Tests lst += ", " + s; } - string sCond = stores.Length > 1 ? ("in (" + lst + ")") : ("=" + lst); + string sCond = stores.Length > 1 ? ("in (" + lst + ")") : ("=" + lst); try { ExecuteSql("DELETE FROM migrations where name " + sCond); diff --git a/OpenSim/Data/Tests/DefaultTestConns.cs b/OpenSim/Data/Tests/DefaultTestConns.cs index 7b52af575a..7c47bddd21 100644 --- a/OpenSim/Data/Tests/DefaultTestConns.cs +++ b/OpenSim/Data/Tests/DefaultTestConns.cs @@ -1,4 +1,31 @@ -using System; +/* + * Copyright (c) Contributors, http://opensimulator.org/ + * See CONTRIBUTORS.TXT for a full list of copyright holders. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * * Neither the name of the OpenSimulator Project nor the + * names of its contributors may be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE DEVELOPERS ``AS IS'' AND ANY + * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED + * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + * DISCLAIMED. IN NO EVENT SHALL THE CONTRIBUTORS BE LIABLE FOR ANY + * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES + * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND + * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS + * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +using System; using System.Collections.Generic; using System.Linq; using System.Text; diff --git a/OpenSim/Data/Tests/EstateTests.cs b/OpenSim/Data/Tests/EstateTests.cs index d6eed3dadd..fbf8ba658e 100644 --- a/OpenSim/Data/Tests/EstateTests.cs +++ b/OpenSim/Data/Tests/EstateTests.cs @@ -37,11 +37,6 @@ using log4net; using System.Reflection; using System.Data.Common; -#if !NUNIT25 -using NUnit.Framework.SyntaxHelpers; -#endif - - // DBMS-specific: using MySql.Data.MySqlClient; using OpenSim.Data.MySQL; @@ -52,7 +47,6 @@ using OpenSim.Data.MSSQL; using Mono.Data.Sqlite; using OpenSim.Data.SQLite; - namespace OpenSim.Data.Tests { diff --git a/OpenSim/Data/Tests/InventoryTests.cs b/OpenSim/Data/Tests/InventoryTests.cs index c22e26c3c9..dc0325911d 100644 --- a/OpenSim/Data/Tests/InventoryTests.cs +++ b/OpenSim/Data/Tests/InventoryTests.cs @@ -37,10 +37,6 @@ using log4net; using System.Reflection; using System.Data.Common; -#if !NUNIT25 -using NUnit.Framework.SyntaxHelpers; -#endif - // DBMS-specific: using MySql.Data.MySqlClient; using OpenSim.Data.MySQL; @@ -327,7 +323,8 @@ namespace OpenSim.Data.Tests .IgnoreProperty(x => x.InvType) .IgnoreProperty(x => x.CreatorIdAsUuid) .IgnoreProperty(x => x.Description) - .IgnoreProperty(x => x.CreatorId)); + .IgnoreProperty(x => x.CreatorId) + .IgnoreProperty(x => x.CreatorData)); inventoryScrambler.Scramble(expected); db.updateInventoryItem(expected); @@ -337,7 +334,8 @@ namespace OpenSim.Data.Tests .IgnoreProperty(x => x.InvType) .IgnoreProperty(x => x.CreatorIdAsUuid) .IgnoreProperty(x => x.Description) - .IgnoreProperty(x => x.CreatorId)); + .IgnoreProperty(x => x.CreatorId) + .IgnoreProperty(x => x.CreatorData)); } [Test] diff --git a/OpenSim/Data/Tests/RegionTests.cs b/OpenSim/Data/Tests/RegionTests.cs index eeffddaa1b..23d498d6fa 100644 --- a/OpenSim/Data/Tests/RegionTests.cs +++ b/OpenSim/Data/Tests/RegionTests.cs @@ -40,10 +40,6 @@ using log4net; using System.Reflection; using System.Data.Common; -#if !NUNIT25 -using NUnit.Framework.SyntaxHelpers; -#endif - // DBMS-specific: using MySql.Data.MySqlClient; using OpenSim.Data.MySQL; @@ -65,17 +61,17 @@ namespace OpenSim.Data.Tests #else [TestFixture(Description = "Region store tests (SQLite)")] - public class SQLiteRegionTests : RegionTests + public class SQLiteRegionTests : RegionTests { } [TestFixture(Description = "Region store tests (MySQL)")] - public class MySqlRegionTests : RegionTests + public class MySqlRegionTests : RegionTests { } [TestFixture(Description = "Region store tests (MS SQL Server)")] - public class MSSQLRegionTests : RegionTests + public class MSSQLRegionTests : RegionTests { } @@ -83,11 +79,11 @@ namespace OpenSim.Data.Tests public class RegionTests : BasicDataServiceTest where TConn : DbConnection, new() - where TRegStore : class, IRegionDataStore, new() + where TRegStore : class, ISimulationDataStore, new() { bool m_rebuildDB; - public IRegionDataStore db; + public ISimulationDataStore db; public UUID zero = UUID.Zero; public UUID region1 = UUID.Random(); public UUID region2 = UUID.Random(); @@ -126,7 +122,7 @@ namespace OpenSim.Data.Tests protected override void InitService(object service) { ClearDB(); - db = (IRegionDataStore)service; + db = (ISimulationDataStore)service; db.Initialise(m_connStr); } @@ -236,15 +232,15 @@ namespace OpenSim.Data.Tests sog.AddPart(p2); sog.AddPart(p3); - SceneObjectPart[] parts = sog.GetParts(); + SceneObjectPart[] parts = sog.Parts; Assert.That(parts.Length,Is.EqualTo(4), "Assert.That(parts.Length,Is.EqualTo(4))"); db.StoreObject(sog, newregion); List sogs = db.LoadObjects(newregion); Assert.That(sogs.Count,Is.EqualTo(1), "Assert.That(sogs.Count,Is.EqualTo(1))"); SceneObjectGroup newsog = sogs[0]; - - SceneObjectPart[] newparts = newsog.GetParts(); + + SceneObjectPart[] newparts = newsog.Parts; Assert.That(newparts.Length,Is.EqualTo(4), "Assert.That(newparts.Length,Is.EqualTo(4))"); Assert.That(newsog.HasChildPrim(tmp0), "Assert.That(newsog.HasChildPrim(tmp0))"); @@ -317,7 +313,7 @@ namespace OpenSim.Data.Tests sop.CreatorID = creator; sop.InventorySerial = iserial; sop.TaskInventory = dic; - sop.ObjectFlags = objf; + sop.Flags = (PrimFlags)objf; sop.Name = name; sop.Material = material; sop.ScriptAccessPin = pin; @@ -350,7 +346,7 @@ namespace OpenSim.Data.Tests // Modified in-class // Assert.That(iserial,Is.EqualTo(sop.InventorySerial), "Assert.That(iserial,Is.EqualTo(sop.InventorySerial))"); Assert.That(dic,Is.EqualTo(sop.TaskInventory), "Assert.That(dic,Is.EqualTo(sop.TaskInventory))"); - Assert.That(objf,Is.EqualTo(sop.ObjectFlags), "Assert.That(objf,Is.EqualTo(sop.ObjectFlags))"); + Assert.That(objf, Is.EqualTo((uint)sop.Flags), "Assert.That(objf,Is.EqualTo(sop.Flags))"); Assert.That(name,Is.EqualTo(sop.Name), "Assert.That(name,Is.EqualTo(sop.Name))"); Assert.That(material,Is.EqualTo(sop.Material), "Assert.That(material,Is.EqualTo(sop.Material))"); Assert.That(pin,Is.EqualTo(sop.ScriptAccessPin), "Assert.That(pin,Is.EqualTo(sop.ScriptAccessPin))"); @@ -373,7 +369,7 @@ namespace OpenSim.Data.Tests Assert.That(updatef,Is.EqualTo(sop.UpdateFlag), "Assert.That(updatef,Is.EqualTo(sop.UpdateFlag))"); // This is necessary or object will not be inserted in DB - sop.ObjectFlags = 0; + sop.Flags = PrimFlags.None; SceneObjectGroup sog = new SceneObjectGroup(sop); @@ -398,7 +394,7 @@ namespace OpenSim.Data.Tests Assert.That(creator,Is.EqualTo(p.CreatorID), "Assert.That(creator,Is.EqualTo(p.CreatorID))"); //Assert.That(iserial,Is.EqualTo(p.InventorySerial), "Assert.That(iserial,Is.EqualTo(p.InventorySerial))"); Assert.That(dic,Is.EqualTo(p.TaskInventory), "Assert.That(dic,Is.EqualTo(p.TaskInventory))"); - //Assert.That(objf,Is.EqualTo(p.ObjectFlags), "Assert.That(objf,Is.EqualTo(p.ObjectFlags))"); + //Assert.That(objf, Is.EqualTo((uint)p.Flags), "Assert.That(objf,Is.EqualTo(p.Flags))"); Assert.That(name,Is.EqualTo(p.Name), "Assert.That(name,Is.EqualTo(p.Name))"); Assert.That(material,Is.EqualTo(p.Material), "Assert.That(material,Is.EqualTo(p.Material))"); Assert.That(pin,Is.EqualTo(p.ScriptAccessPin), "Assert.That(pin,Is.EqualTo(p.ScriptAccessPin))"); @@ -564,7 +560,7 @@ namespace OpenSim.Data.Tests } SceneObjectGroup retsog = FindSOG("Test SOG", region4); - SceneObjectPart[] parts = retsog.GetParts(); + SceneObjectPart[] parts = retsog.Parts; for (int i=0;i<30;i++) { SceneObjectPart cursop = mydic[parts[i].UUID]; @@ -611,7 +607,7 @@ namespace OpenSim.Data.Tests sog.AddPart(p2); sog.AddPart(p3); - SceneObjectPart[] parts = sog.GetParts(); + SceneObjectPart[] parts = sog.Parts; Assert.That(parts.Length, Is.EqualTo(4), "Assert.That(parts.Length,Is.EqualTo(4))"); db.StoreObject(sog, newregion); @@ -619,7 +615,7 @@ namespace OpenSim.Data.Tests Assert.That(sogs.Count, Is.EqualTo(1), "Assert.That(sogs.Count,Is.EqualTo(1))"); SceneObjectGroup newsog = sogs[0]; - SceneObjectPart[] newparts = newsog.GetParts(); + SceneObjectPart[] newparts = newsog.Parts; Assert.That(newparts.Length, Is.EqualTo(4), "Assert.That(newparts.Length,Is.EqualTo(4))"); Assert.That(newsog, Constraints.PropertyCompareConstraint(sog) @@ -629,7 +625,7 @@ namespace OpenSim.Data.Tests .IgnoreProperty(x=>x.RegionHandle) .IgnoreProperty(x=>x.RegionUUID) .IgnoreProperty(x=>x.Scene) - .IgnoreProperty(x=>x.Children) + .IgnoreProperty(x=>x.Parts) .IgnoreProperty(x=>x.PassCollision) .IgnoreProperty(x=>x.RootPart)); } diff --git a/OpenSim/Framework/ACL.cs b/OpenSim/Framework/ACL.cs deleted file mode 100644 index f76e8b7288..0000000000 --- a/OpenSim/Framework/ACL.cs +++ /dev/null @@ -1,252 +0,0 @@ -/* - * Copyright (c) Contributors, http://opensimulator.org/ - * See CONTRIBUTORS.TXT for a full list of copyright holders. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * * Neither the name of the OpenSimulator Project nor the - * names of its contributors may be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE DEVELOPERS ``AS IS'' AND ANY - * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED - * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL THE CONTRIBUTORS BE LIABLE FOR ANY - * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES - * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; - * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ - -using System; -using System.Collections.Generic; - -namespace OpenSim.Framework -{ - // ACL Class - // Modelled after the structure of the Zend ACL Framework Library - // with one key difference - the tree will search for all matching - // permissions rather than just the first. Deny permissions will - // override all others. - - #region ACL Core Class - - /// - /// Access Control List Engine - /// - public class ACL - { - private Dictionary Resources = new Dictionary(); - private Dictionary Roles = new Dictionary(); - - /// - /// Adds a new role - /// - /// - /// - public ACL AddRole(Role role) - { - if (Roles.ContainsKey(role.Name)) - throw new AlreadyContainsRoleException(role); - - Roles.Add(role.Name, role); - - return this; - } - - /// - /// Adds a new resource - /// - /// - /// - public ACL AddResource(Resource resource) - { - Resources.Add(resource.Name, resource); - - return this; - } - - /// - /// Permision for user/roll on a resource - /// - /// - /// - /// - public Permission HasPermission(string role, string resource) - { - if (!Roles.ContainsKey(role)) - throw new KeyNotFoundException(); - - if (!Resources.ContainsKey(resource)) - throw new KeyNotFoundException(); - - return Roles[role].RequestPermission(resource); - } - - public ACL GrantPermission(string role, string resource) - { - if (!Roles.ContainsKey(role)) - throw new KeyNotFoundException(); - - if (!Resources.ContainsKey(resource)) - throw new KeyNotFoundException(); - - Roles[role].GivePermission(resource, Permission.Allow); - - return this; - } - - public ACL DenyPermission(string role, string resource) - { - if (!Roles.ContainsKey(role)) - throw new KeyNotFoundException(); - - if (!Resources.ContainsKey(resource)) - throw new KeyNotFoundException(); - - Roles[role].GivePermission(resource, Permission.Deny); - - return this; - } - - public ACL ResetPermission(string role, string resource) - { - if (!Roles.ContainsKey(role)) - throw new KeyNotFoundException(); - - if (!Resources.ContainsKey(resource)) - throw new KeyNotFoundException(); - - Roles[role].GivePermission(resource, Permission.None); - - return this; - } - } - - #endregion - - #region Exceptions - - /// - /// Thrown when an ACL attempts to add a duplicate role. - /// - public class AlreadyContainsRoleException : Exception - { - protected Role m_role; - - public AlreadyContainsRoleException(Role role) - { - m_role = role; - } - - public Role ErrorRole - { - get { return m_role; } - } - - public override string ToString() - { - return "This ACL already contains a role called '" + m_role.Name + "'."; - } - } - - #endregion - - #region Roles and Resources - - /// - /// Does this Role have permission to access a specified Resource? - /// - public enum Permission - { - Deny, - None, - Allow - } ; - - /// - /// A role class, for use with Users or Groups - /// - public class Role - { - private string m_name; - private Role[] m_parents; - private Dictionary m_resources = new Dictionary(); - - public Role(string name) - { - m_name = name; - m_parents = null; - } - - public Role(string name, Role[] parents) - { - m_name = name; - m_parents = parents; - } - - public string Name - { - get { return m_name; } - } - - public Permission RequestPermission(string resource) - { - return RequestPermission(resource, Permission.None); - } - - public Permission RequestPermission(string resource, Permission current) - { - // Deny permissions always override any others - if (current == Permission.Deny) - return current; - - Permission temp = Permission.None; - - // Pickup non-None permissions - if (m_resources.ContainsKey(resource) && m_resources[resource] != Permission.None) - temp = m_resources[resource]; - - if (m_parents != null) - { - foreach (Role parent in m_parents) - { - temp = parent.RequestPermission(resource, temp); - } - } - - return temp; - } - - public void GivePermission(string resource, Permission perm) - { - m_resources[resource] = perm; - } - } - - public class Resource - { - private string m_name; - - public Resource(string name) - { - m_name = name; - } - - public string Name - { - get { return m_name; } - } - } - - #endregion - - -} \ No newline at end of file diff --git a/OpenSim/Framework/AgentCircuitData.cs b/OpenSim/Framework/AgentCircuitData.cs index 783a8337a5..cc9fcea2e7 100644 --- a/OpenSim/Framework/AgentCircuitData.cs +++ b/OpenSim/Framework/AgentCircuitData.cs @@ -26,7 +26,9 @@ */ using System; +using System.Reflection; using System.Collections.Generic; +using log4net; using OpenMetaverse; using OpenMetaverse.StructuredData; @@ -38,6 +40,12 @@ namespace OpenSim.Framework /// public class AgentCircuitData { +// DEBUG ON + private static readonly ILog m_log = + LogManager.GetLogger( + MethodBase.GetCurrentMethod().DeclaringType); +// DEBUG OFF + /// /// Avatar Unique Agent Identifier /// @@ -108,10 +116,30 @@ namespace OpenSim.Framework public string ServiceSessionID = string.Empty; /// - /// Viewer's version string + /// The client's IP address, as captured by the login service + /// + public string IPAddress; + + /// + /// Viewer's version string as reported by the viewer at login /// public string Viewer; + /// + /// The channel strinf sent by the viewer at login + /// + public string Channel; + + /// + /// The Mac address as reported by the viewer at login + /// + public string Mac; + + /// + /// The id0 as reported by the viewer at login + /// + public string Id0; + /// /// Position the Agent's Avatar starts in the region /// @@ -175,40 +203,21 @@ namespace OpenSim.Framework args["inventory_folder"] = OSD.FromUUID(InventoryFolder); args["secure_session_id"] = OSD.FromUUID(SecureSessionID); args["session_id"] = OSD.FromUUID(SessionID); - + args["service_session_id"] = OSD.FromString(ServiceSessionID); args["start_pos"] = OSD.FromString(startpos.ToString()); - args["appearance_serial"] = OSD.FromInteger(Appearance.Serial); + args["client_ip"] = OSD.FromString(IPAddress); args["viewer"] = OSD.FromString(Viewer); + args["channel"] = OSD.FromString(Channel); + args["mac"] = OSD.FromString(Mac); + args["id0"] = OSD.FromString(Id0); if (Appearance != null) { - //System.Console.WriteLine("XXX Before packing Wearables"); - if ((Appearance.Wearables != null) && (Appearance.Wearables.Length > 0)) - { - OSDArray wears = new OSDArray(Appearance.Wearables.Length * 2); - foreach (AvatarWearable awear in Appearance.Wearables) - { - wears.Add(OSD.FromUUID(awear.ItemID)); - wears.Add(OSD.FromUUID(awear.AssetID)); - //System.Console.WriteLine("XXX ItemID=" + awear.ItemID + " assetID=" + awear.AssetID); - } - args["wearables"] = wears; - } + args["appearance_serial"] = OSD.FromInteger(Appearance.Serial); - //System.Console.WriteLine("XXX Before packing Attachments"); - Dictionary attachments = Appearance.GetAttachmentDictionary(); - if ((attachments != null) && (attachments.Count > 0)) - { - OSDArray attachs = new OSDArray(attachments.Count); - foreach (KeyValuePair kvp in attachments) - { - AttachmentData adata = new AttachmentData(kvp.Key, kvp.Value[0], kvp.Value[1]); - attachs.Add(adata.PackUpdateMessage()); - //System.Console.WriteLine("XXX att.pt=" + kvp.Key + "; itemID=" + kvp.Value[0] + "; assetID=" + kvp.Value[1]); - } - args["attachments"] = attachs; - } + OSDMap appmap = Appearance.Pack(); + args["packed_appearance"] = appmap; } if (ServiceURLs != null && ServiceURLs.Count > 0) @@ -279,40 +288,49 @@ namespace OpenSim.Framework SessionID = args["session_id"].AsUUID(); if (args["service_session_id"] != null) ServiceSessionID = args["service_session_id"].AsString(); + if (args["client_ip"] != null) + IPAddress = args["client_ip"].AsString(); if (args["viewer"] != null) Viewer = args["viewer"].AsString(); + if (args["channel"] != null) + Channel = args["channel"].AsString(); + if (args["mac"] != null) + Mac = args["mac"].AsString(); + if (args["id0"] != null) + Id0 = args["id0"].AsString(); if (args["start_pos"] != null) Vector3.TryParse(args["start_pos"].AsString(), out startpos); +// DEBUG ON + m_log.WarnFormat("[AGENTCIRCUITDATA] agentid={0}, child={1}, startpos={2}",AgentID,child,startpos.ToString()); +// DEBUG OFF + + try { + // Unpack various appearance elements Appearance = new AvatarAppearance(AgentID); + + // Eventually this code should be deprecated, use full appearance + // packing in packed_appearance if (args["appearance_serial"] != null) Appearance.Serial = args["appearance_serial"].AsInteger(); - if ((args["wearables"] != null) && (args["wearables"]).Type == OSDType.Array) - { - OSDArray wears = (OSDArray)(args["wearables"]); - for (int i = 0; i < wears.Count / 2; i++) - { - Appearance.Wearables[i].ItemID = wears[i*2].AsUUID(); - Appearance.Wearables[i].AssetID = wears[(i*2)+1].AsUUID(); - } - } - if ((args["attachments"] != null) && (args["attachments"]).Type == OSDType.Array) + if (args.ContainsKey("packed_appearance") && (args["packed_appearance"].Type == OSDType.Map)) { - OSDArray attachs = (OSDArray)(args["attachments"]); - AttachmentData[] attachments = new AttachmentData[attachs.Count]; - int i = 0; - foreach (OSD o in attachs) - { - if (o.Type == OSDType.Map) - { - attachments[i++] = new AttachmentData((OSDMap)o); - } - } - Appearance.SetAttachments(attachments); + Appearance.Unpack((OSDMap)args["packed_appearance"]); +// DEBUG ON + m_log.WarnFormat("[AGENTCIRCUITDATA] unpacked appearance"); +// DEBUG OFF } - +// DEBUG ON + else + m_log.Warn("[AGENTCIRCUITDATA] failed to find a valid packed_appearance"); +// DEBUG OFF + } catch (Exception e) + { + m_log.ErrorFormat("[AGENTCIRCUITDATA] failed to unpack appearance; {0}",e.Message); + } + ServiceURLs = new Dictionary(); if (args.ContainsKey("service_urls") && args["service_urls"] != null && (args["service_urls"]).Type == OSDType.Array) { @@ -349,6 +367,9 @@ namespace OpenSim.Framework public float startposy; public float startposz; public string Viewer; + public string Channel; + public string Mac; + public string Id0; public sAgentCircuitData() { diff --git a/OpenSim/Framework/AvatarAppearance.cs b/OpenSim/Framework/AvatarAppearance.cs index 9b99a70669..2906af87d4 100644 --- a/OpenSim/Framework/AvatarAppearance.cs +++ b/OpenSim/Framework/AvatarAppearance.cs @@ -26,10 +26,11 @@ */ using System; +using System.Reflection; using System.Collections; using System.Collections.Generic; using OpenMetaverse; -using System.Reflection; +using OpenMetaverse.StructuredData; using log4net; namespace OpenSim.Framework @@ -39,48 +40,27 @@ namespace OpenSim.Framework /// public class AvatarAppearance { - //private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); - - // these are guessed at by the list here - - // http://wiki.secondlife.com/wiki/Avatar_Appearance. We'll - // correct them over time for when were are wrong. - public readonly static int BODY = 0; - public readonly static int SKIN = 1; - public readonly static int HAIR = 2; - public readonly static int EYES = 3; - public readonly static int SHIRT = 4; - public readonly static int PANTS = 5; - public readonly static int SHOES = 6; - public readonly static int SOCKS = 7; - public readonly static int JACKET = 8; - public readonly static int GLOVES = 9; - public readonly static int UNDERSHIRT = 10; - public readonly static int UNDERPANTS = 11; - public readonly static int SKIRT = 12; - - private readonly static int MAX_WEARABLES = 13; - - private static UUID BODY_ASSET = new UUID("66c41e39-38f9-f75a-024e-585989bfab73"); - private static UUID BODY_ITEM = new UUID("66c41e39-38f9-f75a-024e-585989bfaba9"); - private static UUID SKIN_ASSET = new UUID("77c41e39-38f9-f75a-024e-585989bbabbb"); - private static UUID SKIN_ITEM = new UUID("77c41e39-38f9-f75a-024e-585989bfabc9"); - private static UUID SHIRT_ASSET = new UUID("00000000-38f9-1111-024e-222222111110"); - private static UUID SHIRT_ITEM = new UUID("77c41e39-38f9-f75a-0000-585989bf0000"); - private static UUID PANTS_ASSET = new UUID("00000000-38f9-1111-024e-222222111120"); - private static UUID PANTS_ITEM = new UUID("77c41e39-38f9-f75a-0000-5859892f1111"); - private static UUID HAIR_ASSET = new UUID("d342e6c0-b9d2-11dc-95ff-0800200c9a66"); - private static UUID HAIR_ITEM = new UUID("d342e6c1-b9d2-11dc-95ff-0800200c9a66"); + private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); public readonly static int VISUALPARAM_COUNT = 218; + public readonly static int TEXTURE_COUNT = 21; + public readonly static byte[] BAKE_INDICES = new byte[] { 8, 9, 10, 11, 19, 20 }; + protected UUID m_owner; + protected int m_serial = 1; + protected byte[] m_visualparams; + protected Primitive.TextureEntry m_texture; + protected AvatarWearable[] m_wearables; + protected Dictionary> m_attachments; + protected float m_avatarHeight = 0; + protected float m_hipOffset = 0; public virtual UUID Owner { get { return m_owner; } set { m_owner = value; } } - protected int m_serial = 1; public virtual int Serial { @@ -88,194 +68,23 @@ namespace OpenSim.Framework set { m_serial = value; } } - protected byte[] m_visualparams; - public virtual byte[] VisualParams { get { return m_visualparams; } set { m_visualparams = value; } } - protected AvatarWearable[] m_wearables; - - public virtual AvatarWearable[] Wearables - { - get { return m_wearables; } - set { m_wearables = value; } - } - - public virtual UUID BodyItem { - get { return m_wearables[BODY].ItemID; } - set { m_wearables[BODY].ItemID = value; } - } - - public virtual UUID BodyAsset { - get { return m_wearables[BODY].AssetID; } - set { m_wearables[BODY].AssetID = value; } - } - - public virtual UUID SkinItem { - get { return m_wearables[SKIN].ItemID; } - set { m_wearables[SKIN].ItemID = value; } - } - - public virtual UUID SkinAsset { - get { return m_wearables[SKIN].AssetID; } - set { m_wearables[SKIN].AssetID = value; } - } - - public virtual UUID HairItem { - get { return m_wearables[HAIR].ItemID; } - set { m_wearables[HAIR].ItemID = value; } - } - - public virtual UUID HairAsset { - get { return m_wearables[HAIR].AssetID; } - set { m_wearables[HAIR].AssetID = value; } - } - - public virtual UUID EyesItem { - get { return m_wearables[EYES].ItemID; } - set { m_wearables[EYES].ItemID = value; } - } - - public virtual UUID EyesAsset { - get { return m_wearables[EYES].AssetID; } - set { m_wearables[EYES].AssetID = value; } - } - - public virtual UUID ShirtItem { - get { return m_wearables[SHIRT].ItemID; } - set { m_wearables[SHIRT].ItemID = value; } - } - - public virtual UUID ShirtAsset { - get { return m_wearables[SHIRT].AssetID; } - set { m_wearables[SHIRT].AssetID = value; } - } - - public virtual UUID PantsItem { - get { return m_wearables[PANTS].ItemID; } - set { m_wearables[PANTS].ItemID = value; } - } - - public virtual UUID PantsAsset { - get { return m_wearables[PANTS].AssetID; } - set { m_wearables[PANTS].AssetID = value; } - } - - public virtual UUID ShoesItem { - get { return m_wearables[SHOES].ItemID; } - set { m_wearables[SHOES].ItemID = value; } - } - - public virtual UUID ShoesAsset { - get { return m_wearables[SHOES].AssetID; } - set { m_wearables[SHOES].AssetID = value; } - } - - public virtual UUID SocksItem { - get { return m_wearables[SOCKS].ItemID; } - set { m_wearables[SOCKS].ItemID = value; } - } - - public virtual UUID SocksAsset { - get { return m_wearables[SOCKS].AssetID; } - set { m_wearables[SOCKS].AssetID = value; } - } - - public virtual UUID JacketItem { - get { return m_wearables[JACKET].ItemID; } - set { m_wearables[JACKET].ItemID = value; } - } - - public virtual UUID JacketAsset { - get { return m_wearables[JACKET].AssetID; } - set { m_wearables[JACKET].AssetID = value; } - } - - public virtual UUID GlovesItem { - get { return m_wearables[GLOVES].ItemID; } - set { m_wearables[GLOVES].ItemID = value; } - } - - public virtual UUID GlovesAsset { - get { return m_wearables[GLOVES].AssetID; } - set { m_wearables[GLOVES].AssetID = value; } - } - - public virtual UUID UnderShirtItem { - get { return m_wearables[UNDERSHIRT].ItemID; } - set { m_wearables[UNDERSHIRT].ItemID = value; } - } - - public virtual UUID UnderShirtAsset { - get { return m_wearables[UNDERSHIRT].AssetID; } - set { m_wearables[UNDERSHIRT].AssetID = value; } - } - - public virtual UUID UnderPantsItem { - get { return m_wearables[UNDERPANTS].ItemID; } - set { m_wearables[UNDERPANTS].ItemID = value; } - } - - public virtual UUID UnderPantsAsset { - get { return m_wearables[UNDERPANTS].AssetID; } - set { m_wearables[UNDERPANTS].AssetID = value; } - } - - public virtual UUID SkirtItem { - get { return m_wearables[SKIRT].ItemID; } - set { m_wearables[SKIRT].ItemID = value; } - } - - public virtual UUID SkirtAsset { - get { return m_wearables[SKIRT].AssetID; } - set { m_wearables[SKIRT].AssetID = value; } - } - - public virtual void SetDefaultWearables() - { - m_wearables[BODY].AssetID = BODY_ASSET; - m_wearables[BODY].ItemID = BODY_ITEM; - m_wearables[SKIN].AssetID = SKIN_ASSET; - m_wearables[SKIN].ItemID = SKIN_ITEM; - m_wearables[HAIR].AssetID = HAIR_ASSET; - m_wearables[HAIR].ItemID = HAIR_ITEM; - m_wearables[SHIRT].AssetID = SHIRT_ASSET; - m_wearables[SHIRT].ItemID = SHIRT_ITEM; - m_wearables[PANTS].AssetID = PANTS_ASSET; - m_wearables[PANTS].ItemID = PANTS_ITEM; - } - - public virtual void ClearWearables() - { - for (int i = 0; i < 13; i++) - { - m_wearables[i].AssetID = UUID.Zero; - m_wearables[i].ItemID = UUID.Zero; - } - } - - public virtual void SetDefaultParams(byte[] vparams) - { - // TODO: Figure out better values then 'fat scientist 150' or 'alien 0' - for (int i = 0; i < VISUALPARAM_COUNT; i++) - { - vparams[i] = 150; - } - } - - protected Primitive.TextureEntry m_texture; - public virtual Primitive.TextureEntry Texture { get { return m_texture; } set { m_texture = value; } } - protected float m_avatarHeight = 0; - protected float m_hipOffset = 0; + public virtual AvatarWearable[] Wearables + { + get { return m_wearables; } + set { m_wearables = value; } + } public virtual float AvatarHeight { @@ -288,110 +97,234 @@ namespace OpenSim.Framework get { return m_hipOffset; } } - //Builds the VisualParam Enum using LIBOMV's Visual Param NameValues - /* - public void BuildVisualParamEnum() - { - Dictionary IndexedParams = new Dictionary(); - int vpIndex = 0; - IndexedParams = new Dictionary(); - - System.Text.StringBuilder sb = new System.Text.StringBuilder(); - - sb.Append("public enum VPElement: int\n"); - sb.Append("{\n"); - foreach (KeyValuePair kvp in OpenMetaverse.VisualParams.Params) - { - VisualParam vp = kvp.Value; - - // Only Group-0 parameters are sent in AgentSetAppearance packets - if (kvp.Value.Group == 0) - { - - if (!IndexedParams.ContainsKey(vp.Name)) - { - - if (vp.Label.Length > 0 || vp.LabelMin.Length > 0 || vp.LabelMax.Length > 0) - { - - sb.Append("/// \n"); - if (vp.LabelMin.Length > 0 && vp.LabelMax.Length > 0) - sb.Append(string.Format("/// {0} - {1} 0--+255 {2}\n", vp.Label, vp.LabelMin, - vp.LabelMax)); - - else - sb.Append(string.Format("/// {0}\n", vp.Label)); - - sb.Append("/// \n"); - } - sb.Append(string.Format(" {0}_{1} = {2}", vp.Wearable.ToUpper(), vp.Name.ToUpper().Replace(" ", "_"),vpIndex)); - - IndexedParams.Add(vp.Name, vpIndex++); - } - else - { - sb.Append(string.Format(" {0}_{1}_{2} = {2}", vp.Wearable.ToUpper(), vp.Name.ToUpper().Replace(" ", "_"), vpIndex)); - vpIndex++; - //int i = 0; - } - } - if (vpIndex < 217) - sb.Append(",\n"); - else - sb.Append("\n"); - - } - sb.Append("}\n"); - - } - */ - public AvatarAppearance() : this(UUID.Zero) {} public AvatarAppearance(UUID owner) { - m_wearables = new AvatarWearable[MAX_WEARABLES]; - for (int i = 0; i < MAX_WEARABLES; i++) - { - // this makes them all null - m_wearables[i] = new AvatarWearable(); - } - m_serial = 0; - m_owner = owner; - //BuildVisualParamEnum() - m_visualparams = new byte[VISUALPARAM_COUNT]; - // This sets Visual Params with *less* weirder values then default. Instead of a ugly alien, it looks like a fat scientist - SetDefaultParams(m_visualparams); - SetDefaultWearables(); - // m_texture = null;//GetDefaultTexture(); - m_texture = GetDefaultTexture(); - } - - public AvatarAppearance(UUID avatarID, AvatarWearable[] wearables, byte[] visualParams) - { - m_owner = avatarID; +// m_log.WarnFormat("[AVATAR APPEARANCE]: create empty appearance for {0}",owner); + m_serial = 1; - m_wearables = wearables; - m_visualparams = visualParams; - // m_texture = null;// GetDefaultTexture(); - m_texture = GetDefaultTexture(); + m_owner = owner; + + SetDefaultWearables(); + SetDefaultTexture(); + SetDefaultParams(); + SetHeight(); + + m_attachments = new Dictionary>(); } - private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); - - /// - /// Set up appearance textures and avatar parameters, including a height calculation - /// - public virtual void SetAppearance(Primitive.TextureEntry textureEntry, byte[] visualParams) + public AvatarAppearance(UUID avatarID, OSDMap map) { - //m_log.WarnFormat("[APPEARANCE] SetAppearance called ({0})", textureEntry == null ? " " : "te"); +// m_log.WarnFormat("[AVATAR APPEARANCE]: create appearance for {0} from OSDMap",avatarID); + + m_owner = avatarID; + Unpack(map); + SetHeight(); + } + + public AvatarAppearance(UUID avatarID, AvatarWearable[] wearables, Primitive.TextureEntry textureEntry, byte[] visualParams) + { +// m_log.WarnFormat("[AVATAR APPEARANCE] create initialized appearance for {0}",avatarID); + + m_serial = 1; + m_owner = avatarID; + + if (wearables != null) + m_wearables = wearables; + else + SetDefaultWearables(); + if (textureEntry != null) m_texture = textureEntry; + else + SetDefaultTexture(); + if (visualParams != null) m_visualparams = visualParams; - if (m_visualparams == null) - return; + else + SetDefaultParams(); + SetHeight(); + + m_attachments = new Dictionary>(); + } + + public AvatarAppearance(AvatarAppearance appearance) : this(appearance, true) + { + } + + public AvatarAppearance(AvatarAppearance appearance, bool copyWearables) + { +// m_log.WarnFormat("[AVATAR APPEARANCE] create from an existing appearance"); + + if (appearance == null) + { + m_serial = 1; + m_owner = UUID.Zero; + + SetDefaultWearables(); + SetDefaultTexture(); + SetDefaultParams(); + SetHeight(); + + m_attachments = new Dictionary>(); + + return; + } + + m_serial = appearance.Serial; + m_owner = appearance.Owner; + + m_wearables = new AvatarWearable[AvatarWearable.MAX_WEARABLES]; + for (int i = 0; i < AvatarWearable.MAX_WEARABLES; i++) + m_wearables[i] = new AvatarWearable(); + if (copyWearables && (appearance.Wearables != null)) + { + for (int i = 0; i < AvatarWearable.MAX_WEARABLES; i++) + SetWearable(i,appearance.Wearables[i]); + } + + m_texture = null; + if (appearance.Texture != null) + { + byte[] tbytes = appearance.Texture.GetBytes(); + m_texture = new Primitive.TextureEntry(tbytes,0,tbytes.Length); + } + + m_visualparams = null; + if (appearance.VisualParams != null) + m_visualparams = (byte[])appearance.VisualParams.Clone(); + + // Copy the attachment, force append mode since that ensures consistency + m_attachments = new Dictionary>(); + foreach (AvatarAttachment attachment in appearance.GetAttachments()) + AppendAttachment(new AvatarAttachment(attachment)); + } + + public void GetAssetsFrom(AvatarAppearance app) + { + for (int i = 0; i < AvatarWearable.MAX_WEARABLES; i++) + { + for (int j = 0; j < m_wearables[i].Count; j++) + { + UUID itemID = m_wearables[i][j].ItemID; + UUID assetID = app.Wearables[i].GetAsset(itemID); + + if (assetID != UUID.Zero) + m_wearables[i].Add(itemID, assetID); + } + } + } + + public void ClearWearables() + { + m_wearables = new AvatarWearable[AvatarWearable.MAX_WEARABLES]; + for (int i = 0; i < AvatarWearable.MAX_WEARABLES; i++) + m_wearables[i] = new AvatarWearable(); + } + + protected virtual void SetDefaultWearables() + { + m_wearables = AvatarWearable.DefaultWearables; + } + + protected virtual void SetDefaultParams() + { + m_visualparams = new byte[] { 33,61,85,23,58,127,63,85,63,42,0,85,63,36,85,95,153,63,34,0,63,109,88,132,63,136,81,85,103,136,127,0,150,150,150,127,0,0,0,0,0,127,0,0,255,127,114,127,99,63,127,140,127,127,0,0,0,191,0,104,0,0,0,0,0,0,0,0,0,145,216,133,0,127,0,127,170,0,0,127,127,109,85,127,127,63,85,42,150,150,150,150,150,150,150,25,150,150,150,0,127,0,0,144,85,127,132,127,85,0,127,127,127,127,127,127,59,127,85,127,127,106,47,79,127,127,204,2,141,66,0,0,127,127,0,0,0,0,127,0,159,0,0,178,127,36,85,131,127,127,127,153,95,0,140,75,27,127,127,0,150,150,198,0,0,63,30,127,165,209,198,127,127,153,204,51,51,255,255,255,204,0,255,150,150,150,150,150,150,150,150,150,150,0,150,150,150,150,150,0,127,127,150,150,150,150,150,150,150,150,0,0,150,51,132,150,150,150 }; +// for (int i = 0; i < VISUALPARAM_COUNT; i++) +// { +// m_visualparams[i] = 150; +// } + } + + protected virtual void SetDefaultTexture() + { + m_texture = new Primitive.TextureEntry(new UUID("C228D1CF-4B5D-4BA8-84F4-899A0796AA97")); + for (uint i = 0; i < TEXTURE_COUNT; i++) + m_texture.CreateFace(i).TextureID = new UUID(AppearanceManager.DEFAULT_AVATAR_TEXTURE); + } + + /// + /// Set up appearance textures. + /// Returns boolean that indicates whether the new entries actually change the + /// existing values. + /// + public virtual bool SetTextureEntries(Primitive.TextureEntry textureEntry) + { + if (textureEntry == null) + return false; + + // There are much simpler versions of this copy that could be + // made. We determine if any of the textures actually + // changed to know if the appearance should be saved later + bool changed = false; + for (uint i = 0; i < AvatarAppearance.TEXTURE_COUNT; i++) + { + Primitive.TextureEntryFace newface = textureEntry.FaceTextures[i]; + Primitive.TextureEntryFace oldface = m_texture.FaceTextures[i]; + + if (newface == null) + { + if (oldface == null) continue; + } + else + { + if (oldface != null && oldface.TextureID == newface.TextureID) continue; + } + + changed = true; + +// if (newface != null) +// m_log.WarnFormat("[AVATAR APPEARANCE]: index {0}, new texture id {1}",i,newface.TextureID); + } + + m_texture = textureEntry; + return changed; + } + + /// + /// Set up visual parameters for the avatar and refresh the avatar height + /// Returns boolean that indicates whether the new entries actually change the + /// existing values. + /// + public virtual bool SetVisualParams(byte[] visualParams) + { + if (visualParams == null) + return false; + + // There are much simpler versions of this copy that could be + // made. We determine if any of the visual parameters actually + // changed to know if the appearance should be saved later + bool changed = false; + for (int i = 0; i < AvatarAppearance.VISUALPARAM_COUNT; i++) + { + if (visualParams[i] != m_visualparams[i]) + { +// DEBUG ON +// m_log.WarnFormat("[AVATARAPPEARANCE] vparams changed [{0}] {1} ==> {2}", +// i,m_visualparams[i],visualParams[i]); +// DEBUG OFF + m_visualparams[i] = visualParams[i]; + changed = true; + } + } + + // Reset the height if the visual parameters actually changed + if (changed) + SetHeight(); + + return changed; + } + + public virtual void SetAppearance(Primitive.TextureEntry textureEntry, byte[] visualParams) + { + SetTextureEntries(textureEntry); + SetVisualParams(visualParams); + } + + public virtual void SetHeight() + { m_avatarHeight = 1.23077f // Shortest possible avatar height + 0.516945f * (float)m_visualparams[(int)VPElement.SHAPE_HEIGHT] / 255.0f // Body height + 0.072514f * (float)m_visualparams[(int)VPElement.SHAPE_HEAD_SIZE] / 255.0f // Head size @@ -399,264 +332,86 @@ namespace OpenSim.Framework + 0.08f * (float)m_visualparams[(int)VPElement.SHOES_PLATFORM_HEIGHT] / 255.0f // Shoe platform height + 0.07f * (float)m_visualparams[(int)VPElement.SHOES_HEEL_HEIGHT] / 255.0f // Shoe heel height + 0.076f * (float)m_visualparams[(int)VPElement.SHAPE_NECK_LENGTH] / 255.0f; // Neck length + m_hipOffset = (((1.23077f // Half of avatar + 0.516945f * (float)m_visualparams[(int)VPElement.SHAPE_HEIGHT] / 255.0f // Body height + 0.3836f * (float)m_visualparams[(int)VPElement.SHAPE_LEG_LENGTH] / 255.0f // Leg length + 0.08f * (float)m_visualparams[(int)VPElement.SHOES_PLATFORM_HEIGHT] / 255.0f // Shoe platform height + 0.07f * (float)m_visualparams[(int)VPElement.SHOES_HEEL_HEIGHT] / 255.0f // Shoe heel height ) / 2) - m_avatarHeight / 2) * 0.31f - 0.0425f; - - - - //System.Console.WriteLine(">>>>>>> [APPEARANCE]: Height {0} Hip offset {1}" + m_avatarHeight + " " + m_hipOffset); - //m_log.Debug("------------- Set Appearance Texture ---------------"); - //Primitive.TextureEntryFace[] faces = Texture.FaceTextures; - //foreach (Primitive.TextureEntryFace face in faces) - //{ - // if (face != null) - // m_log.Debug(" ++ " + face.TextureID); - // else - // m_log.Debug(" ++ NULL "); - //} - //m_log.Debug("----------------------------"); - } public virtual void SetWearable(int wearableId, AvatarWearable wearable) { - m_wearables[wearableId] = wearable; - } - - public static Primitive.TextureEntry GetDefaultTexture() - { - Primitive.TextureEntry textu = new Primitive.TextureEntry(new UUID("C228D1CF-4B5D-4BA8-84F4-899A0796AA97")); - /* recommended by MB - textu.CreateFace(0).TextureID = new UUID("00000000-0000-1111-9999-000000000012"); - textu.CreateFace(1).TextureID = Util.BLANK_TEXTURE_UUID; - textu.CreateFace(2).TextureID = Util.BLANK_TEXTURE_UUID; - textu.CreateFace(3).TextureID = new UUID("6522E74D-1660-4E7F-B601-6F48C1659A77"); - textu.CreateFace(4).TextureID = new UUID("7CA39B4C-BD19-4699-AFF7-F93FD03D3E7B"); - textu.CreateFace(5).TextureID = new UUID("00000000-0000-1111-9999-000000000010"); - textu.CreateFace(6).TextureID = new UUID("00000000-0000-1111-9999-000000000011"); - */ - return textu; - } - - public static byte[] GetDefaultVisualParams() - { - byte[] visualParams; - visualParams = new byte[VISUALPARAM_COUNT]; - for (int i = 0; i < VISUALPARAM_COUNT; i++) - { - visualParams[i] = 100; - } - return visualParams; +// DEBUG ON +// m_log.WarnFormat("[AVATARAPPEARANCE] set wearable {0} --> {1}:{2}",wearableId,wearable.ItemID,wearable.AssetID); +// DEBUG OFF + m_wearables[wearableId].Clear(); + for (int i = 0; i < wearable.Count; i++) + m_wearables[wearableId].Add(wearable[i].ItemID, wearable[i].AssetID); } +// DEBUG ON public override String ToString() { - String s = "[Wearables] =>"; - s += " Body Item: " + BodyItem.ToString() + ";"; - s += " Skin Item: " + SkinItem.ToString() + ";"; - s += " Shirt Item: " + ShirtItem.ToString() + ";"; - s += " Pants Item: " + PantsItem.ToString() + ";"; + String s = ""; + + s += String.Format("Serial: {0}\n",m_serial); + + for (uint i = 0; i < AvatarAppearance.TEXTURE_COUNT; i++) + if (m_texture.FaceTextures[i] != null) + s += String.Format("Texture: {0} --> {1}\n",i,m_texture.FaceTextures[i].TextureID); + + foreach (AvatarWearable awear in m_wearables) + { + for (int i = 0; i < awear.Count; i++) + s += String.Format("Wearable: item={0}, asset={1}\n",awear[i].ItemID,awear[i].AssetID); + } + + s += "Visual Params: "; + for (uint j = 0; j < AvatarAppearance.VISUALPARAM_COUNT; j++) + s += String.Format("{0},",m_visualparams[j]); + s += "\n"; + return s; } +// DEBUG OFF - // this is used for OGS1 - public virtual Hashtable ToHashTable() + /// + /// Get a list of the attachments, note that there may be + /// duplicate attachpoints + /// + public List GetAttachments() { - Hashtable h = new Hashtable(); - h["owner"] = Owner.ToString(); - h["serial"] = Serial.ToString(); - h["visual_params"] = VisualParams; - h["texture"] = Texture.GetBytes(); - h["avatar_height"] = AvatarHeight.ToString(); - h["body_item"] = BodyItem.ToString(); - h["body_asset"] = BodyAsset.ToString(); - h["skin_item"] = SkinItem.ToString(); - h["skin_asset"] = SkinAsset.ToString(); - h["hair_item"] = HairItem.ToString(); - h["hair_asset"] = HairAsset.ToString(); - h["eyes_item"] = EyesItem.ToString(); - h["eyes_asset"] = EyesAsset.ToString(); - h["shirt_item"] = ShirtItem.ToString(); - h["shirt_asset"] = ShirtAsset.ToString(); - h["pants_item"] = PantsItem.ToString(); - h["pants_asset"] = PantsAsset.ToString(); - h["shoes_item"] = ShoesItem.ToString(); - h["shoes_asset"] = ShoesAsset.ToString(); - h["socks_item"] = SocksItem.ToString(); - h["socks_asset"] = SocksAsset.ToString(); - h["jacket_item"] = JacketItem.ToString(); - h["jacket_asset"] = JacketAsset.ToString(); - h["gloves_item"] = GlovesItem.ToString(); - h["gloves_asset"] = GlovesAsset.ToString(); - h["undershirt_item"] = UnderShirtItem.ToString(); - h["undershirt_asset"] = UnderShirtAsset.ToString(); - h["underpants_item"] = UnderPantsItem.ToString(); - h["underpants_asset"] = UnderPantsAsset.ToString(); - h["skirt_item"] = SkirtItem.ToString(); - h["skirt_asset"] = SkirtAsset.ToString(); - - string attachments = GetAttachmentsString(); - if (attachments != String.Empty) - h["attachments"] = attachments; - - return h; - } - - public AvatarAppearance(Hashtable h) - { - Owner = new UUID((string)h["owner"]); - Serial = Convert.ToInt32((string)h["serial"]); - VisualParams = (byte[])h["visual_params"]; - - if (h.Contains("texture")) + List alist = new List(); + foreach (KeyValuePair> kvp in m_attachments) { - byte[] te = h["texture"] as byte[]; - if (te != null && te.Length > 0) - Texture = new Primitive.TextureEntry(te, 0, te.Length); - } - else - { - // We shouldn't be receiving appearance hashtables without a TextureEntry, - // but in case we do this will prevent a failure when saving to the database - Texture = GetDefaultTexture(); + foreach (AvatarAttachment attach in kvp.Value) + alist.Add(new AvatarAttachment(attach)); } - - AvatarHeight = (float)Convert.ToDouble((string)h["avatar_height"]); - - m_wearables = new AvatarWearable[MAX_WEARABLES]; - for (int i = 0; i < MAX_WEARABLES; i++) - { - // this makes them all null - m_wearables[i] = new AvatarWearable(); - } - - BodyItem = new UUID((string)h["body_item"]); - BodyAsset = new UUID((string)h["body_asset"]); - SkinItem = new UUID((string)h["skin_item"]); - SkinAsset = new UUID((string)h["skin_asset"]); - HairItem = new UUID((string)h["hair_item"]); - HairAsset = new UUID((string)h["hair_asset"]); - EyesItem = new UUID((string)h["eyes_item"]); - EyesAsset = new UUID((string)h["eyes_asset"]); - ShirtItem = new UUID((string)h["shirt_item"]); - ShirtAsset = new UUID((string)h["shirt_asset"]); - PantsItem = new UUID((string)h["pants_item"]); - PantsAsset = new UUID((string)h["pants_asset"]); - ShoesItem = new UUID((string)h["shoes_item"]); - ShoesAsset = new UUID((string)h["shoes_asset"]); - SocksItem = new UUID((string)h["socks_item"]); - SocksAsset = new UUID((string)h["socks_asset"]); - JacketItem = new UUID((string)h["jacket_item"]); - JacketAsset = new UUID((string)h["jacket_asset"]); - GlovesItem = new UUID((string)h["gloves_item"]); - GlovesAsset = new UUID((string)h["gloves_asset"]); - UnderShirtItem = new UUID((string)h["undershirt_item"]); - UnderShirtAsset = new UUID((string)h["undershirt_asset"]); - UnderPantsItem = new UUID((string)h["underpants_item"]); - UnderPantsAsset = new UUID((string)h["underpants_asset"]); - SkirtItem = new UUID((string)h["skirt_item"]); - SkirtAsset = new UUID((string)h["skirt_asset"]); - - if (h.ContainsKey("attachments")) - { - SetAttachmentsString(h["attachments"].ToString()); - } + return alist; } - private Dictionary m_attachments = new Dictionary(); - - public void SetAttachments(AttachmentData[] data) + internal void AppendAttachment(AvatarAttachment attach) { - foreach (AttachmentData a in data) - { - m_attachments[a.AttachPoint] = new UUID[2]; - m_attachments[a.AttachPoint][0] = a.ItemID; - m_attachments[a.AttachPoint][1] = a.AssetID; - } + if (! m_attachments.ContainsKey(attach.AttachPoint)) + m_attachments[attach.AttachPoint] = new List(); + m_attachments[attach.AttachPoint].Add(attach); } - public void SetAttachments(Hashtable data) + internal void ReplaceAttachment(AvatarAttachment attach) { - m_attachments.Clear(); - - if (data == null) - return; - - foreach (DictionaryEntry e in data) - { - int attachpoint = Convert.ToInt32(e.Key); - - if (m_attachments.ContainsKey(attachpoint)) - continue; - - UUID item; - UUID asset; - - Hashtable uuids = (Hashtable) e.Value; - UUID.TryParse(uuids["item"].ToString(), out item); - UUID.TryParse(uuids["asset"].ToString(), out asset); - - UUID[] attachment = new UUID[2]; - attachment[0] = item; - attachment[1] = asset; - - m_attachments[attachpoint] = attachment; - } - } - - public Dictionary GetAttachmentDictionary() - { - return m_attachments; - } - - public Hashtable GetAttachments() - { - if (m_attachments.Count == 0) - return null; - - Hashtable ret = new Hashtable(); - - foreach (KeyValuePair kvp in m_attachments) - { - int attachpoint = kvp.Key; - UUID[] uuids = kvp.Value; - - Hashtable data = new Hashtable(); - data["item"] = uuids[0].ToString(); - data["asset"] = uuids[1].ToString(); - - ret[attachpoint] = data; - } - - return ret; - } - - public List GetAttachedPoints() - { - return new List(m_attachments.Keys); - } - - public UUID GetAttachedItem(int attachpoint) - { - if (!m_attachments.ContainsKey(attachpoint)) - return UUID.Zero; - - return m_attachments[attachpoint][0]; - } - - public UUID GetAttachedAsset(int attachpoint) - { - if (!m_attachments.ContainsKey(attachpoint)) - return UUID.Zero; - - return m_attachments[attachpoint][1]; + m_attachments[attach.AttachPoint] = new List(); + m_attachments[attach.AttachPoint].Add(attach); } + /// + /// Add an attachment, if the attachpoint has the + /// 0x80 bit set then we assume this is an append + /// operation otherwise we replace whatever is + /// currently attached at the attachpoint + /// public void SetAttachment(int attachpoint, UUID item, UUID asset) { if (attachpoint == 0) @@ -669,31 +424,47 @@ namespace OpenSim.Framework return; } - if (!m_attachments.ContainsKey(attachpoint)) - m_attachments[attachpoint] = new UUID[2]; - - m_attachments[attachpoint][0] = item; - m_attachments[attachpoint][1] = asset; + // check if this is an append or a replace, 0x80 marks it as an append + if ((attachpoint & 0x80) > 0) + { + // strip the append bit + int point = attachpoint & 0x7F; + AppendAttachment(new AvatarAttachment(point, item, asset)); + } + else + { + ReplaceAttachment(new AvatarAttachment(attachpoint,item,asset)); + } } public int GetAttachpoint(UUID itemID) { - foreach (KeyValuePair kvp in m_attachments) + foreach (KeyValuePair> kvp in m_attachments) { - if (kvp.Value[0] == itemID) - { + int index = kvp.Value.FindIndex(delegate(AvatarAttachment a) { return a.ItemID == itemID; }); + if (index >= 0) return kvp.Key; - } } + return 0; } public void DetachAttachment(UUID itemID) { - int attachpoint = GetAttachpoint(itemID); + foreach (KeyValuePair> kvp in m_attachments) + { + int index = kvp.Value.FindIndex(delegate(AvatarAttachment a) { return a.ItemID == itemID; }); + if (index >= 0) + { + // Remove it from the list of attachments at that attach point + m_attachments[kvp.Key].RemoveAt(index); - if (attachpoint > 0) - m_attachments.Remove(attachpoint); + // And remove the list if there are no more attachments here + if (m_attachments[kvp.Key].Count == 0) + m_attachments.Remove(kvp.Key); + return; + } + } } public void ClearAttachments() @@ -701,42 +472,126 @@ namespace OpenSim.Framework m_attachments.Clear(); } - string GetAttachmentsString() + #region Packing Functions + + /// + /// Create an OSDMap from the appearance data + /// + public OSDMap Pack() { - List strings = new List(); + OSDMap data = new OSDMap(); - foreach (KeyValuePair e in m_attachments) + data["serial"] = OSD.FromInteger(m_serial); + data["height"] = OSD.FromReal(m_avatarHeight); + data["hipoffset"] = OSD.FromReal(m_hipOffset); + + // Wearables + OSDArray wears = new OSDArray(AvatarWearable.MAX_WEARABLES); + for (int i = 0; i < AvatarWearable.MAX_WEARABLES; i++) + wears.Add(m_wearables[i].Pack()); + data["wearables"] = wears; + + // Avatar Textures + OSDArray textures = new OSDArray(AvatarAppearance.TEXTURE_COUNT); + for (uint i = 0; i < AvatarAppearance.TEXTURE_COUNT; i++) { - strings.Add(e.Key.ToString()); - strings.Add(e.Value[0].ToString()); - strings.Add(e.Value[1].ToString()); + if (m_texture.FaceTextures[i] != null) + textures.Add(OSD.FromUUID(m_texture.FaceTextures[i].TextureID)); + else + textures.Add(OSD.FromUUID(AppearanceManager.DEFAULT_AVATAR_TEXTURE)); } + data["textures"] = textures; - return String.Join(",", strings.ToArray()); + // Visual Parameters + OSDBinary visualparams = new OSDBinary(m_visualparams); + data["visualparams"] = visualparams; + + // Attachments + OSDArray attachs = new OSDArray(m_attachments.Count); + foreach (AvatarAttachment attach in GetAttachments()) + attachs.Add(attach.Pack()); + data["attachments"] = attachs; + + return data; } - void SetAttachmentsString(string data) + /// + /// Unpack and OSDMap and initialize the appearance + /// from it + /// + public void Unpack(OSDMap data) { - string[] strings = data.Split(new char[] {','}); - int i = 0; + if ((data != null) && (data["serial"] != null)) + m_serial = data["serial"].AsInteger(); + if ((data != null) && (data["height"] != null)) + m_avatarHeight = (float)data["height"].AsReal(); + if ((data != null) && (data["hipoffset"] != null)) + m_hipOffset = (float)data["hipoffset"].AsReal(); - m_attachments.Clear(); - - while (strings.Length - i > 2) + try { - int attachpoint = Int32.Parse(strings[i]); - UUID item = new UUID(strings[i+1]); - UUID asset = new UUID(strings[i+2]); - i += 3; - - if (!m_attachments.ContainsKey(attachpoint)) + // Wearables + SetDefaultWearables(); + if ((data != null) && (data["wearables"] != null) && (data["wearables"]).Type == OSDType.Array) { - m_attachments[attachpoint] = new UUID[2]; - m_attachments[attachpoint][0] = item; - m_attachments[attachpoint][1] = asset; + OSDArray wears = (OSDArray)(data["wearables"]); + for (int i = 0; i < wears.Count; i++) + m_wearables[i] = new AvatarWearable((OSDArray)wears[i]); + } + else + { + m_log.Warn("[AVATAR APPEARANCE]: failed to unpack wearables"); + } + + // Avatar Textures + SetDefaultTexture(); + if ((data != null) && (data["textures"] != null) && (data["textures"]).Type == OSDType.Array) + { + OSDArray textures = (OSDArray)(data["textures"]); + for (int i = 0; i < AvatarAppearance.TEXTURE_COUNT && i < textures.Count; i++) + { + UUID textureID = AppearanceManager.DEFAULT_AVATAR_TEXTURE; + if (textures[i] != null) + textureID = textures[i].AsUUID(); + m_texture.CreateFace((uint)i).TextureID = new UUID(textureID); + } + } + else + { + m_log.Warn("[AVATAR APPEARANCE]: failed to unpack textures"); + } + + // Visual Parameters + SetDefaultParams(); + if ((data != null) && (data["visualparams"] != null)) + { + if ((data["visualparams"].Type == OSDType.Binary) || (data["visualparams"].Type == OSDType.Array)) + m_visualparams = data["visualparams"].AsBinary(); + } + else + { + m_log.Warn("[AVATAR APPEARANCE]: failed to unpack visual parameters"); + } + + // Attachments + m_attachments = new Dictionary>(); + if ((data != null) && (data["attachments"] != null) && (data["attachments"]).Type == OSDType.Array) + { + OSDArray attachs = (OSDArray)(data["attachments"]); + for (int i = 0; i < attachs.Count; i++) + AppendAttachment(new AvatarAttachment((OSDMap)attachs[i])); } } + catch (Exception e) + { + m_log.ErrorFormat("[AVATAR APPEARANCE]: unpack failed badly: {0}{1}", e.Message, e.StackTrace); + } } + + #endregion + + #region VPElement + /// /// Viewer Params Array Element for AgentSetAppearance /// Generated from LibOMV's Visual Params list @@ -1499,5 +1354,6 @@ namespace OpenSim.Framework SKIRT_SKIRT_GREEN = 216, SKIRT_SKIRT_BLUE = 217 } + #endregion } -} \ No newline at end of file +} diff --git a/OpenSim/Tools/OpenSim.GridLaunch/GUI/Service/Service.cs b/OpenSim/Framework/AvatarAttachment.cs similarity index 59% rename from OpenSim/Tools/OpenSim.GridLaunch/GUI/Service/Service.cs rename to OpenSim/Framework/AvatarAttachment.cs index f518bd79f7..c68d78d74e 100644 --- a/OpenSim/Tools/OpenSim.GridLaunch/GUI/Service/Service.cs +++ b/OpenSim/Framework/AvatarAttachment.cs @@ -1,4 +1,4 @@ -/* +/* * Copyright (c) Contributors, http://opensimulator.org/ * See CONTRIBUTORS.TXT for a full list of copyright holders. * @@ -24,42 +24,55 @@ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ + using System; -using System.Collections.Generic; -using System.ServiceProcess; -using System.Text; -using OpenSim.GridLaunch.GUI; +using OpenMetaverse; +using OpenMetaverse.StructuredData; -namespace OpenSim.GridLaunch +namespace OpenSim.Framework { - internal class Service: ServiceBase, IGUI + public class AvatarAttachment { - private ServiceBase[] ServicesToRun; - public Service() + public int AttachPoint; + public UUID ItemID; + public UUID AssetID; + + public AvatarAttachment(AvatarAttachment attach) { - ServicesToRun = new ServiceBase[] {this}; + AttachPoint = attach.AttachPoint; + ItemID = attach.ItemID; + AssetID = attach.AssetID; } - public void StartGUI() + public AvatarAttachment(int point, UUID item, UUID asset) { - ServiceBase.Run(ServicesToRun); + AttachPoint = point; + ItemID = item; + AssetID = asset; } - public void StopGUI() + public AvatarAttachment(OSDMap args) { - // Nothing + Unpack(args); } - protected override void OnStart(string[] args) + public OSDMap Pack() { - // Command line arguments override settings - Program.Settings.ParseCommandArguments(args); + OSDMap attachdata = new OSDMap(); + attachdata["point"] = OSD.FromInteger(AttachPoint); + attachdata["item"] = OSD.FromUUID(ItemID); + attachdata["asset"] = OSD.FromUUID(AssetID); + + return attachdata; } - protected override void OnStop() - { - Program.Shutdown(); - } + public void Unpack(OSDMap args) + { + if (args["point"] != null) + AttachPoint = args["point"].AsInteger(); + ItemID = (args["item"] != null) ? args["item"].AsUUID() : UUID.Zero; + AssetID = (args["asset"] != null) ? args["asset"].AsUUID() : UUID.Zero; + } } -} \ No newline at end of file +} diff --git a/OpenSim/Framework/AvatarWearable.cs b/OpenSim/Framework/AvatarWearable.cs index 87d9e617b8..0809ab691c 100644 --- a/OpenSim/Framework/AvatarWearable.cs +++ b/OpenSim/Framework/AvatarWearable.cs @@ -26,56 +26,227 @@ */ using System; -using System.Runtime.Serialization; -using System.Security.Permissions; +using System.Collections.Generic; using OpenMetaverse; +using OpenMetaverse.StructuredData; namespace OpenSim.Framework { + public struct WearableItem + { + public UUID ItemID; + public UUID AssetID; + + public WearableItem(UUID itemID, UUID assetID) + { + ItemID = itemID; + AssetID = assetID; + } + } + public class AvatarWearable { - public UUID AssetID = new UUID("00000000-0000-0000-0000-000000000000"); - public UUID ItemID = new UUID("00000000-0000-0000-0000-000000000000"); + // these are guessed at by the list here - + // http://wiki.secondlife.com/wiki/Avatar_Appearance. We'll + // correct them over time for when were are wrong. + public static readonly int BODY = 0; + public static readonly int SKIN = 1; + public static readonly int HAIR = 2; + public static readonly int EYES = 3; + public static readonly int SHIRT = 4; + public static readonly int PANTS = 5; + public static readonly int SHOES = 6; + public static readonly int SOCKS = 7; + public static readonly int JACKET = 8; + public static readonly int GLOVES = 9; + public static readonly int UNDERSHIRT = 10; + public static readonly int UNDERPANTS = 11; + public static readonly int SKIRT = 12; + public static readonly int ALPHA = 13; + public static readonly int TATTOO = 14; + + public static readonly int MAX_WEARABLES = 15; + + public static readonly UUID DEFAULT_BODY_ITEM = new UUID("66c41e39-38f9-f75a-024e-585989bfaba9"); + public static readonly UUID DEFAULT_BODY_ASSET = new UUID("66c41e39-38f9-f75a-024e-585989bfab73"); + + public static readonly UUID DEFAULT_HAIR_ITEM = new UUID("d342e6c1-b9d2-11dc-95ff-0800200c9a66"); + public static readonly UUID DEFAULT_HAIR_ASSET = new UUID("d342e6c0-b9d2-11dc-95ff-0800200c9a66"); + + public static readonly UUID DEFAULT_SKIN_ITEM = new UUID("77c41e39-38f9-f75a-024e-585989bfabc9"); + public static readonly UUID DEFAULT_SKIN_ASSET = new UUID("77c41e39-38f9-f75a-024e-585989bbabbb"); + + public static readonly UUID DEFAULT_SHIRT_ITEM = new UUID("77c41e39-38f9-f75a-0000-585989bf0000"); + public static readonly UUID DEFAULT_SHIRT_ASSET = new UUID("00000000-38f9-1111-024e-222222111110"); + + public static readonly UUID DEFAULT_PANTS_ITEM = new UUID("77c41e39-38f9-f75a-0000-5859892f1111"); + public static readonly UUID DEFAULT_PANTS_ASSET = new UUID("00000000-38f9-1111-024e-222222111120"); + +// public static readonly UUID DEFAULT_ALPHA_ITEM = new UUID("bfb9923c-4838-4d2d-bf07-608c5b1165c8"); +// public static readonly UUID DEFAULT_ALPHA_ASSET = new UUID("1578a2b1-5179-4b53-b618-fe00ca5a5594"); + +// public static readonly UUID DEFAULT_TATTOO_ITEM = new UUID("c47e22bd-3021-4ba4-82aa-2b5cb34d35e1"); +// public static readonly UUID DEFAULT_TATTOO_ASSET = new UUID("00000000-0000-2222-3333-100000001007"); + + private static AvatarWearable[] defaultWearables = null; + + protected Dictionary m_items = new Dictionary(); + protected List m_ids = new List(); public AvatarWearable() { } - public AvatarWearable(UUID itemId, UUID assetId) + public AvatarWearable(UUID itemID, UUID assetID) { - AssetID = assetId; - ItemID = itemId; + Wear(itemID, assetID); + } + + public AvatarWearable(OSDArray args) + { + Unpack(args); + } + + public OSD Pack() + { + OSDArray wearlist = new OSDArray(); + + foreach (UUID id in m_ids) + { + OSDMap weardata = new OSDMap(); + weardata["item"] = OSD.FromUUID(id); + weardata["asset"] = OSD.FromUUID(m_items[id]); + wearlist.Add(weardata); + } + + return wearlist; + } + + public void Unpack(OSDArray args) + { + Clear(); + + foreach (OSDMap weardata in args) + { + Add(weardata["item"].AsUUID(), weardata["asset"].AsUUID()); + } + } + + public int Count + { + get { return m_ids.Count; } + } + + public void Add(UUID itemID, UUID assetID) + { + if (itemID == UUID.Zero) + return; + if (m_items.ContainsKey(itemID)) + { + m_items[itemID] = assetID; + return; + } + if (m_ids.Count >= 5) + return; + + m_ids.Add(itemID); + m_items[itemID] = assetID; + } + + public void Wear(WearableItem item) + { + Wear(item.ItemID, item.AssetID); + } + + public void Wear(UUID itemID, UUID assetID) + { + Clear(); + Add(itemID, assetID); + } + + public void Clear() + { + m_ids.Clear(); + m_items.Clear(); + } + + public void RemoveItem(UUID itemID) + { + if (m_items.ContainsKey(itemID)) + { + m_ids.Remove(itemID); + m_items.Remove(itemID); + } + } + + public void RemoveAsset(UUID assetID) + { + UUID itemID = UUID.Zero; + + foreach (KeyValuePair kvp in m_items) + { + if (kvp.Value == assetID) + { + itemID = kvp.Key; + break; + } + } + + if (itemID != UUID.Zero) + { + m_ids.Remove(itemID); + m_items.Remove(itemID); + } + } + + public WearableItem this [int idx] + { + get + { + if (idx >= m_ids.Count || idx < 0) + return new WearableItem(UUID.Zero, UUID.Zero); + + return new WearableItem(m_ids[idx], m_items[m_ids[idx]]); + } + } + + public UUID GetAsset(UUID itemID) + { + if (!m_items.ContainsKey(itemID)) + return UUID.Zero; + return m_items[itemID]; } public static AvatarWearable[] DefaultWearables { get { - AvatarWearable[] defaultWearables = new AvatarWearable[13]; //should be 13 of these - for (int i = 0; i < 13; i++) + defaultWearables = new AvatarWearable[MAX_WEARABLES]; //should be 15 of these + for (int i = 0; i < MAX_WEARABLES; i++) { defaultWearables[i] = new AvatarWearable(); } // Body - defaultWearables[0].ItemID = new UUID("66c41e39-38f9-f75a-024e-585989bfaba9"); - defaultWearables[0].AssetID = new UUID("66c41e39-38f9-f75a-024e-585989bfab73"); + defaultWearables[BODY].Add(DEFAULT_BODY_ITEM, DEFAULT_BODY_ASSET); // Hair - defaultWearables[2].ItemID = new UUID("d342e6c1-b9d2-11dc-95ff-0800200c9a66"); - defaultWearables[2].AssetID = new UUID("d342e6c0-b9d2-11dc-95ff-0800200c9a66"); + defaultWearables[HAIR].Add(DEFAULT_HAIR_ITEM, DEFAULT_HAIR_ASSET); // Skin - defaultWearables[1].ItemID = new UUID("77c41e39-38f9-f75a-024e-585989bfabc9"); - defaultWearables[1].AssetID = new UUID("77c41e39-38f9-f75a-024e-585989bbabbb"); + defaultWearables[SKIN].Add(DEFAULT_SKIN_ITEM, DEFAULT_SKIN_ASSET); // Shirt - defaultWearables[4].ItemID = new UUID("77c41e39-38f9-f75a-0000-585989bf0000"); - defaultWearables[4].AssetID = new UUID("00000000-38f9-1111-024e-222222111110"); + defaultWearables[SHIRT].Add(DEFAULT_SHIRT_ITEM, DEFAULT_SHIRT_ASSET); // Pants - defaultWearables[5].ItemID = new UUID("77c41e39-38f9-f75a-0000-5859892f1111"); - defaultWearables[5].AssetID = new UUID("00000000-38f9-1111-024e-222222111120"); + defaultWearables[PANTS].Add(DEFAULT_PANTS_ITEM, DEFAULT_PANTS_ASSET); + +// // Alpha +// defaultWearables[ALPHA].Add(DEFAULT_ALPHA_ITEM, DEFAULT_ALPHA_ASSET); + +// // Tattoo +// defaultWearables[TATTOO].Add(DEFAULT_TATTOO_ITEM, DEFAULT_TATTOO_ASSET); return defaultWearables; } diff --git a/OpenSim/Framework/Capabilities/Caps.cs b/OpenSim/Framework/Capabilities/Caps.cs index da953bbef0..e7f2e132e2 100644 --- a/OpenSim/Framework/Capabilities/Caps.cs +++ b/OpenSim/Framework/Capabilities/Caps.cs @@ -31,6 +31,7 @@ using System.Collections.Generic; using System.IO; using System.Reflection; using log4net; +using Nini.Config; using OpenMetaverse; using OpenSim.Framework.Servers; using OpenSim.Framework.Servers.HttpServer; @@ -44,6 +45,8 @@ namespace OpenSim.Framework.Capabilities string assetName, string description, UUID assetID, UUID inventoryItem, UUID parentFolder, byte[] data, string inventoryType, string assetType); + public delegate void UploadedBakedTexture(UUID assetID, byte[] data); + public delegate UUID UpdateItem(UUID itemID, byte[] data); public delegate void UpdateTaskScript(UUID itemID, UUID primID, bool isScriptRunning, byte[] data, ref ArrayList errors); @@ -97,6 +100,7 @@ namespace OpenSim.Framework.Capabilities // private static readonly string m_provisionVoiceAccountRequestPath = "0008/";// This is in a module. // private static readonly string m_remoteParcelRequestPath = "0009/";// This is in the LandManagementModule. + private static readonly string m_uploadBakedTexturePath = "0010/";// This is in the LandManagementModule. //private string eventQueue = "0100/"; private IScene m_Scene; @@ -109,6 +113,8 @@ namespace OpenSim.Framework.Capabilities private string m_regionName; private object m_fetchLock = new Object(); + private bool m_persistBakedTextures = false; + public bool SSLCaps { get { return m_httpListener.UseSSL; } @@ -142,7 +148,16 @@ namespace OpenSim.Framework.Capabilities m_httpListenPort = httpPort; - if (httpServer.UseSSL) + m_persistBakedTextures = false; + IConfigSource config = m_Scene.Config; + if (config != null) + { + IConfig sconfig = config.Configs["Startup"]; + if (sconfig != null) + m_persistBakedTextures = sconfig.GetBoolean("PersistBakedTextures",m_persistBakedTextures); + } + + if (httpServer != null && httpServer.UseSSL) { m_httpListenPort = httpServer.SSLPort; httpListen = httpServer.SSLCommonName; @@ -151,7 +166,7 @@ namespace OpenSim.Framework.Capabilities m_agentID = agent; m_dumpAssetsToFile = dumpAssetsToFile; - m_capsHandlers = new CapsHandlers(httpServer, httpListen, httpPort, httpServer.UseSSL); + m_capsHandlers = new CapsHandlers(httpServer, httpListen, httpPort, (httpServer == null) ? false : httpServer.UseSSL); m_regionName = regionName; } @@ -185,6 +200,8 @@ namespace OpenSim.Framework.Capabilities m_capsHandlers["UpdateScriptTaskInventory"] = new RestStreamHandler("POST", capsBase + m_notecardTaskUpdatePath, ScriptTaskInventory); m_capsHandlers["UpdateScriptTask"] = m_capsHandlers["UpdateScriptTaskInventory"]; + m_capsHandlers["UploadBakedTexture"] = + new RestStreamHandler("POST", capsBase + m_uploadBakedTexturePath, UploadBakedTexture); } catch (Exception e) @@ -742,6 +759,50 @@ namespace OpenSim.Framework.Capabilities return null; } + public string UploadBakedTexture(string request, string path, + string param, OSHttpRequest httpRequest, + OSHttpResponse httpResponse) + { + try + { + m_log.Debug("[CAPS]: UploadBakedTexture Request in region: " + + m_regionName); + + string capsBase = "/CAPS/" + m_capsObjectPath; + string uploaderPath = Util.RandomClass.Next(5000, 8000).ToString("0000"); + + BakedTextureUploader uploader = + new BakedTextureUploader(capsBase + uploaderPath, + m_httpListener); + uploader.OnUpLoad += BakedTextureUploaded; + + m_httpListener.AddStreamHandler( + new BinaryStreamHandler("POST", capsBase + uploaderPath, + uploader.uploaderCaps)); + + string protocol = "http://"; + + if (m_httpListener.UseSSL) + protocol = "https://"; + + string uploaderURL = protocol + m_httpListenerHostName + ":" + + m_httpListenPort.ToString() + capsBase + uploaderPath; + + LLSDAssetUploadResponse uploadResponse = + new LLSDAssetUploadResponse(); + uploadResponse.uploader = uploaderURL; + uploadResponse.state = "upload"; + + return LLSDHelpers.SerialiseLLSDReply(uploadResponse); + } + catch (Exception e) + { + m_log.Error("[CAPS]: " + e.ToString()); + } + + return null; + } + /// /// Called by the notecard update handler. Provides a URL to which the client can upload a new asset. /// @@ -906,6 +967,7 @@ namespace OpenSim.Framework.Capabilities InventoryItemBase item = new InventoryItemBase(); item.Owner = m_agentID; item.CreatorId = m_agentID.ToString(); + item.CreatorData = String.Empty; item.ID = inventoryItem; item.AssetID = asset.FullID; item.Description = assetDescription; @@ -913,10 +975,10 @@ namespace OpenSim.Framework.Capabilities item.AssetType = assType; item.InvType = inType; item.Folder = parentFolder; - item.CurrentPermissions = 2147483647; - item.BasePermissions = 2147483647; + item.CurrentPermissions = (uint)PermissionMask.All; + item.BasePermissions = (uint)PermissionMask.All; item.EveryOnePermissions = 0; - item.NextPermissions = 2147483647; + item.NextPermissions = (uint)(PermissionMask.Move | PermissionMask.Modify | PermissionMask.Transfer); item.CreationDate = Util.UnixTimeSinceEpoch(); if (AddNewInventoryItem != null) @@ -925,6 +987,17 @@ namespace OpenSim.Framework.Capabilities } } + public void BakedTextureUploaded(UUID assetID, byte[] data) + { +// m_log.WarnFormat("[CAPS]: Received baked texture {0}", assetID.ToString()); + AssetBase asset; + asset = new AssetBase(assetID, "Baked Texture", (sbyte)AssetType.Texture, m_agentID.ToString()); + asset.Data = data; + asset.Temporary = true; + asset.Local = ! m_persistBakedTextures; // Local assets aren't persisted, non-local are + m_assetCache.Store(asset); + } + /// /// Called when new asset data for an agent inventory item update has been uploaded. /// @@ -1243,5 +1316,50 @@ namespace OpenSim.Framework.Capabilities fs.Close(); } } + + public class BakedTextureUploader + { + public event UploadedBakedTexture OnUpLoad; + private UploadedBakedTexture handlerUpLoad = null; + + private string uploaderPath = String.Empty; + private UUID newAssetID; + private IHttpServer httpListener; + + public BakedTextureUploader(string path, IHttpServer httpServer) + { + newAssetID = UUID.Random(); + uploaderPath = path; + httpListener = httpServer; + } + + /// + /// + /// + /// + /// + /// + /// + public string uploaderCaps(byte[] data, string path, string param) + { + string res = String.Empty; + LLSDAssetUploadComplete uploadComplete = new LLSDAssetUploadComplete(); + uploadComplete.new_asset = newAssetID.ToString(); + uploadComplete.new_inventory_item = UUID.Zero; + uploadComplete.state = "complete"; + + res = LLSDHelpers.SerialiseLLSDReply(uploadComplete); + + httpListener.RemoveStreamHandler("POST", uploaderPath); + + handlerUpLoad = OnUpLoad; + if (handlerUpLoad != null) + { + handlerUpLoad(newAssetID, data); + } + + return res; + } + } } } diff --git a/OpenSim/Framework/Capabilities/CapsHandlers.cs b/OpenSim/Framework/Capabilities/CapsHandlers.cs index f000aed3c2..864e6ddb7e 100644 --- a/OpenSim/Framework/Capabilities/CapsHandlers.cs +++ b/OpenSim/Framework/Capabilities/CapsHandlers.cs @@ -74,7 +74,7 @@ namespace OpenSim.Framework.Capabilities m_httpListenerHostName = httpListenerHostname; m_httpListenerPort = httpListenerPort; m_useSSL = https; - if (m_useSSL) + if (httpListener != null && m_useSSL) { m_httpListenerHostName = httpListener.SSLCommonName; m_httpListenerPort = httpListener.SSLPort; diff --git a/OpenSim/Framework/Capabilities/LLSDAssetUploadResponse.cs b/OpenSim/Framework/Capabilities/LLSDAssetUploadResponse.cs index 08f14e302f..0d6f7f9423 100644 --- a/OpenSim/Framework/Capabilities/LLSDAssetUploadResponse.cs +++ b/OpenSim/Framework/Capabilities/LLSDAssetUploadResponse.cs @@ -39,4 +39,18 @@ namespace OpenSim.Framework.Capabilities { } } + + [OSDMap] + public class LLSDNewFileAngentInventoryVariablePriceReplyResponse + { + public int resource_cost; + public string state; + public int upload_price; + public string rsvp; + + public LLSDNewFileAngentInventoryVariablePriceReplyResponse() + { + state = "confirm_upload"; + } + } } \ No newline at end of file diff --git a/OpenSim/Framework/ChildAgentDataUpdate.cs b/OpenSim/Framework/ChildAgentDataUpdate.cs index 89ee39cecc..a2273385e0 100644 --- a/OpenSim/Framework/ChildAgentDataUpdate.cs +++ b/OpenSim/Framework/ChildAgentDataUpdate.cs @@ -28,6 +28,8 @@ using System; using System.Collections; using System.Collections.Generic; +using System.Reflection; +using log4net; using OpenMetaverse; using OpenMetaverse.StructuredData; @@ -150,10 +152,10 @@ namespace OpenSim.Framework Vector3.TryParse(args["at_axis"].AsString(), out AtAxis); if (args["left_axis"] != null) - Vector3.TryParse(args["left_axis"].AsString(), out AtAxis); + Vector3.TryParse(args["left_axis"].AsString(), out LeftAxis); if (args["up_axis"] != null) - Vector3.TryParse(args["up_axis"].AsString(), out AtAxis); + Vector3.TryParse(args["up_axis"].AsString(), out UpAxis); if (args["changed_grid"] != null) ChangedGrid = args["changed_grid"].AsBoolean(); @@ -225,46 +227,6 @@ namespace OpenSim.Framework } } - public class AttachmentData - { - public int AttachPoint; - public UUID ItemID; - public UUID AssetID; - - public AttachmentData(int point, UUID item, UUID asset) - { - AttachPoint = point; - ItemID = item; - AssetID = asset; - } - - public AttachmentData(OSDMap args) - { - UnpackUpdateMessage(args); - } - - public OSDMap PackUpdateMessage() - { - OSDMap attachdata = new OSDMap(); - attachdata["point"] = OSD.FromInteger(AttachPoint); - attachdata["item"] = OSD.FromUUID(ItemID); - attachdata["asset"] = OSD.FromUUID(AssetID); - - return attachdata; - } - - - public void UnpackUpdateMessage(OSDMap args) - { - if (args["point"] != null) - AttachPoint = args["point"].AsInteger(); - if (args["item"] != null) - ItemID = args["item"].AsUUID(); - if (args["asset"] != null) - AssetID = args["asset"].AsUUID(); - } - } - public class ControllerData { public UUID ItemID; @@ -348,11 +310,20 @@ namespace OpenSim.Framework public UUID GranterID; // Appearance + public AvatarAppearance Appearance; + +// DEBUG ON + private static readonly ILog m_log = + LogManager.GetLogger( + MethodBase.GetCurrentMethod().DeclaringType); +// DEBUG OFF + +/* public byte[] AgentTextures; public byte[] VisualParams; public UUID[] Wearables; - public AttachmentData[] Attachments; - + public AvatarAttachment[] Attachments; +*/ // Scripted public ControllerData[] Controllers; @@ -360,6 +331,10 @@ namespace OpenSim.Framework public virtual OSDMap Pack() { +// DEBUG ON + m_log.WarnFormat("[CHILDAGENTDATAUPDATE] Pack data"); +// DEBUG OFF + OSDMap args = new OSDMap(); args["message_type"] = OSD.FromString("AgentData"); @@ -413,6 +388,9 @@ namespace OpenSim.Framework args["animations"] = anims; } + if (Appearance != null) + args["packed_appearance"] = Appearance.Pack(); + //if ((AgentTextures != null) && (AgentTextures.Length > 0)) //{ // OSDArray textures = new OSDArray(AgentTextures.Length); @@ -421,30 +399,37 @@ namespace OpenSim.Framework // args["agent_textures"] = textures; //} - - if ((AgentTextures != null) && (AgentTextures.Length > 0)) - args["texture_entry"] = OSD.FromBinary(AgentTextures); + // The code to pack textures, visuals, wearables and attachments + // should be removed; packed appearance contains the full appearance + // This is retained for backward compatibility only + if (Appearance.Texture != null) + { + byte[] rawtextures = Appearance.Texture.GetBytes(); + args["texture_entry"] = OSD.FromBinary(rawtextures); + } - if ((VisualParams != null) && (VisualParams.Length > 0)) - args["visual_params"] = OSD.FromBinary(VisualParams); + if ((Appearance.VisualParams != null) && (Appearance.VisualParams.Length > 0)) + args["visual_params"] = OSD.FromBinary(Appearance.VisualParams); // We might not pass this in all cases... - if ((Wearables != null) && (Wearables.Length > 0)) + if ((Appearance.Wearables != null) && (Appearance.Wearables.Length > 0)) { - OSDArray wears = new OSDArray(Wearables.Length); - foreach (UUID uuid in Wearables) - wears.Add(OSD.FromUUID(uuid)); + OSDArray wears = new OSDArray(Appearance.Wearables.Length); + foreach (AvatarWearable awear in Appearance.Wearables) + wears.Add(awear.Pack()); + args["wearables"] = wears; } - - if ((Attachments != null) && (Attachments.Length > 0)) + List attachments = Appearance.GetAttachments(); + if ((attachments != null) && (attachments.Count > 0)) { - OSDArray attachs = new OSDArray(Attachments.Length); - foreach (AttachmentData att in Attachments) - attachs.Add(att.PackUpdateMessage()); + OSDArray attachs = new OSDArray(attachments.Count); + foreach (AvatarAttachment att in attachments) + attachs.Add(att.Pack()); args["attachments"] = attachs; } + // End of code to remove if ((Controllers != null) && (Controllers.Length > 0)) { @@ -469,6 +454,10 @@ namespace OpenSim.Framework /// public virtual void Unpack(OSDMap args) { +// DEBUG ON + m_log.WarnFormat("[CHILDAGENTDATAUPDATE] Unpack data"); +// DEBUG OFF + if (args.ContainsKey("region_id")) UUID.TryParse(args["region_id"].AsString(), out RegionID); @@ -581,34 +570,53 @@ namespace OpenSim.Framework // AgentTextures[i++] = o.AsUUID(); //} + Appearance = new AvatarAppearance(AgentID); + + // The code to unpack textures, visuals, wearables and attachments + // should be removed; packed appearance contains the full appearance + // This is retained for backward compatibility only if (args["texture_entry"] != null) - AgentTextures = args["texture_entry"].AsBinary(); + { + byte[] rawtextures = args["texture_entry"].AsBinary(); + Primitive.TextureEntry textures = new Primitive.TextureEntry(rawtextures,0,rawtextures.Length); + Appearance.SetTextureEntries(textures); + } if (args["visual_params"] != null) - VisualParams = args["visual_params"].AsBinary(); + Appearance.SetVisualParams(args["visual_params"].AsBinary()); if ((args["wearables"] != null) && (args["wearables"]).Type == OSDType.Array) { OSDArray wears = (OSDArray)(args["wearables"]); - Wearables = new UUID[wears.Count]; - int i = 0; - foreach (OSD o in wears) - Wearables[i++] = o.AsUUID(); + for (int i = 0; i < wears.Count / 2; i++) + { + AvatarWearable awear = new AvatarWearable((OSDArray)wears[i]); + Appearance.SetWearable(i,awear); + } } if ((args["attachments"] != null) && (args["attachments"]).Type == OSDType.Array) { OSDArray attachs = (OSDArray)(args["attachments"]); - Attachments = new AttachmentData[attachs.Count]; - int i = 0; foreach (OSD o in attachs) { if (o.Type == OSDType.Map) { - Attachments[i++] = new AttachmentData((OSDMap)o); + // We know all of these must end up as attachments so we + // append rather than replace to ensure multiple attachments + // per point continues to work + Appearance.AppendAttachment(new AvatarAttachment((OSDMap)o)); } } } + // end of code to remove + + if (args.ContainsKey("packed_appearance") && (args["packed_appearance"]).Type == OSDType.Map) + Appearance = new AvatarAppearance(AgentID,(OSDMap)args["packed_appearance"]); +// DEBUG ON + else + m_log.WarnFormat("[CHILDAGENTDATAUPDATE] No packed appearance"); +// DEBUG OFF if ((args["controllers"] != null) && (args["controllers"]).Type == OSDType.Array) { diff --git a/OpenSim/Framework/ConfigSettings.cs b/OpenSim/Framework/ConfigSettings.cs index 8feaa372ee..be7734128f 100644 --- a/OpenSim/Framework/ConfigSettings.cs +++ b/OpenSim/Framework/ConfigSettings.cs @@ -124,22 +124,6 @@ namespace OpenSim.Framework set { m_standaloneUserSource = value; } } - protected string m_storageConnectionString; - - public string StorageConnectionString - { - get { return m_storageConnectionString; } - set { m_storageConnectionString = value; } - } - - protected string m_estateConnectionString; - - public string EstateConnectionString - { - get { return m_estateConnectionString; } - set { m_estateConnectionString = value; } - } - protected string m_librariesXMLFile; public string LibrariesXMLFile { diff --git a/OpenSim/Framework/Console/CommandConsole.cs b/OpenSim/Framework/Console/CommandConsole.cs index b17dbc08de..52bcd5599b 100644 --- a/OpenSim/Framework/Console/CommandConsole.cs +++ b/OpenSim/Framework/Console/CommandConsole.cs @@ -151,7 +151,7 @@ namespace OpenSim.Framework.Console help.Add(commandInfo.descriptive_help); if (descriptiveHelp != string.Empty) - help.Add(string.Empty); + help.Add(string.Empty); } else { diff --git a/OpenSim/Framework/Console/ConsoleBase.cs b/OpenSim/Framework/Console/ConsoleBase.cs index b70d1dbdc6..22ce88060c 100755 --- a/OpenSim/Framework/Console/ConsoleBase.cs +++ b/OpenSim/Framework/Console/ConsoleBase.cs @@ -89,6 +89,57 @@ namespace OpenSim.Framework.Console return ret; } + + public string CmdPrompt(string p, List excludedCharacters) + { + bool itisdone = false; + string ret = String.Empty; + while (!itisdone) + { + itisdone = true; + ret = CmdPrompt(p); + + foreach (char c in excludedCharacters) + { + if (ret.Contains(c.ToString())) + { + System.Console.WriteLine("The character \"" + c.ToString() + "\" is not permitted."); + itisdone = false; + } + } + } + + return ret; + } + + public string CmdPrompt(string p, string def, List excludedCharacters) + { + bool itisdone = false; + string ret = String.Empty; + while (!itisdone) + { + itisdone = true; + ret = CmdPrompt(p, def); + + if (ret == String.Empty) + { + ret = def; + } + else + { + foreach (char c in excludedCharacters) + { + if (ret.Contains(c.ToString())) + { + System.Console.WriteLine("The character \"" + c.ToString() + "\" is not permitted."); + itisdone = false; + } + } + } + } + + return ret; + } // Displays a command prompt and returns a default value, user may only enter 1 of 2 options public string CmdPrompt(string prompt, string defaultresponse, List options) @@ -118,7 +169,7 @@ namespace OpenSim.Framework.Console // (Done with no echo and suitable for passwords) public string PasswdPrompt(string p) { - return ReadLine(p, false, false); + return ReadLine(String.Format("{0}: ", p), false, false); } public virtual string ReadLine(string p, bool isCommand, bool e) diff --git a/OpenSim/Framework/Console/LocalConsole.cs b/OpenSim/Framework/Console/LocalConsole.cs index a3036d0df6..eda41b8d5a 100644 --- a/OpenSim/Framework/Console/LocalConsole.cs +++ b/OpenSim/Framework/Console/LocalConsole.cs @@ -38,12 +38,13 @@ namespace OpenSim.Framework.Console { /// /// A console that uses cursor control and color - /// + /// public class LocalConsole : CommandConsole { // private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); // private readonly object m_syncRoot = new object(); + private const string LOGLEVEL_NONE = "(none)"; private int y = -1; private int cp = 0; @@ -100,8 +101,8 @@ namespace OpenSim.Framework.Console private int SetCursorTop(int top) { // From at least mono 2.4.2.3, window resizing can give mono an invalid row and column values. If we try - // to set a cursor row position with a currently invalid column, mono will throw an exception. - // Therefore, we need to make sure that the column position is valid first. + // to set a cursor row position with a currently invalid column, mono will throw an exception. + // Therefore, we need to make sure that the column position is valid first. int left = System.Console.CursorLeft; if (left < 0) @@ -121,7 +122,7 @@ namespace OpenSim.Framework.Console { top = 0; } - else + else { int bh = System.Console.BufferHeight; @@ -133,7 +134,7 @@ namespace OpenSim.Framework.Console System.Console.CursorTop = top; return top; - } + } /// /// Set the cursor column. @@ -145,12 +146,12 @@ namespace OpenSim.Framework.Console /// /// /// The new cursor column. - /// + /// private int SetCursorLeft(int left) { // From at least mono 2.4.2.3, window resizing can give mono an invalid row and column values. If we try - // to set a cursor column position with a currently invalid row, mono will throw an exception. - // Therefore, we need to make sure that the row position is valid first. + // to set a cursor column position with a currently invalid row, mono will throw an exception. + // Therefore, we need to make sure that the row position is valid first. int top = System.Console.CursorTop; if (top < 0) @@ -214,7 +215,7 @@ namespace OpenSim.Framework.Console System.Console.Write("{0}", prompt); SetCursorTop(new_y); - SetCursorLeft(new_x); + SetCursorLeft(new_x); } } @@ -278,22 +279,25 @@ namespace OpenSim.Framework.Console private void WriteLocalText(string text, string level) { - string regex = @"^(?.*?)\[(?[^\]]+)\]:?(?.*)"; - - Regex RE = new Regex(regex, RegexOptions.Multiline); - MatchCollection matches = RE.Matches(text); - string outText = text; - if (matches.Count == 1) + if (level != LOGLEVEL_NONE) { - outText = matches[0].Groups["End"].Value; - System.Console.Write(matches[0].Groups["Front"].Value); + string regex = @"^(?.*?)\[(?[^\]]+)\]:?(?.*)"; - System.Console.Write("["); - WriteColorText(DeriveColor(matches[0].Groups["Category"].Value), - matches[0].Groups["Category"].Value); - System.Console.Write("]:"); + Regex RE = new Regex(regex, RegexOptions.Multiline); + MatchCollection matches = RE.Matches(text); + + if (matches.Count == 1) + { + outText = matches[0].Groups["End"].Value; + 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 (level == "error") @@ -308,7 +312,7 @@ namespace OpenSim.Framework.Console public override void Output(string text) { - Output(text, "normal"); + Output(text, LOGLEVEL_NONE); } public override void Output(string text, string level) @@ -461,16 +465,19 @@ namespace OpenSim.Framework.Console SetCursorLeft(0); y = SetCursorTop(y); - System.Console.WriteLine("{0}{1}", prompt, cmdline); + System.Console.WriteLine(); + //Show(); lock (cmdline) { y = -1; } + string commandLine = cmdline.ToString(); + if (isCommand) { - string[] cmd = Commands.Resolve(Parser.Parse(cmdline.ToString())); + string[] cmd = Commands.Resolve(Parser.Parse(commandLine)); if (cmd.Length != 0) { @@ -486,8 +493,11 @@ namespace OpenSim.Framework.Console } } - AddToHistory(cmdline.ToString()); - return cmdline.ToString(); + // If we're not echoing to screen (e.g. a password) then we probably don't want it in history + if (echo && commandLine != "") + AddToHistory(commandLine); + + return commandLine; default: break; } diff --git a/OpenSim/Framework/Console/MockConsole.cs b/OpenSim/Framework/Console/MockConsole.cs index 9eb197750d..a29b370857 100644 --- a/OpenSim/Framework/Console/MockConsole.cs +++ b/OpenSim/Framework/Console/MockConsole.cs @@ -1,4 +1,31 @@ -using System; +/* + * Copyright (c) Contributors, http://opensimulator.org/ + * See CONTRIBUTORS.TXT for a full list of copyright holders. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * * Neither the name of the OpenSimulator Project nor the + * names of its contributors may be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE DEVELOPERS ``AS IS'' AND ANY + * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED + * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + * DISCLAIMED. IN NO EVENT SHALL THE CONTRIBUTORS BE LIABLE FOR ANY + * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES + * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND + * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS + * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +using System; using System.Threading; using System.Collections.Generic; using System.Text; diff --git a/OpenSim/Framework/Console/RemoteConsole.cs b/OpenSim/Framework/Console/RemoteConsole.cs index c038aaca5c..07de27a2fc 100644 --- a/OpenSim/Framework/Console/RemoteConsole.cs +++ b/OpenSim/Framework/Console/RemoteConsole.cs @@ -32,6 +32,7 @@ using System.Collections.Generic; using System.Diagnostics; using System.Reflection; using System.Text; +using System.Text.RegularExpressions; using System.Threading; using OpenMetaverse; using Nini.Config; @@ -62,6 +63,7 @@ namespace OpenSim.Framework.Console new Dictionary(); private string m_UserName = String.Empty; private string m_Password = String.Empty; + private string m_AllowedOrigin = String.Empty; public RemoteConsole(string defaultPrompt) : base(defaultPrompt) { @@ -77,6 +79,7 @@ namespace OpenSim.Framework.Console m_UserName = netConfig.GetString("ConsoleUser", String.Empty); m_Password = netConfig.GetString("ConsolePass", String.Empty); + m_AllowedOrigin = netConfig.GetString("ConsoleAllowedOrigin", String.Empty); } public void SetServer(IHttpServer server) @@ -150,6 +153,29 @@ namespace OpenSim.Framework.Console return cmdinput; } + private Hashtable CheckOrigin(Hashtable result) + { + if (!string.IsNullOrEmpty(m_AllowedOrigin)) + result["access_control_allow_origin"] = m_AllowedOrigin; + return result; + } + /* TODO: Figure out how PollServiceHTTPHandler can access the request headers + * in order to use m_AllowedOrigin as a regular expression + private Hashtable CheckOrigin(Hashtable headers, Hashtable result) + { + if (!string.IsNullOrEmpty(m_AllowedOrigin)) + { + if (headers.ContainsKey("origin")) + { + string origin = headers["origin"].ToString(); + if (Regex.IsMatch(origin, m_AllowedOrigin)) + result["access_control_allow_origin"] = origin; + } + } + return result; + } + */ + private void DoExpire() { List expired = new List(); @@ -235,6 +261,7 @@ namespace OpenSim.Framework.Console reply["str_response_string"] = xmldoc.InnerXml; reply["int_response_code"] = 200; reply["content_type"] = "text/xml"; + reply = CheckOrigin(reply); return reply; } @@ -288,7 +315,8 @@ namespace OpenSim.Framework.Console reply["str_response_string"] = xmldoc.InnerXml; reply["int_response_code"] = 200; - reply["content_type"] = "text/plain"; + reply["content_type"] = "text/xml"; + reply = CheckOrigin(reply); return reply; } @@ -343,7 +371,8 @@ namespace OpenSim.Framework.Console reply["str_response_string"] = xmldoc.InnerXml; reply["int_response_code"] = 200; - reply["content_type"] = "text/plain"; + reply["content_type"] = "text/xml"; + reply = CheckOrigin(reply); return reply; } @@ -457,6 +486,7 @@ namespace OpenSim.Framework.Console result["content_type"] = "application/xml"; result["keepalive"] = false; result["reusecontext"] = false; + result = CheckOrigin(result); return result; } @@ -480,6 +510,7 @@ namespace OpenSim.Framework.Console result["content_type"] = "text/xml"; result["keepalive"] = false; result["reusecontext"] = false; + result = CheckOrigin(result); return result; } diff --git a/OpenSim/Framework/Constants.cs b/OpenSim/Framework/Constants.cs index 5757061efc..1b1aaf2bc4 100644 --- a/OpenSim/Framework/Constants.cs +++ b/OpenSim/Framework/Constants.cs @@ -83,7 +83,9 @@ namespace OpenSim.Framework /// Finished, Sim Changed FinishedViaNewSim = 1 << 28, /// Finished, Same Sim - FinishedViaSameSim = 1 << 29 + FinishedViaSameSim = 1 << 29, + /// Agent coming into the grid from another grid + ViaHGLogin = 1 << 30 } } diff --git a/OpenSim/Framework/GridConfig.cs b/OpenSim/Framework/GridConfig.cs deleted file mode 100644 index 3a43a14415..0000000000 --- a/OpenSim/Framework/GridConfig.cs +++ /dev/null @@ -1,162 +0,0 @@ -/* - * Copyright (c) Contributors, http://opensimulator.org/ - * See CONTRIBUTORS.TXT for a full list of copyright holders. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * * Neither the name of the OpenSimulator Project nor the - * names of its contributors may be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE DEVELOPERS ``AS IS'' AND ANY - * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED - * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL THE CONTRIBUTORS BE LIABLE FOR ANY - * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES - * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; - * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ - -using System; - -namespace OpenSim.Framework -{ - public class GridConfig:ConfigBase - { - public string AllowForcefulBanlines = "TRUE"; - public bool AllowRegionRegistration = true; - public string AssetRecvKey = String.Empty; - public string AssetSendKey = String.Empty; - - public string DatabaseProvider = String.Empty; - public string DatabaseConnect = String.Empty; - public string DefaultAssetServer = String.Empty; - public string DefaultUserServer = String.Empty; - public uint HttpPort = ConfigSettings.DefaultGridServerHttpPort; - public string SimRecvKey = String.Empty; - public string SimSendKey = String.Empty; - public string UserRecvKey = String.Empty; - public string UserSendKey = String.Empty; - public string ConsoleUser = String.Empty; - public string ConsolePass = String.Empty; - - public GridConfig(string description, string filename) - { - m_configMember = - new ConfigurationMember(filename, description, loadConfigurationOptions, handleIncomingConfiguration, true); - m_configMember.performConfigurationRetrieve(); - } - - public void loadConfigurationOptions() - { - m_configMember.addConfigurationOption("default_asset_server", - ConfigurationOption.ConfigurationTypes.TYPE_STRING_NOT_EMPTY, - "Default Asset Server URI", - "http://127.0.0.1:" + ConfigSettings.DefaultAssetServerHttpPort.ToString() + "/", - false); - m_configMember.addConfigurationOption("asset_send_key", ConfigurationOption.ConfigurationTypes.TYPE_STRING, - "Key to send to asset server", "null", false); - m_configMember.addConfigurationOption("asset_recv_key", ConfigurationOption.ConfigurationTypes.TYPE_STRING, - "Key to expect from asset server", "null", false); - - m_configMember.addConfigurationOption("default_user_server", - ConfigurationOption.ConfigurationTypes.TYPE_STRING_NOT_EMPTY, - "Default User Server URI", - "http://127.0.0.1:" + ConfigSettings.DefaultUserServerHttpPort.ToString() + "/", false); - m_configMember.addConfigurationOption("user_send_key", ConfigurationOption.ConfigurationTypes.TYPE_STRING, - "Key to send to user server", "null", false); - m_configMember.addConfigurationOption("user_recv_key", ConfigurationOption.ConfigurationTypes.TYPE_STRING, - "Key to expect from user server", "null", false); - - m_configMember.addConfigurationOption("sim_send_key", ConfigurationOption.ConfigurationTypes.TYPE_STRING, - "Key to send to a simulator", "null", false); - m_configMember.addConfigurationOption("sim_recv_key", ConfigurationOption.ConfigurationTypes.TYPE_STRING, - "Key to expect from a simulator", "null", false); - m_configMember.addConfigurationOption("database_provider", ConfigurationOption.ConfigurationTypes.TYPE_STRING, - "DLL for database provider", "OpenSim.Data.MySQL.dll", false); - m_configMember.addConfigurationOption("database_connect", ConfigurationOption.ConfigurationTypes.TYPE_STRING, - "Database connect string", "", false); - - m_configMember.addConfigurationOption("http_port", ConfigurationOption.ConfigurationTypes.TYPE_UINT32, - "Http Listener port", ConfigSettings.DefaultGridServerHttpPort.ToString(), false); - - m_configMember.addConfigurationOption("allow_forceful_banlines", - ConfigurationOption.ConfigurationTypes.TYPE_STRING, - "Allow Forceful Banlines", "TRUE", true); - - m_configMember.addConfigurationOption("allow_region_registration", - ConfigurationOption.ConfigurationTypes.TYPE_BOOLEAN, - "Allow regions to register immediately upon grid server startup? true/false", - "True", - false); - m_configMember.addConfigurationOption("console_user", ConfigurationOption.ConfigurationTypes.TYPE_STRING, - "Remote console access user name [Default: disabled]", "", false); - - m_configMember.addConfigurationOption("console_pass", ConfigurationOption.ConfigurationTypes.TYPE_STRING, - "Remote console access password [Default: disabled]", "", false); - - } - - public bool handleIncomingConfiguration(string configuration_key, object configuration_result) - { - switch (configuration_key) - { - case "default_asset_server": - DefaultAssetServer = (string) configuration_result; - break; - case "asset_send_key": - AssetSendKey = (string) configuration_result; - break; - case "asset_recv_key": - AssetRecvKey = (string) configuration_result; - break; - case "default_user_server": - DefaultUserServer = (string) configuration_result; - break; - case "user_send_key": - UserSendKey = (string) configuration_result; - break; - case "user_recv_key": - UserRecvKey = (string) configuration_result; - break; - case "sim_send_key": - SimSendKey = (string) configuration_result; - break; - case "sim_recv_key": - SimRecvKey = (string) configuration_result; - break; - case "database_provider": - DatabaseProvider = (string) configuration_result; - break; - case "database_connect": - DatabaseConnect = (string) configuration_result; - break; - case "http_port": - HttpPort = (uint) configuration_result; - break; - case "allow_forceful_banlines": - AllowForcefulBanlines = (string) configuration_result; - break; - case "allow_region_registration": - AllowRegionRegistration = (bool)configuration_result; - break; - case "console_user": - ConsoleUser = (string)configuration_result; - break; - case "console_pass": - ConsolePass = (string)configuration_result; - break; - } - - return true; - } - } -} diff --git a/OpenSim/Framework/HGNetworkServersInfo.cs b/OpenSim/Framework/HGNetworkServersInfo.cs deleted file mode 100644 index 08655764d1..0000000000 --- a/OpenSim/Framework/HGNetworkServersInfo.cs +++ /dev/null @@ -1,107 +0,0 @@ -/* - * Copyright (c) Contributors, http://opensimulator.org/ - * See CONTRIBUTORS.TXT for a full list of copyright holders. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * * Neither the name of the OpenSimulator Project nor the - * names of its contributors may be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE DEVELOPERS ``AS IS'' AND ANY - * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED - * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL THE CONTRIBUTORS BE LIABLE FOR ANY - * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES - * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; - * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ - -using System.Net; - -namespace OpenSim.Framework -{ - public class HGNetworkServersInfo - { - - public readonly string LocalAssetServerURI, LocalInventoryServerURI, LocalUserServerURI; - - private static HGNetworkServersInfo m_singleton; - public static HGNetworkServersInfo Singleton - { - get { return m_singleton; } - } - - public static void Init(string assetserver, string inventoryserver, string userserver) - { - m_singleton = new HGNetworkServersInfo(assetserver, inventoryserver, userserver); - - } - - private HGNetworkServersInfo(string a, string i, string u) - { - LocalAssetServerURI = ServerURI(a); - LocalInventoryServerURI = ServerURI(i); - LocalUserServerURI = ServerURI(u); - } - - public bool IsLocalUser(string userserver) - { - string userServerURI = ServerURI(userserver); - bool ret = (((userServerURI == null) || (userServerURI == "") || (userServerURI == LocalUserServerURI))); - //m_log.Debug("-------------> HGNetworkServersInfo.IsLocalUser? " + ret + "(userServer=" + userServerURI + "; localuserserver=" + LocalUserServerURI + ")"); - return ret; - } - - public bool IsLocalUser(UserProfileData userData) - { - if (userData != null) - { - if (userData is ForeignUserProfileData) - return IsLocalUser(((ForeignUserProfileData)userData).UserServerURI); - else - return true; - } - else - // Something fishy; ignore it - return true; - } - - public static string ServerURI(string uri) - { - // Get rid of eventual slashes at the end - try - { - if (uri.EndsWith("/")) - uri = uri.Substring(0, uri.Length - 1); - } - catch { } - - IPAddress ipaddr1 = null; - string port1 = ""; - try - { - ipaddr1 = Util.GetHostFromURL(uri); - } - catch { } - - try - { - port1 = uri.Split(new char[] { ':' })[2]; - } - catch { } - - // We tried our best to convert the domain names to IP addresses - return (ipaddr1 != null) ? "http://" + ipaddr1.ToString() + ":" + port1 : uri; - } - - } -} diff --git a/OpenSim/Framework/IClientAPI.cs b/OpenSim/Framework/IClientAPI.cs index fe0cf85b53..3bfe2ff1cf 100644 --- a/OpenSim/Framework/IClientAPI.cs +++ b/OpenSim/Framework/IClientAPI.cs @@ -44,7 +44,7 @@ namespace OpenSim.Framework public delegate void TextureRequest(Object sender, TextureRequestArgs e); - public delegate void AvatarNowWearing(Object sender, AvatarWearingArgs e); + public delegate void AvatarNowWearing(IClientAPI sender, AvatarWearingArgs e); public delegate void ImprovedInstantMessage(IClientAPI remoteclient, GridInstantMessage im); @@ -66,7 +66,7 @@ namespace OpenSim.Framework public delegate void NetworkStats(int inPackets, int outPackets, int unAckedBytes); - public delegate void SetAppearance(Primitive.TextureEntry textureEntry, byte[] visualParams); + public delegate void SetAppearance(IClientAPI remoteClient, Primitive.TextureEntry textureEntry, byte[] visualParams); public delegate void SetAppearanceRaw(IClientAPI sender, UUID agentID, byte[] vp, Primitive.TextureEntry te); public delegate void StartAnim(IClientAPI remoteClient, UUID animID); @@ -718,7 +718,7 @@ namespace OpenSim.Framework event TeleportLandmarkRequest OnTeleportLandmarkRequest; event DeRezObject OnDeRezObject; event Action OnRegionHandShakeReply; - event GenericCall2 OnRequestWearables; + event GenericCall1 OnRequestWearables; event GenericCall1 OnCompleteMovementToRegion; event UpdateAgent OnPreAgentUpdate; event UpdateAgent OnAgentUpdate; @@ -1019,7 +1019,9 @@ namespace OpenSim.Framework uint flags, string capsURL); void SendTeleportFailed(string reason); - void SendTeleportLocationStart(); + void SendTeleportStart(uint flags); + void SendTeleportProgress(uint flags, string message); + void SendMoneyBalance(UUID transaction, bool success, byte[] description, int balance); void SendPayPrice(UUID objectID, int[] payPrice); diff --git a/OpenSim/Framework/ISceneObject.cs b/OpenSim/Framework/ISceneObject.cs index 51479014cd..18631f17b1 100644 --- a/OpenSim/Framework/ISceneObject.cs +++ b/OpenSim/Framework/ISceneObject.cs @@ -39,5 +39,6 @@ namespace OpenSim.Framework void ExtraFromXmlString(string xmlstr); string GetStateSnapshot(); void SetState(string xmlstr, IScene s); + bool HasGroupChanged { get; set; } } } diff --git a/OpenSim/Framework/InventoryItemBase.cs b/OpenSim/Framework/InventoryItemBase.cs index aeb01e2493..a663680a78 100644 --- a/OpenSim/Framework/InventoryItemBase.cs +++ b/OpenSim/Framework/InventoryItemBase.cs @@ -117,6 +117,56 @@ namespace OpenSim.Framework } protected UUID m_creatorIdAsUuid = UUID.Zero; + protected string m_creatorData = string.Empty; + public string CreatorData // = ; + { + get { return m_creatorData; } + set { m_creatorData = value; } + } + + /// + /// Used by the DB layer to retrieve / store the entire user identification. + /// The identification can either be a simple UUID or a string of the form + /// uuid[;profile_url[;name]] + /// + public string CreatorIdentification + { + get + { + if (m_creatorData != null && m_creatorData != string.Empty) + return m_creatorId + ';' + m_creatorData; + else + return m_creatorId; + } + set + { + if ((value == null) || (value != null && value == string.Empty)) + { + m_creatorData = string.Empty; + return; + } + + if (!value.Contains(";")) // plain UUID + { + m_creatorId = value; + } + else // [;[;name]] + { + string name = "Unknown User"; + string[] parts = value.Split(';'); + if (parts.Length >= 1) + m_creatorId = parts[0]; + if (parts.Length >= 2) + m_creatorData = parts[1]; + if (parts.Length >= 3) + name = parts[2]; + + m_creatorData += ';' + name; + + } + } + } + /// /// The description of the inventory item (must be less than 64 characters) /// diff --git a/OpenSim/Framework/LandData.cs b/OpenSim/Framework/LandData.cs index 060e88696a..accf52ec44 100644 --- a/OpenSim/Framework/LandData.cs +++ b/OpenSim/Framework/LandData.cs @@ -88,8 +88,79 @@ namespace OpenSim.Framework private UUID _snapshotID = UUID.Zero; private Vector3 _userLocation = new Vector3(); private Vector3 _userLookAt = new Vector3(); - private int _dwell = 0; private int _otherCleanTime = 0; + private string _mediaType = "none/none"; + private string _mediaDescription = ""; + private int _mediaHeight = 0; + private int _mediaWidth = 0; + private bool _mediaLoop = false; + private bool _obscureMusic = false; + private bool _obscureMedia = false; + + /// + /// Whether to obscure parcel media URL + /// + [XmlIgnore] + public bool ObscureMedia { + get { + return _obscureMedia; + } + set { + _obscureMedia = value; + } + } + + /// + /// Whether to obscure parcel music URL + /// + [XmlIgnore] + public bool ObscureMusic { + get { + return _obscureMusic; + } + set { + _obscureMusic = value; + } + } + + /// + /// Whether to loop parcel media + /// + [XmlIgnore] + public bool MediaLoop { + get { + return _mediaLoop; + } + set { + _mediaLoop = value; + } + } + + /// + /// Height of parcel media render + /// + [XmlIgnore] + public int MediaHeight { + get { + return _mediaHeight; + } + set { + _mediaHeight = value; + } + } + + /// + /// Width of parcel media render + /// + [XmlIgnore] + public int MediaWidth { + get { + return _mediaWidth; + } + set { + _mediaWidth = value; + } + } /// /// Upper corner of the AABB for the parcel @@ -358,20 +429,6 @@ namespace OpenSim.Framework } } - private int[] _mediaSize = new int[2]; - public int[] MediaSize - { - get - { - return _mediaSize; - } - set - { - _mediaSize = value; - } - } - - private string _mediaType = ""; public string MediaType { get @@ -561,18 +618,6 @@ namespace OpenSim.Framework } } - /// - /// Deprecated idea. Number of visitors ~= free money - /// - public int Dwell { - get { - return _dwell; - } - set { - _dwell = value; - } - } - /// /// Number of minutes to return SceneObjectGroup that are owned by someone who doesn't own /// the parcel and isn't set to the same 'group' as the parcel. @@ -586,6 +631,17 @@ namespace OpenSim.Framework } } + /// + /// parcel media description + /// + public string MediaDescription { + get { + return _mediaDescription; + } + set { + _mediaDescription = value; + } + } public LandData() { @@ -634,7 +690,13 @@ namespace OpenSim.Framework landData._userLocation = _userLocation; landData._userLookAt = _userLookAt; landData._otherCleanTime = _otherCleanTime; - landData._dwell = _dwell; + landData._mediaType = _mediaType; + landData._mediaDescription = _mediaDescription; + landData._mediaWidth = _mediaWidth; + landData._mediaHeight = _mediaHeight; + landData._mediaLoop = _mediaLoop; + landData._obscureMusic = _obscureMusic; + landData._obscureMedia = _obscureMedia; landData._parcelAccessList.Clear(); foreach (ParcelManager.ParcelAccessEntry entry in _parcelAccessList) diff --git a/OpenSim/Framework/LandUpdateArgs.cs b/OpenSim/Framework/LandUpdateArgs.cs index 9760a1d328..7d6c4f2dab 100644 --- a/OpenSim/Framework/LandUpdateArgs.cs +++ b/OpenSim/Framework/LandUpdateArgs.cs @@ -49,5 +49,12 @@ namespace OpenSim.Framework public UUID SnapshotID; public Vector3 UserLocation; public Vector3 UserLookAt; + public string MediaType; + public string MediaDescription; + public int MediaHeight; + public int MediaWidth; + public bool MediaLoop; + public bool ObscureMusic; + public bool ObscureMedia; } } diff --git a/OpenSim/Framework/Lazy.cs b/OpenSim/Framework/Lazy.cs index 8a417ac64b..91de4bdd1d 100644 --- a/OpenSim/Framework/Lazy.cs +++ b/OpenSim/Framework/Lazy.cs @@ -1,4 +1,4 @@ -// +// // Lazy.cs // // Authors: diff --git a/OpenSim/Framework/MainServer.cs b/OpenSim/Framework/MainServer.cs index 1f5f2088fc..0515b166e2 100644 --- a/OpenSim/Framework/MainServer.cs +++ b/OpenSim/Framework/MainServer.cs @@ -27,6 +27,7 @@ using System.Collections.Generic; using System.Reflection; +using System.Net; using log4net; using OpenSim.Framework.Servers.HttpServer; @@ -35,7 +36,7 @@ namespace OpenSim.Framework public class MainServer { private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); - + private static BaseHttpServer instance = null; private static Dictionary m_Servers = new Dictionary(); @@ -47,6 +48,11 @@ namespace OpenSim.Framework } public static IHttpServer GetHttpServer(uint port) + { + return GetHttpServer(port,null); + } + + public static IHttpServer GetHttpServer(uint port, IPAddress ipaddr) { if (port == 0) return Instance; @@ -58,6 +64,9 @@ namespace OpenSim.Framework m_Servers[port] = new BaseHttpServer(port); + if (ipaddr != null) + m_Servers[port].ListenIPAddress = ipaddr; + m_log.InfoFormat("[MAIN HTTP SERVER]: Starting main http server on port {0}", port); m_Servers[port].Start(); diff --git a/OpenSim/Framework/MapAndArray.cs b/OpenSim/Framework/MapAndArray.cs new file mode 100644 index 0000000000..c98d3ccd6f --- /dev/null +++ b/OpenSim/Framework/MapAndArray.cs @@ -0,0 +1,189 @@ +/* + * Copyright (c) Contributors, http://opensimulator.org/ + * See CONTRIBUTORS.TXT for a full list of copyright holders. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * * Neither the name of the OpenSimulator Project nor the + * names of its contributors may be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE DEVELOPERS ``AS IS'' AND ANY + * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED + * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + * DISCLAIMED. IN NO EVENT SHALL THE CONTRIBUTORS BE LIABLE FOR ANY + * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES + * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND + * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS + * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +using System; +using System.Collections.Generic; + +namespace OpenSim.Framework +{ + /// + /// Stores two synchronized collections: a mutable dictionary and an + /// immutable array. Slower inserts/removes than a normal dictionary, + /// but provides safe iteration while maintaining fast hash lookups + /// + /// Key type to use for hash lookups + /// Value type to store + public sealed class MapAndArray + { + private Dictionary m_dict; + private TValue[] m_array; + private object m_syncRoot = new object(); + + /// Number of values currently stored in the collection + public int Count { get { return m_array.Length; } } + /// NOTE: This collection is thread safe. You do not need to + /// acquire a lock to add, remove, or enumerate entries. This + /// synchronization object should only be locked for larger + /// transactions + public object SyncRoot { get { return m_syncRoot; } } + + /// + /// Constructor + /// + public MapAndArray() + { + m_dict = new Dictionary(); + m_array = new TValue[0]; + } + + /// + /// Constructor + /// + /// Initial capacity of the dictionary + public MapAndArray(int capacity) + { + m_dict = new Dictionary(capacity); + m_array = new TValue[0]; + } + + /// + /// Adds a key/value pair to the collection, or updates an existing key + /// with a new value + /// + /// Key to add or update + /// Value to add + /// True if a new key was added, false if an existing key was + /// updated + public bool AddOrReplace(TKey key, TValue value) + { + lock (m_syncRoot) + { + bool containedKey = m_dict.ContainsKey(key); + + m_dict[key] = value; + CreateArray(); + + return !containedKey; + } + } + + /// + /// Adds a key/value pair to the collection. This will throw an + /// exception if the key is already present in the collection + /// + /// Key to add or update + /// Value to add + /// Index of the inserted item + public int Add(TKey key, TValue value) + { + lock (m_syncRoot) + { + m_dict.Add(key, value); + CreateArray(); + return m_array.Length; + } + } + + /// + /// Removes a key/value pair from the collection + /// + /// Key to remove + /// True if the key was found and removed, otherwise false + public bool Remove(TKey key) + { + lock (m_syncRoot) + { + bool removed = m_dict.Remove(key); + CreateArray(); + + return removed; + } + } + + /// + /// Determines whether the collections contains a specified key + /// + /// Key to search for + /// True if the key was found, otherwise false + public bool ContainsKey(TKey key) + { + lock (m_syncRoot) + return m_dict.ContainsKey(key); + } + + /// + /// Gets the value associated with the specified key + /// + /// Key of the value to get + /// Will contain the value associated with the + /// given key if the key is found. If the key is not found it will + /// contain the default value for the type of the value parameter + /// True if the key was found and a value was retrieved, + /// otherwise false + public bool TryGetValue(TKey key, out TValue value) + { + lock (m_syncRoot) + return m_dict.TryGetValue(key, out value); + } + + /// + /// Clears all key/value pairs from the collection + /// + public void Clear() + { + lock (m_syncRoot) + { + m_dict = new Dictionary(); + m_array = new TValue[0]; + } + } + + /// + /// Gets a reference to the immutable array of values stored in this + /// collection. This array is thread safe for iteration + /// + /// A thread safe reference ton an array of all of the stored + /// values + public TValue[] GetArray() + { + return m_array; + } + + private void CreateArray() + { + // Rebuild the array from the dictionary. This method must be + // called from inside a lock + TValue[] array = new TValue[m_dict.Count]; + int i = 0; + + foreach (TValue value in m_dict.Values) + array[i++] = value; + + m_array = array; + } + } +} diff --git a/OpenSim/Framework/MessageServerConfig.cs b/OpenSim/Framework/MessageServerConfig.cs deleted file mode 100644 index 884c0eab23..0000000000 --- a/OpenSim/Framework/MessageServerConfig.cs +++ /dev/null @@ -1,152 +0,0 @@ -/* - * Copyright (c) Contributors, http://opensimulator.org/ - * See CONTRIBUTORS.TXT for a full list of copyright holders. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * * Neither the name of the OpenSimulator Project nor the - * names of its contributors may be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE DEVELOPERS ``AS IS'' AND ANY - * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED - * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL THE CONTRIBUTORS BE LIABLE FOR ANY - * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES - * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; - * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ - -using System; - -namespace OpenSim.Framework -{ - /// - /// Message Server Config - Configuration of the Message Server - /// - public class MessageServerConfig:ConfigBase - { - public string DatabaseProvider = String.Empty; - public string DatabaseConnect = String.Empty; - public string GridCommsProvider = String.Empty; - public string GridRecvKey = String.Empty; - public string GridSendKey = String.Empty; - public string GridServerURL = String.Empty; - public uint HttpPort = ConfigSettings.DefaultMessageServerHttpPort; - public bool HttpSSL = ConfigSettings.DefaultMessageServerHttpSSL; - public string MessageServerIP = String.Empty; - public string UserRecvKey = String.Empty; - public string UserSendKey = String.Empty; - public string UserServerURL = String.Empty; - public string ConsoleUser = String.Empty; - public string ConsolePass = String.Empty; - - public MessageServerConfig(string description, string filename) - { - m_configMember = - new ConfigurationMember(filename, description, loadConfigurationOptions, handleIncomingConfiguration, true); - m_configMember.performConfigurationRetrieve(); - } - - public void loadConfigurationOptions() - { - m_configMember.addConfigurationOption("default_user_server", - ConfigurationOption.ConfigurationTypes.TYPE_STRING_NOT_EMPTY, - "Default User Server URI", - "http://127.0.0.1:" + ConfigSettings.DefaultUserServerHttpPort.ToString() + "/", false); - m_configMember.addConfigurationOption("user_send_key", ConfigurationOption.ConfigurationTypes.TYPE_STRING, - "Key to send to user server", "null", false); - m_configMember.addConfigurationOption("user_recv_key", ConfigurationOption.ConfigurationTypes.TYPE_STRING, - "Key to expect from user server", "null", false); - m_configMember.addConfigurationOption("default_grid_server", - ConfigurationOption.ConfigurationTypes.TYPE_STRING_NOT_EMPTY, - "Default Grid Server URI", - "http://127.0.0.1:" + ConfigSettings.DefaultGridServerHttpPort.ToString() + "/", false); - m_configMember.addConfigurationOption("grid_send_key", ConfigurationOption.ConfigurationTypes.TYPE_STRING, - "Key to send to grid server", "null", false); - m_configMember.addConfigurationOption("grid_recv_key", ConfigurationOption.ConfigurationTypes.TYPE_STRING, - "Key to expect from grid server", "null", false); - - m_configMember.addConfigurationOption("database_connect", ConfigurationOption.ConfigurationTypes.TYPE_STRING, - "Connection String for Database", "", false); - - m_configMember.addConfigurationOption("database_provider", ConfigurationOption.ConfigurationTypes.TYPE_STRING, - "DLL for database provider", "OpenSim.Data.MySQL.dll", false); - - m_configMember.addConfigurationOption("region_comms_provider", ConfigurationOption.ConfigurationTypes.TYPE_STRING, - "DLL for comms provider", "OpenSim.Region.Communications.OGS1.dll", false); - - m_configMember.addConfigurationOption("http_port", ConfigurationOption.ConfigurationTypes.TYPE_UINT32, - "Http Listener port", ConfigSettings.DefaultMessageServerHttpPort.ToString(), false); - m_configMember.addConfigurationOption("http_ssl", ConfigurationOption.ConfigurationTypes.TYPE_BOOLEAN, - "Use SSL? true/false", ConfigSettings.DefaultMessageServerHttpSSL.ToString(), false); - m_configMember.addConfigurationOption("published_ip", ConfigurationOption.ConfigurationTypes.TYPE_STRING, - "My Published IP Address", "127.0.0.1", false); - m_configMember.addConfigurationOption("console_user", ConfigurationOption.ConfigurationTypes.TYPE_STRING, - "Remote console access user name [Default: disabled]", "", false); - - m_configMember.addConfigurationOption("console_pass", ConfigurationOption.ConfigurationTypes.TYPE_STRING, - "Remote console access password [Default: disabled]", "", false); - - } - - public bool handleIncomingConfiguration(string configuration_key, object configuration_result) - { - switch (configuration_key) - { - case "default_user_server": - UserServerURL = (string) configuration_result; - break; - case "user_send_key": - UserSendKey = (string) configuration_result; - break; - case "user_recv_key": - UserRecvKey = (string) configuration_result; - break; - case "default_grid_server": - GridServerURL = (string) configuration_result; - break; - case "grid_send_key": - GridSendKey = (string) configuration_result; - break; - case "grid_recv_key": - GridRecvKey = (string) configuration_result; - break; - case "database_provider": - DatabaseProvider = (string) configuration_result; - break; - case "database_connect": - DatabaseConnect = (string)configuration_result; - break; - case "http_port": - HttpPort = (uint) configuration_result; - break; - case "http_ssl": - HttpSSL = (bool) configuration_result; - break; - case "region_comms_provider": - GridCommsProvider = (string) configuration_result; - break; - case "published_ip": - MessageServerIP = (string) configuration_result; - break; - case "console_user": - ConsoleUser = (string)configuration_result; - break; - case "console_pass": - ConsolePass = (string)configuration_result; - break; - } - - return true; - } - } -} diff --git a/OpenSim/Framework/NetworkUtil.cs b/OpenSim/Framework/NetworkUtil.cs index 5fe343d059..2e94b0d5b4 100644 --- a/OpenSim/Framework/NetworkUtil.cs +++ b/OpenSim/Framework/NetworkUtil.cs @@ -31,6 +31,7 @@ using System.Net.Sockets; using System.Net; using System.Net.NetworkInformation; using System.Reflection; +using System.Text; using log4net; namespace OpenSim.Framework @@ -244,5 +245,6 @@ namespace OpenSim.Framework } return defaultHostname; } + } } diff --git a/OpenSim/Framework/PrimitiveBaseShape.cs b/OpenSim/Framework/PrimitiveBaseShape.cs index 4d1de22eeb..927415e850 100644 --- a/OpenSim/Framework/PrimitiveBaseShape.cs +++ b/OpenSim/Framework/PrimitiveBaseShape.cs @@ -26,12 +26,17 @@ */ using System; +using System.Collections.Generic; using System.Drawing; using System.Drawing.Imaging; +using System.IO; using System.Reflection; +using System.Xml; +using System.Xml.Schema; using System.Xml.Serialization; using log4net; using OpenMetaverse; +using OpenMetaverse.StructuredData; namespace OpenSim.Framework { @@ -131,6 +136,13 @@ namespace OpenSim.Framework [XmlIgnore] private bool _lightEntry; [XmlIgnore] private bool _sculptEntry; + // Light Projection Filter + [XmlIgnore] private bool _projectionEntry; + [XmlIgnore] private UUID _projectionTextureID; + [XmlIgnore] private float _projectionFOV; + [XmlIgnore] private float _projectionFocus; + [XmlIgnore] private float _projectionAmb; + public byte ProfileCurve { get { return (byte)((byte)HollowShape | (byte)ProfileShape); } @@ -171,6 +183,13 @@ namespace OpenSim.Framework } } + /// + /// Entries to store media textures on each face + /// + /// Do not change this value directly - always do it through an IMoapModule. + /// Lock before manipulating. + public MediaList Media { get; set; } + public PrimitiveBaseShape() { PCode = (byte) PCodeEnum.Primitive; @@ -783,11 +802,57 @@ namespace OpenSim.Framework } } + public bool ProjectionEntry { + get { + return _projectionEntry; + } + set { + _projectionEntry = value; + } + } + + public UUID ProjectionTextureUUID { + get { + return _projectionTextureID; + } + set { + _projectionTextureID = value; + } + } + + public float ProjectionFOV { + get { + return _projectionFOV; + } + set { + _projectionFOV = value; + } + } + + public float ProjectionFocus { + get { + return _projectionFocus; + } + set { + _projectionFocus = value; + } + } + + public float ProjectionAmbiance { + get { + return _projectionAmb; + } + set { + _projectionAmb = value; + } + } + public byte[] ExtraParamsToBytes() { ushort FlexiEP = 0x10; ushort LightEP = 0x20; ushort SculptEP = 0x30; + ushort ProjectionEP = 0x40; int i = 0; uint TotalBytesLength = 1; // ExtraParamsNum @@ -811,6 +876,12 @@ namespace OpenSim.Framework TotalBytesLength += 17;// data TotalBytesLength += 2 + 4; // type } + if (_projectionEntry) + { + ExtraParamsNum++; + TotalBytesLength += 28;// data + TotalBytesLength += 2 + 4;// type + } byte[] returnbytes = new byte[TotalBytesLength]; @@ -862,8 +933,20 @@ namespace OpenSim.Framework Array.Copy(SculptData, 0, returnbytes, i, SculptData.Length); i += SculptData.Length; } + if (_projectionEntry) + { + byte[] ProjectionData = GetProjectionBytes(); - if (!_flexiEntry && !_lightEntry && !_sculptEntry) + returnbytes[i++] = (byte)(ProjectionEP % 256); + returnbytes[i++] = (byte)((ProjectionEP >> 8) % 256); + returnbytes[i++] = (byte)((ProjectionData.Length) % 256); + returnbytes[i++] = (byte)((ProjectionData.Length >> 16) % 256); + returnbytes[i++] = (byte)((ProjectionData.Length >> 20) % 256); + returnbytes[i++] = (byte)((ProjectionData.Length >> 24) % 256); + Array.Copy(ProjectionData, 0, returnbytes, i, ProjectionData.Length); + i += ProjectionData.Length; + } + if (!_flexiEntry && !_lightEntry && !_sculptEntry && !_projectionEntry) { byte[] returnbyte = new byte[1]; returnbyte[0] = 0; @@ -881,6 +964,7 @@ namespace OpenSim.Framework const ushort FlexiEP = 0x10; const ushort LightEP = 0x20; const ushort SculptEP = 0x30; + const ushort ProjectionEP = 0x40; switch (type) { @@ -910,6 +994,14 @@ namespace OpenSim.Framework } ReadSculptData(data, 0); break; + case ProjectionEP: + if (!inUse) + { + _projectionEntry = false; + return; + } + ReadProjectionData(data, 0); + break; } } @@ -921,10 +1013,12 @@ namespace OpenSim.Framework const ushort FlexiEP = 0x10; const ushort LightEP = 0x20; const ushort SculptEP = 0x30; + const ushort ProjectionEP = 0x40; bool lGotFlexi = false; bool lGotLight = false; bool lGotSculpt = false; + bool lGotFilter = false; int i = 0; byte extraParamCount = 0; @@ -961,6 +1055,11 @@ namespace OpenSim.Framework i += 17; lGotSculpt = true; break; + case ProjectionEP: + ReadProjectionData(data, i); + i += 28; + lGotFilter = true; + break; } } @@ -970,6 +1069,8 @@ namespace OpenSim.Framework _lightEntry = false; if (!lGotSculpt) _sculptEntry = false; + if (!lGotFilter) + _projectionEntry = false; } @@ -1109,6 +1210,42 @@ namespace OpenSim.Framework return data; } + public void ReadProjectionData(byte[] data, int pos) + { + byte[] ProjectionTextureUUID = new byte[16]; + + if (data.Length - pos >= 28) + { + _projectionEntry = true; + Array.Copy(data, pos, ProjectionTextureUUID,0, 16); + _projectionTextureID = new UUID(ProjectionTextureUUID, 0); + + _projectionFOV = Utils.BytesToFloat(data, pos + 16); + _projectionFocus = Utils.BytesToFloat(data, pos + 20); + _projectionAmb = Utils.BytesToFloat(data, pos + 24); + } + else + { + _projectionEntry = false; + _projectionTextureID = UUID.Zero; + _projectionFOV = 0f; + _projectionFocus = 0f; + _projectionAmb = 0f; + } + } + + public byte[] GetProjectionBytes() + { + byte[] data = new byte[28]; + + _projectionTextureID.GetBytes().CopyTo(data, 0); + Utils.FloatToBytes(_projectionFOV).CopyTo(data, 16); + Utils.FloatToBytes(_projectionFocus).CopyTo(data, 20); + Utils.FloatToBytes(_projectionAmb).CopyTo(data, 24); + + return data; + } + /// /// Creates a OpenMetaverse.Primitive and populates it with converted PrimitiveBaseShape values @@ -1204,8 +1341,107 @@ namespace OpenSim.Framework prim.Properties.Permissions = new Permissions(); prim.Properties.SalePrice = 10; prim.Properties.SaleType = new SaleType(); - + return prim; } + + /// + /// Encapsulates a list of media entries. + /// + /// This class is necessary because we want to replace auto-serialization of MediaEntry with something more + /// OSD like and less vulnerable to change. + public class MediaList : List, IXmlSerializable + { + public const string MEDIA_TEXTURE_TYPE = "sl"; + + public MediaList() : base() {} + public MediaList(IEnumerable collection) : base(collection) {} + public MediaList(int capacity) : base(capacity) {} + + public XmlSchema GetSchema() + { + return null; + } + + public string ToXml() + { + lock (this) + { + using (StringWriter sw = new StringWriter()) + { + using (XmlTextWriter xtw = new XmlTextWriter(sw)) + { + xtw.WriteStartElement("OSMedia"); + xtw.WriteAttributeString("type", MEDIA_TEXTURE_TYPE); + xtw.WriteAttributeString("version", "0.1"); + + OSDArray meArray = new OSDArray(); + foreach (MediaEntry me in this) + { + OSD osd = (null == me ? new OSD() : me.GetOSD()); + meArray.Add(osd); + } + + xtw.WriteStartElement("OSData"); + xtw.WriteRaw(OSDParser.SerializeLLSDXmlString(meArray)); + xtw.WriteEndElement(); + + xtw.WriteEndElement(); + + xtw.Flush(); + return sw.ToString(); + } + } + } + } + + public void WriteXml(XmlWriter writer) + { + writer.WriteRaw(ToXml()); + } + + public static MediaList FromXml(string rawXml) + { + MediaList ml = new MediaList(); + ml.ReadXml(rawXml); + return ml; + } + + public void ReadXml(string rawXml) + { + using (StringReader sr = new StringReader(rawXml)) + { + using (XmlTextReader xtr = new XmlTextReader(sr)) + { + xtr.MoveToContent(); + + string type = xtr.GetAttribute("type"); + //m_log.DebugFormat("[MOAP]: Loaded media texture entry with type {0}", type); + + if (type != MEDIA_TEXTURE_TYPE) + return; + + xtr.ReadStartElement("OSMedia"); + + OSDArray osdMeArray = (OSDArray)OSDParser.DeserializeLLSDXml(xtr.ReadInnerXml()); + foreach (OSD osdMe in osdMeArray) + { + MediaEntry me = (osdMe is OSDMap ? MediaEntry.FromOSD(osdMe) : new MediaEntry()); + Add(me); + } + + xtr.ReadEndElement(); + } + } + } + + public void ReadXml(XmlReader reader) + { + if (reader.IsEmptyElement) + return; + + ReadXml(reader.ReadInnerXml()); + } + } } } diff --git a/OpenSim/Framework/RegionInfo.cs b/OpenSim/Framework/RegionInfo.cs index afc4060044..176a523146 100644 --- a/OpenSim/Framework/RegionInfo.cs +++ b/OpenSim/Framework/RegionInfo.cs @@ -42,6 +42,7 @@ namespace OpenSim.Framework { public class RegionLightShareData : ICloneable { + public bool valid = false; public UUID regionID = UUID.Zero; public Vector3 waterColor = new Vector3(4.0f,38.0f,64.0f); public float waterFogDensityExponent = 4.0f; @@ -97,9 +98,9 @@ namespace OpenSim.Framework [Serializable] public class SimpleRegionInfo - { + { // private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); - + /// /// The port by which http communication occurs with the region (most noticeably, CAPS communication) /// @@ -344,7 +345,7 @@ namespace OpenSim.Framework public string proxyUrl = ""; public int ProxyOffset = 0; public string regionSecret = UUID.Random().ToString(); - + public string osSecret; public UUID lastMapUUID = UUID.Zero; @@ -393,7 +394,7 @@ namespace OpenSim.Framework if (!File.Exists(filename)) // New region config request { IniConfigSource newFile = new IniConfigSource(); - ReadNiniConfig(newFile, String.Empty); + ReadNiniConfig(newFile, configName); newFile.Save(filename); @@ -699,7 +700,7 @@ namespace OpenSim.Framework RegionID = new UUID(regionUUID); originRegionID = RegionID; // What IS this?! - + RegionName = name; string location = config.GetString("Location", String.Empty); @@ -720,7 +721,7 @@ namespace OpenSim.Framework // Internal IP IPAddress address; - + if (config.Contains("InternalAddress")) { address = IPAddress.Parse(config.GetString("InternalAddress", String.Empty)); @@ -774,7 +775,7 @@ namespace OpenSim.Framework { m_externalHostName = Util.GetLocalHost().ToString(); m_log.InfoFormat( - "[REGIONINFO]: Resolving SYSTEMIP to {0} for external hostname of region {1}", + "[REGIONINFO]: Resolving SYSTEMIP to {0} for external hostname of region {1}", m_externalHostName, name); } else @@ -805,7 +806,7 @@ namespace OpenSim.Framework IConfig config = source.Configs[RegionName]; if (config != null) - source.Configs.Remove(RegionName); + source.Configs.Remove(config); config = source.AddConfig(RegionName); @@ -864,10 +865,15 @@ namespace OpenSim.Framework return; } - configMember = new ConfigurationMember(filename, description, loadConfigurationOptionsFromMe, - ignoreIncomingConfiguration, false); - configMember.performConfigurationRetrieve(); - RegionFile = filename; + else if (filename.ToLower().EndsWith(".xml")) + { + configMember = new ConfigurationMember(filename, description, loadConfigurationOptionsFromMe, + ignoreIncomingConfiguration, false); + configMember.performConfigurationRetrieve(); + RegionFile = filename; + } + else + throw new Exception("Invalid file type for region persistence."); } public void loadConfigurationOptionsFromMe() @@ -904,16 +910,16 @@ namespace OpenSim.Framework configMember.addConfigurationOption("nonphysical_prim_max", ConfigurationOption.ConfigurationTypes.TYPE_INT32, "Maximum size for nonphysical prims", m_nonphysPrimMax.ToString(), true); - + configMember.addConfigurationOption("physical_prim_max", ConfigurationOption.ConfigurationTypes.TYPE_INT32, "Maximum size for physical prims", m_physPrimMax.ToString(), true); - + configMember.addConfigurationOption("clamp_prim_size", ConfigurationOption.ConfigurationTypes.TYPE_BOOLEAN, "Clamp prims to max size", m_clampPrimSize.ToString(), true); - + configMember.addConfigurationOption("object_capacity", ConfigurationOption.ConfigurationTypes.TYPE_INT32, "Max objects this sim will hold", m_objectCapacity.ToString(), true); - + configMember.addConfigurationOption("scope_id", ConfigurationOption.ConfigurationTypes.TYPE_UUID, "Scope ID for this region", ScopeID.ToString(), true); @@ -951,16 +957,16 @@ namespace OpenSim.Framework configMember.addConfigurationOption("lastmap_refresh", ConfigurationOption.ConfigurationTypes.TYPE_STRING_NOT_EMPTY, "Last Map Refresh", Util.UnixTimeSinceEpoch().ToString(), true); - + configMember.addConfigurationOption("nonphysical_prim_max", ConfigurationOption.ConfigurationTypes.TYPE_INT32, "Maximum size for nonphysical prims", "0", true); - + configMember.addConfigurationOption("physical_prim_max", ConfigurationOption.ConfigurationTypes.TYPE_INT32, "Maximum size for physical prims", "0", true); - + configMember.addConfigurationOption("clamp_prim_size", ConfigurationOption.ConfigurationTypes.TYPE_BOOLEAN, "Clamp prims to max size", "false", true); - + configMember.addConfigurationOption("object_capacity", ConfigurationOption.ConfigurationTypes.TYPE_INT32, "Max objects this sim will hold", "0", true); diff --git a/OpenSim/Framework/RegionInfoForEstateMenuArgs.cs b/OpenSim/Framework/RegionInfoForEstateMenuArgs.cs index fee3126978..f274da2e7a 100644 --- a/OpenSim/Framework/RegionInfoForEstateMenuArgs.cs +++ b/OpenSim/Framework/RegionInfoForEstateMenuArgs.cs @@ -47,5 +47,6 @@ namespace OpenSim.Framework public bool useEstateSun; public float waterHeight; public string simName; + public string regionType; } -} \ No newline at end of file +} diff --git a/OpenSim/Framework/RegionSettings.cs b/OpenSim/Framework/RegionSettings.cs index 8d1212bbbc..673cf203f8 100644 --- a/OpenSim/Framework/RegionSettings.cs +++ b/OpenSim/Framework/RegionSettings.cs @@ -33,8 +33,6 @@ namespace OpenSim.Framework { public class RegionSettings { - private ConfigurationMember configMember; - public delegate void SaveDelegate(RegionSettings rs); public event SaveDelegate OnSave; @@ -47,202 +45,6 @@ namespace OpenSim.Framework public static readonly UUID DEFAULT_TERRAIN_TEXTURE_3 = new UUID("179cdabd-398a-9b6b-1391-4dc333ba321f"); public static readonly UUID DEFAULT_TERRAIN_TEXTURE_4 = new UUID("beb169c7-11ea-fff2-efe5-0f24dc881df2"); - public RegionSettings() - { - if (configMember == null) - { - try - { - configMember = new ConfigurationMember(Path.Combine(Util.configDir(), "estate_settings.xml"), "ESTATE SETTINGS", LoadConfigurationOptions, HandleIncomingConfiguration, true); - configMember.performConfigurationRetrieve(); - } - catch (Exception) - { - } - } - } - - public void LoadConfigurationOptions() - { - configMember.addConfigurationOption("region_flags", - ConfigurationOption.ConfigurationTypes.TYPE_UINT32, - String.Empty, "336723974", true); - - configMember.addConfigurationOption("max_agents", - ConfigurationOption.ConfigurationTypes.TYPE_INT32, - String.Empty, "40", true); - - configMember.addConfigurationOption("object_bonus_factor", - ConfigurationOption.ConfigurationTypes.TYPE_DOUBLE, - String.Empty, "1.0", true); - - configMember.addConfigurationOption("sim_access", - ConfigurationOption.ConfigurationTypes.TYPE_INT32, - String.Empty, "21", true); - - configMember.addConfigurationOption("terrain_base_0", - ConfigurationOption.ConfigurationTypes.TYPE_UUID, - String.Empty, DEFAULT_TERRAIN_TEXTURE_1.ToString(), true); - - configMember.addConfigurationOption("terrain_base_1", - ConfigurationOption.ConfigurationTypes.TYPE_UUID, - String.Empty, DEFAULT_TERRAIN_TEXTURE_2.ToString(), true); - - configMember.addConfigurationOption("terrain_base_2", - ConfigurationOption.ConfigurationTypes.TYPE_UUID, - String.Empty, DEFAULT_TERRAIN_TEXTURE_3.ToString(), true); - - configMember.addConfigurationOption("terrain_base_3", - ConfigurationOption.ConfigurationTypes.TYPE_UUID, - String.Empty, DEFAULT_TERRAIN_TEXTURE_4.ToString(), true); - - configMember.addConfigurationOption("terrain_start_height_0", - ConfigurationOption.ConfigurationTypes.TYPE_DOUBLE, - String.Empty, "10.0", true); - - configMember.addConfigurationOption("terrain_start_height_1", - ConfigurationOption.ConfigurationTypes.TYPE_DOUBLE, - String.Empty, "10.0", true); - - configMember.addConfigurationOption("terrain_start_height_2", - ConfigurationOption.ConfigurationTypes.TYPE_DOUBLE, - String.Empty, "10.0", true); - - configMember.addConfigurationOption("terrain_start_height_3", - ConfigurationOption.ConfigurationTypes.TYPE_DOUBLE, - String.Empty, "10.0", true); - - configMember.addConfigurationOption("terrain_height_range_0", - ConfigurationOption.ConfigurationTypes.TYPE_DOUBLE, - String.Empty, "60.0", true); - - configMember.addConfigurationOption("terrain_height_range_1", - ConfigurationOption.ConfigurationTypes.TYPE_DOUBLE, - String.Empty, "60.0", true); - - configMember.addConfigurationOption("terrain_height_range_2", - ConfigurationOption.ConfigurationTypes.TYPE_DOUBLE, - String.Empty, "60.0", true); - - configMember.addConfigurationOption("terrain_height_range_3", - ConfigurationOption.ConfigurationTypes.TYPE_DOUBLE, - String.Empty, "60.0", true); - - configMember.addConfigurationOption("region_water_height", - ConfigurationOption.ConfigurationTypes.TYPE_DOUBLE, - String.Empty, "20.0", true); - - configMember.addConfigurationOption("terrain_raise_limit", - ConfigurationOption.ConfigurationTypes.TYPE_DOUBLE, - String.Empty, "100.0", true); - - configMember.addConfigurationOption("terrain_lower_limit", - ConfigurationOption.ConfigurationTypes.TYPE_DOUBLE, - String.Empty, "-100.0", true); - - configMember.addConfigurationOption("sun_hour", - ConfigurationOption.ConfigurationTypes.TYPE_DOUBLE, - String.Empty, "0.0", true); - } - - public bool HandleIncomingConfiguration(string key, object value) - { - switch (key) - { - case "region_flags": - RegionFlags flags = (RegionFlags)(uint)value; - - m_BlockTerraform = - (flags & RegionFlags.BlockTerraform) != 0; - m_BlockFly = - (flags & RegionFlags.NoFly) != 0; - m_AllowDamage = - (flags & RegionFlags.AllowDamage) != 0; - m_RestrictPushing = - (flags & RegionFlags.RestrictPushObject) != 0; - m_AllowLandResell = - (flags & RegionFlags.BlockLandResell) == 0; - m_AllowLandJoinDivide = - (flags & RegionFlags.AllowParcelChanges) != 0; - m_BlockShowInSearch = - ((uint)flags & (1 << 29)) != 0; - m_DisableScripts = - (flags & RegionFlags.SkipScripts) != 0; - m_DisableCollisions = - (flags & RegionFlags.SkipCollisions) != 0; - m_DisablePhysics = - (flags & RegionFlags.SkipPhysics) != 0; - m_FixedSun = - (flags & RegionFlags.SunFixed) != 0; - m_Sandbox = - (flags & RegionFlags.Sandbox) != 0; - break; - case "max_agents": - m_AgentLimit = (int)value; - break; - case "object_bonus_factor": - m_ObjectBonus = (double)value; - break; - case "sim_access": - int access = (int)value; - if (access <= 13) - m_Maturity = 0; - else - m_Maturity = 1; - break; - case "terrain_base_0": - m_TerrainTexture1 = (UUID)value; - break; - case "terrain_base_1": - m_TerrainTexture2 = (UUID)value; - break; - case "terrain_base_2": - m_TerrainTexture3 = (UUID)value; - break; - case "terrain_base_3": - m_TerrainTexture4 = (UUID)value; - break; - case "terrain_start_height_0": - m_Elevation1SW = (double)value; - break; - case "terrain_start_height_1": - m_Elevation1NW = (double)value; - break; - case "terrain_start_height_2": - m_Elevation1SE = (double)value; - break; - case "terrain_start_height_3": - m_Elevation1NE = (double)value; - break; - case "terrain_height_range_0": - m_Elevation2SW = (double)value; - break; - case "terrain_height_range_1": - m_Elevation2NW = (double)value; - break; - case "terrain_height_range_2": - m_Elevation2SE = (double)value; - break; - case "terrain_height_range_3": - m_Elevation2NE = (double)value; - break; - case "region_water_height": - m_WaterHeight = (double)value; - break; - case "terrain_raise_limit": - m_TerrainRaiseLimit = (double)value; - break; - case "terrain_lower_limit": - m_TerrainLowerLimit = (double)value; - break; - case "sun_hour": - m_SunPosition = (double)value; - break; - } - - return true; - } - public void Save() { if (OnSave != null) diff --git a/OpenSim/Framework/SLUtil.cs b/OpenSim/Framework/SLUtil.cs index a4898061da..9941a7f147 100644 --- a/OpenSim/Framework/SLUtil.cs +++ b/OpenSim/Framework/SLUtil.cs @@ -46,7 +46,7 @@ namespace OpenSim.Framework case AssetType.Texture: return "image/x-j2c"; case AssetType.Sound: - return "application/ogg"; + return "audio/ogg"; case AssetType.CallingCard: return "application/vnd.ll.callingcard"; case AssetType.Landmark: @@ -98,8 +98,6 @@ namespace OpenSim.Framework return "application/vnd.ll.outfitfolder"; case AssetType.MyOutfitsFolder: return "application/vnd.ll.myoutfitsfolder"; - case AssetType.InboxFolder: - return "application/vnd.ll.inboxfolder"; case AssetType.Unknown: default: return "application/octet-stream"; @@ -128,7 +126,7 @@ namespace OpenSim.Framework case InventoryType.Object: return "application/vnd.ll.primitive"; case InventoryType.Sound: - return "application/ogg"; + return "audio/ogg"; case InventoryType.Snapshot: case InventoryType.Texture: return "image/x-j2c"; @@ -147,6 +145,7 @@ namespace OpenSim.Framework case "image/jp2": return (sbyte)AssetType.Texture; case "application/ogg": + case "audio/ogg": return (sbyte)AssetType.Sound; case "application/vnd.ll.callingcard": case "application/x-metaverse-callingcard": @@ -209,8 +208,6 @@ namespace OpenSim.Framework return (sbyte)AssetType.OutfitFolder; case "application/vnd.ll.myoutfitsfolder": return (sbyte)AssetType.MyOutfitsFolder; - case "application/vnd.ll.inboxfolder": - return (sbyte)AssetType.InboxFolder; case "application/octet-stream": default: return (sbyte)AssetType.Unknown; @@ -227,6 +224,7 @@ namespace OpenSim.Framework case "image/jpeg": return (sbyte)InventoryType.Texture; case "application/ogg": + case "audio/ogg": case "audio/x-wav": return (sbyte)InventoryType.Sound; case "application/vnd.ll.callingcard": diff --git a/OpenSim/Framework/Serialization/ArchiveConstants.cs b/OpenSim/Framework/Serialization/ArchiveConstants.cs index 475a9de0cb..2c5e0018ec 100644 --- a/OpenSim/Framework/Serialization/ArchiveConstants.cs +++ b/OpenSim/Framework/Serialization/ArchiveConstants.cs @@ -27,6 +27,7 @@ using System; using System.Collections.Generic; +using System.Text; using OpenMetaverse; namespace OpenSim.Framework.Serialization @@ -111,6 +112,7 @@ namespace OpenSim.Framework.Serialization ASSET_TYPE_TO_EXTENSION[(sbyte)AssetType.LostAndFoundFolder] = ASSET_EXTENSION_SEPARATOR + "lostandfoundfolder.txt"; // Not sure if we'll ever see this ASSET_TYPE_TO_EXTENSION[(sbyte)AssetType.LSLBytecode] = ASSET_EXTENSION_SEPARATOR + "bytecode.lso"; ASSET_TYPE_TO_EXTENSION[(sbyte)AssetType.LSLText] = ASSET_EXTENSION_SEPARATOR + "script.lsl"; + ASSET_TYPE_TO_EXTENSION[(sbyte)AssetType.Mesh] = ASSET_EXTENSION_SEPARATOR + "mesh.llmesh"; ASSET_TYPE_TO_EXTENSION[(sbyte)AssetType.Notecard] = ASSET_EXTENSION_SEPARATOR + "notecard.txt"; ASSET_TYPE_TO_EXTENSION[(sbyte)AssetType.Object] = ASSET_EXTENSION_SEPARATOR + "object.xml"; ASSET_TYPE_TO_EXTENSION[(sbyte)AssetType.RootFolder] = ASSET_EXTENSION_SEPARATOR + "rootfolder.txt"; // Not sure if we'll ever see this @@ -134,6 +136,7 @@ namespace OpenSim.Framework.Serialization EXTENSION_TO_ASSET_TYPE[ASSET_EXTENSION_SEPARATOR + "lostandfoundfolder.txt"] = (sbyte)AssetType.LostAndFoundFolder; EXTENSION_TO_ASSET_TYPE[ASSET_EXTENSION_SEPARATOR + "bytecode.lso"] = (sbyte)AssetType.LSLBytecode; EXTENSION_TO_ASSET_TYPE[ASSET_EXTENSION_SEPARATOR + "script.lsl"] = (sbyte)AssetType.LSLText; + EXTENSION_TO_ASSET_TYPE[ASSET_EXTENSION_SEPARATOR + "mesh.llmesh"] = (sbyte)AssetType.Mesh; EXTENSION_TO_ASSET_TYPE[ASSET_EXTENSION_SEPARATOR + "notecard.txt"] = (sbyte)AssetType.Notecard; EXTENSION_TO_ASSET_TYPE[ASSET_EXTENSION_SEPARATOR + "object.xml"] = (sbyte)AssetType.Object; EXTENSION_TO_ASSET_TYPE[ASSET_EXTENSION_SEPARATOR + "rootfolder.txt"] = (sbyte)AssetType.RootFolder; @@ -156,9 +159,9 @@ namespace OpenSim.Framework.Serialization public static string CreateOarObjectFilename(string objectName, UUID uuid, Vector3 pos) { return string.Format( - OAR_OBJECT_FILENAME_TEMPLATE, objectName, + OAR_OBJECT_FILENAME_TEMPLATE, objectName, Math.Round(pos.X), Math.Round(pos.Y), Math.Round(pos.Z), - uuid); + uuid); } /// @@ -170,7 +173,31 @@ namespace OpenSim.Framework.Serialization /// public static string CreateOarObjectPath(string objectName, UUID uuid, Vector3 pos) { - return OBJECTS_PATH + CreateOarObjectFilename(objectName, uuid, pos); - } + return OBJECTS_PATH + CreateOarObjectFilename(objectName, uuid, pos); + } + + /// + /// Extract a plain path from an IAR path + /// + /// + /// + public static string ExtractPlainPathFromIarPath(string iarPath) + { + List plainDirs = new List(); + + string[] iarDirs = iarPath.Split(new char[] { '/' }, StringSplitOptions.RemoveEmptyEntries); + + foreach (string iarDir in iarDirs) + { + if (!iarDir.Contains(ArchiveConstants.INVENTORY_NODE_NAME_COMPONENT_SEPARATOR)) + plainDirs.Add(iarDir); + + int i = iarDir.LastIndexOf(ArchiveConstants.INVENTORY_NODE_NAME_COMPONENT_SEPARATOR); + + plainDirs.Add(iarDir.Remove(i)); + } + + return string.Join("/", plainDirs.ToArray()); + } } } diff --git a/OpenSim/Framework/Serialization/External/LandDataSerializer.cs b/OpenSim/Framework/Serialization/External/LandDataSerializer.cs index ff0afc86e8..fc0387b76c 100644 --- a/OpenSim/Framework/Serialization/External/LandDataSerializer.cs +++ b/OpenSim/Framework/Serialization/External/LandDataSerializer.cs @@ -118,7 +118,8 @@ namespace OpenSim.Framework.Serialization.External landData.SnapshotID = UUID.Parse( xtr.ReadElementString("SnapshotID")); landData.UserLocation = Vector3.Parse( xtr.ReadElementString("UserLocation")); landData.UserLookAt = Vector3.Parse( xtr.ReadElementString("UserLookAt")); - landData.Dwell = Convert.ToInt32( xtr.ReadElementString("Dwell")); + // No longer used here + xtr.ReadElementString("Dwell"); landData.OtherCleanTime = Convert.ToInt32( xtr.ReadElementString("OtherCleanTime")); xtr.ReadEndElement(); @@ -177,7 +178,7 @@ namespace OpenSim.Framework.Serialization.External xtw.WriteElementString("SnapshotID", landData.SnapshotID.ToString()); xtw.WriteElementString("UserLocation", landData.UserLocation.ToString()); xtw.WriteElementString("UserLookAt", landData.UserLookAt.ToString()); - xtw.WriteElementString("Dwell", Convert.ToString(landData.Dwell)); + xtw.WriteElementString("Dwell", "0"); xtw.WriteElementString("OtherCleanTime", Convert.ToString(landData.OtherCleanTime)); xtw.WriteEndElement(); diff --git a/OpenSim/Framework/Servers/BaseOpenSimServer.cs b/OpenSim/Framework/Servers/BaseOpenSimServer.cs index f0f8d0186b..cbab2dbc6a 100644 --- a/OpenSim/Framework/Servers/BaseOpenSimServer.cs +++ b/OpenSim/Framework/Servers/BaseOpenSimServer.cs @@ -37,6 +37,7 @@ using log4net; using log4net.Appender; using log4net.Core; using log4net.Repository; +using OpenSim.Framework; using OpenSim.Framework.Console; using OpenSim.Framework.Servers; using OpenSim.Framework.Servers.HttpServer; @@ -234,26 +235,19 @@ namespace OpenSim.Framework.Servers protected string GetThreadsReport() { StringBuilder sb = new StringBuilder(); + Watchdog.ThreadWatchdogInfo[] threads = Watchdog.GetThreads(); - ProcessThreadCollection threads = ThreadTracker.GetThreads(); - if (threads == null) + sb.Append(threads.Length + " threads are being tracked:" + Environment.NewLine); + foreach (Watchdog.ThreadWatchdogInfo twi in threads) { - sb.Append("OpenSim thread tracking is only enabled in DEBUG mode."); + Thread t = twi.Thread; + + sb.Append( + "ID: " + t.ManagedThreadId + ", Name: " + t.Name + ", TimeRunning: " + + "Pri: " + t.Priority + ", State: " + t.ThreadState); + sb.Append(Environment.NewLine); } - else - { - sb.Append(threads.Count + " threads are being tracked:" + Environment.NewLine); - foreach (ProcessThread t in threads) - { - sb.Append("ID: " + t.Id + ", TotalProcessorTime: " + t.TotalProcessorTime + ", TimeRunning: " + - (DateTime.Now - t.StartTime) + ", Pri: " + t.CurrentPriority + ", State: " + t.ThreadState); - if (t.ThreadState == System.Diagnostics.ThreadState.Wait) - sb.Append(", Reason: " + t.WaitReason + Environment.NewLine); - else - sb.Append(Environment.NewLine); - } - } int workers = 0, ports = 0, maxWorkers = 0, maxPorts = 0; ThreadPool.GetAvailableThreads(out workers, out ports); ThreadPool.GetMaxThreads(out maxWorkers, out maxPorts); diff --git a/OpenSim/Framework/Servers/HttpServer/BaseHttpServer.cs b/OpenSim/Framework/Servers/HttpServer/BaseHttpServer.cs index 6fd3c1efa4..30505f6a5b 100644 --- a/OpenSim/Framework/Servers/HttpServer/BaseHttpServer.cs +++ b/OpenSim/Framework/Servers/HttpServer/BaseHttpServer.cs @@ -28,6 +28,7 @@ using System; using System.Collections; using System.Collections.Generic; +using System.Collections.Specialized; using System.IO; using System.Net; using System.Net.Sockets; @@ -50,7 +51,7 @@ namespace OpenSim.Framework.Servers.HttpServer { private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); private HttpServerLogWriter httpserverlog = new HttpServerLogWriter(); - + private volatile int NotSocketErrors = 0; public volatile bool HTTPDRunning = false; @@ -159,7 +160,7 @@ namespace OpenSim.Framework.Servers.HttpServer m_rpcHandlers[method] = handler; m_rpcHandlersKeepAlive[method] = keepAlive; // default } - + return true; } @@ -181,7 +182,7 @@ namespace OpenSim.Framework.Servers.HttpServer public bool AddHTTPHandler(string methodName, GenericHTTPMethod handler) { //m_log.DebugFormat("[BASE HTTP SERVER]: Registering {0}", methodName); - + lock (m_HTTPHandlers) { if (!m_HTTPHandlers.ContainsKey(methodName)) @@ -203,14 +204,14 @@ namespace OpenSim.Framework.Servers.HttpServer if (!m_pollHandlers.ContainsKey(methodName)) { m_pollHandlers.Add(methodName,args); - pollHandlerResult = true; + pollHandlerResult = true; } } - + if (pollHandlerResult) return AddHTTPHandler(methodName, handler); - return false; + return false; } // Note that the agent string is provided simply to differentiate @@ -256,51 +257,51 @@ namespace OpenSim.Framework.Servers.HttpServer { IHttpClientContext context = (IHttpClientContext)source; IHttpRequest request = args.Request; - + PollServiceEventArgs psEvArgs; - + if (TryGetPollServiceHTTPHandler(request.UriPath.ToString(), out psEvArgs)) { PollServiceHttpRequest psreq = new PollServiceHttpRequest(psEvArgs, context, request); - + if (psEvArgs.Request != null) { OSHttpRequest req = new OSHttpRequest(context, request); - + Stream requestStream = req.InputStream; - + Encoding encoding = Encoding.UTF8; StreamReader reader = new StreamReader(requestStream, encoding); - + string requestBody = reader.ReadToEnd(); - + Hashtable keysvals = new Hashtable(); Hashtable headervals = new Hashtable(); - + string[] querystringkeys = req.QueryString.AllKeys; string[] rHeaders = req.Headers.AllKeys; - + keysvals.Add("body", requestBody); keysvals.Add("uri", req.RawUrl); keysvals.Add("content-type", req.ContentType); keysvals.Add("http-method", req.HttpMethod); - + foreach (string queryname in querystringkeys) { keysvals.Add(queryname, req.QueryString[queryname]); } - + foreach (string headername in rHeaders) { headervals[headername] = req.Headers[headername]; } - + keysvals.Add("headers", headervals); keysvals.Add("querystringkeys", querystringkeys); - + psEvArgs.Request(psreq.RequestID, keysvals); } - + m_PollServiceManager.Enqueue(psreq); } else @@ -319,6 +320,13 @@ namespace OpenSim.Framework.Servers.HttpServer OSHttpRequest req = new OSHttpRequest(context, request); OSHttpResponse resp = new OSHttpResponse(new HttpResponse(context, request),context); HandleRequest(req, resp); + + // !!!HACK ALERT!!! + // There seems to be a bug in the underlying http code that makes subsequent requests + // come up with trash in Accept headers. Until that gets fixed, we're cleaning them up here. + if (request.AcceptTypes != null) + for (int i = 0; i < request.AcceptTypes.Length; i++) + request.AcceptTypes[i] = string.Empty; } // public void ConvertIHttpClientContextToOSHttp(object stateinfo) @@ -331,19 +339,25 @@ namespace OpenSim.Framework.Servers.HttpServer // HandleRequest(request,resp); // } + /// + /// This methods is the start of incoming HTTP request handling. + /// + /// + /// public virtual void HandleRequest(OSHttpRequest request, OSHttpResponse response) { try { +// m_log.Debug("[BASE HTTP SERVER]: Handling request to " + request.RawUrl); + Thread.CurrentThread.CurrentCulture = new CultureInfo("en-US", true); + // This is the REST agent interface. We require an agent to properly identify // itself. If the REST handler recognizes the prefix it will attempt to // satisfy the request. If it is not recognizable, and no damage has occurred // the request can be passed through to the other handlers. This is a low // probability event; if a request is matched it is normally expected to be // handled -// m_log.Debug("[BASE HTTP SERVER]: Handling request to " + request.RawUrl); - IHttpAgentHandler agentHandler; if (TryGetAgentHandler(request, response, out agentHandler)) @@ -362,7 +376,7 @@ namespace OpenSim.Framework.Servers.HttpServer string path = request.RawUrl; string handlerKey = GetHandlerKey(request.HttpMethod, path); - //m_log.DebugFormat("[BASE HTTP SERVER]: Handling {0} request for {1}", request.HttpMethod, path); +// m_log.DebugFormat("[BASE HTTP SERVER]: Handling {0} request for {1}", request.HttpMethod, path); if (TryGetStreamHandler(handlerKey, out requestHandler)) { @@ -442,7 +456,7 @@ namespace OpenSim.Framework.Servers.HttpServer } request.InputStream.Close(); - + // HTTP IN support. The script engine taes it from here // Nothing to worry about for us. // @@ -526,7 +540,7 @@ namespace OpenSim.Framework.Servers.HttpServer HandleLLSDRequests(request, response); return; } - + // m_log.DebugFormat("[BASE HTTP SERVER]: Checking for HTTP Handler for request {0}", request.RawUrl); if (DoWeHaveAHTTPHandler(request.RawUrl)) { @@ -580,7 +594,7 @@ namespace OpenSim.Framework.Servers.HttpServer } } } - + if (String.IsNullOrEmpty(bestMatch)) { streamHandler = null; @@ -627,7 +641,7 @@ namespace OpenSim.Framework.Servers.HttpServer private bool TryGetHTTPHandler(string handlerKey, out GenericHTTPMethod HTTPHandler) { // m_log.DebugFormat("[BASE HTTP HANDLER]: Looking for HTTP handler for {0}", handlerKey); - + string bestMatch = null; lock (m_HTTPHandlers) @@ -713,17 +727,18 @@ namespace OpenSim.Framework.Servers.HttpServer { xmlRprcRequest.Params.Add(request.RemoteIPEndPoint); // Param[1] XmlRpcResponse xmlRpcResponse; - + XmlRpcMethod method; bool methodWasFound; lock (m_rpcHandlers) { methodWasFound = m_rpcHandlers.TryGetValue(methodName, out method); } - + if (methodWasFound) { xmlRprcRequest.Params.Add(request.Url); // Param[2] + xmlRprcRequest.Params.Add(request.Headers.Get("X-Forwarded-For")); // Param[3] try { @@ -751,10 +766,10 @@ namespace OpenSim.Framework.Servers.HttpServer else { xmlRpcResponse = new XmlRpcResponse(); - + // Code set in accordance with http://xmlrpc-epi.sourceforge.net/specs/rfc.fault_codes.php xmlRpcResponse.SetFault( - XmlRpcErrorCodes.SERVER_ERROR_METHOD, + XmlRpcErrorCodes.SERVER_ERROR_METHOD, String.Format("Requested method [{0}] not found", methodName)); } @@ -771,11 +786,11 @@ namespace OpenSim.Framework.Servers.HttpServer response.KeepAlive = false; m_log.ErrorFormat("[BASE HTTP SERVER]: Handler not found for http request {0}", request.RawUrl); - + response.SendChunked = false; response.ContentLength64 = buf.Length; response.ContentEncoding = Encoding.UTF8; - + try { response.OutputStream.Write(buf, 0, buf.Length); @@ -857,13 +872,13 @@ namespace OpenSim.Framework.Servers.HttpServer OSD llsdRequest = null; OSD llsdResponse = null; - + bool LegacyLLSDLoginLibOMV = (requestBody.Contains("passwd") && requestBody.Contains("mac") && requestBody.Contains("viewer_digest")); - + if (requestBody.Length == 0) // Get Request { - requestBody = "requestget"; + requestBody = "requestget"; } try { @@ -1075,7 +1090,7 @@ namespace OpenSim.Framework.Servers.HttpServer string bestMatch = null; //m_log.DebugFormat("[BASE HTTP HANDLER]: Checking if we have an HTTP handler for {0}", searchquery); - + lock (m_HTTPHandlers) { foreach (string pattern in m_HTTPHandlers.Keys) @@ -1141,7 +1156,7 @@ namespace OpenSim.Framework.Servers.HttpServer // You have to specifically register for '/' and to get it, you must specificaly request it // if (pattern == "/" && searchquery == "/" || pattern != "/") - bestMatch = pattern; + bestMatch = pattern; } } } @@ -1221,11 +1236,11 @@ namespace OpenSim.Framework.Servers.HttpServer } public void HandleHTTPRequest(OSHttpRequest request, OSHttpResponse response) - { + { // m_log.DebugFormat( -// "[BASE HTTP SERVER]: HandleHTTPRequest for request to {0}, method {1}", +// "[BASE HTTP SERVER]: HandleHTTPRequest for request to {0}, method {1}", // request.RawUrl, request.HttpMethod); - + switch (request.HttpMethod) { case "OPTIONS": @@ -1241,7 +1256,7 @@ namespace OpenSim.Framework.Servers.HttpServer private void HandleContentVerbs(OSHttpRequest request, OSHttpResponse response) { // m_log.DebugFormat("[BASE HTTP SERVER]: HandleContentVerbs for request to {0}", request.RawUrl); - + // 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. // @@ -1376,7 +1391,7 @@ namespace OpenSim.Framework.Servers.HttpServer // m_log.DebugFormat( // "[BASE HTTP HANDLER]: TryGetHTTPHandlerPathBased() looking for HTTP handler to match {0}", searchquery); - + lock (m_HTTPHandlers) { foreach (string pattern in m_HTTPHandlers.Keys) @@ -1435,9 +1450,13 @@ namespace OpenSim.Framework.Servers.HttpServer if (responsedata.ContainsKey("reusecontext")) response.ReuseContext = (bool) responsedata["reusecontext"]; + // Cross-Origin Resource Sharing with simple requests + if (responsedata.ContainsKey("access_control_allow_origin")) + response.AddHeader("Access-Control-Allow-Origin", (string)responsedata["access_control_allow_origin"]); + //Even though only one other part of the entire code uses HTTPHandlers, we shouldn't expect this //and should check for NullReferenceExceptions - + if (string.IsNullOrEmpty(contentType)) { contentType = "text/html"; @@ -1457,9 +1476,10 @@ namespace OpenSim.Framework.Servers.HttpServer byte[] buffer; - if (!(contentType.Contains("image") - || contentType.Contains("x-shockwave-flash") - || contentType.Contains("application/x-oar"))) + if (!(contentType.Contains("image") + || contentType.Contains("x-shockwave-flash") + || contentType.Contains("application/x-oar") + || contentType.Contains("application/vnd.ll.mesh"))) { // Text buffer = Encoding.UTF8.GetBytes(responseString); @@ -1489,7 +1509,7 @@ namespace OpenSim.Framework.Servers.HttpServer { response.OutputStream.Flush(); response.Send(); - + //if (!response.KeepAlive && response.ReuseContext) // response.FreeContext(); } @@ -1596,11 +1616,11 @@ namespace OpenSim.Framework.Servers.HttpServer m_httpListener2 = CoolHTTPListener.Create(m_listenIPAddress, (int)m_port); m_httpListener2.ExceptionThrown += httpServerException; m_httpListener2.LogWriter = httpserverlog; - - // Uncomment this line in addition to those in HttpServerLogWriter + + // Uncomment this line in addition to those in HttpServerLogWriter // if you want more detailed trace information from the HttpServer //m_httpListener2.UseTraceLogs = true; - + //m_httpListener2.DisconnectHandler = httpServerDisconnectMonitor; } else @@ -1628,8 +1648,8 @@ namespace OpenSim.Framework.Servers.HttpServer { m_log.Error("[BASE HTTP SERVER]: Error - " + e.Message); m_log.Error("[BASE HTTP SERVER]: Tip: Do you have permission to listen on port " + m_port + ", " + m_sslport + "?"); - - // We want this exception to halt the entire server since in current configurations we aren't too + + // We want this exception to halt the entire server since in current configurations we aren't too // useful without inbound HTTP. throw e; } @@ -1641,7 +1661,7 @@ namespace OpenSim.Framework.Servers.HttpServer { case SocketError.NotSocket: NotSocketErrors++; - + break; } } @@ -1671,12 +1691,11 @@ namespace OpenSim.Framework.Servers.HttpServer m_httpListener2.LogWriter = null; m_httpListener2.RequestReceived -= OnRequest; m_httpListener2.Stop(); - } + } catch (NullReferenceException) { m_log.Warn("[BASE HTTP SERVER]: Null Reference when stopping HttpServer."); } - } public void RemoveStreamHandler(string httpMethod, string path) @@ -1697,7 +1716,7 @@ namespace OpenSim.Framework.Servers.HttpServer m_HTTPHandlers.Remove(path); return; } - + m_HTTPHandlers.Remove(GetHandlerKey(httpMethod, path)); } } @@ -1713,7 +1732,6 @@ namespace OpenSim.Framework.Servers.HttpServer } RemoveHTTPHandler(httpMethod, path); - } public bool RemoveAgentHandler(string agent, IHttpAgentHandler handler) @@ -1744,7 +1762,6 @@ namespace OpenSim.Framework.Servers.HttpServer } } - public bool RemoveLLSDHandler(string path, LLSDMethod handler) { try @@ -1818,7 +1835,7 @@ namespace OpenSim.Framework.Servers.HttpServer oresp = osresp; } } - + /// /// Relays HttpServer log messages to our own logging mechanism. /// @@ -1837,7 +1854,7 @@ namespace OpenSim.Framework.Servers.HttpServer { case LogPrio.Trace: m_log.DebugFormat("[{0}]: {1}", source, message); - break; + break; case LogPrio.Debug: m_log.DebugFormat("[{0}]: {1}", source, message); break; @@ -1857,7 +1874,7 @@ namespace OpenSim.Framework.Servers.HttpServer break; } */ - + return; } } diff --git a/OpenSim/Framework/Servers/HttpServer/SynchronousRestFormsRequester.cs b/OpenSim/Framework/Servers/HttpServer/SynchronousRestFormsRequester.cs index b0cf34d16e..41ece86047 100644 --- a/OpenSim/Framework/Servers/HttpServer/SynchronousRestFormsRequester.cs +++ b/OpenSim/Framework/Servers/HttpServer/SynchronousRestFormsRequester.cs @@ -57,75 +57,73 @@ namespace OpenSim.Framework.Servers.HttpServer { WebRequest request = WebRequest.Create(requestUrl); request.Method = verb; - - if ((verb == "POST") || (verb == "PUT")) - { - request.ContentType = "text/www-form-urlencoded"; - - MemoryStream buffer = new MemoryStream(); - int length = 0; - using (StreamWriter writer = new StreamWriter(buffer)) - { - writer.Write(obj); - writer.Flush(); - } - - length = (int)obj.Length; - request.ContentLength = length; - - Stream requestStream = null; - try - { - requestStream = request.GetRequestStream(); - requestStream.Write(buffer.ToArray(), 0, length); - } - catch (Exception e) - { - m_log.DebugFormat("[FORMS]: exception occured on sending request to {0}: {1}", requestUrl, e.Message); - } - finally - { - if (requestStream != null) - requestStream.Close(); - // Let's not close this - //buffer.Close(); - - } - } - string respstring = String.Empty; - try + using (MemoryStream buffer = new MemoryStream()) { - using (WebResponse resp = request.GetResponse()) + if ((verb == "POST") || (verb == "PUT")) { - if (resp.ContentLength > 0) + request.ContentType = "text/www-form-urlencoded"; + + int length = 0; + using (StreamWriter writer = new StreamWriter(buffer)) { - Stream respStream = null; - try + writer.Write(obj); + writer.Flush(); + } + + length = (int)obj.Length; + request.ContentLength = length; + + Stream requestStream = null; + try + { + requestStream = request.GetRequestStream(); + requestStream.Write(buffer.ToArray(), 0, length); + } + catch (Exception e) + { + m_log.DebugFormat("[FORMS]: exception occured on sending request to {0}: " + e.ToString(), requestUrl); + } + finally + { + if (requestStream != null) + requestStream.Close(); + } + } + + try + { + using (WebResponse resp = request.GetResponse()) + { + if (resp.ContentLength != 0) { - respStream = resp.GetResponseStream(); - using (StreamReader reader = new StreamReader(respStream)) + Stream respStream = null; + try { - respstring = reader.ReadToEnd(); + respStream = resp.GetResponseStream(); + using (StreamReader reader = new StreamReader(respStream)) + { + respstring = reader.ReadToEnd(); + } + } + catch (Exception e) + { + m_log.DebugFormat("[FORMS]: exception occured on receiving reply " + e.ToString()); + } + finally + { + if (respStream != null) + respStream.Close(); } - } - catch (Exception e) - { - m_log.DebugFormat("[FORMS]: exception occured on receiving reply {0}", e.Message); - } - finally - { - if (respStream != null) - respStream.Close(); } } } - } - catch (System.InvalidOperationException) - { - // This is what happens when there is invalid XML - m_log.DebugFormat("[FORMS]: InvalidOperationException on receiving request"); + catch (System.InvalidOperationException) + { + // This is what happens when there is invalid XML + m_log.DebugFormat("[FORMS]: InvalidOperationException on receiving request"); + } } return respstring; } diff --git a/OpenSim/Framework/Servers/VersionInfo.cs b/OpenSim/Framework/Servers/VersionInfo.cs index 100bf1fd52..c9d4c93d49 100644 --- a/OpenSim/Framework/Servers/VersionInfo.cs +++ b/OpenSim/Framework/Servers/VersionInfo.cs @@ -49,7 +49,7 @@ namespace OpenSim public static string GetVersionString(string versionNumber, Flavour flavour) { - string versionString = "OpenSim " + versionNumber + " (" + flavour + ")"; + string versionString = "OpenSim " + versionNumber + " " + flavour; return versionString.PadRight(VERSIONINFO_VERSION_LENGTH); } @@ -69,6 +69,6 @@ namespace OpenSim /// of the code that is too old. /// /// - public readonly static int MajorInterfaceVersion = 6; + public readonly static int MajorInterfaceVersion = 7; } } diff --git a/OpenSim/Framework/Statistics/SimExtraStatsCollector.cs b/OpenSim/Framework/Statistics/SimExtraStatsCollector.cs index 3619606679..544975791b 100644 --- a/OpenSim/Framework/Statistics/SimExtraStatsCollector.cs +++ b/OpenSim/Framework/Statistics/SimExtraStatsCollector.cs @@ -390,36 +390,41 @@ Asset service request failures: {3}" + Environment.NewLine, public override string XReport(string uptime, string version) { OSDMap args = new OSDMap(30); - args["AssetsInCache"] = OSD.FromReal(AssetsInCache); - args["TimeAfterCacheMiss"] = OSD.FromReal(assetRequestTimeAfterCacheMiss.Milliseconds / 1000.0); - args["BlockedMissingTextureRequests"] = OSD.FromReal(BlockedMissingTextureRequests); - args["AssetServiceRequestFailures"] = OSD.FromReal(AssetServiceRequestFailures); - args["abnormalClientThreadTerminations"] = OSD.FromReal(abnormalClientThreadTerminations); - args["InventoryServiceRetrievalFailures"] = OSD.FromReal(InventoryServiceRetrievalFailures); - args["Dilatn"] = OSD.FromReal(timeDilation); - args["SimFPS"] = OSD.FromReal(simFps); - args["PhyFPS"] = OSD.FromReal(physicsFps); - args["AgntUp"] = OSD.FromReal(agentUpdates); - args["RootAg"] = OSD.FromReal(rootAgents); - args["ChldAg"] = OSD.FromReal(childAgents); - args["Prims"] = OSD.FromReal(totalPrims); - args["AtvPrm"] = OSD.FromReal(activePrims); - args["AtvScr"] = OSD.FromReal(activeScripts); - args["ScrLPS"] = OSD.FromReal(scriptLinesPerSecond); - args["PktsIn"] = OSD.FromReal(inPacketsPerSecond); - args["PktOut"] = OSD.FromReal(outPacketsPerSecond); - args["PendDl"] = OSD.FromReal(pendingDownloads); - args["PendUl"] = OSD.FromReal(pendingUploads); - args["UnackB"] = OSD.FromReal(unackedBytes); - args["TotlFt"] = OSD.FromReal(totalFrameTime); - args["NetFt"] = OSD.FromReal(netFrameTime); - args["PhysFt"] = OSD.FromReal(physicsFrameTime); - args["OthrFt"] = OSD.FromReal(otherFrameTime); - args["AgntFt"] = OSD.FromReal(agentFrameTime); - args["ImgsFt"] = OSD.FromReal(imageFrameTime); - args["Memory"] = OSD.FromString(base.XReport(uptime, version)); - args["Uptime"] = OSD.FromString(uptime); - args["Version"] = OSD.FromString(version); + args["AssetsInCache"] = OSD.FromString (String.Format ("{0:0.##}", AssetsInCache)); + args["TimeAfterCacheMiss"] = OSD.FromString (String.Format ("{0:0.##}", + assetRequestTimeAfterCacheMiss.Milliseconds / 1000.0)); + args["BlockedMissingTextureRequests"] = OSD.FromString (String.Format ("{0:0.##}", + BlockedMissingTextureRequests)); + args["AssetServiceRequestFailures"] = OSD.FromString (String.Format ("{0:0.##}", + AssetServiceRequestFailures)); + args["abnormalClientThreadTerminations"] = OSD.FromString (String.Format ("{0:0.##}", + abnormalClientThreadTerminations)); + args["InventoryServiceRetrievalFailures"] = OSD.FromString (String.Format ("{0:0.##}", + InventoryServiceRetrievalFailures)); + args["Dilatn"] = OSD.FromString (String.Format ("{0:0.##}", timeDilation)); + args["SimFPS"] = OSD.FromString (String.Format ("{0:0.##}", simFps)); + args["PhyFPS"] = OSD.FromString (String.Format ("{0:0.##}", physicsFps)); + args["AgntUp"] = OSD.FromString (String.Format ("{0:0.##}", agentUpdates)); + args["RootAg"] = OSD.FromString (String.Format ("{0:0.##}", rootAgents)); + args["ChldAg"] = OSD.FromString (String.Format ("{0:0.##}", childAgents)); + args["Prims"] = OSD.FromString (String.Format ("{0:0.##}", totalPrims)); + args["AtvPrm"] = OSD.FromString (String.Format ("{0:0.##}", activePrims)); + args["AtvScr"] = OSD.FromString (String.Format ("{0:0.##}", activeScripts)); + args["ScrLPS"] = OSD.FromString (String.Format ("{0:0.##}", scriptLinesPerSecond)); + args["PktsIn"] = OSD.FromString (String.Format ("{0:0.##}", inPacketsPerSecond)); + args["PktOut"] = OSD.FromString (String.Format ("{0:0.##}", outPacketsPerSecond)); + args["PendDl"] = OSD.FromString (String.Format ("{0:0.##}", pendingDownloads)); + args["PendUl"] = OSD.FromString (String.Format ("{0:0.##}", pendingUploads)); + args["UnackB"] = OSD.FromString (String.Format ("{0:0.##}", unackedBytes)); + args["TotlFt"] = OSD.FromString (String.Format ("{0:0.##}", totalFrameTime)); + args["NetFt"] = OSD.FromString (String.Format ("{0:0.##}", netFrameTime)); + args["PhysFt"] = OSD.FromString (String.Format ("{0:0.##}", physicsFrameTime)); + args["OthrFt"] = OSD.FromString (String.Format ("{0:0.##}", otherFrameTime)); + args["AgntFt"] = OSD.FromString (String.Format ("{0:0.##}", agentFrameTime)); + args["ImgsFt"] = OSD.FromString (String.Format ("{0:0.##}", imageFrameTime)); + args["Memory"] = OSD.FromString (base.XReport (uptime, version)); + args["Uptime"] = OSD.FromString (uptime); + args["Version"] = OSD.FromString (version); string strBuffer = ""; strBuffer = OSDParser.SerializeJsonString(args); diff --git a/OpenSim/Framework/TaskInventoryItem.cs b/OpenSim/Framework/TaskInventoryItem.cs index 2cb78957f5..30d775cf6a 100644 --- a/OpenSim/Framework/TaskInventoryItem.cs +++ b/OpenSim/Framework/TaskInventoryItem.cs @@ -102,6 +102,7 @@ namespace OpenSim.Framework private uint _baseMask = FULL_MASK_PERMISSIONS_GENERAL; private uint _creationDate = 0; private UUID _creatorID = UUID.Zero; + private string _creatorData = String.Empty; private string _description = String.Empty; private uint _everyoneMask = FULL_MASK_PERMISSIONS_GENERAL; private uint _flags = 0; @@ -160,6 +161,61 @@ namespace OpenSim.Framework } } + public string CreatorData // = ; + { + get { return _creatorData; } + set { _creatorData = value; } + } + + /// + /// Used by the DB layer to retrieve / store the entire user identification. + /// The identification can either be a simple UUID or a string of the form + /// uuid[;profile_url[;name]] + /// + public string CreatorIdentification + { + get + { + if (_creatorData != null && _creatorData != string.Empty) + return _creatorID.ToString() + ';' + _creatorData; + else + return _creatorID.ToString(); + } + set + { + if ((value == null) || (value != null && value == string.Empty)) + { + _creatorData = string.Empty; + return; + } + + if (!value.Contains(";")) // plain UUID + { + UUID uuid = UUID.Zero; + UUID.TryParse(value, out uuid); + _creatorID = uuid; + } + else // [;[;name]] + { + string name = "Unknown User"; + string[] parts = value.Split(';'); + if (parts.Length >= 1) + { + UUID uuid = UUID.Zero; + UUID.TryParse(parts[0], out uuid); + _creatorID = uuid; + } + if (parts.Length >= 2) + _creatorData = parts[1]; + if (parts.Length >= 3) + name = parts[2]; + + _creatorData += ';' + name; + + } + } + } + public string Description { get { return _description; @@ -348,15 +404,15 @@ namespace OpenSim.Framework /// The new part ID to which this item belongs public void ResetIDs(UUID partID) { - _oldID = _itemID; - _itemID = UUID.Random(); - _parentPartID = partID; - _parentID = partID; + OldItemID = ItemID; + ItemID = UUID.Random(); + ParentPartID = partID; + ParentID = partID; } public TaskInventoryItem() { - _creationDate = (uint)(DateTime.UtcNow - new DateTime(1970, 1, 1)).TotalSeconds; + CreationDate = (uint)(DateTime.UtcNow - new DateTime(1970, 1, 1)).TotalSeconds; } } } diff --git a/OpenSim/Framework/Tests/ACLTest.cs b/OpenSim/Framework/Tests/ACLTest.cs deleted file mode 100644 index 06e860e01c..0000000000 --- a/OpenSim/Framework/Tests/ACLTest.cs +++ /dev/null @@ -1,125 +0,0 @@ -/* - * Copyright (c) Contributors, http://opensimulator.org/ - * See CONTRIBUTORS.TXT for a full list of copyright holders. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * * Neither the name of the OpenSimulator Project nor the - * names of its contributors may be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE DEVELOPERS ``AS IS'' AND ANY - * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED - * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL THE CONTRIBUTORS BE LIABLE FOR ANY - * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES - * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; - * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ - -using System; -using NUnit.Framework; -using System.Collections.Generic; - - -namespace OpenSim.Framework.Tests -{ - [TestFixture] - public class ACLTest - { - #region Tests - - /// - /// ACL Test class - /// - [Test] - public void ACLTest01() - { - ACL acl = new ACL(); - - Role Guests = new Role("Guests"); - acl.AddRole(Guests); - - Role[] parents = new Role[1]; - parents[0] = Guests; - - Role JoeGuest = new Role("JoeGuest", parents); - acl.AddRole(JoeGuest); - - Resource CanBuild = new Resource("CanBuild"); - acl.AddResource(CanBuild); - - - acl.GrantPermission("Guests", "CanBuild"); - - Permission perm = acl.HasPermission("JoeGuest", "CanBuild"); - Assert.That(perm == Permission.Allow, "JoeGuest should have permission to build"); - perm = Permission.None; - try - { - perm = acl.HasPermission("unknownGuest", "CanBuild"); - - } - catch (KeyNotFoundException) - { - - - } - catch (Exception) - { - Assert.That(false,"Exception thrown should have been KeyNotFoundException"); - } - Assert.That(perm == Permission.None,"Permission None should be set because exception should have been thrown"); - - } - - [Test] - public void KnownButPermissionDenyAndPermissionNoneUserTest() - { - ACL acl = new ACL(); - - Role Guests = new Role("Guests"); - acl.AddRole(Guests); - Role Administrators = new Role("Administrators"); - acl.AddRole(Administrators); - Role[] Guestparents = new Role[1]; - Role[] Adminparents = new Role[1]; - - Guestparents[0] = Guests; - Adminparents[0] = Administrators; - - Role JoeGuest = new Role("JoeGuest", Guestparents); - acl.AddRole(JoeGuest); - - Resource CanBuild = new Resource("CanBuild"); - acl.AddResource(CanBuild); - - Resource CanScript = new Resource("CanScript"); - acl.AddResource(CanScript); - - Resource CanRestart = new Resource("CanRestart"); - acl.AddResource(CanRestart); - - acl.GrantPermission("Guests", "CanBuild"); - acl.DenyPermission("Guests", "CanRestart"); - - acl.GrantPermission("Administrators", "CanScript"); - - acl.GrantPermission("Administrators", "CanRestart"); - Permission setPermission = acl.HasPermission("JoeGuest", "CanRestart"); - Assert.That(setPermission == Permission.Deny, "Guests Should not be able to restart"); - Assert.That(acl.HasPermission("JoeGuest", "CanScript") == Permission.None, - "No Explicit Permissions set so should be Permission.None"); - } - - #endregion - } -} diff --git a/OpenSim/Framework/Tests/AgentCircuitDataTest.cs b/OpenSim/Framework/Tests/AgentCircuitDataTest.cs index 2fda6f31cc..05d8469728 100644 --- a/OpenSim/Framework/Tests/AgentCircuitDataTest.cs +++ b/OpenSim/Framework/Tests/AgentCircuitDataTest.cs @@ -65,9 +65,7 @@ namespace OpenSim.Framework.Tests SessionId = UUID.Random(); AvAppearance = new AvatarAppearance(AgentId); - AvAppearance.SetDefaultWearables(); VisualParams = new byte[218]; - AvAppearance.SetDefaultParams(VisualParams); //body VisualParams[(int)AvatarAppearance.VPElement.SHAPE_HEIGHT] = 155; diff --git a/OpenSim/Framework/Tests/AnimationTests.cs b/OpenSim/Framework/Tests/AnimationTests.cs new file mode 100644 index 0000000000..719ddce306 --- /dev/null +++ b/OpenSim/Framework/Tests/AnimationTests.cs @@ -0,0 +1,96 @@ +/* + * Copyright (c) Contributors, http://opensimulator.org/ + * See CONTRIBUTORS.TXT for a full list of copyright holders. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * * Neither the name of the OpenSimulator Project nor the + * names of its contributors may be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE DEVELOPERS ``AS IS'' AND ANY + * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED + * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + * DISCLAIMED. IN NO EVENT SHALL THE CONTRIBUTORS BE LIABLE FOR ANY + * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES + * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND + * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS + * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +using System; +using System.Reflection; +using NUnit.Framework; +using NUnit.Framework.SyntaxHelpers; +using OpenMetaverse; +using OpenMetaverse.StructuredData; +using OpenSim.Framework; +using OpenSim.Tests.Common; +using OpenSim.Tests.Common.Mock; +using OpenSim.Tests.Common.Setup; +using Animation = OpenSim.Framework.Animation; + +namespace OpenSim.Framework.Tests +{ + [TestFixture] + public class AnimationTests + { + private Animation anim1 = null; + private Animation anim2 = null; + private UUID animUUID1 = UUID.Zero; + private UUID objUUID1 = UUID.Zero; + private UUID animUUID2 = UUID.Zero; + private UUID objUUID2 = UUID.Zero; + + [SetUp] + public void Setup() + { + animUUID1 = UUID.Random(); + animUUID2 = UUID.Random(); + objUUID1 = UUID.Random(); + objUUID2 = UUID.Random(); + + anim1 = new Animation(animUUID1, 1, objUUID1); + anim2 = new Animation(animUUID2, 1, objUUID2); + } + + [Test] + public void AnimationOSDTest() + { + Assert.That(anim1.AnimID==animUUID1 && anim1.ObjectID == objUUID1 && anim1.SequenceNum ==1, "The Animation Constructor didn't set the fields correctly"); + OSD updateMessage = anim1.PackUpdateMessage(); + Assert.That(updateMessage is OSDMap, "Packed UpdateMessage isn't an OSDMap"); + OSDMap updateMap = (OSDMap) updateMessage; + Assert.That(updateMap.ContainsKey("animation"), "Packed Message doesn't contain an animation element"); + Assert.That(updateMap.ContainsKey("object_id"), "Packed Message doesn't contain an object_id element"); + Assert.That(updateMap.ContainsKey("seq_num"), "Packed Message doesn't contain a seq_num element"); + Assert.That(updateMap["animation"].AsUUID() == animUUID1); + Assert.That(updateMap["object_id"].AsUUID() == objUUID1); + Assert.That(updateMap["seq_num"].AsInteger() == 1); + + Animation anim3 = new Animation(updateMap); + + Assert.That(anim3.ObjectID == anim1.ObjectID && anim3.AnimID == anim1.AnimID && anim3.SequenceNum == anim1.SequenceNum, "OSDMap Constructor failed to set the properties correctly."); + + anim3.UnpackUpdateMessage(anim2.PackUpdateMessage()); + + Assert.That(anim3.ObjectID == objUUID2 && anim3.AnimID == animUUID2 && anim3.SequenceNum == 1, "Animation.UnpackUpdateMessage failed to set the properties correctly."); + + Animation anim4 = new Animation(); + anim4.AnimID = anim2.AnimID; + anim4.ObjectID = anim2.ObjectID; + anim4.SequenceNum = anim2.SequenceNum; + + Assert.That(anim4.ObjectID == objUUID2 && anim4.AnimID == animUUID2 && anim4.SequenceNum == 1, "void constructor and manual field population failed to set the properties correctly."); + + + } + } +} \ No newline at end of file diff --git a/OpenSim/Framework/Tests/CacheTests.cs b/OpenSim/Framework/Tests/CacheTests.cs index 32c0c9510a..c3613e6410 100644 --- a/OpenSim/Framework/Tests/CacheTests.cs +++ b/OpenSim/Framework/Tests/CacheTests.cs @@ -40,6 +40,7 @@ namespace OpenSim.Framework.Tests public void Build() { cache = new Cache(); + cache = new Cache(CacheMedium.Memory,CacheStrategy.Aggressive,CacheFlags.AllowUpdate); cacheItemUUID = UUID.Random(); MemoryCacheItem cachedItem = new MemoryCacheItem(cacheItemUUID.ToString(),DateTime.Now + TimeSpan.FromDays(1)); byte[] foo = new byte[1]; @@ -68,23 +69,7 @@ namespace OpenSim.Framework.Tests Assert.That(citem == null, "Item should not be in Cache"); } - //NOTE: Test Case disabled until Cache is fixed - [Test] - public void TestTTLExpiredEntry() - { - UUID ImmediateExpiryUUID = UUID.Random(); - MemoryCacheItem cachedItem = new MemoryCacheItem(ImmediateExpiryUUID.ToString(), TimeSpan.FromDays(-1)); - byte[] foo = new byte[1]; - foo[0] = 1; - cachedItem.Store(foo); - cache.Store(cacheItemUUID.ToString(), cachedItem); - - cache.Get(cacheItemUUID.ToString()); - //object citem = cache.Get(cacheItemUUID.ToString()); - //Assert.That(citem == null, "Item should not be in Cache because the expiry time was before now"); - } - - //NOTE: Test Case disabled until Cache is fixed + [Test] public void ExpireItemManually() { @@ -94,10 +79,45 @@ namespace OpenSim.Framework.Tests foo[0] = 1; cachedItem.Store(foo); cache.Store(cacheItemUUID.ToString(), cachedItem); - cache.Invalidate(ImmediateExpiryUUID.ToString()); + cache.Invalidate(cacheItemUUID.ToString()); cache.Get(cacheItemUUID.ToString()); - //object citem = cache.Get(cacheItemUUID.ToString()); - //Assert.That(citem == null, "Item should not be in Cache because we manually invalidated it"); + object citem = cache.Get(cacheItemUUID.ToString()); + Assert.That(citem == null, "Item should not be in Cache because we manually invalidated it"); + } + + [Test] + public void ClearCacheTest() + { + UUID ImmediateExpiryUUID = UUID.Random(); + MemoryCacheItem cachedItem = new MemoryCacheItem(ImmediateExpiryUUID.ToString(), DateTime.Now - TimeSpan.FromDays(1)); + byte[] foo = new byte[1]; + foo[0] = 1; + cachedItem.Store(foo); + cache.Store(cacheItemUUID.ToString(), cachedItem); + cache.Clear(); + + object citem = cache.Get(cacheItemUUID.ToString()); + Assert.That(citem == null, "Item should not be in Cache because we manually invalidated it"); + } + + [Test] + public void CacheItemMundane() + { + UUID Random1 = UUID.Random(); + UUID Random2 = UUID.Random(); + byte[] data = new byte[0]; + CacheItemBase cb1 = new CacheItemBase(Random1.ToString(), DateTime.Now + TimeSpan.FromDays(1)); + CacheItemBase cb2 = new CacheItemBase(Random2.ToString(), DateTime.Now + TimeSpan.FromDays(1)); + CacheItemBase cb3 = new CacheItemBase(Random1.ToString(), DateTime.Now + TimeSpan.FromDays(1)); + + cb1.Store(data); + + Assert.That(cb1.Equals(cb3), "cb1 should equal cb3, their uuids are the same"); + Assert.That(!cb2.Equals(cb1), "cb2 should not equal cb1, their uuids are NOT the same"); + Assert.That(cb1.IsLocked() == false, "CacheItemBase default is false"); + Assert.That(cb1.Retrieve() == null, "Virtual Retrieve method should return null"); + + } } diff --git a/OpenSim/Framework/Tests/LocationTest.cs b/OpenSim/Framework/Tests/LocationTest.cs index 237568f5e4..2707afa066 100644 --- a/OpenSim/Framework/Tests/LocationTest.cs +++ b/OpenSim/Framework/Tests/LocationTest.cs @@ -54,9 +54,28 @@ namespace OpenSim.Framework.Tests Location TestLocation2 = new Location(1099511628032000); Assert.That(TestLocation1 == TestLocation2); + Assert.That(TestLocation2.X == 256000 && TestLocation2.Y == 256000, "Test xy location doesn't match regionhandle provided"); + + Assert.That(TestLocation2.RegionHandle == 1099511628032000, + "Location RegionHandle Property didn't match regionhandle provided in constructor"); + + TestLocation1 = new Location(256001, 256001); TestLocation2 = new Location(1099511628032000); Assert.That(TestLocation1 != TestLocation2); + + Assert.That(TestLocation1.Equals(256001, 256001), "Equals(x,y) failed to match the position in the constructor"); + + Assert.That(TestLocation2.GetHashCode() == (TestLocation2.X.GetHashCode() ^ TestLocation2.Y.GetHashCode()), "GetHashCode failed to produce the expected hashcode"); + + Location TestLocation3; + object cln = TestLocation2.Clone(); + TestLocation3 = (Location) cln; + Assert.That(TestLocation3.X == TestLocation2.X && TestLocation3.Y == TestLocation2.Y, + "Cloned Location values do not match"); + + Assert.That(TestLocation2.Equals(cln), "Cloned object failed .Equals(obj) Test"); + } } diff --git a/OpenSim/Framework/Tests/MundaneFrameworkTests.cs b/OpenSim/Framework/Tests/MundaneFrameworkTests.cs new file mode 100644 index 0000000000..e7f8bfc1f0 --- /dev/null +++ b/OpenSim/Framework/Tests/MundaneFrameworkTests.cs @@ -0,0 +1,311 @@ +/* + * Copyright (c) Contributors, http://opensimulator.org/ + * See CONTRIBUTORS.TXT for a full list of copyright holders. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * * Neither the name of the OpenSimulator Project nor the + * names of its contributors may be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE DEVELOPERS ``AS IS'' AND ANY + * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED + * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + * DISCLAIMED. IN NO EVENT SHALL THE CONTRIBUTORS BE LIABLE FOR ANY + * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES + * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND + * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS + * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +using NUnit.Framework; +using OpenSim.Framework; +using OpenMetaverse; +using OpenMetaverse.StructuredData; +using System; +using System.Globalization; +using System.Threading; + +namespace OpenSim.Framework.Tests +{ + [TestFixture] + public class MundaneFrameworkTests + { + private bool m_RegionSettingsOnSaveEventFired; + private bool m_RegionLightShareDataOnSaveEventFired; + + + [Test] + public void ChildAgentDataUpdate01() + { + // code coverage + ChildAgentDataUpdate cadu = new ChildAgentDataUpdate(); + Assert.IsFalse(cadu.alwaysrun, "Default is false"); + } + + [Test] + public void AgentPositionTest01() + { + UUID AgentId1 = UUID.Random(); + UUID SessionId1 = UUID.Random(); + uint CircuitCode1 = uint.MinValue; + Vector3 Size1 = Vector3.UnitZ; + Vector3 Position1 = Vector3.UnitX; + Vector3 LeftAxis1 = Vector3.UnitY; + Vector3 UpAxis1 = Vector3.UnitZ; + Vector3 AtAxis1 = Vector3.UnitX; + + ulong RegionHandle1 = ulong.MinValue; + byte[] Throttles1 = new byte[] {0, 1, 0}; + + Vector3 Velocity1 = Vector3.Zero; + float Far1 = 256; + + bool ChangedGrid1 = false; + Vector3 Center1 = Vector3.Zero; + + AgentPosition position1 = new AgentPosition(); + position1.AgentID = AgentId1; + position1.SessionID = SessionId1; + position1.CircuitCode = CircuitCode1; + position1.Size = Size1; + position1.Position = Position1; + position1.LeftAxis = LeftAxis1; + position1.UpAxis = UpAxis1; + position1.AtAxis = AtAxis1; + position1.RegionHandle = RegionHandle1; + position1.Throttles = Throttles1; + position1.Velocity = Velocity1; + position1.Far = Far1; + position1.ChangedGrid = ChangedGrid1; + position1.Center = Center1; + + ChildAgentDataUpdate cadu = new ChildAgentDataUpdate(); + cadu.AgentID = AgentId1.Guid; + cadu.ActiveGroupID = UUID.Zero.Guid; + cadu.throttles = Throttles1; + cadu.drawdistance = Far1; + cadu.Position = Position1; + cadu.Velocity = Velocity1; + cadu.regionHandle = RegionHandle1; + cadu.cameraPosition = Center1; + cadu.AVHeight = Size1.Z; + + AgentPosition position2 = new AgentPosition(); + position2.CopyFrom(cadu); + + Assert.IsTrue( + position2.AgentID == position1.AgentID + && position2.Size == position1.Size + && position2.Position == position1.Position + && position2.Velocity == position1.Velocity + && position2.Center == position1.Center + && position2.RegionHandle == position1.RegionHandle + && position2.Far == position1.Far + + ,"Copy From ChildAgentDataUpdate failed"); + + position2 = new AgentPosition(); + + Assert.IsFalse(position2.AgentID == position1.AgentID, "Test Error, position2 should be a blank uninitialized AgentPosition"); + position2.Unpack(position1.Pack()); + + Assert.IsTrue(position2.AgentID == position1.AgentID, "Agent ID didn't unpack the same way it packed"); + Assert.IsTrue(position2.Position == position1.Position, "Position didn't unpack the same way it packed"); + Assert.IsTrue(position2.Velocity == position1.Velocity, "Velocity didn't unpack the same way it packed"); + Assert.IsTrue(position2.SessionID == position1.SessionID, "SessionID didn't unpack the same way it packed"); + Assert.IsTrue(position2.CircuitCode == position1.CircuitCode, "CircuitCode didn't unpack the same way it packed"); + Assert.IsTrue(position2.LeftAxis == position1.LeftAxis, "LeftAxis didn't unpack the same way it packed"); + Assert.IsTrue(position2.UpAxis == position1.UpAxis, "UpAxis didn't unpack the same way it packed"); + Assert.IsTrue(position2.AtAxis == position1.AtAxis, "AtAxis didn't unpack the same way it packed"); + Assert.IsTrue(position2.RegionHandle == position1.RegionHandle, "RegionHandle didn't unpack the same way it packed"); + Assert.IsTrue(position2.ChangedGrid == position1.ChangedGrid, "ChangedGrid didn't unpack the same way it packed"); + Assert.IsTrue(position2.Center == position1.Center, "Center didn't unpack the same way it packed"); + Assert.IsTrue(position2.Size == position1.Size, "Size didn't unpack the same way it packed"); + + } + + [Test] + public void RegionSettingsTest01() + { + RegionSettings settings = new RegionSettings(); + settings.OnSave += RegionSaveFired; + settings.Save(); + settings.OnSave -= RegionSaveFired; + +// string str = settings.LoadedCreationDate; +// int dt = settings.LoadedCreationDateTime; +// string id = settings.LoadedCreationID; +// string time = settings.LoadedCreationTime; + + Assert.That(m_RegionSettingsOnSaveEventFired, "RegionSettings Save Event didn't Fire"); + + } + public void RegionSaveFired(RegionSettings settings) + { + m_RegionSettingsOnSaveEventFired = true; + } + + [Test] + public void InventoryItemBaseConstructorTest01() + { + InventoryItemBase b1 = new InventoryItemBase(); + Assert.That(b1.ID == UUID.Zero, "void constructor should create an inventory item with ID = UUID.Zero"); + Assert.That(b1.Owner == UUID.Zero, "void constructor should create an inventory item with Owner = UUID.Zero"); + + UUID ItemID = UUID.Random(); + UUID OwnerID = UUID.Random(); + + InventoryItemBase b2 = new InventoryItemBase(ItemID); + Assert.That(b2.ID == ItemID, "ID constructor should create an inventory item with ID = ItemID"); + Assert.That(b2.Owner == UUID.Zero, "ID constructor should create an inventory item with Owner = UUID.Zero"); + + InventoryItemBase b3 = new InventoryItemBase(ItemID,OwnerID); + Assert.That(b3.ID == ItemID, "ID,OwnerID constructor should create an inventory item with ID = ItemID"); + Assert.That(b3.Owner == OwnerID, "ID,OwnerID constructor should create an inventory item with Owner = OwnerID"); + + } + + [Test] + public void AssetMetaDataNonNullContentTypeTest01() + { + AssetMetadata assetMetadata = new AssetMetadata(); + assetMetadata.ContentType = "image/jp2"; + Assert.That(assetMetadata.Type == (sbyte)AssetType.Texture, "Content type should be AssetType.Texture"); + Assert.That(assetMetadata.ContentType == "image/jp2", "Text of content type should be image/jp2"); + UUID rndID = UUID.Random(); + assetMetadata.ID = rndID.ToString(); + Assert.That(assetMetadata.ID.ToLower() == rndID.ToString().ToLower(), "assetMetadata.ID Setter/Getter not Consistent"); + DateTime fixedTime = DateTime.Now; + assetMetadata.CreationDate = fixedTime; + } + + [Test] + public void RegionLightShareDataCloneSaveTest01() + { + RegionLightShareData rlsd = new RegionLightShareData(); + rlsd.OnSave += RegionLightShareDataSaveFired; + rlsd.Save(); + rlsd.OnSave -= RegionLightShareDataSaveFired; + Assert.IsTrue(m_RegionLightShareDataOnSaveEventFired, "OnSave Event Never Fired"); + + object o = rlsd.Clone(); + RegionLightShareData dupe = (RegionLightShareData) o; + Assert.IsTrue(rlsd.sceneGamma == dupe.sceneGamma, "Memberwise Clone of RegionLightShareData failed"); + } + public void RegionLightShareDataSaveFired(RegionLightShareData settings) + { + m_RegionLightShareDataOnSaveEventFired = true; + } + + [Test] + public void EstateSettingsMundateTests() + { + EstateSettings es = new EstateSettings(); + es.AddBan(null); + UUID bannedUserId = UUID.Random(); + es.AddBan(new EstateBan() + { BannedHostAddress = string.Empty, + BannedHostIPMask = string.Empty, + BannedHostNameMask = string.Empty, + BannedUserID = bannedUserId} + ); + Assert.IsTrue(es.IsBanned(bannedUserId), "User Should be banned but is not."); + Assert.IsFalse(es.IsBanned(UUID.Zero), "User Should not be banned but is."); + + es.RemoveBan(bannedUserId); + + Assert.IsFalse(es.IsBanned(bannedUserId), "User Should not be banned but is."); + + es.AddEstateManager(UUID.Zero); + + es.AddEstateManager(bannedUserId); + Assert.IsTrue(es.IsEstateManager(bannedUserId), "bannedUserId should be EstateManager but isn't."); + + es.RemoveEstateManager(bannedUserId); + Assert.IsFalse(es.IsEstateManager(bannedUserId), "bannedUserID is estateManager but shouldn't be"); + + Assert.IsFalse(es.HasAccess(bannedUserId), "bannedUserID has access but shouldn't"); + + es.AddEstateUser(bannedUserId); + + Assert.IsTrue(es.HasAccess(bannedUserId), "bannedUserID doesn't have access but should"); + es.RemoveEstateUser(bannedUserId); + + es.AddEstateManager(bannedUserId); + + Assert.IsTrue(es.HasAccess(bannedUserId), "bannedUserID doesn't have access but should"); + + Assert.That(es.EstateGroups.Length == 0, "No Estate Groups Added.. so the array should be 0 length"); + + es.AddEstateGroup(bannedUserId); + + Assert.That(es.EstateGroups.Length == 1, "1 Estate Groups Added.. so the array should be 1 length"); + + Assert.That(es.EstateGroups[0] == bannedUserId,"User ID should be in EstateGroups"); + + } + + [Test] + public void InventoryFolderBaseConstructorTest01() + { + UUID uuid1 = UUID.Random(); + UUID uuid2 = UUID.Random(); + + InventoryFolderBase fld = new InventoryFolderBase(uuid1); + Assert.That(fld.ID == uuid1, "ID constructor failed to save value in ID field."); + + fld = new InventoryFolderBase(uuid1, uuid2); + Assert.That(fld.ID == uuid1, "ID,Owner constructor failed to save value in ID field."); + Assert.That(fld.Owner == uuid2, "ID,Owner constructor failed to save value in ID field."); + } + + [Test] + public void AsssetBaseConstructorTest01() + { + AssetBase abase = new AssetBase(); + Assert.IsNotNull(abase.Metadata, "void constructor of AssetBase should have created a MetaData element but didn't."); + UUID itemID = UUID.Random(); + UUID creatorID = UUID.Random(); + abase = new AssetBase(itemID.ToString(), "test item", (sbyte) AssetType.Texture, creatorID.ToString()); + + Assert.IsNotNull(abase.Metadata, "string,string,sbyte,string constructor of AssetBase should have created a MetaData element but didn't."); + Assert.That(abase.ID == itemID.ToString(), "string,string,sbyte,string constructor failed to set ID property"); + Assert.That(abase.Metadata.CreatorID == creatorID.ToString(), "string,string,sbyte,string constructor failed to set Creator ID"); + + + abase = new AssetBase(itemID.ToString(), "test item", -1, creatorID.ToString()); + Assert.IsNotNull(abase.Metadata, "string,string,sbyte,string constructor of AssetBase with unknown type should have created a MetaData element but didn't."); + Assert.That(abase.Metadata.Type == -1, "Unknown Type passed to string,string,sbyte,string constructor and was a known type when it came out again"); + + AssetMetadata metts = new AssetMetadata(); + metts.FullID = itemID; + metts.ID = string.Empty; + metts.Name = "test item"; + abase.Metadata = metts; + + Assert.That(abase.ToString() == itemID.ToString(), "ToString is overriden to be fullID.ToString()"); + Assert.That(abase.ID == itemID.ToString(),"ID should be MetaData.FullID.ToString() when string.empty or null is provided to the ID property"); + } + + [Test] + public void CultureSetCultureTest01() + { + CultureInfo ci = new CultureInfo("en-US", false); + Culture.SetCurrentCulture(); + Assert.That(Thread.CurrentThread.CurrentCulture.Name == ci.Name, "SetCurrentCulture failed to set thread culture to en-US"); + + } + + + + } +} + diff --git a/OpenSim/Framework/Tests/PrimeNumberHelperTests.cs b/OpenSim/Framework/Tests/PrimeNumberHelperTests.cs new file mode 100644 index 0000000000..d741f9116d --- /dev/null +++ b/OpenSim/Framework/Tests/PrimeNumberHelperTests.cs @@ -0,0 +1,146 @@ +/* + * Copyright (c) Contributors, http://opensimulator.org/ + * See CONTRIBUTORS.TXT for a full list of copyright holders. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * * Neither the name of the OpenSimulator Project nor the + * names of its contributors may be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE DEVELOPERS ``AS IS'' AND ANY + * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED + * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + * DISCLAIMED. IN NO EVENT SHALL THE CONTRIBUTORS BE LIABLE FOR ANY + * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES + * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND + * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS + * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +using System; +using System.Reflection; +using NUnit.Framework; +using NUnit.Framework.SyntaxHelpers; +using OpenMetaverse; +using OpenMetaverse.StructuredData; +using OpenSim.Framework; + +namespace OpenSim.Framework.Tests +{ + [TestFixture] + public class PrimeNumberHelperTests + { + + + [Test] + public void TestGetPrime() + { + int prime1 = PrimeNumberHelper.GetPrime(7919); + Assert.That(prime1 == 8419, "Prime Number Get Prime Failed, 7919 is prime"); + Assert.That(PrimeNumberHelper.IsPrime(prime1),"Prime1 should be prime"); + Assert.That(PrimeNumberHelper.IsPrime(7919), "7919 is prime but is falsely failing the prime test"); + prime1 = PrimeNumberHelper.GetPrime(Int32.MaxValue - 1); + Assert.That(prime1 == -1, "prime1 should have been -1 since there are no primes between Int32.MaxValue-1 and Int32.MaxValue"); + + } + + [Test] + public void Test1000SmallPrimeNumbers() + { + int[] primes = { + 2, 3, 5, 7, 11, 13, 17, 19, 23, 29, 31, 37, 41, 43, 47, 53, 59, 61, 67, 71, 73, 79, 83, 89, + 97, 101, 103, 107, 109, 113, 127, 131, 137, 139, 149, 151, 157, 163, 167, 173, 179, 181, 191 + , 193, 197, 199, 211, 223, 227, 229, 233, 239, 241, 251, 257, 263, 269, 271, 277, 281, 283, + 293, 307, 311, 313, 317, 331, 337, 347, 349, 353, 359, 367, 373, 379, 383, 389, 397, 401, + 409, 419, 421, 431, 433, 439, 443, 449, 457, 461, 463, 467, 479, 487, 491, 499, 503, 509, + 521, 523, 541, 547, 557, 563, 569, 571, 577, 587, 593, 599, 601, 607, 613, 617, 619, 631, + 641, 643, 647, 653, 659, 661, 673, 677, 683, 691, 701, 709, 719, 727, 733, 739, 743, 751, + 757, 761, 769, 773, 787, 797, 809, 811, 821, 823, 827, 829, 839, 853, 857, 859, 863, 877, + 881, 883, 887, 907, 911, 919, 929, 937, 941, 947, 953, 967, 971, 977, 983, 991, 997, 1009, + 1013, 1019, 1021, 1031, 1033, 1039, 1049, 1051, 1061, 1063, 1069, 1087, 1091, 1093, 1097, + 1103, 1109, 1117, 1123, 1129, 1151, 1153, 1163, 1171, 1181, 1187, 1193, 1201, 1213, 1217, + 1223, 1229, 1231, 1237, 1249, 1259, 1277, 1279, 1283, 1289, 1291, 1297, 1301, 1303, 1307, + 1319, 1321, 1327, 1361, 1367, 1373, 1381, 1399, 1409, 1423, 1427, 1429, 1433, 1439, 1447, + 1451, 1453, 1459, 1471, 1481, 1483, 1487, 1489, 1493, 1499, 1511, 1523, 1531, 1543, 1549, + 1553, 1559, 1567, 1571, 1579, 1583, 1597, 1601, 1607, 1609, 1613, 1619, 1621, 1627, 1637, + 1657, 1663, 1667, 1669, 1693, 1697, 1699, 1709, 1721, 1723, 1733, 1741, 1747, 1753, 1759, + 1777, 1783, 1787, 1789, 1801, 1811, 1823, 1831, 1847, 1861, 1867, 1871, 1873, 1877, 1879, + 1889, 1901, 1907, 1913, 1931, 1933, 1949, 1951, 1973, 1979, 1987, 1993, 1997, 1999, 2003, + 2011, 2017, 2027, 2029, 2039, 2053, 2063, 2069, 2081, 2083, 2087, 2089, 2099, 2111, 2113, + 2129, 2131, 2137, 2141, 2143, 2153, 2161, 2179, 2203, 2207, 2213, 2221, 2237, 2239, 2243, + 2251, 2267, 2269, 2273, 2281, 2287, 2293, 2297, 2309, 2311, 2333, 2339, 2341, 2347, 2351, + 2357, 2371, 2377, 2381, 2383, 2389, 2393, 2399, 2411, 2417, 2423, 2437, 2441, 2447, 2459, + 2467, 2473, 2477, 2503, 2521, 2531, 2539, 2543, 2549, 2551, 2557, 2579, 2591, 2593, 2609, + 2617, 2621, 2633, 2647, 2657, 2659, 2663, 2671, 2677, 2683, 2687, 2689, 2693, 2699, 2707, + 2711, 2713, 2719, 2729, 2731, 2741, 2749, 2753, 2767, 2777, 2789, 2791, 2797, 2801, 2803, + 2819, 2833, 2837, 2843, 2851, 2857, 2861, 2879, 2887, 2897, 2903, 2909, 2917, 2927, 2939, + 2953, 2957, 2963, 2969, 2971, 2999, 3001, 3011, 3019, 3023, 3037, 3041, 3049, 3061, 3067, + 3079, 3083, 3089, 3109, 3119, 3121, 3137, 3163, 3167, 3169, 3181, 3187, 3191, 3203, 3209, + 3217, 3221, 3229, 3251, 3253, 3257, 3259, 3271, 3299, 3301, 3307, 3313, 3319, 3323, 3329, + 3331, 3343, 3347, 3359, 3361, 3371, 3373, 3389, 3391, 3407, 3413, 3433, 3449, 3457, 3461, + 3463, 3467, 3469, 3491, 3499, 3511, 3517, 3527, 3529, 3533, 3539, 3541, 3547, 3557, 3559, + 3571, 3581, 3583, 3593, 3607, 3613, 3617, 3623, 3631, 3637, 3643, 3659, 3671, 3673, 3677, + 3691, 3697, 3701, 3709, 3719, 3727, 3733, 3739, 3761, 3767, 3769, 3779, 3793, 3797, 3803, + 3821, 3823, 3833, 3847, 3851, 3853, 3863, 3877, 3881, 3889, 3907, 3911, 3917, 3919, 3923, + 3929, 3931, 3943, 3947, 3967, 3989, 4001, 4003, 4007, 4013, 4019, 4021, 4027, 4049, 4051, + 4057, 4073, 4079, 4091, 4093, 4099, 4111, 4127, 4129, 4133, 4139, 4153, 4157, 4159, 4177, + 4201, 4211, 4217, 4219, 4229, 4231, 4241, 4243, 4253, 4259, 4261, 4271, 4273, 4283, 4289, + 4297, 4327, 4337, 4339, 4349, 4357, 4363, 4373, 4391, 4397, 4409, 4421, 4423, 4441, 4447, + 4451, 4457, 4463, 4481, 4483, 4493, 4507, 4513, 4517, 4519, 4523, 4547, 4549, 4561, 4567, + 4583, 4591, 4597, 4603, 4621, 4637, 4639, 4643, 4649, 4651, 4657, 4663, 4673, 4679, 4691, + 4703, 4721, 4723, 4729, 4733, 4751, 4759, 4783, 4787, 4789, 4793, 4799, 4801, 4813, 4817, + 4831, 4861, 4871, 4877, 4889, 4903, 4909, 4919, 4931, 4933, 4937, 4943, 4951, 4957, 4967, + 4969, 4973, 4987, 4993, 4999, 5003, 5009, 5011, 5021, 5023, 5039, 5051, 5059, 5077, 5081, + 5087, 5099, 5101, 5107, 5113, 5119, 5147, 5153, 5167, 5171, 5179, 5189, 5197, 5209, 5227, + 5231, 5233, 5237, 5261, 5273, 5279, 5281, 5297, 5303, 5309, 5323, 5333, 5347, 5351, 5381, + 5387, 5393, 5399, 5407, 5413, 5417, 5419, 5431, 5437, 5441, 5443, 5449, 5471, 5477, 5479, + 5483, 5501, 5503, 5507, 5519, 5521, 5527, 5531, 5557, 5563, 5569, 5573, 5581, 5591, 5623, + 5639, 5641, 5647, 5651, 5653, 5657, 5659, 5669, 5683, 5689, 5693, 5701, 5711, 5717, 5737, + 5741, 5743, 5749, 5779, 5783, 5791, 5801, 5807, 5813, 5821, 5827, 5839, 5843, 5849, 5851, + 5857, 5861, 5867, 5869, 5879, 5881, 5897, 5903, 5923, 5927, 5939, 5953, 5981, 5987, 6007, + 6011, 6029, 6037, 6043, 6047, 6053, 6067, 6073, 6079, 6089, 6091, 6101, 6113, 6121, 6131, + 6133, 6143, 6151, 6163, 6173, 6197, 6199, 6203, 6211, 6217, 6221, 6229, 6247, 6257, 6263, + 6269, 6271, 6277, 6287, 6299, 6301, 6311, 6317, 6323, 6329, 6337, 6343, 6353, 6359, 6361, + 6367, 6373, 6379, 6389, 6397, 6421, 6427, 6449, 6451, 6469, 6473, 6481, 6491, 6521, 6529, + 6547, 6551, 6553, 6563, 6569, 6571, 6577, 6581, 6599, 6607, 6619, 6637, 6653, 6659, 6661, + 6673, 6679, 6689, 6691, 6701, 6703, 6709, 6719, 6733, 6737, 6761, 6763, 6779, 6781, 6791, + 6793, 6803, 6823, 6827, 6829, 6833, 6841, 6857, 6863, 6869, 6871, 6883, 6899, 6907, 6911, + 6917, 6947, 6949, 6959, 6961, 6967, 6971, 6977, 6983, 6991, 6997, 7001, 7013, 7019, 7027, + 7039, 7043, 7057, 7069, 7079, 7103, 7109, 7121, 7127, 7129, 7151, 7159, 7177, 7187, 7193, + 7207, 7211, 7213, 7219, 7229, 7237, 7243, 7247, 7253, 7283, 7297, 7307, 7309, 7321, 7331, + 7333, 7349, 7351, 7369, 7393, 7411, 7417, 7433, 7451, 7457, 7459, 7477, 7481, 7487, 7489, + 7499, 7507, 7517, 7523, 7529, 7537, 7541, 7547, 7549, 7559, 7561, 7573, 7577, 7583, 7589, + 7591, 7603, 7607, 7621, 7639, 7643, 7649, 7669, 7673, 7681, 7687, 7691, 7699, 7703, 7717, + 7723, 7727, 7741, 7753, 7757, 7759, 7789, 7793, 7817, 7823, 7829, 7841, 7853, 7867, 7873, + 7877, 7879, 7883, 7901, 7907, 7919 + }; + for (int i = 0; i < primes.Length; i++) + { + Assert.That(PrimeNumberHelper.IsPrime(primes[i]),primes[i] + " is prime but is erroniously failing the prime test"); + } + + int[] nonprimes = { + 4, 6, 8, 10, 14, 16, 18, 22, 28, 30, 36, 40, 42, 46, 52, 58, 60, 66, 70, 72, 78, 82, 88, + 96, 366, 372, 378, 382, 388, 396, 400, 408, 418, 420, 430, 432, 438, 442, 448, 456, 460, 462, + 466, 478, 486, 490, 498, 502, 508, 856, 858, 862, 876, 880, 882, 886, 906, 910, 918, 928, 936, + 940, 946, 952, 966, 970, 976, 982, 990, 996, 1008, 1740, 1746, 1752, 1758, 4650, 4656, 4662, + 4672, 4678, 4690, 7740, 7752, 7756, 7758, 7788, 7792, 7816, 7822, 7828, 7840, 7852, 7866, 7872, + 7876, 7878, 7882, 7900, 7906, 7918 + }; + for (int i = 0; i < nonprimes.Length; i++) + { + Assert.That(!PrimeNumberHelper.IsPrime(nonprimes[i]), nonprimes[i] + " is not prime but is erroniously passing the prime test"); + } + + Assert.That(PrimeNumberHelper.IsPrime(3)); + } + } +} \ No newline at end of file diff --git a/OpenSim/Framework/Tests/UtilTest.cs b/OpenSim/Framework/Tests/UtilTest.cs index 45d822cec2..89f5c0cba9 100644 --- a/OpenSim/Framework/Tests/UtilTest.cs +++ b/OpenSim/Framework/Tests/UtilTest.cs @@ -170,5 +170,119 @@ namespace OpenSim.Framework.Tests // Varying secrets should not eqal the same Assert.AreNotEqual(Util.GetHashGuid(string1, "secret1"), Util.GetHashGuid(string1, "secret2")); } + + [Test] + public void SLUtilTypeConvertTests() + { + int[] assettypes = new int[]{-1,0,1,2,3,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22 + ,23,24,25,46,47,48}; + string[] contenttypes = new string[] + { + "application/octet-stream", + "image/x-j2c", + "audio/ogg", + "application/vnd.ll.callingcard", + "application/vnd.ll.landmark", + "application/vnd.ll.clothing", + "application/vnd.ll.primitive", + "application/vnd.ll.notecard", + "application/vnd.ll.folder", + "application/vnd.ll.rootfolder", + "application/vnd.ll.lsltext", + "application/vnd.ll.lslbyte", + "image/tga", + "application/vnd.ll.bodypart", + "application/vnd.ll.trashfolder", + "application/vnd.ll.snapshotfolder", + "application/vnd.ll.lostandfoundfolder", + "audio/x-wav", + "image/tga", + "image/jpeg", + "application/vnd.ll.animation", + "application/vnd.ll.gesture", + "application/x-metaverse-simstate", + "application/vnd.ll.favoritefolder", + "application/vnd.ll.link", + "application/vnd.ll.linkfolder", + "application/vnd.ll.currentoutfitfolder", + "application/vnd.ll.outfitfolder", + "application/vnd.ll.myoutfitsfolder" + }; + for (int i=0;i - /// UserConfig -- For User Server Configuration - /// - public class UserConfig:ConfigBase - { - public string DatabaseProvider = String.Empty; - public string DatabaseConnect = String.Empty; - public string DefaultStartupMsg = String.Empty; - public uint DefaultX = 1000; - public uint DefaultY = 1000; - public string GridRecvKey = String.Empty; - public string GridSendKey = String.Empty; - public uint HttpPort = ConfigSettings.DefaultUserServerHttpPort; - public bool HttpSSL = ConfigSettings.DefaultUserServerHttpSSL; - public uint DefaultUserLevel = 0; - public string LibraryXmlfile = ""; - public string ConsoleUser = String.Empty; - public string ConsolePass = String.Empty; - - private Uri m_inventoryUrl; - - public Uri InventoryUrl - { - get - { - return m_inventoryUrl; - } - set - { - m_inventoryUrl = value; - } - } - - private Uri m_authUrl; - public Uri AuthUrl - { - get - { - return m_authUrl; - } - set - { - m_authUrl = value; - } - } - - private Uri m_gridServerURL; - - public Uri GridServerURL - { - get - { - return m_gridServerURL; - } - set - { - m_gridServerURL = value; - } - } - - public bool EnableLLSDLogin = true; - - public bool EnableHGLogin = true; - - public UserConfig() - { - // weird, but UserManagerBase needs this. - } - public UserConfig(string description, string filename) - { - m_configMember = - new ConfigurationMember(filename, description, loadConfigurationOptions, handleIncomingConfiguration, true); - m_configMember.performConfigurationRetrieve(); - } - - public void loadConfigurationOptions() - { - m_configMember.addConfigurationOption("default_startup_message", - ConfigurationOption.ConfigurationTypes.TYPE_STRING_NOT_EMPTY, - "Default Startup Message", "Welcome to OGS", false); - - m_configMember.addConfigurationOption("default_grid_server", - ConfigurationOption.ConfigurationTypes.TYPE_STRING_NOT_EMPTY, - "Default Grid Server URI", - "http://127.0.0.1:" + ConfigSettings.DefaultGridServerHttpPort + "/", false); - m_configMember.addConfigurationOption("grid_send_key", ConfigurationOption.ConfigurationTypes.TYPE_STRING, - "Key to send to grid server", "null", false); - m_configMember.addConfigurationOption("grid_recv_key", ConfigurationOption.ConfigurationTypes.TYPE_STRING, - "Key to expect from grid server", "null", false); - - m_configMember.addConfigurationOption("default_inventory_server", - ConfigurationOption.ConfigurationTypes.TYPE_STRING_NOT_EMPTY, - "Default Inventory Server URI", - "http://127.0.0.1:" + ConfigSettings.DefaultInventoryServerHttpPort + "/", - false); - m_configMember.addConfigurationOption("default_authentication_server", - ConfigurationOption.ConfigurationTypes.TYPE_STRING_NOT_EMPTY, - "User Server (this) External URI for authentication keys", - "http://localhost:" + ConfigSettings.DefaultUserServerHttpPort + "/", - false); - m_configMember.addConfigurationOption("library_location", - ConfigurationOption.ConfigurationTypes.TYPE_STRING_NOT_EMPTY, - "Path to library control file", - string.Format(".{0}inventory{0}Libraries.xml", Path.DirectorySeparatorChar), false); - - m_configMember.addConfigurationOption("database_provider", ConfigurationOption.ConfigurationTypes.TYPE_STRING, - "DLL for database provider", "OpenSim.Data.MySQL.dll", false); - m_configMember.addConfigurationOption("database_connect", ConfigurationOption.ConfigurationTypes.TYPE_STRING, - "Connection String for Database", "", false); - - m_configMember.addConfigurationOption("http_port", ConfigurationOption.ConfigurationTypes.TYPE_UINT32, - "Http Listener port", ConfigSettings.DefaultUserServerHttpPort.ToString(), false); - m_configMember.addConfigurationOption("http_ssl", ConfigurationOption.ConfigurationTypes.TYPE_BOOLEAN, - "Use SSL? true/false", ConfigSettings.DefaultUserServerHttpSSL.ToString(), false); - m_configMember.addConfigurationOption("default_X", ConfigurationOption.ConfigurationTypes.TYPE_UINT32, - "Known good region X", "1000", false); - m_configMember.addConfigurationOption("default_Y", ConfigurationOption.ConfigurationTypes.TYPE_UINT32, - "Known good region Y", "1000", false); - m_configMember.addConfigurationOption("enable_llsd_login", ConfigurationOption.ConfigurationTypes.TYPE_BOOLEAN, - "Enable LLSD login support [Currently used by libsl based clients/bots]? true/false", true.ToString(), false); - - m_configMember.addConfigurationOption("enable_hg_login", ConfigurationOption.ConfigurationTypes.TYPE_BOOLEAN, - "Enable Hypergrid login support [Currently used by GridSurfer-proxied clients]? true/false", true.ToString(), false); - - m_configMember.addConfigurationOption("default_loginLevel", ConfigurationOption.ConfigurationTypes.TYPE_UINT32, - "Minimum Level a user should have to login [0 default]", "0", false); - - m_configMember.addConfigurationOption("console_user", ConfigurationOption.ConfigurationTypes.TYPE_STRING, - "Remote console access user name [Default: disabled]", "", false); - - m_configMember.addConfigurationOption("console_pass", ConfigurationOption.ConfigurationTypes.TYPE_STRING, - "Remote console access password [Default: disabled]", "", false); - - } - - public bool handleIncomingConfiguration(string configuration_key, object configuration_result) - { - switch (configuration_key) - { - case "default_startup_message": - DefaultStartupMsg = (string) configuration_result; - break; - case "default_grid_server": - GridServerURL = new Uri((string) configuration_result); - break; - case "grid_send_key": - GridSendKey = (string) configuration_result; - break; - case "grid_recv_key": - GridRecvKey = (string) configuration_result; - break; - case "default_inventory_server": - InventoryUrl = new Uri((string) configuration_result); - break; - case "default_authentication_server": - AuthUrl = new Uri((string)configuration_result); - break; - case "database_provider": - DatabaseProvider = (string) configuration_result; - break; - case "database_connect": - DatabaseConnect = (string) configuration_result; - break; - case "http_port": - HttpPort = (uint) configuration_result; - break; - case "http_ssl": - HttpSSL = (bool) configuration_result; - break; - case "default_X": - DefaultX = (uint) configuration_result; - break; - case "default_Y": - DefaultY = (uint) configuration_result; - break; - case "enable_llsd_login": - EnableLLSDLogin = (bool)configuration_result; - break; - case "enable_hg_login": - EnableHGLogin = (bool)configuration_result; - break; - case "default_loginLevel": - DefaultUserLevel = (uint)configuration_result; - break; - case "library_location": - LibraryXmlfile = (string)configuration_result; - break; - case "console_user": - ConsoleUser = (string)configuration_result; - break; - case "console_pass": - ConsolePass = (string)configuration_result; - break; - } - - return true; - } - } -} diff --git a/OpenSim/Framework/Util.cs b/OpenSim/Framework/Util.cs index 802cb37aa0..e8f8e012de 100644 --- a/OpenSim/Framework/Util.cs +++ b/OpenSim/Framework/Util.cs @@ -91,6 +91,17 @@ namespace OpenSim.Framework public static FireAndForgetMethod FireAndForgetMethod = FireAndForgetMethod.SmartThreadPool; + /// + /// Gets the name of the directory where the current running executable + /// is located + /// + /// Filesystem path to the directory containing the current + /// executable + public static string ExecutingDirectory() + { + return Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location); + } + /// /// Linear interpolates B<->C using percent A /// @@ -440,6 +451,14 @@ namespace OpenSim.Framework return (x + y - (min >> 1) - (min >> 2) + (min >> 4)); } + /// + /// Are the co-ordinates of the new region visible from the old region? + /// + /// Old region x-coord + /// New region x-coord + /// Old region y-coord + /// New region y-coord + /// public static bool IsOutsideView(uint oldx, uint newx, uint oldy, uint newy) { // Eventually this will be a function of the draw distance / camera position too. @@ -1171,6 +1190,16 @@ namespace OpenSim.Framework } + public static uint ConvertAccessLevelToMaturity(byte maturity) + { + if (maturity <= 13) + return 0; + else if (maturity <= 21) + return 1; + else + return 2; + } + /// /// Produces an OSDMap from its string representation on a stream /// @@ -1485,5 +1514,49 @@ namespace OpenSim.Framework } } + /// + /// Gets the client IP address + /// + /// + /// + public static IPEndPoint GetClientIPFromXFF(string xff) + { + if (xff == string.Empty) + return null; + + string[] parts = xff.Split(new char[] { ',' }); + if (parts.Length > 0) + { + try + { + return new IPEndPoint(IPAddress.Parse(parts[0]), 0); + } + catch (Exception e) + { + m_log.WarnFormat("[UTIL]: Exception parsing XFF header {0}: {1}", xff, e.Message); + } + } + + return null; + } + + public static string GetCallerIP(Hashtable req) + { + if (req.ContainsKey("headers")) + { + try + { + Hashtable headers = (Hashtable)req["headers"]; + if (headers.ContainsKey("remote_addr") && headers["remote_addr"] != null) + return headers["remote_addr"].ToString(); + } + catch (Exception e) + { + m_log.WarnFormat("[UTIL]: exception in GetCallerIP: {0}", e.Message); + } + } + return string.Empty; + } + } -} \ No newline at end of file +} diff --git a/OpenSim/Framework/Watchdog.cs b/OpenSim/Framework/Watchdog.cs index 5d46905a73..0f34e8338d 100644 --- a/OpenSim/Framework/Watchdog.cs +++ b/OpenSim/Framework/Watchdog.cs @@ -1,4 +1,4 @@ -/* +/* * Copyright (c) Contributors, http://opensimulator.org/ * See CONTRIBUTORS.TXT for a full list of copyright holders. * @@ -27,6 +27,7 @@ using System; using System.Collections.Generic; +using System.Linq; using System.Threading; using log4net; @@ -43,7 +44,7 @@ namespace OpenSim.Framework const int WATCHDOG_TIMEOUT_MS = 5000; [System.Diagnostics.DebuggerDisplay("{Thread.Name}")] - private class ThreadWatchdogInfo + public class ThreadWatchdogInfo { public Thread Thread; public int LastTick; @@ -149,6 +150,15 @@ namespace OpenSim.Framework } catch { } } + + /// + /// Get currently watched threads for diagnostic purposes + /// + /// + public static ThreadWatchdogInfo[] GetThreads() + { + return m_threads.Values.ToArray(); + } private static void WatchdogTimerElapsed(object sender, System.Timers.ElapsedEventArgs e) { diff --git a/OpenSim/Framework/WebUtil.cs b/OpenSim/Framework/WebUtil.cs index e20866eaa3..d16f9bf213 100644 --- a/OpenSim/Framework/WebUtil.cs +++ b/OpenSim/Framework/WebUtil.cs @@ -139,8 +139,9 @@ namespace OpenSim.Framework request.ContentLength = requestData.Length; request.ContentType = "application/x-www-form-urlencoded"; - using (Stream requestStream = request.GetRequestStream()) - requestStream.Write(requestData, 0, requestData.Length); + Stream requestStream = request.GetRequestStream(); + requestStream.Write(requestData, 0, requestData.Length); + requestStream.Close(); using (WebResponse response = request.GetResponse()) { @@ -169,7 +170,7 @@ namespace OpenSim.Framework } catch (Exception ex) { - m_log.Warn("POST to URL " + url + " failed: " + ex.Message); + m_log.Warn("POST to URL " + url + " failed: " + ex); errorMessage = ex.Message; } diff --git a/OpenSim/Region/Application/Application.cs b/OpenSim/Region/Application/Application.cs index b860cf6bc0..d120f03dc9 100644 --- a/OpenSim/Region/Application/Application.cs +++ b/OpenSim/Region/Application/Application.cs @@ -225,7 +225,7 @@ namespace OpenSim } } MainConsole.Instance = null; - } + } */ configSource.Alias.AddAlias("On", true); configSource.Alias.AddAlias("Off", false); diff --git a/OpenSim/Region/Application/ConfigurationLoader.cs b/OpenSim/Region/Application/ConfigurationLoader.cs index cac5fa99c8..6e3d6af57c 100644 --- a/OpenSim/Region/Application/ConfigurationLoader.cs +++ b/OpenSim/Region/Application/ConfigurationLoader.cs @@ -83,7 +83,10 @@ namespace OpenSim List sources = new List(); string masterFileName = - startupConfig.GetString("inimaster", String.Empty); + startupConfig.GetString("inimaster", "OpenSimDefaults.ini"); + + if (masterFileName == "none") + masterFileName = String.Empty; if (IsUri(masterFileName)) { @@ -95,10 +98,19 @@ namespace OpenSim string masterFilePath = Path.GetFullPath( Path.Combine(Util.configDir(), masterFileName)); - if (masterFileName != String.Empty && - File.Exists(masterFilePath) && - (!sources.Contains(masterFilePath))) - sources.Add(masterFilePath); + if (masterFileName != String.Empty) + { + if (File.Exists(masterFilePath)) + { + if (!sources.Contains(masterFilePath)) + sources.Add(masterFilePath); + } + else + { + m_log.ErrorFormat("Master ini file {0} not found", masterFilePath); + Environment.Exit(1); + } + } } @@ -160,7 +172,7 @@ namespace OpenSim if (sources.Count == 0) { m_log.FatalFormat("[CONFIG]: Could not load any configuration"); - m_log.FatalFormat("[CONFIG]: Did you copy the OpenSim.ini.example file to OpenSim.ini?"); + m_log.FatalFormat("[CONFIG]: Did you copy the OpenSimDefaults.ini.example file to OpenSimDefaults.ini?"); Environment.Exit(1); } @@ -211,7 +223,17 @@ namespace OpenSim else { string basepath = Path.GetFullPath(Util.configDir()); - string path = Path.Combine(basepath, file); + // Resolve relative paths with wildcards + string chunkWithoutWildcards = file; + string chunkWithWildcards = string.Empty; + int wildcardIndex = file.IndexOfAny(new char[] { '*', '?' }); + if (wildcardIndex != -1) + { + chunkWithoutWildcards = file.Substring(0, wildcardIndex); + chunkWithWildcards = file.Substring(wildcardIndex); + } + string path = Path.Combine(basepath, chunkWithoutWildcards); + path = Path.GetFullPath(path) + chunkWithWildcards; string[] paths = Util.Glob(path); foreach (string p in paths) { @@ -307,21 +329,6 @@ namespace OpenSim config.Set("EventQueue", true); } - { - IConfig config = defaultConfig.Configs["StandAlone"]; - - if (null == config) - config = defaultConfig.AddConfig("StandAlone"); - - config.Set("accounts_authenticate", true); - config.Set("welcome_message", "Welcome to OpenSimulator"); - config.Set("inventory_plugin", "OpenSim.Data.SQLite.dll"); - config.Set("inventory_source", ""); - config.Set("userDatabase_plugin", "OpenSim.Data.SQLite.dll"); - config.Set("user_source", ""); - config.Set("LibrariesXMLFile", string.Format(".{0}inventory{0}Libraries.xml", Path.DirectorySeparatorChar)); - } - { IConfig config = defaultConfig.Configs["Network"]; @@ -350,10 +357,6 @@ namespace OpenSim m_configSettings.StorageDll = startupConfig.GetString("storage_plugin"); - m_configSettings.StorageConnectionString - = startupConfig.GetString("storage_connection_string"); - m_configSettings.EstateConnectionString - = startupConfig.GetString("estate_connection_string", m_configSettings.StorageConnectionString); m_configSettings.ClientstackDll = startupConfig.GetString("clientstack_plugin", "OpenSim.Region.ClientStack.LindenUDP.dll"); } diff --git a/OpenSim/Region/Application/OpenSim.cs b/OpenSim/Region/Application/OpenSim.cs index 00fb10412e..01e10c233a 100644 --- a/OpenSim/Region/Application/OpenSim.cs +++ b/OpenSim/Region/Application/OpenSim.cs @@ -30,6 +30,7 @@ using System.Collections; using System.Collections.Generic; using System.IO; using System.Reflection; +using System.Text; using System.Timers; using log4net; using Nini.Config; @@ -152,7 +153,7 @@ namespace OpenSim RegisterConsoleCommands(); base.StartupSpecific(); - + MainServer.Instance.AddStreamHandler(new OpenSim.SimStatusHandler()); MainServer.Instance.AddStreamHandler(new OpenSim.XSimStatusHandler(this)); if (userStatsURI != String.Empty) @@ -192,7 +193,7 @@ namespace OpenSim // Hook up to the watchdog timer Watchdog.OnWatchdogTimeout += WatchdogTimeoutHandler; - PrintFileToConsole("startuplogo.txt"); + PrintFileToConsole("startuplogo.txt"); // For now, start at the 'root' level by default if (m_sceneManager.Scenes.Count == 1) // If there is only one region, select it @@ -218,7 +219,13 @@ namespace OpenSim m_console.Commands.AddCommand("region", false, "debug packet", "debug packet ", - "Turn on packet debugging", Debug); + "Turn on packet debugging", + "If level > 255 then all incoming and outgoing packets are logged.\n" + + "If level <= 255 then incoming AgentUpdate and outgoing SimStats and SimulatorViewerTimeMessage packets are not logged.\n" + + "If level <= 200 then incoming RequestImage and outgoing ImagePacket, ImageData, LayerData and CoarseLocationUpdate packets are not logged.\n" + + "If level <= 100 then incoming ViewerEffect and AgentAnimation and outgoing ViewerEffect and AvatarAnimation packets are not logged.\n" + + "If level <= 0 then no packets are logged.", + Debug); m_console.Commands.AddCommand("region", false, "debug scene", "debug scene ", @@ -258,9 +265,11 @@ namespace OpenSim LoadOar); m_console.Commands.AddCommand("region", false, "save oar", - "save oar []", + "save oar [-v|--version=N] [-p|--profile=url] []", "Save a region's data to an OAR archive.", - "The OAR path must be a filesystem path." + "-v|--version=N generates scene objects as per older versions of the serialization (e.g. -v=0)" + Environment.NewLine + + "-p|--profile=url adds the url of the profile service to the saved user information" + Environment.NewLine + + "The OAR path must be a filesystem path." + " If this is not given then the oar is saved to region.oar in the current directory.", SaveOar); @@ -278,16 +287,15 @@ namespace OpenSim m_console.Commands.AddCommand("region", false, "show users", "show users [full]", - "Show user data", HandleShow); + "Show user data for users currently on the region", + "Without the 'full' option, only users actually on the region are shown." + + " With the 'full' option child agents of users in neighbouring regions are also shown.", + HandleShow); m_console.Commands.AddCommand("region", false, "show connections", "show connections", "Show connection data", HandleShow); - m_console.Commands.AddCommand("region", false, "show users full", - "show users full", - String.Empty, HandleShow); - m_console.Commands.AddCommand("region", false, "show modules", "show modules", "Show module data", HandleShow); @@ -297,8 +305,12 @@ namespace OpenSim "Show region data", HandleShow); m_console.Commands.AddCommand("region", false, "show queues", - "show queues", - "Show queue data", HandleShow); + "show queues [full]", + "Show queue data for each client", + "Without the 'full' option, only users actually on the region are shown." + + " With the 'full' option child agents of users in neighbouring regions are also shown.", + HandleShow); + m_console.Commands.AddCommand("region", false, "show ratings", "show ratings", "Show rating data", HandleShow); @@ -308,8 +320,13 @@ namespace OpenSim "Persist objects to the database now", RunCommand); m_console.Commands.AddCommand("region", false, "create region", - "create region", - "Create a new region", HandleCreateRegion); + "create region [\"region name\"] ", + "Create a new region.", + "The settings for \"region name\" are read from . Paths specified with are relative to your Regions directory, unless an absolute path is given." + + " If \"region name\" does not exist in , it will be added." + Environment.NewLine + + "Without \"region name\", the first region found in will be created." + Environment.NewLine + + "If does not exist, it will be created.", + HandleCreateRegion); m_console.Commands.AddCommand("region", false, "restart", "restart", @@ -469,7 +486,7 @@ namespace OpenSim { MainConsole.Instance.Output( String.Format( - "Kicking user: {0,-16}{1,-16}{2,-37} in region: {3,-16}", + "Kicking user: {0,-16} {1,-16} {2,-37} in region: {3,-16}", presence.Firstname, presence.Lastname, presence.UUID, regionInfo.RegionName)); // kick client... @@ -564,41 +581,48 @@ namespace OpenSim /// Creates a new region based on the parameters specified. This will ask the user questions on the console /// /// - /// 0,1,region name, region XML file + /// 0,1,region name, region ini or XML file private void HandleCreateRegion(string module, string[] cmd) { - if (cmd.Length < 4) + string regionName = string.Empty; + string regionFile = string.Empty; + if (cmd.Length == 3) { - MainConsole.Instance.Output("Usage: create region "); + regionFile = cmd[2]; + } + else if (cmd.Length > 3) + { + regionName = cmd[2]; + regionFile = cmd[3]; + } + string extension = Path.GetExtension(regionFile).ToLower(); + bool isXml = extension.Equals(".xml"); + bool isIni = extension.Equals(".ini"); + if (!isXml && !isIni) + { + MainConsole.Instance.Output("Usage: create region [\"region name\"] "); return; } - if (cmd[3].EndsWith(".xml")) + if (!Path.IsPathRooted(regionFile)) { string regionsDir = ConfigSource.Source.Configs["Startup"].GetString("regionload_regionsdir", "Regions").Trim(); - string regionFile = String.Format("{0}/{1}", regionsDir, cmd[3]); - // Allow absolute and relative specifiers - if (cmd[3].StartsWith("/") || cmd[3].StartsWith("\\") || cmd[3].StartsWith("..")) - regionFile = cmd[3]; - - IScene scene; - CreateRegion(new RegionInfo(cmd[2], regionFile, false, ConfigSource.Source), true, out scene); + regionFile = Path.Combine(regionsDir, regionFile); } - else if (cmd[3].EndsWith(".ini")) - { - string regionsDir = ConfigSource.Source.Configs["Startup"].GetString("regionload_regionsdir", "Regions").Trim(); - string regionFile = String.Format("{0}/{1}", regionsDir, cmd[3]); - // Allow absolute and relative specifiers - if (cmd[3].StartsWith("/") || cmd[3].StartsWith("\\") || cmd[3].StartsWith("..")) - regionFile = cmd[3]; - IScene scene; - CreateRegion(new RegionInfo(cmd[2], regionFile, false, ConfigSource.Source, cmd[2]), true, out scene); + RegionInfo regInfo; + if (isXml) + { + regInfo = new RegionInfo(regionName, regionFile, false, ConfigSource.Source); } else { - MainConsole.Instance.Output("Usage: create region "); - return; + regInfo = new RegionInfo(regionName, regionFile, false, ConfigSource.Source, regionName); } + + IScene scene; + PopulateRegionEstateInfo(regInfo); + CreateRegion(regInfo, true, out scene); + regInfo.EstateSettings.Save(); } /// @@ -908,14 +932,13 @@ namespace OpenSim { agents = m_sceneManager.GetCurrentSceneAvatars(); } - + MainConsole.Instance.Output(String.Format("\nAgents connected: {0}\n", agents.Count)); MainConsole.Instance.Output( - String.Format("{0,-16}{1,-16}{2,-37}{3,-11}{4,-16}{5,-30}", "Firstname", "Lastname", + String.Format("{0,-16} {1,-16} {2,-37} {3,-11} {4,-16} {5,-30}", "Firstname", "Lastname", "Agent ID", "Root/Child", "Region", "Position")); - bool missingTextures = false; foreach (ScenePresence presence in agents) { RegionInfo regionInfo = presence.Scene.RegionInfo; @@ -930,25 +953,17 @@ namespace OpenSim regionName = regionInfo.RegionName; } - string te = "TE"; - if (presence.Appearance.Texture == null) - { - te = ""; - missingTextures = true; - } MainConsole.Instance.Output( String.Format( - "{0,-16}{1,-16}{2,-37}{3,-11}{4,-16}{5,-30}{6,2}", + "{0,-16} {1,-16} {2,-37} {3,-11} {4,-16} {5,-30}", presence.Firstname, presence.Lastname, presence.UUID, presence.IsChildAgent ? "Child" : "Root", regionName, - presence.AbsolutePosition.ToString(), - te)); + presence.AbsolutePosition.ToString())); } - MainConsole.Instance.Output(String.Empty); break; @@ -985,7 +1000,7 @@ namespace OpenSim delegate(Scene scene) { MainConsole.Instance.Output(String.Format( - "Region Name: {0}, Region XLoc: {1}, Region YLoc: {2}, Region Port: {3}", + "Region Name: {0}, Region XLoc: {1}, Region YLoc: {2}, Region Port: {3}", scene.RegionInfo.RegionName, scene.RegionInfo.RegionLocX, scene.RegionInfo.RegionLocY, @@ -994,7 +1009,7 @@ namespace OpenSim break; case "queues": - Notice(GetQueuesReport()); + Notice(GetQueuesReport(showParams)); break; case "ratings": @@ -1024,43 +1039,91 @@ namespace OpenSim } /// - /// print UDP Queue data for each client + /// Generate UDP Queue data report for each client /// + /// /// - private string GetQueuesReport() + private string GetQueuesReport(string[] showParams) { - string report = String.Empty; + bool showChildren = false; + + if (showParams.Length > 1 && showParams[1] == "full") + showChildren = true; + + StringBuilder report = new StringBuilder(); + + int columnPadding = 2; + int maxNameLength = 18; + int maxRegionNameLength = 14; + int maxTypeLength = 4; + int totalInfoFieldsLength = maxNameLength + columnPadding + maxRegionNameLength + columnPadding + maxTypeLength + columnPadding; + + report.AppendFormat("{0,-" + maxNameLength + "}{1,-" + columnPadding + "}", "User", ""); + report.AppendFormat("{0,-" + maxRegionNameLength + "}{1,-" + columnPadding + "}", "Region", ""); + report.AppendFormat("{0,-" + maxTypeLength + "}{1,-" + columnPadding + "}", "Type", ""); + + report.AppendFormat( + "{0,9} {1,9} {2,9} {3,8} {4,7} {5,7} {6,7} {7,7} {8,9} {9,7} {10,7}\n", + "Packets", + "Packets", + "Bytes", + "Bytes", + "Bytes", + "Bytes", + "Bytes", + "Bytes", + "Bytes", + "Bytes", + "Bytes"); + + report.AppendFormat("{0,-" + totalInfoFieldsLength + "}", ""); + report.AppendFormat( + "{0,9} {1,9} {2,9} {3,8} {4,7} {5,7} {6,7} {7,7} {8,9} {9,7} {10,7}\n", + "Out", + "In", + "Unacked", + "Resend", + "Land", + "Wind", + "Cloud", + "Task", + "Texture", + "Asset", + "State"); + + m_sceneManager.ForEachScene( + delegate(Scene scene) + { + scene.ForEachClient( + delegate(IClientAPI client) + { + if (client is IStatsCollector) + { + bool isChild = scene.PresenceChildStatus(client.AgentId); + if (isChild && !showChildren) + return; + + string name = client.Name; + string regionName = scene.RegionInfo.RegionName; + + report.AppendFormat( + "{0,-" + maxNameLength + "}{1,-" + columnPadding + "}", + name.Length > maxNameLength ? name.Substring(0, maxNameLength) : name, ""); + report.AppendFormat( + "{0,-" + maxRegionNameLength + "}{1,-" + columnPadding + "}", + regionName.Length > maxRegionNameLength ? regionName.Substring(0, maxRegionNameLength) : regionName, ""); + report.AppendFormat( + "{0,-" + maxTypeLength + "}{1,-" + columnPadding + "}", + isChild ? "Cd" : "Rt", ""); - m_sceneManager.ForEachScene(delegate(Scene scene) - { - scene.ForEachClient(delegate(IClientAPI client) - { - if (client is IStatsCollector) - { - report = report + client.FirstName + - " " + client.LastName; + IStatsCollector stats = (IStatsCollector)client; + + report.AppendLine(stats.Report()); + } + }); + }); - IStatsCollector stats = - (IStatsCollector) client; - - report = report + string.Format("{0,7} {1,7} {2,7} {3,7} {4,7} {5,7} {6,7} {7,7} {8,7} {9,7}\n", - "Send", - "In", - "Out", - "Resend", - "Land", - "Wind", - "Cloud", - "Task", - "Texture", - "Asset"); - report = report + stats.Report() + - "\n"; - } - }); - }); - - return report; + return report.ToString(); } /// diff --git a/OpenSim/Region/Application/OpenSimBase.cs b/OpenSim/Region/Application/OpenSimBase.cs index f535fe805a..74ad1685f9 100644 --- a/OpenSim/Region/Application/OpenSimBase.cs +++ b/OpenSim/Region/Application/OpenSimBase.cs @@ -36,7 +36,6 @@ using Nini.Config; using OpenMetaverse; using OpenSim.Framework; using OpenSim.Framework.Communications; - using OpenSim.Framework.Console; using OpenSim.Framework.Servers; using OpenSim.Framework.Servers.HttpServer; @@ -46,6 +45,7 @@ using OpenSim.Region.Framework; using OpenSim.Region.Framework.Interfaces; using OpenSim.Region.Framework.Scenes; using OpenSim.Region.Physics.Manager; +using OpenSim.Server.Base; namespace OpenSim { @@ -187,6 +187,24 @@ namespace OpenSim userStatsURI = startupConfig.GetString("Stats_URI", String.Empty); } + // Load the simulation data service + IConfig simDataConfig = m_config.Source.Configs["SimulationDataStore"]; + if (simDataConfig == null) + throw new Exception("Configuration file is missing the [SimulationDataStore] section"); + string module = simDataConfig.GetString("LocalServiceModule", String.Empty); + if (String.IsNullOrEmpty(module)) + throw new Exception("Configuration file is missing the LocalServiceModule parameter in the [SimulationDataStore] section"); + m_simulationDataService = ServerUtils.LoadPlugin(module, new object[] { m_config.Source }); + + // Load the estate data service + IConfig estateDataConfig = m_config.Source.Configs["EstateDataStore"]; + if (estateDataConfig == null) + throw new Exception("Configuration file is missing the [EstateDataStore] section"); + module = estateDataConfig.GetString("LocalServiceModule", String.Empty); + if (String.IsNullOrEmpty(module)) + throw new Exception("Configuration file is missing the LocalServiceModule parameter in the [EstateDataStore] section"); + m_estateDataService = ServerUtils.LoadPlugin(module, new object[] { m_config.Source }); + base.StartupSpecific(); m_stats = StatsManager.StartCollectingSimExtraStats(); @@ -347,10 +365,6 @@ namespace OpenSim // Prims have to be loaded after module configuration since some modules may be invoked during the load scene.LoadPrimsFromStorage(regionInfo.originRegionID); - // moved these here as the terrain texture has to be created after the modules are initialized - // and has to happen before the region is registered with the grid. - scene.CreateTerrainTexture(); - // TODO : Try setting resource for region xstats here on scene MainServer.Instance.AddStreamHandler(new Region.Framework.Scenes.RegionStatsHandler(regionInfo)); @@ -360,7 +374,9 @@ namespace OpenSim } catch (Exception e) { - m_log.ErrorFormat("[STARTUP]: Registration of region with grid failed, aborting startup - {0}", e.StackTrace); + m_log.ErrorFormat( + "[STARTUP]: Registration of region with grid failed, aborting startup due to {0} {1}", + e.Message, e.StackTrace); // Carrying on now causes a lot of confusion down the // line - we need to get the user's attention @@ -539,7 +555,7 @@ namespace OpenSim regionInfo.InternalEndPoint.Port = (int) port; - Scene scene = CreateScene(regionInfo, m_storageManager, circuitManager); + Scene scene = CreateScene(regionInfo, m_simulationDataService, m_estateDataService, circuitManager); if (m_autoCreateClientStack) { @@ -555,30 +571,19 @@ namespace OpenSim return scene; } - protected override StorageManager CreateStorageManager() - { - return - CreateStorageManager(m_configSettings.StorageConnectionString, m_configSettings.EstateConnectionString); - } - - protected StorageManager CreateStorageManager(string connectionstring, string estateconnectionstring) - { - return new StorageManager(m_configSettings.StorageDll, connectionstring, estateconnectionstring); - } - protected override ClientStackManager CreateClientStackManager() { return new ClientStackManager(m_configSettings.ClientstackDll); } - protected override Scene CreateScene(RegionInfo regionInfo, StorageManager storageManager, - AgentCircuitManager circuitManager) + protected override Scene CreateScene(RegionInfo regionInfo, ISimulationDataService simDataService, + IEstateDataService estateDataService, AgentCircuitManager circuitManager) { SceneCommunicationService sceneGridService = new SceneCommunicationService(); return new Scene( regionInfo, circuitManager, sceneGridService, - storageManager, m_moduleLoader, false, m_configSettings.PhysicalPrim, + simDataService, estateDataService, m_moduleLoader, false, m_configSettings.PhysicalPrim, m_configSettings.See_into_region_from_neighbor, m_config.Source, m_version); } @@ -786,6 +791,62 @@ namespace OpenSim { regionnum = m_sceneManager.Scenes.Count; } + + /// + /// Load the estate information for the provided RegionInfo object. + /// + /// + /// A + /// + public void PopulateRegionEstateInfo(RegionInfo regInfo) + { + IEstateDataService estateDataService = EstateDataService; + + if (estateDataService != null) + { + regInfo.EstateSettings = estateDataService.LoadEstateSettings(regInfo.RegionID, false); + } + + if (regInfo.EstateSettings.EstateID == 0) // No record at all + { + MainConsole.Instance.Output("Your region is not part of an estate."); + while (true) + { + string response = MainConsole.Instance.CmdPrompt("Do you wish to join an existing estate?", "no", new List() { "yes", "no" }); + if (response == "no") + { + // Create a new estate + regInfo.EstateSettings = estateDataService.LoadEstateSettings(regInfo.RegionID, true); + + regInfo.EstateSettings.EstateName = MainConsole.Instance.CmdPrompt("New estate name", regInfo.EstateSettings.EstateName); + //regInfo.EstateSettings.Save(); + break; + } + else + { + response = MainConsole.Instance.CmdPrompt("Estate name to join", "None"); + if (response == "None") + continue; + + List estateIDs = estateDataService.GetEstates(response); + if (estateIDs.Count < 1) + { + MainConsole.Instance.Output("The name you have entered matches no known estate. Please try again"); + continue; + } + + int estateID = estateIDs[0]; + + regInfo.EstateSettings = estateDataService.LoadEstateSettings(estateID); + + if (estateDataService.LinkRegion(regInfo.RegionID, estateID)) + break; + + MainConsole.Instance.Output("Joining the estate failed. Please try again."); + } + } + } + } } diff --git a/OpenSim/Region/ClientStack/LindenUDP/LLClientView.cs b/OpenSim/Region/ClientStack/LindenUDP/LLClientView.cs index e1cbe03654..f4dca9fdaf 100644 --- a/OpenSim/Region/ClientStack/LindenUDP/LLClientView.cs +++ b/OpenSim/Region/ClientStack/LindenUDP/LLClientView.cs @@ -37,6 +37,7 @@ using System.Xml; using log4net; using OpenMetaverse; using OpenMetaverse.Packets; +using OpenMetaverse.Messages.Linden; using OpenMetaverse.StructuredData; using OpenSim.Framework; using OpenSim.Framework.Client; @@ -60,10 +61,10 @@ namespace OpenSim.Region.ClientStack.LindenUDP public class LLClientView : IClientAPI, IClientCore, IClientIM, IClientChat, IClientIPEndpoint, IStatsCollector { /// - /// Debug packet level. At the moment, only 255 does anything (prints out all in and out packets). + /// Debug packet level. See OpenSim.RegisterConsoleCommands() for more details. /// protected int m_debugPacketLevel = 0; - + #region Events public event GenericMessage OnGenericMessage; @@ -80,7 +81,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP public event DeRezObject OnDeRezObject; public event ModifyTerrain OnModifyTerrain; public event Action OnRegionHandShakeReply; - public event GenericCall2 OnRequestWearables; + public event GenericCall1 OnRequestWearables; public event SetAppearance OnSetAppearance; public event SetAppearanceRaw OnSetAppearanceRaw; public event AvatarNowWearing OnAvatarNowWearing; @@ -290,7 +291,6 @@ namespace OpenSim.Region.ClientStack.LindenUDP public event MuteListEntryRemove OnRemoveMuteListEntry; public event GodlikeMessage onGodlikeMessage; public event GodUpdateRegionInfoUpdate OnGodUpdateRegionInfoUpdate; - #endregion Events @@ -318,6 +318,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP private int m_cachedTextureSerial; private PriorityQueue m_entityUpdates; private Prioritizer m_prioritizer; + private bool m_disableFacelights = false; /// /// List used in construction of data blocks for an object update packet. This is to stop us having to @@ -330,13 +331,13 @@ namespace OpenSim.Region.ClientStack.LindenUDP /// thread servicing the m_primFullUpdates queue after a kill. If this happens the object persists as an /// ownerless phantom. /// - /// All manipulation of this set has to occur under a m_primFullUpdate.SyncRoot lock - /// + /// All manipulation of this set has to occur under an m_entityUpdates.SyncRoot lock + /// /// protected HashSet m_killRecord; - -// protected HashSet m_attachmentsSent; - + +// protected HashSet m_attachmentsSent; + private int m_moneyBalance; private int m_animationSequenceNumber = 1; private bool m_SendLogoutPacketWhenClosing = true; @@ -387,18 +388,22 @@ namespace OpenSim.Region.ClientStack.LindenUDP public string ActiveGroupName { get { return m_activeGroupName; } } public ulong ActiveGroupPowers { get { return m_activeGroupPowers; } } public bool IsGroupMember(UUID groupID) { return m_groupPowers.ContainsKey(groupID); } + /// /// First name of the agent/avatar represented by the client /// public string FirstName { get { return m_firstName; } } + /// /// Last name of the agent/avatar represented by the client /// public string LastName { get { return m_lastName; } } + /// /// Full name of the client (first name and last name) /// public string Name { get { return FirstName + " " + LastName; } } + public uint CircuitCode { get { return m_circuitCode; } } public int MoneyBalance { get { return m_moneyBalance; } } public int NextAnimationSequenceNumber { get { return m_animationSequenceNumber++; } } @@ -413,6 +418,12 @@ namespace OpenSim.Region.ClientStack.LindenUDP set { m_IsLoggingOut = value; } } + public bool DisableFacelights + { + get { return m_disableFacelights; } + set { m_disableFacelights = value; } + } + public bool SendLogoutPacketWhenClosing { set { m_SendLogoutPacketWhenClosing = value; } } public uint MaxCoarseLocations { get { return m_maxCoarseLocations; } } @@ -436,7 +447,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP m_entityUpdates = new PriorityQueue(m_scene.Entities.Count); m_fullUpdateDataBlocksBuilder = new List(); m_killRecord = new HashSet(); -// m_attachmentsSent = new HashSet(); +// m_attachmentsSent = new HashSet(); m_assetService = m_scene.RequestModuleInterface(); m_GroupsModule = scene.RequestModuleInterface(); @@ -648,9 +659,10 @@ namespace OpenSim.Region.ClientStack.LindenUDP catch (Exception e) { // Make sure that we see any exception caused by the asynchronous operation. - m_log.Error( - string.Format("[LLCLIENTVIEW]: Caught exception while processing {0}", packetObject.Pack), e); - } + m_log.ErrorFormat( + "[LLCLIENTVIEW]: Caught exception while processing {0} for {1}, {2} {3}", + packetObject.Pack, Name, e.Message, e.StackTrace); + } } #endregion Packet Handling @@ -718,7 +730,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP handshake.RegionInfo3.CPURatio = 1; handshake.RegionInfo3.ColoName = Utils.EmptyBytes; - handshake.RegionInfo3.ProductName = Utils.EmptyBytes; + handshake.RegionInfo3.ProductName = Util.StringToBytes256(regionInfo.RegionType); handshake.RegionInfo3.ProductSKU = Utils.EmptyBytes; OutPacket(handshake, ThrottleOutPacketType.Task); @@ -861,7 +873,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP foreach (GroupActiveProposals Proposal in Proposals) { GroupActiveProposalItemReplyPacket GAPIRP = new GroupActiveProposalItemReplyPacket(); - + GAPIRP.AgentData.AgentID = AgentId; GAPIRP.AgentData.GroupID = groupID; GAPIRP.TransactionData.TransactionID = transactionID; @@ -885,7 +897,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP if (Proposals.Length == 0) { GroupActiveProposalItemReplyPacket GAPIRP = new GroupActiveProposalItemReplyPacket(); - + GAPIRP.AgentData.AgentID = AgentId; GAPIRP.AgentData.GroupID = groupID; GAPIRP.TransactionData.TransactionID = transactionID; @@ -940,7 +952,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP if (Votes.Length == 0) { GroupVoteHistoryItemReplyPacket GVHIRP = new GroupVoteHistoryItemReplyPacket(); - + GVHIRP.AgentData.AgentID = AgentId; GVHIRP.AgentData.GroupID = groupID; GVHIRP.TransactionData.TransactionID = transactionID; @@ -964,7 +976,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP OutPacket(GVHIRP, ThrottleOutPacketType.Task); } } - + public void SendGroupAccountingDetails(IClientAPI sender,UUID groupID, UUID transactionID, UUID sessionID, int amt) { GroupAccountDetailsReplyPacket GADRP = new GroupAccountDetailsReplyPacket(); @@ -983,13 +995,13 @@ namespace OpenSim.Region.ClientStack.LindenUDP GADRP.HistoryData[0] = History; OutPacket(GADRP, ThrottleOutPacketType.Task); } - + public void SendGroupAccountingSummary(IClientAPI sender,UUID groupID, uint moneyAmt, int totalTier, int usedTier) { GroupAccountSummaryReplyPacket GASRP = (GroupAccountSummaryReplyPacket)PacketPool.Instance.GetPacket( PacketType.GroupAccountSummaryReply); - + GASRP.AgentData = new GroupAccountSummaryReplyPacket.AgentDataBlock(); GASRP.AgentData.AgentID = sender.AgentId; GASRP.AgentData.GroupID = groupID; @@ -1016,13 +1028,13 @@ namespace OpenSim.Region.ClientStack.LindenUDP GASRP.MoneyData.LightTaxEstimate = 0; OutPacket(GASRP, ThrottleOutPacketType.Task); } - + public void SendGroupTransactionsSummaryDetails(IClientAPI sender,UUID groupID, UUID transactionID, UUID sessionID, int amt) { GroupAccountTransactionsReplyPacket GATRP = (GroupAccountTransactionsReplyPacket)PacketPool.Instance.GetPacket( PacketType.GroupAccountTransactionsReply); - + GATRP.AgentData = new GroupAccountTransactionsReplyPacket.AgentDataBlock(); GATRP.AgentData.AgentID = sender.AgentId; GATRP.AgentData.GroupID = groupID; @@ -1433,16 +1445,27 @@ namespace OpenSim.Region.ClientStack.LindenUDP /// /// /// - public void SendTeleportLocationStart() + public void SendTeleportStart(uint flags) { - //TeleportStartPacket tpStart = (TeleportStartPacket)PacketPool.Instance.GetPacket(PacketType.TeleportStart); - TeleportStartPacket tpStart = new TeleportStartPacket(); - tpStart.Info.TeleportFlags = 16; // Teleport via location + TeleportStartPacket tpStart = (TeleportStartPacket)PacketPool.Instance.GetPacket(PacketType.TeleportStart); + //TeleportStartPacket tpStart = new TeleportStartPacket(); + tpStart.Info.TeleportFlags = flags; //16; // Teleport via location // Hack to get this out immediately and skip throttles OutPacket(tpStart, ThrottleOutPacketType.Unknown); } + public void SendTeleportProgress(uint flags, string message) + { + TeleportProgressPacket tpProgress = (TeleportProgressPacket)PacketPool.Instance.GetPacket(PacketType.TeleportProgress); + tpProgress.AgentData.AgentID = this.AgentId; + tpProgress.Info.TeleportFlags = flags; + tpProgress.Info.Message = Util.StringToBytes256(message); + + // Hack to get this out immediately and skip throttles + OutPacket(tpProgress, ThrottleOutPacketType.Unknown); + } + public void SendMoneyBalance(UUID transaction, bool success, byte[] description, int balance) { MoneyBalanceReplyPacket money = (MoneyBalanceReplyPacket)PacketPool.Instance.GetPacket(PacketType.MoneyBalanceReply); @@ -1495,7 +1518,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP public void SendKillObject(ulong regionHandle, uint localID) { // m_log.DebugFormat("[CLIENT]: Sending KillObjectPacket to {0} for {1} in {2}", Name, localID, regionHandle); - + KillObjectPacket kill = (KillObjectPacket)PacketPool.Instance.GetPacket(PacketType.KillObject); // TODO: don't create new blocks if recycling an old packet kill.ObjectData = new KillObjectPacket.ObjectDataBlock[1]; @@ -1504,9 +1527,21 @@ namespace OpenSim.Region.ClientStack.LindenUDP kill.Header.Reliable = true; kill.Header.Zerocoded = true; - lock (m_entityUpdates.SyncRoot) + if (m_scene.GetScenePresence(localID) == null) + { + lock (m_entityUpdates.SyncRoot) + { + m_killRecord.Add(localID); + + // The throttle queue used here must match that being used for updates. Otherwise, there is a + // chance that a kill packet put on a separate queue will be sent to the client before an existing + // update packet on another queue. Receiving updates after kills results in unowned and undeletable + // scene objects in a viewer until that viewer is relogged in. + OutPacket(kill, ThrottleOutPacketType.Task); + } + } + else { - m_killRecord.Add(localID); OutPacket(kill, ThrottleOutPacketType.State); } } @@ -2653,6 +2688,10 @@ namespace OpenSim.Region.ClientStack.LindenUDP public void SendParcelInfo(RegionInfo info, LandData land, UUID parcelID, uint x, uint y) { + float dwell = 0.0f; + IDwellModule dwellModule = m_scene.RequestModuleInterface(); + if (dwellModule != null) + dwell = dwellModule.GetDwell(land.GlobalID); ParcelInfoReplyPacket reply = (ParcelInfoReplyPacket)PacketPool.Instance.GetPacket(PacketType.ParcelInfoReply); reply.AgentData.AgentID = m_agentId; reply.Data.ParcelID = parcelID; @@ -2664,7 +2703,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP // Bit 0: Mature, bit 7: on sale, other bits: no idea reply.Data.Flags = (byte)( - ((land.Flags & (uint)ParcelFlags.MaturePublish) != 0 ? (1 << 0) : 0) + + (info.AccessLevel > 13 ? (1 << 0) : 0) + ((land.Flags & (uint)ParcelFlags.ForSale) != 0 ? (1 << 7) : 0)); Vector3 pos = land.UserLocation; @@ -2672,12 +2711,12 @@ namespace OpenSim.Region.ClientStack.LindenUDP { pos = (land.AABBMax + land.AABBMin) * 0.5f; } - reply.Data.GlobalX = info.RegionLocX * Constants.RegionSize + x; - reply.Data.GlobalY = info.RegionLocY * Constants.RegionSize + y; + reply.Data.GlobalX = info.RegionLocX + x; + reply.Data.GlobalY = info.RegionLocY + y; reply.Data.GlobalZ = pos.Z; reply.Data.SimName = Utils.StringToBytes(info.RegionName); reply.Data.SnapshotID = land.SnapshotID; - reply.Data.Dwell = land.Dwell; + reply.Data.Dwell = dwell; reply.Data.SalePrice = land.SalePrice; reply.Data.AuctionID = (int)land.AuctionID; @@ -2705,32 +2744,58 @@ namespace OpenSim.Region.ClientStack.LindenUDP packet.QueryData = new DirPlacesReplyPacket.QueryDataBlock[1]; packet.QueryData[0] = new DirPlacesReplyPacket.QueryDataBlock(); - packet.QueryReplies = - new DirPlacesReplyPacket.QueryRepliesBlock[data.Length]; - - packet.StatusData = new DirPlacesReplyPacket.StatusDataBlock[ - data.Length]; - packet.AgentData.AgentID = AgentId; packet.QueryData[0].QueryID = queryID; - int i = 0; + DirPlacesReplyPacket.QueryRepliesBlock[] replies = + new DirPlacesReplyPacket.QueryRepliesBlock[0]; + DirPlacesReplyPacket.StatusDataBlock[] status = + new DirPlacesReplyPacket.StatusDataBlock[0]; + + packet.QueryReplies = replies; + packet.StatusData = status; + foreach (DirPlacesReplyData d in data) { - packet.QueryReplies[i] = - new DirPlacesReplyPacket.QueryRepliesBlock(); - packet.StatusData[i] = new DirPlacesReplyPacket.StatusDataBlock(); - packet.QueryReplies[i].ParcelID = d.parcelID; - packet.QueryReplies[i].Name = Utils.StringToBytes(d.name); - packet.QueryReplies[i].ForSale = d.forSale; - packet.QueryReplies[i].Auction = d.auction; - packet.QueryReplies[i].Dwell = d.dwell; - packet.StatusData[i].Status = d.Status; - i++; + int idx = replies.Length; + Array.Resize(ref replies, idx + 1); + Array.Resize(ref status, idx + 1); + + replies[idx] = new DirPlacesReplyPacket.QueryRepliesBlock(); + status[idx] = new DirPlacesReplyPacket.StatusDataBlock(); + replies[idx].ParcelID = d.parcelID; + replies[idx].Name = Utils.StringToBytes(d.name); + replies[idx].ForSale = d.forSale; + replies[idx].Auction = d.auction; + replies[idx].Dwell = d.dwell; + status[idx].Status = d.Status; + + packet.QueryReplies = replies; + packet.StatusData = status; + + if (packet.Length >= 1000) + { + OutPacket(packet, ThrottleOutPacketType.Task); + + packet = (DirPlacesReplyPacket)PacketPool.Instance.GetPacket(PacketType.DirPlacesReply); + + packet.AgentData = new DirPlacesReplyPacket.AgentDataBlock(); + + packet.QueryData = new DirPlacesReplyPacket.QueryDataBlock[1]; + packet.QueryData[0] = new DirPlacesReplyPacket.QueryDataBlock(); + + packet.AgentData.AgentID = AgentId; + + packet.QueryData[0].QueryID = queryID; + + replies = new DirPlacesReplyPacket.QueryRepliesBlock[0]; + status = new DirPlacesReplyPacket.StatusDataBlock[0]; + } } - OutPacket(packet, ThrottleOutPacketType.Task); + if (replies.Length > 0 || data.Length == 0) + OutPacket(packet, ThrottleOutPacketType.Task); } public void SendDirPeopleReply(UUID queryID, DirPeopleReplyData[] data) @@ -3023,7 +3088,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP { OSDMap GroupDataMap = new OSDMap(6); OSDMap NewGroupDataMap = new OSDMap(1); - GroupDataMap.Add("GroupPowers", OSD.FromBinary(m.GroupPowers)); + GroupDataMap.Add("GroupPowers", OSD.FromULong(m.GroupPowers)); GroupDataMap.Add("AcceptNotices", OSD.FromBoolean(m.AcceptNotices)); GroupDataMap.Add("GroupTitle", OSD.FromString(m.GroupTitle)); GroupDataMap.Add("GroupID", OSD.FromUUID(m.GroupID)); @@ -3332,20 +3397,29 @@ namespace OpenSim.Region.ClientStack.LindenUDP aw.AgentData.SerialNum = (uint)serial; aw.AgentData.SessionID = m_sessionId; + int count = 0; + for (int i = 0; i < wearables.Length; i++) + count += wearables[i].Count; + // TODO: don't create new blocks if recycling an old packet - aw.WearableData = new AgentWearablesUpdatePacket.WearableDataBlock[13]; + aw.WearableData = new AgentWearablesUpdatePacket.WearableDataBlock[count]; AgentWearablesUpdatePacket.WearableDataBlock awb; + int idx = 0; for (int i = 0; i < wearables.Length; i++) { - awb = new AgentWearablesUpdatePacket.WearableDataBlock(); - awb.WearableType = (byte)i; - awb.AssetID = wearables[i].AssetID; - awb.ItemID = wearables[i].ItemID; - aw.WearableData[i] = awb; + for (int j = 0; j < wearables[i].Count; j++) + { + awb = new AgentWearablesUpdatePacket.WearableDataBlock(); + awb.WearableType = (byte)i; + awb.AssetID = wearables[i][j].AssetID; + awb.ItemID = wearables[i][j].ItemID; + aw.WearableData[idx] = awb; + idx++; // m_log.DebugFormat( // "[APPEARANCE]: Sending wearable item/asset {0} {1} (index {2}) for {3}", // awb.ItemID, awb.AssetID, i, Name); + } } OutPacket(aw, ThrottleOutPacketType.Task); @@ -3353,11 +3427,6 @@ namespace OpenSim.Region.ClientStack.LindenUDP public void SendAppearance(UUID agentID, byte[] visualParams, byte[] textureEntry) { - ScenePresence sp; - string forName = ""; - if (m_scene.TryGetScenePresence(agentID, out sp)) - forName = sp.Name; - //m_log.WarnFormat("[LLCLIENTVIEW] Sending {0} appearance to {1}", forName, Name); AvatarAppearancePacket avp = (AvatarAppearancePacket)PacketPool.Instance.GetPacket(PacketType.AvatarAppearance); // TODO: don't create new blocks if recycling an old packet avp.VisualParam = new AvatarAppearancePacket.VisualParamBlock[218]; @@ -3373,6 +3442,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP avp.Sender.IsTrial = false; avp.Sender.ID = agentID; + //m_log.DebugFormat("[CLIENT]: Sending appearance for {0} to {1}", agentID.ToString(), AgentId.ToString()); OutPacket(avp, ThrottleOutPacketType.Task); } @@ -3426,9 +3496,9 @@ namespace OpenSim.Region.ClientStack.LindenUDP objupdate.ObjectData[0] = CreateAvatarUpdateBlock(presence); OutPacket(objupdate, ThrottleOutPacketType.Task); - + // We need to record the avatar local id since the root prim of an attachment points to this. -// m_attachmentsSent.Add(avatar.LocalId); +// m_attachmentsSent.Add(avatar.LocalId); } public void SendCoarseLocationUpdate(List users, List CoarseLocations) @@ -3476,7 +3546,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP #region Primitive Packet/Data Sending Methods /// - /// Generate one of the object update packets based on PrimUpdateFlags + /// Generate one of the object update packets based on PrimUpdateFlags /// and broadcast the packet to clients /// public void SendPrimUpdate(ISceneEntity entity, PrimUpdateFlags updateFlags) @@ -3484,7 +3554,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP double priority = m_prioritizer.GetUpdatePriority(this, entity); lock (m_entityUpdates.SyncRoot) - m_entityUpdates.Enqueue(priority, new EntityUpdate(entity, updateFlags), entity.LocalId); + m_entityUpdates.Enqueue(priority, new EntityUpdate(entity, updateFlags), entity.LocalId); } private void ProcessEntityUpdates(int maxUpdates) @@ -3501,6 +3571,34 @@ namespace OpenSim.Region.ClientStack.LindenUDP EntityUpdate update; while (updatesThisCall < maxUpdates && m_entityUpdates.TryDequeue(out update)) { + // Please do not remove this unless you can demonstrate on the OpenSim mailing list that a client + // will never receive an update after a prim kill. Even then, keeping the kill record may be a good + // safety measure. + // + // Receiving updates after kills results in undeleteable prims that persist until relog and + // currently occurs because prims can be deleted before all queued updates are sent. + if (m_killRecord.Contains(update.Entity.LocalId)) + { +// m_log.WarnFormat( +// "[CLIENT]: Preventing full update for prim with local id {0} after client for user {1} told it was deleted", +// update.Entity.LocalId, Name); + continue; + } + + if (update.Entity is SceneObjectPart) + { + SceneObjectPart part = (SceneObjectPart)update.Entity; + + if (part.ParentGroup.IsAttachment && m_disableFacelights) + { + if (part.ParentGroup.RootPart.Shape.State != (byte)AttachmentPoint.LeftHand && + part.ParentGroup.RootPart.Shape.State != (byte)AttachmentPoint.RightHand) + { + part.Shape.LightEntry = false; + } + } + } + ++updatesThisCall; #region UpdateFlags to packet type conversion @@ -3571,28 +3669,28 @@ namespace OpenSim.Region.ClientStack.LindenUDP // string text = sop.Text; // if (text.IndexOf("\n") >= 0) // text = text.Remove(text.IndexOf("\n")); -// +// // if (m_attachmentsSent.Contains(sop.ParentID)) // { //// m_log.DebugFormat( //// "[CLIENT]: Sending full info about attached prim {0} text {1}", //// sop.LocalId, text); -// +// // objectUpdateBlocks.Value.Add(CreatePrimUpdateBlock(sop, this.m_agentId)); -// +// // m_attachmentsSent.Add(sop.LocalId); // } // else // { // m_log.DebugFormat( -// "[CLIENT]: Requeueing full update of prim {0} text {1} since we haven't sent its parent {2} yet", +// "[CLIENT]: Requeueing full update of prim {0} text {1} since we haven't sent its parent {2} yet", // sop.LocalId, text, sop.ParentID); -// -// m_entityUpdates.Enqueue(double.MaxValue, update, sop.LocalId); +// +// m_entityUpdates.Enqueue(double.MaxValue, update, sop.LocalId); // } // } // else -// { +// { objectUpdateBlocks.Value.Add(CreatePrimUpdateBlock((SceneObjectPart)update.Entity, this.m_agentId)); // } } @@ -3608,56 +3706,56 @@ namespace OpenSim.Region.ClientStack.LindenUDP #endregion Block Construction } - } - #region Packet Sending - - const float TIME_DILATION = 1.0f; - ushort timeDilation = Utils.FloatToUInt16(TIME_DILATION, 0.0f, 1.0f); - - if (objectUpdateBlocks.IsValueCreated) - { - List blocks = objectUpdateBlocks.Value; - - ObjectUpdatePacket packet = (ObjectUpdatePacket)PacketPool.Instance.GetPacket(PacketType.ObjectUpdate); - packet.RegionData.RegionHandle = m_scene.RegionInfo.RegionHandle; - packet.RegionData.TimeDilation = timeDilation; - packet.ObjectData = new ObjectUpdatePacket.ObjectDataBlock[blocks.Count]; - - for (int i = 0; i < blocks.Count; i++) - packet.ObjectData[i] = blocks[i]; - - OutPacket(packet, ThrottleOutPacketType.Task, true); - } - - if (compressedUpdateBlocks.IsValueCreated) - { - List blocks = compressedUpdateBlocks.Value; - - ObjectUpdateCompressedPacket packet = (ObjectUpdateCompressedPacket)PacketPool.Instance.GetPacket(PacketType.ObjectUpdateCompressed); - packet.RegionData.RegionHandle = m_scene.RegionInfo.RegionHandle; - packet.RegionData.TimeDilation = timeDilation; - packet.ObjectData = new ObjectUpdateCompressedPacket.ObjectDataBlock[blocks.Count]; - - for (int i = 0; i < blocks.Count; i++) - packet.ObjectData[i] = blocks[i]; - - OutPacket(packet, ThrottleOutPacketType.Task, true); - } - - if (terseUpdateBlocks.IsValueCreated) - { - List blocks = terseUpdateBlocks.Value; - - ImprovedTerseObjectUpdatePacket packet = new ImprovedTerseObjectUpdatePacket(); - packet.RegionData.RegionHandle = m_scene.RegionInfo.RegionHandle; - packet.RegionData.TimeDilation = timeDilation; - packet.ObjectData = new ImprovedTerseObjectUpdatePacket.ObjectDataBlock[blocks.Count]; - - for (int i = 0; i < blocks.Count; i++) - packet.ObjectData[i] = blocks[i]; - - OutPacket(packet, ThrottleOutPacketType.Task, true); + #region Packet Sending + + const float TIME_DILATION = 1.0f; + ushort timeDilation = Utils.FloatToUInt16(TIME_DILATION, 0.0f, 1.0f); + + if (objectUpdateBlocks.IsValueCreated) + { + List blocks = objectUpdateBlocks.Value; + + ObjectUpdatePacket packet = (ObjectUpdatePacket)PacketPool.Instance.GetPacket(PacketType.ObjectUpdate); + packet.RegionData.RegionHandle = m_scene.RegionInfo.RegionHandle; + packet.RegionData.TimeDilation = timeDilation; + packet.ObjectData = new ObjectUpdatePacket.ObjectDataBlock[blocks.Count]; + + for (int i = 0; i < blocks.Count; i++) + packet.ObjectData[i] = blocks[i]; + + OutPacket(packet, ThrottleOutPacketType.Task, true); + } + + if (compressedUpdateBlocks.IsValueCreated) + { + List blocks = compressedUpdateBlocks.Value; + + ObjectUpdateCompressedPacket packet = (ObjectUpdateCompressedPacket)PacketPool.Instance.GetPacket(PacketType.ObjectUpdateCompressed); + packet.RegionData.RegionHandle = m_scene.RegionInfo.RegionHandle; + packet.RegionData.TimeDilation = timeDilation; + packet.ObjectData = new ObjectUpdateCompressedPacket.ObjectDataBlock[blocks.Count]; + + for (int i = 0; i < blocks.Count; i++) + packet.ObjectData[i] = blocks[i]; + + OutPacket(packet, ThrottleOutPacketType.Task, true); + } + + if (terseUpdateBlocks.IsValueCreated) + { + List blocks = terseUpdateBlocks.Value; + + ImprovedTerseObjectUpdatePacket packet = new ImprovedTerseObjectUpdatePacket(); + packet.RegionData.RegionHandle = m_scene.RegionInfo.RegionHandle; + packet.RegionData.TimeDilation = timeDilation; + packet.ObjectData = new ImprovedTerseObjectUpdatePacket.ObjectDataBlock[blocks.Count]; + + for (int i = 0; i < blocks.Count; i++) + packet.ObjectData[i] = blocks[i]; + + OutPacket(packet, ThrottleOutPacketType.Task, true); + } } #endregion Packet Sending @@ -3906,7 +4004,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP m_propertiesPacketTimer.Stop(); return; } - + m_propertiesPacketTimer.Stop(); m_propertiesPacketTimer.Start(); } @@ -4065,7 +4163,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP rinfopack.RegionInfo2.HardMaxAgents = uint.MaxValue; rinfopack.RegionInfo2.HardMaxObjects = uint.MaxValue; rinfopack.RegionInfo2.MaxAgents32 = uint.MaxValue; - rinfopack.RegionInfo2.ProductName = Utils.EmptyBytes; + rinfopack.RegionInfo2.ProductName = Util.StringToBytes256(args.regionType); rinfopack.RegionInfo2.ProductSKU = Utils.EmptyBytes; rinfopack.HasVariableBlocks = true; @@ -4137,94 +4235,101 @@ namespace OpenSim.Region.ClientStack.LindenUDP public void SendLandProperties(int sequence_id, bool snap_selection, int request_result, LandData landData, float simObjectBonusFactor, int parcelObjectCapacity, int simObjectCapacity, uint regionFlags) { - ParcelPropertiesPacket updatePacket = (ParcelPropertiesPacket)PacketPool.Instance.GetPacket(PacketType.ParcelProperties); - // TODO: don't create new blocks if recycling an old packet + ParcelPropertiesMessage updateMessage = new ParcelPropertiesMessage(); - updatePacket.ParcelData.AABBMax = landData.AABBMax; - updatePacket.ParcelData.AABBMin = landData.AABBMin; - updatePacket.ParcelData.Area = landData.Area; - updatePacket.ParcelData.AuctionID = landData.AuctionID; - updatePacket.ParcelData.AuthBuyerID = landData.AuthBuyerID; + updateMessage.AABBMax = landData.AABBMax; + updateMessage.AABBMin = landData.AABBMin; + updateMessage.Area = landData.Area; + updateMessage.AuctionID = landData.AuctionID; + updateMessage.AuthBuyerID = landData.AuthBuyerID; - updatePacket.ParcelData.Bitmap = landData.Bitmap; + updateMessage.Bitmap = landData.Bitmap; - updatePacket.ParcelData.Desc = Utils.StringToBytes(landData.Description); - updatePacket.ParcelData.Category = (byte)landData.Category; - updatePacket.ParcelData.ClaimDate = landData.ClaimDate; - updatePacket.ParcelData.ClaimPrice = landData.ClaimPrice; - updatePacket.ParcelData.GroupID = landData.GroupID; - updatePacket.ParcelData.GroupPrims = landData.GroupPrims; - updatePacket.ParcelData.IsGroupOwned = landData.IsGroupOwned; - updatePacket.ParcelData.LandingType = landData.LandingType; - updatePacket.ParcelData.LocalID = landData.LocalID; + updateMessage.Desc = landData.Description; + updateMessage.Category = landData.Category; + updateMessage.ClaimDate = Util.ToDateTime(landData.ClaimDate); + updateMessage.ClaimPrice = landData.ClaimPrice; + updateMessage.GroupID = landData.GroupID; + updateMessage.GroupPrims = landData.GroupPrims; + updateMessage.IsGroupOwned = landData.IsGroupOwned; + updateMessage.LandingType = (LandingType) landData.LandingType; + updateMessage.LocalID = landData.LocalID; if (landData.Area > 0) { - updatePacket.ParcelData.MaxPrims = parcelObjectCapacity; + updateMessage.MaxPrims = parcelObjectCapacity; } else { - updatePacket.ParcelData.MaxPrims = 0; + updateMessage.MaxPrims = 0; } - updatePacket.ParcelData.MediaAutoScale = landData.MediaAutoScale; - updatePacket.ParcelData.MediaID = landData.MediaID; - updatePacket.ParcelData.MediaURL = Util.StringToBytes256(landData.MediaURL); - updatePacket.ParcelData.MusicURL = Util.StringToBytes256(landData.MusicURL); - updatePacket.ParcelData.Name = Util.StringToBytes256(landData.Name); - updatePacket.ParcelData.OtherCleanTime = landData.OtherCleanTime; - updatePacket.ParcelData.OtherCount = 0; //TODO: Unimplemented - updatePacket.ParcelData.OtherPrims = landData.OtherPrims; - updatePacket.ParcelData.OwnerID = landData.OwnerID; - updatePacket.ParcelData.OwnerPrims = landData.OwnerPrims; - updatePacket.ParcelData.ParcelFlags = landData.Flags; - updatePacket.ParcelData.ParcelPrimBonus = simObjectBonusFactor; - updatePacket.ParcelData.PassHours = landData.PassHours; - updatePacket.ParcelData.PassPrice = landData.PassPrice; - updatePacket.ParcelData.PublicCount = 0; //TODO: Unimplemented + updateMessage.MediaAutoScale = Convert.ToBoolean(landData.MediaAutoScale); + updateMessage.MediaID = landData.MediaID; + updateMessage.MediaURL = landData.MediaURL; + updateMessage.MusicURL = landData.MusicURL; + updateMessage.Name = landData.Name; + updateMessage.OtherCleanTime = landData.OtherCleanTime; + updateMessage.OtherCount = 0; //TODO: Unimplemented + updateMessage.OtherPrims = landData.OtherPrims; + updateMessage.OwnerID = landData.OwnerID; + updateMessage.OwnerPrims = landData.OwnerPrims; + updateMessage.ParcelFlags = (ParcelFlags) landData.Flags; + updateMessage.ParcelPrimBonus = simObjectBonusFactor; + updateMessage.PassHours = landData.PassHours; + updateMessage.PassPrice = landData.PassPrice; + updateMessage.PublicCount = 0; //TODO: Unimplemented - updatePacket.ParcelData.RegionDenyAnonymous = (regionFlags & (uint)RegionFlags.DenyAnonymous) > 0; - updatePacket.ParcelData.RegionDenyIdentified = (regionFlags & (uint)RegionFlags.DenyIdentified) > 0; - updatePacket.ParcelData.RegionDenyTransacted = (regionFlags & (uint)RegionFlags.DenyTransacted) > 0; - updatePacket.ParcelData.RegionPushOverride = (regionFlags & (uint)RegionFlags.RestrictPushObject) > 0; + updateMessage.RegionPushOverride = (regionFlags & (uint)RegionFlags.RestrictPushObject) > 0; + updateMessage.RegionDenyAnonymous = (regionFlags & (uint)RegionFlags.DenyAnonymous) > 0; - updatePacket.ParcelData.RentPrice = 0; - updatePacket.ParcelData.RequestResult = request_result; - updatePacket.ParcelData.SalePrice = landData.SalePrice; - updatePacket.ParcelData.SelectedPrims = landData.SelectedPrims; - updatePacket.ParcelData.SelfCount = 0; //TODO: Unimplemented - updatePacket.ParcelData.SequenceID = sequence_id; + //updateMessage.RegionDenyIdentified = (regionFlags & (uint)RegionFlags.DenyIdentified) > 0; + //updateMessage.RegionDenyTransacted = (regionFlags & (uint)RegionFlags.DenyTransacted) > 0; + + updateMessage.RentPrice = 0; + updateMessage.RequestResult = (ParcelResult) request_result; + updateMessage.SalePrice = landData.SalePrice; + updateMessage.SelectedPrims = landData.SelectedPrims; + updateMessage.SelfCount = 0; //TODO: Unimplemented + updateMessage.SequenceID = sequence_id; if (landData.SimwideArea > 0) { - updatePacket.ParcelData.SimWideMaxPrims = parcelObjectCapacity; + updateMessage.SimWideMaxPrims = parcelObjectCapacity; } else { - updatePacket.ParcelData.SimWideMaxPrims = 0; + updateMessage.SimWideMaxPrims = 0; } - updatePacket.ParcelData.SimWideTotalPrims = landData.SimwidePrims; - updatePacket.ParcelData.SnapSelection = snap_selection; - updatePacket.ParcelData.SnapshotID = landData.SnapshotID; - updatePacket.ParcelData.Status = (byte)landData.Status; - updatePacket.ParcelData.TotalPrims = landData.OwnerPrims + landData.GroupPrims + landData.OtherPrims + + updateMessage.SimWideTotalPrims = landData.SimwidePrims; + updateMessage.SnapSelection = snap_selection; + updateMessage.SnapshotID = landData.SnapshotID; + updateMessage.Status = (ParcelStatus) landData.Status; + updateMessage.TotalPrims = landData.OwnerPrims + landData.GroupPrims + landData.OtherPrims + landData.SelectedPrims; - updatePacket.ParcelData.UserLocation = landData.UserLocation; - updatePacket.ParcelData.UserLookAt = landData.UserLookAt; - updatePacket.Header.Zerocoded = true; + updateMessage.UserLocation = landData.UserLocation; + updateMessage.UserLookAt = landData.UserLookAt; + + updateMessage.MediaType = landData.MediaType; + updateMessage.MediaDesc = landData.MediaDescription; + updateMessage.MediaWidth = landData.MediaWidth; + updateMessage.MediaHeight = landData.MediaHeight; + updateMessage.MediaLoop = landData.MediaLoop; + updateMessage.ObscureMusic = landData.ObscureMusic; + updateMessage.ObscureMedia = landData.ObscureMedia; try { IEventQueue eq = Scene.RequestModuleInterface(); if (eq != null) { - eq.ParcelProperties(updatePacket, this.AgentId); + eq.ParcelProperties(updateMessage, this.AgentId); + } else { + m_log.Warn("No EQ Interface when sending parcel data."); } } catch (Exception ex) { m_log.Error("Unable to send parcel data via eventqueue - exception: " + ex.ToString()); - m_log.Warn("sending parcel data via UDP"); - OutPacket(updatePacket, ThrottleOutPacketType.Task); } } @@ -4302,8 +4407,6 @@ namespace OpenSim.Region.ClientStack.LindenUDP public void SendLandObjectOwners(LandData land, List groups, Dictionary ownersAndCount) { - - int notifyCount = ownersAndCount.Count; ParcelObjectOwnersReplyPacket pack = (ParcelObjectOwnersReplyPacket)PacketPool.Instance.GetPacket(PacketType.ParcelObjectOwnersReply); @@ -4575,6 +4678,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP update.TextureEntry = data.Shape.TextureEntry ?? Utils.EmptyBytes; update.Scale = data.Shape.Scale; update.Text = Util.StringToBytes256(data.Text); + update.MediaURL = Util.StringToBytes256(data.MediaUrl); #region PrimFlags @@ -4593,6 +4697,10 @@ namespace OpenSim.Region.ClientStack.LindenUDP } } +// m_log.DebugFormat( +// "[LLCLIENTVIEW]: Constructing client update for part {0} {1} with flags {2}, localId {3}", +// data.Name, update.FullID, flags, update.ID); + update.UpdateFlags = (uint)flags; #endregion PrimFlags @@ -4725,7 +4833,11 @@ namespace OpenSim.Region.ClientStack.LindenUDP AddLocalPacketHandler(PacketType.ObjectScale, HandleObjectScale); AddLocalPacketHandler(PacketType.ObjectRotation, HandleObjectRotation); AddLocalPacketHandler(PacketType.ObjectFlagUpdate, HandleObjectFlagUpdate); - AddLocalPacketHandler(PacketType.ObjectImage, HandleObjectImage); + + // Handle ObjectImage (TextureEntry) updates synchronously, since when updating multiple prim faces at once, + // some clients will send out a separate ObjectImage packet for each face + AddLocalPacketHandler(PacketType.ObjectImage, HandleObjectImage, false); + AddLocalPacketHandler(PacketType.ObjectGrab, HandleObjectGrab, false); AddLocalPacketHandler(PacketType.ObjectGrabUpdate, HandleObjectGrabUpdate, false); AddLocalPacketHandler(PacketType.ObjectDeGrab, HandleObjectDeGrab); @@ -4994,12 +5106,12 @@ namespace OpenSim.Region.ClientStack.LindenUDP return false; } - + private bool HandleParcelGodMarkAsContent(IClientAPI client, Packet Packet) { ParcelGodMarkAsContentPacket ParcelGodMarkAsContent = (ParcelGodMarkAsContentPacket)Packet; - + ParcelGodMark ParcelGodMarkAsContentHandler = OnParcelGodMark; if (ParcelGodMarkAsContentHandler != null) { @@ -5010,11 +5122,11 @@ namespace OpenSim.Region.ClientStack.LindenUDP } return false; } - + private bool HandleFreezeUser(IClientAPI client, Packet Packet) { FreezeUserPacket FreezeUser = (FreezeUserPacket)Packet; - + FreezeUserUpdate FreezeUserHandler = OnParcelFreezeUser; if (FreezeUserHandler != null) { @@ -5026,12 +5138,12 @@ namespace OpenSim.Region.ClientStack.LindenUDP } return false; } - + private bool HandleEjectUser(IClientAPI client, Packet Packet) { EjectUserPacket EjectUser = (EjectUserPacket)Packet; - + EjectUserUpdate EjectUserHandler = OnParcelEjectUser; if (EjectUserHandler != null) { @@ -5043,12 +5155,12 @@ namespace OpenSim.Region.ClientStack.LindenUDP } return false; } - + private bool HandleParcelBuyPass(IClientAPI client, Packet Packet) { ParcelBuyPassPacket ParcelBuyPass = (ParcelBuyPassPacket)Packet; - + ParcelBuyPass ParcelBuyPassHandler = OnParcelBuyPass; if (ParcelBuyPassHandler != null) { @@ -5059,7 +5171,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP } return false; } - + private bool HandleParcelBuyRequest(IClientAPI sender, Packet Pack) { ParcelBuyPacket parcel = (ParcelBuyPacket)Pack; @@ -5129,11 +5241,13 @@ namespace OpenSim.Region.ClientStack.LindenUDP } catch (Exception e) { - m_log.Error("[GENERICMESSAGE] " + e); + m_log.ErrorFormat( + "[LLCLIENTVIEW]: Exeception when handling generic message {0}{1}", e.Message, e.StackTrace); } } } - m_log.Error("[GENERICMESSAGE] Not handling GenericMessage with method-type of: " + method); + + //m_log.Debug("[LLCLIENTVIEW]: Not handling GenericMessage with method-type of: " + method); return false; } @@ -5294,7 +5408,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP ScriptDialogReplyPacket rdialog = (ScriptDialogReplyPacket)Pack; //m_log.DebugFormat("[CLIENT]: Received ScriptDialogReply from {0}", rdialog.Data.ObjectID); - + #region Packet Session and User Check if (m_checkPackets) { @@ -5440,12 +5554,12 @@ namespace OpenSim.Region.ClientStack.LindenUDP } return true; } - + private bool HandleFindAgent(IClientAPI client, Packet Packet) { FindAgentPacket FindAgent = (FindAgentPacket)Packet; - + FindAgentUpdate FindAgentHandler = OnFindAgent; if (FindAgentHandler != null) { @@ -5454,12 +5568,12 @@ namespace OpenSim.Region.ClientStack.LindenUDP } return false; } - + private bool HandleTrackAgent(IClientAPI client, Packet Packet) { TrackAgentPacket TrackAgent = (TrackAgentPacket)Packet; - + TrackAgentUpdate TrackAgentHandler = OnTrackAgent; if (TrackAgentHandler != null) { @@ -5470,7 +5584,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP } return false; } - + private bool HandlerRezObject(IClientAPI sender, Packet Pack) { RezObjectPacket rezPacket = (RezObjectPacket)Pack; @@ -5579,12 +5693,11 @@ namespace OpenSim.Region.ClientStack.LindenUDP private bool HandlerAgentWearablesRequest(IClientAPI sender, Packet Pack) { - //m_log.WarnFormat("[LLCLIENTVIEW] Received AgentWearablesRequest from {0}", sender.Name); - GenericCall2 handlerRequestWearables = OnRequestWearables; + GenericCall1 handlerRequestWearables = OnRequestWearables; if (handlerRequestWearables != null) { - handlerRequestWearables(); + handlerRequestWearables(sender); } Action handlerRequestAvatarsData = OnRequestAvatarsData; @@ -5627,18 +5740,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP if (appear.ObjectData.TextureEntry.Length > 1) te = new Primitive.TextureEntry(appear.ObjectData.TextureEntry, 0, appear.ObjectData.TextureEntry.Length); - // What would happen if we ignore any SetAppearance packet that does not include textures? - if (te == null) - { - m_log.WarnFormat("[LLCLIENTVIEW] Received SetAppearance from {0} ( )", Name); - return true; - } - m_log.WarnFormat("[LLCLIENTVIEW] Received SetAppearance from {0} (TE)", Name); - if (handlerSetAppearanceRaw != null) - handlerSetAppearanceRaw(this, AgentId, visualparams, te); - if (handlerSetAppearance != null) - handlerSetAppearance(te, visualparams); - + handlerSetAppearance(sender, te, visualparams); } catch (Exception e) { @@ -5669,6 +5771,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP AvatarWearingArgs wearingArgs = new AvatarWearingArgs(); for (int i = 0; i < nowWearing.WearableData.Length; i++) { + m_log.DebugFormat("[XXX]: Wearable type {0} item {1}", nowWearing.WearableData[i].WearableType, nowWearing.WearableData[i].ItemID); AvatarWearingArgs.Wearable wearable = new AvatarWearingArgs.Wearable(nowWearing.WearableData[i].ItemID, nowWearing.WearableData[i].WearableType); @@ -5949,8 +6052,9 @@ namespace OpenSim.Region.ClientStack.LindenUDP SoundTrigger handlerSoundTrigger = OnSoundTrigger; if (handlerSoundTrigger != null) { - handlerSoundTrigger(soundTriggerPacket.SoundData.SoundID, soundTriggerPacket.SoundData.OwnerID, - soundTriggerPacket.SoundData.ObjectID, soundTriggerPacket.SoundData.ParentID, + // UUIDS are sent as zeroes by the client, substitute agent's id + handlerSoundTrigger(soundTriggerPacket.SoundData.SoundID, AgentId, + AgentId, AgentId, soundTriggerPacket.SoundData.Gain, soundTriggerPacket.SoundData.Position, soundTriggerPacket.SoundData.Handle, 0); @@ -6320,7 +6424,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP } #endregion - ObjectDuplicatePacket.AgentDataBlock AgentandGroupData = dupe.AgentData; +// ObjectDuplicatePacket.AgentDataBlock AgentandGroupData = dupe.AgentData; ObjectDuplicate handlerObjectDuplicate = null; @@ -7138,19 +7242,19 @@ namespace OpenSim.Region.ClientStack.LindenUDP UUID requestID = new UUID(transfer.TransferInfo.Params, 80); // m_log.DebugFormat( -// "[CLIENT]: Got request for asset {0} from item {1} in prim {2} by {3}", +// "[CLIENT]: Got request for asset {0} from item {1} in prim {2} by {3}", // requestID, itemID, taskID, Name); - + if (!(((Scene)m_scene).Permissions.BypassPermissions())) { if (taskID != UUID.Zero) // Prim { SceneObjectPart part = ((Scene)m_scene).GetSceneObjectPart(taskID); - + if (part == null) { m_log.WarnFormat( - "[CLIENT]: {0} requested asset {1} from item {2} in prim {3} but prim does not exist", + "[CLIENT]: {0} requested asset {1} from item {2} in prim {3} but prim does not exist", Name, requestID, itemID, taskID); return true; } @@ -7159,11 +7263,11 @@ namespace OpenSim.Region.ClientStack.LindenUDP if (tii == null) { m_log.WarnFormat( - "[CLIENT]: {0} requested asset {1} from item {2} in prim {3} but item does not exist", - Name, requestID, itemID, taskID); + "[CLIENT]: {0} requested asset {1} from item {2} in prim {3} but item does not exist", + Name, requestID, itemID, taskID); return true; - } - + } + if (tii.Type == (int)AssetType.LSLText) { if (!((Scene)m_scene).Permissions.CanEditScript(itemID, taskID, AgentId)) @@ -7182,41 +7286,41 @@ namespace OpenSim.Region.ClientStack.LindenUDP { m_log.WarnFormat( "[CLIENT]: {0} requested asset {1} from item {2} in prim {3} but the prim is owned by {4}", - Name, requestID, itemID, taskID, part.OwnerID); + Name, requestID, itemID, taskID, part.OwnerID); return true; } - + if ((part.OwnerMask & (uint)PermissionMask.Modify) == 0) { m_log.WarnFormat( - "[CLIENT]: {0} requested asset {1} from item {2} in prim {3} but modify permissions are not set", - Name, requestID, itemID, taskID); + "[CLIENT]: {0} requested asset {1} from item {2} in prim {3} but modify permissions are not set", + Name, requestID, itemID, taskID); return true; } - + if (tii.OwnerID != AgentId) { m_log.WarnFormat( - "[CLIENT]: {0} requested asset {1} from item {2} in prim {3} but the item is owned by {4}", - Name, requestID, itemID, taskID, tii.OwnerID); + "[CLIENT]: {0} requested asset {1} from item {2} in prim {3} but the item is owned by {4}", + Name, requestID, itemID, taskID, tii.OwnerID); return true; } - + if (( - tii.CurrentPermissions & ((uint)PermissionMask.Modify | (uint)PermissionMask.Copy | (uint)PermissionMask.Transfer)) + tii.CurrentPermissions & ((uint)PermissionMask.Modify | (uint)PermissionMask.Copy | (uint)PermissionMask.Transfer)) != ((uint)PermissionMask.Modify | (uint)PermissionMask.Copy | (uint)PermissionMask.Transfer)) { m_log.WarnFormat( - "[CLIENT]: {0} requested asset {1} from item {2} in prim {3} but item permissions are not modify/copy/transfer", - Name, requestID, itemID, taskID); + "[CLIENT]: {0} requested asset {1} from item {2} in prim {3} but item permissions are not modify/copy/transfer", + Name, requestID, itemID, taskID); return true; } - + if (tii.AssetID != requestID) { m_log.WarnFormat( - "[CLIENT]: {0} requested asset {1} from item {2} in prim {3} but this does not match item's asset {4}", - Name, requestID, itemID, taskID, tii.AssetID); + "[CLIENT]: {0} requested asset {1} from item {2} in prim {3} but this does not match item's asset {4}", + Name, requestID, itemID, taskID, tii.AssetID); return true; } } @@ -7820,7 +7924,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP newTaskItem, updatetask.UpdateData.LocalID); } } - } + } return true; } @@ -8815,7 +8919,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP // return true; } - + private bool HandleRequestRegionInfo(IClientAPI sender, Packet Pack) { RequestRegionInfoPacket.AgentDataBlock mPacket = ((RequestRegionInfoPacket)Pack).AgentData; @@ -8836,7 +8940,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP } return true; } - + private bool HandleEstateCovenantRequest(IClientAPI sender, Packet Pack) { @@ -8873,7 +8977,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP return true; } - + private bool HandleGodUpdateRegionInfoUpdate(IClientAPI client, Packet Packet) { GodUpdateRegionInfoPacket GodUpdateRegionInfo = @@ -8893,7 +8997,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP } return false; } - + private bool HandleSimWideDeletes(IClientAPI client, Packet Packet) { SimWideDeletesPacket SimWideDeletesRequest = @@ -8906,7 +9010,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP } return false; } - + private bool HandleGodlikeMessage(IClientAPI client, Packet Packet) { GodlikeMessagePacket GodlikeMessage = @@ -8923,7 +9027,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP } return false; } - + private bool HandleSaveStatePacket(IClientAPI client, Packet Packet) { StateSavePacket SaveStateMessage = @@ -8936,7 +9040,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP } return false; } - + private bool HandleGodKickUser(IClientAPI sender, Packet Pack) { GodKickUserPacket gkupack = (GodKickUserPacket)Pack; @@ -8947,7 +9051,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP if (handlerGodKickUser != null) { handlerGodKickUser(gkupack.UserInfo.GodID, gkupack.UserInfo.GodSessionID, - gkupack.UserInfo.AgentID, (uint)0, gkupack.UserInfo.Reason); + gkupack.UserInfo.AgentID, gkupack.UserInfo.KickFlags, gkupack.UserInfo.Reason); } } else @@ -9074,7 +9178,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP } return true; } - + #endregion Economy/Transaction Packets #region Script Packets @@ -9287,7 +9391,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP } return true; } - + private bool HandleUpdateMuteListEntry(IClientAPI client, Packet Packet) { UpdateMuteListEntryPacket UpdateMuteListEntry = @@ -9303,7 +9407,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP } return false; } - + private bool HandleRemoveMuteListEntry(IClientAPI client, Packet Packet) { RemoveMuteListEntryPacket RemoveMuteListEntry = @@ -9319,7 +9423,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP } return false; } - + private bool HandleUserReport(IClientAPI client, Packet Packet) { UserReportPacket UserReport = @@ -9344,7 +9448,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP } return false; } - + private bool HandleSendPostcard(IClientAPI client, Packet packet) { // SendPostcardPacket SendPostcard = @@ -9626,7 +9730,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP return true; } - + private bool HandleGroupVoteHistoryRequest(IClientAPI client, Packet Packet) { GroupVoteHistoryRequestPacket GroupVoteHistoryRequest = @@ -9639,7 +9743,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP } return false; } - + private bool HandleGroupActiveProposalsRequest(IClientAPI client, Packet Packet) { GroupActiveProposalsRequestPacket GroupActiveProposalsRequest = @@ -9652,7 +9756,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP } return false; } - + private bool HandleGroupAccountDetailsRequest(IClientAPI client, Packet Packet) { GroupAccountDetailsRequestPacket GroupAccountDetailsRequest = @@ -9665,7 +9769,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP } return false; } - + private bool HandleGroupAccountSummaryRequest(IClientAPI client, Packet Packet) { GroupAccountSummaryRequestPacket GroupAccountSummaryRequest = @@ -9678,7 +9782,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP } return false; } - + private bool HandleGroupTransactionsDetailsRequest(IClientAPI client, Packet Packet) { GroupAccountTransactionsRequestPacket GroupAccountTransactionsRequest = @@ -9691,7 +9795,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP } return false; } - + private bool HandleGroupTitlesRequest(IClientAPI sender, Packet Pack) { GroupTitlesRequestPacket groupTitlesRequest = @@ -11136,9 +11240,28 @@ namespace OpenSim.Region.ClientStack.LindenUDP /// handles splitting manually protected void OutPacket(Packet packet, ThrottleOutPacketType throttlePacketType, bool doAutomaticSplitting) { - if (m_debugPacketLevel >= 255) - m_log.DebugFormat("[CLIENT]: Packet OUT {0}", packet.Type); - + if (m_debugPacketLevel > 0) + { + bool outputPacket = true; + + if (m_debugPacketLevel <= 255 + && (packet.Type == PacketType.SimStats || packet.Type == PacketType.SimulatorViewerTimeMessage)) + outputPacket = false; + + if (m_debugPacketLevel <= 200 + && (packet.Type == PacketType.ImagePacket + || packet.Type == PacketType.ImageData + || packet.Type == PacketType.LayerData + || packet.Type == PacketType.CoarseLocationUpdate)) + outputPacket = false; + + if (m_debugPacketLevel <= 100 && (packet.Type == PacketType.AvatarAnimation || packet.Type == PacketType.ViewerEffect)) + outputPacket = false; + + if (outputPacket) + m_log.DebugFormat("[CLIENT]: Packet OUT {0}", packet.Type); + } + m_udpServer.SendPacket(m_udpClient, packet, throttlePacketType, doAutomaticSplitting); } @@ -11208,15 +11331,29 @@ namespace OpenSim.Region.ClientStack.LindenUDP /// Entryway from the client to the simulator. All UDP packets from the client will end up here /// /// OpenMetaverse.packet - public void ProcessInPacket(Packet Pack) + public void ProcessInPacket(Packet packet) { - if (m_debugPacketLevel >= 255) - m_log.DebugFormat("[CLIENT]: Packet IN {0}", Pack.Type); + if (m_debugPacketLevel > 0) + { + bool outputPacket = true; - if (!ProcessPacketMethod(Pack)) - m_log.Warn("[CLIENT]: unhandled packet " + Pack.Type); + if (m_debugPacketLevel <= 255 && packet.Type == PacketType.AgentUpdate) + outputPacket = false; - PacketPool.Instance.ReturnPacket(Pack); + if (m_debugPacketLevel <= 200 && packet.Type == PacketType.RequestImage) + outputPacket = false; + + if (m_debugPacketLevel <= 100 && (packet.Type == PacketType.ViewerEffect || packet.Type == PacketType.AgentAnimation)) + outputPacket = false; + + if (outputPacket) + m_log.DebugFormat("[CLIENT]: Packet IN {0}", packet.Type); + } + + if (!ProcessPacketMethod(packet)) + m_log.Warn("[CLIENT]: unhandled packet " + packet.Type); + + PacketPool.Instance.ReturnPacket(packet); } private static PrimitiveBaseShape GetShapeFromAddPacket(ObjectAddPacket addPacket) @@ -11471,12 +11608,12 @@ namespace OpenSim.Region.ClientStack.LindenUDP UUID requestID = UUID.Zero; byte source = (byte)SourceType.Asset; - - if (transferRequest.TransferInfo.SourceType == (int)SourceType.Asset) + + if (transferRequest.TransferInfo.SourceType == (int)SourceType.Asset) { requestID = new UUID(transferRequest.TransferInfo.Params, 0); } - else if (transferRequest.TransferInfo.SourceType == (int)SourceType.SimInventoryItem) + else if (transferRequest.TransferInfo.SourceType == (int)SourceType.SimInventoryItem) { requestID = new UUID(transferRequest.TransferInfo.Params, 80); source = (byte)SourceType.SimInventoryItem; @@ -11693,8 +11830,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP { StringBuilder sb = new StringBuilder(); sb.Append("["); - if (this.priority != null) - sb.Append(this.priority.ToString()); + sb.Append(this.priority.ToString()); sb.Append(","); if (this.value != null) sb.Append(this.value.ToString()); @@ -11723,7 +11859,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP public PacketMethod method; public bool Async; } - + public class AsyncPacketProcess { public bool result = false; @@ -11792,8 +11928,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP dialog.Data.FirstName = Util.StringToBytes256(ownerFirstName); dialog.Data.LastName = Util.StringToBytes256(ownerLastName); dialog.Data.Message = Util.StringToBytes256(message); - - + ScriptDialogPacket.ButtonsBlock[] buttons = new ScriptDialogPacket.ButtonsBlock[1]; buttons[0] = new ScriptDialogPacket.ButtonsBlock(); buttons[0].ButtonLabel = Util.StringToBytes256("!!llTextBox!!"); @@ -11807,7 +11942,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP { ScenePresence presence = p as ScenePresence; // It turns out to get the agent to stop flying, you have to feed it stop flying velocities - // There's no explicit message to send the client to tell it to stop flying.. it relies on the + // There's no explicit message to send the client to tell it to stop flying.. it relies on the // velocity, collision plane and avatar height // Add 1/6 the avatar's height to it's position so it doesn't shoot into the air @@ -11824,7 +11959,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP // attach a suitable collision plane regardless of the actual situation to force the LLClient to land. // Collision plane below the avatar's position a 6th of the avatar's height is suitable. - // Mind you, that this method doesn't get called if the avatar's velocity magnitude is greater then a + // Mind you, that this method doesn't get called if the avatar's velocity magnitude is greater then a // certain amount.. because the LLClient wouldn't land in that situation anyway. // why are we still testing for this really old height value default??? diff --git a/OpenSim/Region/ClientStack/LindenUDP/LLFileTransfer.cs b/OpenSim/Region/ClientStack/LindenUDP/LLFileTransfer.cs deleted file mode 100644 index 10e5a954b6..0000000000 --- a/OpenSim/Region/ClientStack/LindenUDP/LLFileTransfer.cs +++ /dev/null @@ -1,367 +0,0 @@ -/* - * Copyright (c) Contributors, http://opensimulator.org/ - * See CONTRIBUTORS.TXT for a full list of copyright holders. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * * Neither the name of the OpenSimulator Project nor the - * names of its contributors may be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE DEVELOPERS ``AS IS'' AND ANY - * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED - * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL THE CONTRIBUTORS BE LIABLE FOR ANY - * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES - * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; - * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ - -using System; -using System.Collections.Generic; -using OpenMetaverse; -using OpenSim.Framework; - -namespace OpenSim.Region.ClientStack.LindenUDP -{ - /// - /// A work in progress, to contain the SL specific file transfer code that is currently in various region modules - /// This file currently contains multiple classes that need to be split out into their own files. - /// - public class LLFileTransfer : IClientFileTransfer - { - protected IClientAPI m_clientAPI; - - /// Dictionary of handlers for uploading files from client - /// TODO: Need to add cleanup code to remove handlers that have completed their upload - protected Dictionary m_uploadHandlers; - protected object m_uploadHandlersLock = new object(); - - - /// - /// Dictionary of files ready to be sent to clients - /// - protected static Dictionary m_files; - - /// - /// Dictionary of Download Transfers in progess - /// - protected Dictionary m_downloadHandlers = new Dictionary(); - - - public LLFileTransfer(IClientAPI clientAPI) - { - m_uploadHandlers = new Dictionary(); - m_clientAPI = clientAPI; - - m_clientAPI.OnXferReceive += XferReceive; - m_clientAPI.OnAbortXfer += AbortXferUploadHandler; - } - - public void Close() - { - if (m_clientAPI != null) - { - m_clientAPI.OnXferReceive -= XferReceive; - m_clientAPI.OnAbortXfer -= AbortXferUploadHandler; - m_clientAPI = null; - } - } - - #region Upload Handling - - public bool RequestUpload(string clientFileName, UploadComplete uploadCompleteCallback, UploadAborted abortCallback) - { - if ((String.IsNullOrEmpty(clientFileName)) || (uploadCompleteCallback == null)) - { - return false; - } - - XferUploadHandler uploader = new XferUploadHandler(m_clientAPI, clientFileName); - - return StartUpload(uploader, uploadCompleteCallback, abortCallback); - } - - public bool RequestUpload(UUID fileID, UploadComplete uploadCompleteCallback, UploadAborted abortCallback) - { - if ((fileID == UUID.Zero) || (uploadCompleteCallback == null)) - { - return false; - } - - XferUploadHandler uploader = new XferUploadHandler(m_clientAPI, fileID); - - return StartUpload(uploader, uploadCompleteCallback, abortCallback); - } - - private bool StartUpload(XferUploadHandler uploader, UploadComplete uploadCompleteCallback, UploadAborted abortCallback) - { - uploader.UploadDone += uploadCompleteCallback; - uploader.UploadDone += RemoveXferUploadHandler; - - if (abortCallback != null) - { - uploader.UploadAborted += abortCallback; - } - - lock (m_uploadHandlersLock) - { - if (!m_uploadHandlers.ContainsKey(uploader.XferID)) - { - m_uploadHandlers.Add(uploader.XferID, uploader); - uploader.RequestStartXfer(m_clientAPI); - return true; - } - else - { - // something went wrong with the xferID allocation - uploader.UploadDone -= uploadCompleteCallback; - uploader.UploadDone -= RemoveXferUploadHandler; - if (abortCallback != null) - { - uploader.UploadAborted -= abortCallback; - } - return false; - } - } - } - - protected void AbortXferUploadHandler(IClientAPI remoteClient, ulong xferID) - { - lock (m_uploadHandlersLock) - { - if (m_uploadHandlers.ContainsKey(xferID)) - { - m_uploadHandlers[xferID].AbortUpload(remoteClient); - m_uploadHandlers.Remove(xferID); - } - } - } - - protected void XferReceive(IClientAPI remoteClient, ulong xferID, uint packetID, byte[] data) - { - lock (m_uploadHandlersLock) - { - if (m_uploadHandlers.ContainsKey(xferID)) - { - m_uploadHandlers[xferID].XferReceive(remoteClient, xferID, packetID, data); - } - } - } - - protected void RemoveXferUploadHandler(string filename, UUID fileID, ulong transferID, byte[] fileData, IClientAPI remoteClient) - { - - } - #endregion - - } - - public class XferUploadHandler - { - private AssetBase m_asset; - - public event UploadComplete UploadDone; - public event UploadAborted UploadAborted; - - private sbyte type = 0; - - public ulong mXferID; - private UploadComplete handlerUploadDone; - private UploadAborted handlerAbort; - - private bool m_complete = false; - - public bool UploadComplete - { - get { return m_complete; } - } - - public XferUploadHandler(IClientAPI pRemoteClient, string pClientFilename) - { - Initialise(UUID.Zero, pClientFilename); - } - - public XferUploadHandler(IClientAPI pRemoteClient, UUID fileID) - { - Initialise(fileID, String.Empty); - } - - private void Initialise(UUID fileID, string fileName) - { - m_asset = new AssetBase(fileID, fileName, type, UUID.Zero.ToString()); - m_asset.Data = new byte[0]; - m_asset.Description = "empty"; - m_asset.Local = true; - m_asset.Temporary = true; - mXferID = Util.GetNextXferID(); - } - - public ulong XferID - { - get { return mXferID; } - } - - public void RequestStartXfer(IClientAPI pRemoteClient) - { - m_asset.Metadata.CreatorID = pRemoteClient.AgentId.ToString(); - - if (!String.IsNullOrEmpty(m_asset.Name)) - { - pRemoteClient.SendXferRequest(mXferID, m_asset.Type, m_asset.FullID, 0, Utils.StringToBytes(m_asset.Name)); - } - else - { - pRemoteClient.SendXferRequest(mXferID, m_asset.Type, m_asset.FullID, 0, new byte[0]); - } - } - - /// - /// Process transfer data received from the client. - /// - /// - /// - /// - public void XferReceive(IClientAPI remoteClient, ulong xferID, uint packetID, byte[] data) - { - if (mXferID == xferID) - { - if (m_asset.Data.Length > 1) - { - byte[] destinationArray = new byte[m_asset.Data.Length + data.Length]; - Array.Copy(m_asset.Data, 0, destinationArray, 0, m_asset.Data.Length); - Array.Copy(data, 0, destinationArray, m_asset.Data.Length, data.Length); - m_asset.Data = destinationArray; - } - else - { - byte[] buffer2 = new byte[data.Length - 4]; - Array.Copy(data, 4, buffer2, 0, data.Length - 4); - m_asset.Data = buffer2; - } - - remoteClient.SendConfirmXfer(xferID, packetID); - - if ((packetID & 0x80000000) != 0) - { - SendCompleteMessage(remoteClient); - - } - } - } - - protected void SendCompleteMessage(IClientAPI remoteClient) - { - m_complete = true; - handlerUploadDone = UploadDone; - if (handlerUploadDone != null) - { - handlerUploadDone(m_asset.Name, m_asset.FullID, mXferID, m_asset.Data, remoteClient); - } - } - - public void AbortUpload(IClientAPI remoteClient) - { - handlerAbort = UploadAborted; - if (handlerAbort != null) - { - handlerAbort(m_asset.Name, m_asset.FullID, mXferID, remoteClient); - } - } - } - - public class XferDownloadHandler - { - public IClientAPI Client; - private bool complete; - public byte[] Data = new byte[0]; - public int DataPointer = 0; - public string FileName = String.Empty; - public uint Packet = 0; - public uint Serial = 1; - public ulong XferID = 0; - - public XferDownloadHandler(string fileName, byte[] data, ulong xferID, IClientAPI client) - { - FileName = fileName; - Data = data; - XferID = xferID; - Client = client; - } - - public XferDownloadHandler() - { - } - - /// - /// Start a transfer - /// - /// True if the transfer is complete, false if not - public bool StartSend() - { - if (Data.Length < 1000) - { - // for now (testing) we only support files under 1000 bytes - byte[] transferData = new byte[Data.Length + 4]; - Array.Copy(Utils.IntToBytes(Data.Length), 0, transferData, 0, 4); - Array.Copy(Data, 0, transferData, 4, Data.Length); - Client.SendXferPacket(XferID, 0 + 0x80000000, transferData); - - complete = true; - } - else - { - byte[] transferData = new byte[1000 + 4]; - Array.Copy(Utils.IntToBytes(Data.Length), 0, transferData, 0, 4); - Array.Copy(Data, 0, transferData, 4, 1000); - Client.SendXferPacket(XferID, 0, transferData); - Packet++; - DataPointer = 1000; - } - - return complete; - } - - /// - /// Respond to an ack packet from the client - /// - /// - /// True if the transfer is complete, false otherwise - public bool AckPacket(uint packet) - { - if (!complete) - { - if ((Data.Length - DataPointer) > 1000) - { - byte[] transferData = new byte[1000]; - Array.Copy(Data, DataPointer, transferData, 0, 1000); - Client.SendXferPacket(XferID, Packet, transferData); - Packet++; - DataPointer += 1000; - } - else - { - byte[] transferData = new byte[Data.Length - DataPointer]; - Array.Copy(Data, DataPointer, transferData, 0, Data.Length - DataPointer); - uint endPacket = Packet |= (uint)0x80000000; - Client.SendXferPacket(XferID, endPacket, transferData); - Packet++; - DataPointer += (Data.Length - DataPointer); - - complete = true; - } - } - - return complete; - } - } - -} diff --git a/OpenSim/Region/ClientStack/LindenUDP/LLUDPClient.cs b/OpenSim/Region/ClientStack/LindenUDP/LLUDPClient.cs index 6232c48105..c4db5da2da 100644 --- a/OpenSim/Region/ClientStack/LindenUDP/LLUDPClient.cs +++ b/OpenSim/Region/ClientStack/LindenUDP/LLUDPClient.cs @@ -246,11 +246,28 @@ namespace OpenSim.Region.ClientStack.LindenUDP throw new NotImplementedException(); } + /// + /// Return statistics information about client packet queues. + /// + /// + /// FIXME: This should really be done in a more sensible manner rather than sending back a formatted string. + /// + /// public string GetStats() { - // TODO: ??? - return string.Format("{0,7} {1,7} {2,7} {3,7} {4,7} {5,7} {6,7} {7,7} {8,7} {9,7}", - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); + return string.Format( + "{0,9} {1,9} {2,9} {3,8} {4,7} {5,7} {6,7} {7,7} {8,9} {9,7} {10,7}", + PacketsSent, + PacketsReceived, + UnackedBytes, + m_throttleCategories[(int)ThrottleOutPacketType.Resend].Content, + m_throttleCategories[(int)ThrottleOutPacketType.Land].Content, + m_throttleCategories[(int)ThrottleOutPacketType.Wind].Content, + m_throttleCategories[(int)ThrottleOutPacketType.Cloud].Content, + m_throttleCategories[(int)ThrottleOutPacketType.Task].Content, + m_throttleCategories[(int)ThrottleOutPacketType.Texture].Content, + m_throttleCategories[(int)ThrottleOutPacketType.Asset].Content, + m_throttleCategories[(int)ThrottleOutPacketType.State].Content); } public void SendPacketStats() @@ -412,8 +429,14 @@ namespace OpenSim.Region.ClientStack.LindenUDP /// /// Loops through all of the packet queues for this client and tries to send - /// any outgoing packets, obeying the throttling bucket limits + /// an outgoing packet from each, obeying the throttling bucket limits /// + /// + /// Packet queues are inspected in ascending numerical order starting from 0. Therefore, queues with a lower + /// ThrottleOutPacketType number will see their packet get sent first (e.g. if both Land and Wind queues have + /// packets, then the packet at the front of the Land queue will be sent before the packet at the front of the + /// wind queue). + /// /// This function is only called from a synchronous loop in the /// UDPServer so we don't need to bother making this thread safe /// True if any packets were sent, otherwise false diff --git a/OpenSim/Region/ClientStack/LindenUDP/LLUDPServer.cs b/OpenSim/Region/ClientStack/LindenUDP/LLUDPServer.cs index d13a464195..bfc9cd0605 100644 --- a/OpenSim/Region/ClientStack/LindenUDP/LLUDPServer.cs +++ b/OpenSim/Region/ClientStack/LindenUDP/LLUDPServer.cs @@ -153,6 +153,8 @@ namespace OpenSim.Region.ClientStack.LindenUDP private int m_defaultRTO = 0; private int m_maxRTO = 0; + private bool m_disableFacelights = false; + public Socket Server { get { return null; } } public LLUDPServer(IPAddress listenIP, ref uint port, int proxyPortOffsetParm, bool allow_alternate_port, IConfigSource configSource, AgentCircuitManager circuitManager) @@ -181,7 +183,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP IConfig config = configSource.Configs["ClientStack.LindenUDP"]; if (config != null) { - m_asyncPacketHandling = config.GetBoolean("async_packet_handling", false); + m_asyncPacketHandling = config.GetBoolean("async_packet_handling", true); m_recvBufferSize = config.GetInt("client_socket_rcvbuf_size", 0); sceneThrottleBps = config.GetInt("scene_throttle_max_bps", 0); @@ -190,6 +192,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP m_defaultRTO = config.GetInt("DefaultRTO", 0); m_maxRTO = config.GetInt("MaxRTO", 0); + m_disableFacelights = config.GetBoolean("DisableFacelights", false); } else { @@ -497,6 +500,10 @@ namespace OpenSim.Region.ClientStack.LindenUDP // FIXME: Implement? } + /// + /// Actually send a packet to a client. + /// + /// internal void SendPacketFinal(OutgoingPacket outgoingPacket) { UDPPacketBuffer buffer = outgoingPacket.Buffer; @@ -609,7 +616,6 @@ namespace OpenSim.Region.ClientStack.LindenUDP // UseCircuitCode handling if (packet.Type == PacketType.UseCircuitCode) { - m_log.Debug("[LLUDPSERVER]: Handling UseCircuitCode packet from " + buffer.RemoteEndPoint); object[] array = new object[] { buffer, packet }; if (m_asyncPacketHandling) @@ -692,9 +698,13 @@ namespace OpenSim.Region.ClientStack.LindenUDP if (packet.Header.Reliable && !udpClient.PacketArchive.TryEnqueue(packet.Header.Sequence)) { if (packet.Header.Resent) - m_log.Debug("[LLUDPSERVER]: Received a resend of already processed packet #" + packet.Header.Sequence + ", type: " + packet.Type); - else - m_log.Warn("[LLUDPSERVER]: Received a duplicate (not marked as resend) of packet #" + packet.Header.Sequence + ", type: " + packet.Type); + m_log.DebugFormat( + "[LLUDPSERVER]: Received a resend of already processed packet #{0}, type {1} from {2}", + packet.Header.Sequence, packet.Type, client.Name); + else + m_log.WarnFormat( + "[LLUDPSERVER]: Received a duplicate (not marked as resend) of packet #{0}, type {1} from {2}", + packet.Header.Sequence, packet.Type, client.Name); // Avoid firing a callback twice for the same packet return; @@ -816,9 +826,12 @@ namespace OpenSim.Region.ClientStack.LindenUDP private void HandleUseCircuitCode(object o) { + DateTime startTime = DateTime.Now; object[] array = (object[])o; UDPPacketBuffer buffer = (UDPPacketBuffer)array[0]; UseCircuitCodePacket packet = (UseCircuitCodePacket)array[1]; + + m_log.DebugFormat("[LLUDPSERVER]: Handling UseCircuitCode request from {0}", buffer.RemoteEndPoint); IPEndPoint remoteEndPoint = (IPEndPoint)buffer.RemoteEndPoint; @@ -827,6 +840,10 @@ namespace OpenSim.Region.ClientStack.LindenUDP // Acknowledge the UseCircuitCode packet SendAckImmediate(remoteEndPoint, packet.Header.Sequence); + + m_log.DebugFormat( + "[LLUDPSERVER]: Handling UseCircuitCode request from {0} took {1}ms", + buffer.RemoteEndPoint, (DateTime.Now - startTime).Milliseconds); } private void SendAckImmediate(IPEndPoint remoteEndpoint, uint sequenceNumber) @@ -903,6 +920,8 @@ namespace OpenSim.Region.ClientStack.LindenUDP LLClientView client = new LLClientView(remoteEndPoint, m_scene, this, udpClient, sessionInfo, agentID, sessionID, circuitCode); client.OnLogout += LogoutHandler; + client.DisableFacelights = m_disableFacelights; + // Start the IClientAPI client.Start(); } diff --git a/OpenSim/Region/ClientStack/LindenUDP/UnackedPacketCollection.cs b/OpenSim/Region/ClientStack/LindenUDP/UnackedPacketCollection.cs index e43f7cf57a..4cb4aeec02 100644 --- a/OpenSim/Region/ClientStack/LindenUDP/UnackedPacketCollection.cs +++ b/OpenSim/Region/ClientStack/LindenUDP/UnackedPacketCollection.cs @@ -1,4 +1,4 @@ -/* +/* * Copyright (c) Contributors, http://opensimulator.org/ * See CONTRIBUTORS.TXT for a full list of copyright holders. * @@ -139,28 +139,43 @@ namespace OpenSim.Region.ClientStack.LindenUDP private void ProcessQueues() { // Process all the pending adds - OutgoingPacket pendingAdd; - while (m_pendingAdds.Dequeue(out pendingAdd)) - m_packets[pendingAdd.SequenceNumber] = pendingAdd; + OutgoingPacket pendingAdd; + if (m_pendingAdds != null) + { + while (m_pendingAdds.TryDequeue(out pendingAdd)) + { + if (pendingAdd != null && m_packets != null) + { + m_packets[pendingAdd.SequenceNumber] = pendingAdd; + } + } + } + // Process all the pending removes, including updating statistics and round-trip times PendingAck pendingRemove; OutgoingPacket ackedPacket; - while (m_pendingRemoves.Dequeue(out pendingRemove)) + if (m_pendingRemoves != null) { - if (m_packets.TryGetValue(pendingRemove.SequenceNumber, out ackedPacket)) + while (m_pendingRemoves.TryDequeue(out pendingRemove)) { - m_packets.Remove(pendingRemove.SequenceNumber); - - // Update stats - System.Threading.Interlocked.Add(ref ackedPacket.Client.UnackedBytes, -ackedPacket.Buffer.DataLength); - - if (!pendingRemove.FromResend) + if (m_pendingRemoves != null && m_packets != null) { - // Calculate the round-trip time for this packet and its ACK - int rtt = pendingRemove.RemoveTime - ackedPacket.TickCount; - if (rtt > 0) - ackedPacket.Client.UpdateRoundTrip(rtt); + if (m_packets.TryGetValue(pendingRemove.SequenceNumber, out ackedPacket)) + { + m_packets.Remove(pendingRemove.SequenceNumber); + + // Update stats + System.Threading.Interlocked.Add(ref ackedPacket.Client.UnackedBytes, -ackedPacket.Buffer.DataLength); + + if (!pendingRemove.FromResend) + { + // Calculate the round-trip time for this packet and its ACK + int rtt = pendingRemove.RemoveTime - ackedPacket.TickCount; + if (rtt > 0) + ackedPacket.Client.UpdateRoundTrip(rtt); + } + } } } } diff --git a/OpenSim/Region/ClientStack/RegionApplicationBase.cs b/OpenSim/Region/ClientStack/RegionApplicationBase.cs index e683821d95..ea1317a19c 100644 --- a/OpenSim/Region/ClientStack/RegionApplicationBase.cs +++ b/OpenSim/Region/ClientStack/RegionApplicationBase.cs @@ -36,6 +36,7 @@ using OpenSim.Framework.Communications; using OpenSim.Framework.Servers; using OpenSim.Framework.Servers.HttpServer; using OpenSim.Region.Framework; +using OpenSim.Region.Framework.Interfaces; using OpenSim.Region.Framework.Scenes; using OpenSim.Region.Physics.Manager; @@ -48,23 +49,16 @@ namespace OpenSim.Region.ClientStack protected Dictionary m_clientCircuits = new Dictionary(); protected NetworkServersInfo m_networkServersInfo; - - public NetworkServersInfo NetServersInfo - { - get { return m_networkServersInfo; } - } - protected uint m_httpServerPort; - - protected StorageManager m_storageManager; - + protected ISimulationDataService m_simulationDataService; + protected IEstateDataService m_estateDataService; protected ClientStackManager m_clientStackManager; - - public SceneManager SceneManager - { - get { return m_sceneManager; } - } protected SceneManager m_sceneManager = new SceneManager(); + + public SceneManager SceneManager { get { return m_sceneManager; } } + public NetworkServersInfo NetServersInfo { get { return m_networkServersInfo; } } + public ISimulationDataService SimulationDataService { get { return m_simulationDataService; } } + public IEstateDataService EstateDataService { get { return m_estateDataService; } } protected abstract void Initialize(); @@ -78,15 +72,11 @@ namespace OpenSim.Region.ClientStack /// protected abstract PhysicsScene GetPhysicsScene(string osSceneIdentifier); - protected abstract StorageManager CreateStorageManager(); protected abstract ClientStackManager CreateClientStackManager(); - protected abstract Scene CreateScene(RegionInfo regionInfo, StorageManager storageManager, - AgentCircuitManager circuitManager); + protected abstract Scene CreateScene(RegionInfo regionInfo, ISimulationDataService simDataService, IEstateDataService estateDataService, AgentCircuitManager circuitManager); protected override void StartupSpecific() { - m_storageManager = CreateStorageManager(); - m_clientStackManager = CreateClientStackManager(); Initialize(); diff --git a/OpenSim/Region/CoreModules/Agent/AssetTransaction/AssetXferUploader.cs b/OpenSim/Region/CoreModules/Agent/AssetTransaction/AssetXferUploader.cs index c791cb4c8d..460973840b 100644 --- a/OpenSim/Region/CoreModules/Agent/AssetTransaction/AssetXferUploader.cs +++ b/OpenSim/Region/CoreModules/Agent/AssetTransaction/AssetXferUploader.cs @@ -214,8 +214,6 @@ namespace OpenSim.Region.CoreModules.Agent.AssetTransaction { m_userTransactions.Manager.MyScene.AssetService.Store(m_asset); - IInventoryService invService = m_userTransactions.Manager.MyScene.InventoryService; - InventoryItemBase item = new InventoryItemBase(); item.Owner = ourClient.AgentId; item.CreatorId = ourClient.AgentId.ToString(); @@ -234,7 +232,7 @@ namespace OpenSim.Region.CoreModules.Agent.AssetTransaction item.Flags = (uint) wearableType; item.CreationDate = Util.UnixTimeSinceEpoch(); - if (invService.AddItem(item)) + if (m_userTransactions.Manager.MyScene.AddInventoryItem(item)) ourClient.SendInventoryItemCreateUpdate(item, callbackID); else ourClient.SendAlertMessage("Unable to create inventory item"); diff --git a/OpenSim/Region/CoreModules/Agent/Capabilities/CapabilitiesModule.cs b/OpenSim/Region/CoreModules/Agent/Capabilities/CapabilitiesModule.cs index a6f5d97ad2..c023a6f738 100644 --- a/OpenSim/Region/CoreModules/Agent/Capabilities/CapabilitiesModule.cs +++ b/OpenSim/Region/CoreModules/Agent/Capabilities/CapabilitiesModule.cs @@ -109,9 +109,9 @@ namespace OpenSim.Region.CoreModules.Agent.Capabilities Caps caps = new Caps(m_scene, m_scene.AssetService, MainServer.Instance, m_scene.RegionInfo.ExternalHostName, - MainServer.Instance.Port, + (MainServer.Instance == null) ? 0: MainServer.Instance.Port, capsObjectPath, agentId, m_scene.DumpAssetsToFile, m_scene.RegionInfo.RegionName); - + caps.RegisterHandlers(); m_scene.EventManager.TriggerOnRegisterCaps(agentId, caps); @@ -121,7 +121,7 @@ namespace OpenSim.Region.CoreModules.Agent.Capabilities caps.TaskScriptUpdatedCall = m_scene.CapsUpdateTaskInventoryScriptAsset; caps.CAPSFetchInventoryDescendents = m_scene.HandleFetchInventoryDescendentsCAPS; caps.GetClient = m_scene.SceneContents.GetControllingClient; - + m_capsHandlers[agentId] = caps; } diff --git a/OpenSim/Region/CoreModules/Asset/FlotsamAssetCache.cs b/OpenSim/Region/CoreModules/Asset/FlotsamAssetCache.cs index 9eaa758bd5..6ed48674b2 100644 --- a/OpenSim/Region/CoreModules/Asset/FlotsamAssetCache.cs +++ b/OpenSim/Region/CoreModules/Asset/FlotsamAssetCache.cs @@ -252,7 +252,7 @@ namespace Flotsam.RegionModules.AssetCache } else { - m_MemoryCache.AddOrUpdate(key, asset, DateTime.MaxValue); + m_MemoryCache.AddOrUpdate(key, asset, Double.MaxValue); } } } @@ -863,4 +863,4 @@ namespace Flotsam.RegionModules.AssetCache #endregion } -} \ No newline at end of file +} diff --git a/OpenSim/Region/CoreModules/Avatar/Assets/GetMeshModule.cs b/OpenSim/Region/CoreModules/Avatar/Assets/GetMeshModule.cs new file mode 100644 index 0000000000..36aaab31dc --- /dev/null +++ b/OpenSim/Region/CoreModules/Avatar/Assets/GetMeshModule.cs @@ -0,0 +1,202 @@ +/* + * Copyright (c) Contributors, http://opensimulator.org/ + * See CONTRIBUTORS.TXT for a full list of copyright holders. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * * Neither the name of the OpenSimulator Project nor the + * names of its contributors may be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE DEVELOPERS ``AS IS'' AND ANY + * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED + * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + * DISCLAIMED. IN NO EVENT SHALL THE CONTRIBUTORS BE LIABLE FOR ANY + * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES + * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND + * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS + * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +using System; +using System.Collections; +using System.Collections.Specialized; +using System.Reflection; +using System.IO; +using System.Web; +using Mono.Addins; +using log4net; +using Nini.Config; +using OpenMetaverse; +using OpenMetaverse.StructuredData; +using OpenSim.Framework; +using OpenSim.Framework.Servers; +using OpenSim.Framework.Servers.HttpServer; +using OpenSim.Region.Framework.Interfaces; +using OpenSim.Region.Framework.Scenes; +using OpenSim.Services.Interfaces; +using Caps = OpenSim.Framework.Capabilities.Caps; + +namespace OpenSim.Region.CoreModules.Avatar.Assets +{ + [Extension(Path = "/OpenSim/RegionModules", NodeName = "RegionModule")] + public class GetMeshModule : INonSharedRegionModule + { + private static readonly ILog m_log = + LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); + private Scene m_scene; + private IAssetService m_assetService; + + #region IRegionModuleBase Members + + + public Type ReplaceableInterface + { + get { return null; } + } + + public void Initialise(IConfigSource source) + { + + } + + public void AddRegion(Scene pScene) + { + m_scene = pScene; + } + + public void RemoveRegion(Scene scene) + { + + m_scene.EventManager.OnRegisterCaps -= RegisterCaps; + m_scene = null; + } + + public void RegionLoaded(Scene scene) + { + + m_assetService = m_scene.RequestModuleInterface(); + m_scene.EventManager.OnRegisterCaps += RegisterCaps; + } + + #endregion + + + #region IRegionModule Members + + + + public void Close() { } + + public string Name { get { return "GetMeshModule"; } } + + + public void RegisterCaps(UUID agentID, Caps caps) + { + UUID capID = UUID.Random(); + + m_log.Info("[GETMESH]: /CAPS/" + capID); + caps.RegisterHandler("GetMesh", + new RestHTTPHandler("GET", "/CAPS/" + capID, + delegate(Hashtable m_dhttpMethod) + { + return ProcessGetMesh(m_dhttpMethod, agentID, caps); + })); + + } + + #endregion + + public Hashtable ProcessGetMesh(Hashtable request, UUID AgentId, Caps cap) + { + + Hashtable responsedata = new Hashtable(); + responsedata["int_response_code"] = 400; //501; //410; //404; + responsedata["content_type"] = "text/plain"; + responsedata["keepalive"] = false; + responsedata["str_response_string"] = "Request wasn't what was expected"; + + string meshStr = string.Empty; + + if (request.ContainsKey("mesh_id")) + meshStr = request["mesh_id"].ToString(); + + + UUID meshID = UUID.Zero; + if (!String.IsNullOrEmpty(meshStr) && UUID.TryParse(meshStr, out meshID)) + { + if (m_assetService == null) + { + responsedata["int_response_code"] = 404; //501; //410; //404; + responsedata["content_type"] = "text/plain"; + responsedata["keepalive"] = false; + responsedata["str_response_string"] = "The asset service is unavailable. So is your mesh."; + return responsedata; + } + + AssetBase mesh; + // Only try to fetch locally cached textures. Misses are redirected + mesh = m_assetService.GetCached(meshID.ToString()); + if (mesh != null) + { + if (mesh.Type == (SByte)AssetType.Mesh) + { + responsedata["str_response_string"] = Convert.ToBase64String(mesh.Data); + responsedata["content_type"] = "application/vnd.ll.mesh"; + responsedata["int_response_code"] = 200; + } + // Optionally add additional mesh types here + else + { + responsedata["int_response_code"] = 404; //501; //410; //404; + responsedata["content_type"] = "text/plain"; + responsedata["keepalive"] = false; + responsedata["str_response_string"] = "Unfortunately, this asset isn't a mesh."; + return responsedata; + } + } + else + { + mesh = m_assetService.Get(meshID.ToString()); + if (mesh != null) + { + if (mesh.Type == (SByte)AssetType.Mesh) + { + responsedata["str_response_string"] = Convert.ToBase64String(mesh.Data); + responsedata["content_type"] = "application/vnd.ll.mesh"; + responsedata["int_response_code"] = 200; + } + // Optionally add additional mesh types here + else + { + responsedata["int_response_code"] = 404; //501; //410; //404; + responsedata["content_type"] = "text/plain"; + responsedata["keepalive"] = false; + responsedata["str_response_string"] = "Unfortunately, this asset isn't a mesh."; + return responsedata; + } + } + + else + { + responsedata["int_response_code"] = 404; //501; //410; //404; + responsedata["content_type"] = "text/plain"; + responsedata["keepalive"] = false; + responsedata["str_response_string"] = "Your Mesh wasn't found. Sorry!"; + return responsedata; + } + } + + } + + return responsedata; + } + } +} diff --git a/OpenSim/Region/CoreModules/Avatar/Assets/GetTextureModule.cs b/OpenSim/Region/CoreModules/Avatar/Assets/GetTextureModule.cs index 8aa87fddee..97581e5206 100644 --- a/OpenSim/Region/CoreModules/Avatar/Assets/GetTextureModule.cs +++ b/OpenSim/Region/CoreModules/Avatar/Assets/GetTextureModule.cs @@ -187,18 +187,28 @@ namespace OpenSim.Region.CoreModules.Avatar.ObjectCaps int start, end; if (TryParseRange(range, out start, out end)) { - end = Utils.Clamp(end, 1, texture.Data.Length); - start = Utils.Clamp(start, 0, end - 1); + // Before clamping start make sure we can satisfy it in order to avoid + // sending back the last byte instead of an error status + if (start >= texture.Data.Length) + { + response.StatusCode = (int)System.Net.HttpStatusCode.RequestedRangeNotSatisfiable; + return; + } + + end = Utils.Clamp(end, 0, texture.Data.Length - 1); + start = Utils.Clamp(start, 0, end); + int len = end - start + 1; //m_log.Debug("Serving " + start + " to " + end + " of " + texture.Data.Length + " bytes for texture " + texture.ID); - if (end - start < texture.Data.Length) + if (len < texture.Data.Length) response.StatusCode = (int)System.Net.HttpStatusCode.PartialContent; - response.ContentLength = end - start; + response.ContentLength = len; response.ContentType = texture.Metadata.ContentType; + response.AddHeader("Content-Range", String.Format("bytes {0}-{1}/{2}", start, end, texture.Data.Length)); - response.Body.Write(texture.Data, start, end - start); + response.Body.Write(texture.Data, start, len); } else { diff --git a/OpenSim/Region/CoreModules/Avatar/Assets/NewFileAgentInventoryVariablePriceModule.cs b/OpenSim/Region/CoreModules/Avatar/Assets/NewFileAgentInventoryVariablePriceModule.cs new file mode 100644 index 0000000000..af26b2b5a3 --- /dev/null +++ b/OpenSim/Region/CoreModules/Avatar/Assets/NewFileAgentInventoryVariablePriceModule.cs @@ -0,0 +1,266 @@ +/* + * Copyright (c) Contributors, http://opensimulator.org/ + * See CONTRIBUTORS.TXT for a full list of copyright holders. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * * Neither the name of the OpenSimulator Project nor the + * names of its contributors may be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE DEVELOPERS ``AS IS'' AND ANY + * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED + * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + * DISCLAIMED. IN NO EVENT SHALL THE CONTRIBUTORS BE LIABLE FOR ANY + * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES + * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND + * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS + * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +using System; +using System.Collections; +using System.Collections.Specialized; +using System.Reflection; +using System.IO; +using System.Web; +using Mono.Addins; +using log4net; +using Nini.Config; +using OpenMetaverse; +using OpenMetaverse.StructuredData; +using OpenSim.Framework; +using OpenSim.Framework.Servers; +using OpenSim.Framework.Servers.HttpServer; +using OpenSim.Region.Framework.Interfaces; +using OpenSim.Region.Framework.Scenes; +using OpenSim.Services.Interfaces; +using Caps = OpenSim.Framework.Capabilities.Caps; +using OpenSim.Framework.Capabilities; + +namespace OpenSim.Region.CoreModules.Avatar.Assets +{ + [Extension(Path = "/OpenSim/RegionModules", NodeName = "RegionModule")] + public class NewFileAgentInventoryVariablePriceModule : INonSharedRegionModule + { + private static readonly ILog m_log = + LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); + private Scene m_scene; + private IAssetService m_assetService; + private bool m_dumpAssetsToFile = false; + + #region IRegionModuleBase Members + + + public Type ReplaceableInterface + { + get { return null; } + } + + public void Initialise(IConfigSource source) + { + + } + + public void AddRegion(Scene pScene) + { + m_scene = pScene; + } + + public void RemoveRegion(Scene scene) + { + + m_scene.EventManager.OnRegisterCaps -= RegisterCaps; + m_scene = null; + } + + public void RegionLoaded(Scene scene) + { + + m_assetService = m_scene.RequestModuleInterface(); + m_scene.EventManager.OnRegisterCaps += RegisterCaps; + } + + #endregion + + + #region IRegionModule Members + + + + public void Close() { } + + public string Name { get { return "NewFileAgentInventoryVariablePriceModule"; } } + + + public void RegisterCaps(UUID agentID, Caps caps) + { + UUID capID = UUID.Random(); + + m_log.Info("[GETMESH]: /CAPS/" + capID); + caps.RegisterHandler("NewFileAgentInventoryVariablePrice", + + new LLSDStreamhandler("POST", + "/CAPS/" + capID.ToString(), + delegate(LLSDAssetUploadRequest req) + { + return NewAgentInventoryRequest(req,agentID); + })); + + } + + #endregion + + public LLSDNewFileAngentInventoryVariablePriceReplyResponse NewAgentInventoryRequest(LLSDAssetUploadRequest llsdRequest, UUID agentID) + { + + //TODO: The Mesh uploader uploads many types of content. If you're going to implement a Money based limit + // You need to be aware of this and + + + //if (llsdRequest.asset_type == "texture" || + // llsdRequest.asset_type == "animation" || + // llsdRequest.asset_type == "sound") + // { + IClientAPI client = null; + + + IMoneyModule mm = m_scene.RequestModuleInterface(); + + if (mm != null) + { + if (m_scene.TryGetClient(agentID, out client)) + { + if (!mm.UploadCovered(client, mm.UploadCharge)) + { + if (client != null) + client.SendAgentAlertMessage("Unable to upload asset. Insufficient funds.", false); + + LLSDNewFileAngentInventoryVariablePriceReplyResponse errorResponse = new LLSDNewFileAngentInventoryVariablePriceReplyResponse(); + errorResponse.rsvp = ""; + errorResponse.state = "error"; + return errorResponse; + } + } + } + // } + + + + string assetName = llsdRequest.name; + string assetDes = llsdRequest.description; + string capsBase = "/CAPS/NewFileAgentInventoryVariablePrice/"; + UUID newAsset = UUID.Random(); + UUID newInvItem = UUID.Random(); + UUID parentFolder = llsdRequest.folder_id; + string uploaderPath = Util.RandomClass.Next(5000, 8000).ToString("0000") + "/"; + + Caps.AssetUploader uploader = + new Caps.AssetUploader(assetName, assetDes, newAsset, newInvItem, parentFolder, llsdRequest.inventory_type, + llsdRequest.asset_type, capsBase + uploaderPath, MainServer.Instance, m_dumpAssetsToFile); + MainServer.Instance.AddStreamHandler( + new BinaryStreamHandler("POST", capsBase + uploaderPath, uploader.uploaderCaps)); + + string protocol = "http://"; + + if (MainServer.Instance.UseSSL) + protocol = "https://"; + + string uploaderURL = protocol + m_scene.RegionInfo.ExternalHostName + ":" + MainServer.Instance.Port.ToString() + capsBase + + uploaderPath; + + + LLSDNewFileAngentInventoryVariablePriceReplyResponse uploadResponse = new LLSDNewFileAngentInventoryVariablePriceReplyResponse(); + + + uploadResponse.rsvp = uploaderURL; + uploadResponse.state = "upload"; + uploadResponse.resource_cost = 0; + uploadResponse.upload_price = 0; + + uploader.OnUpLoad += //UploadCompleteHandler; + + delegate( + string passetName, string passetDescription, UUID passetID, + UUID pinventoryItem, UUID pparentFolder, byte[] pdata, string pinventoryType, + string passetType) + { + UploadCompleteHandler(passetName, passetDescription, passetID, + pinventoryItem, pparentFolder, pdata, pinventoryType, + passetType,agentID); + }; + return uploadResponse; + } + + + public void UploadCompleteHandler(string assetName, string assetDescription, UUID assetID, + UUID inventoryItem, UUID parentFolder, byte[] data, string inventoryType, + string assetType,UUID AgentID) + { + + sbyte assType = 0; + sbyte inType = 0; + + if (inventoryType == "sound") + { + inType = 1; + assType = 1; + } + else if (inventoryType == "animation") + { + inType = 19; + assType = 20; + } + else if (inventoryType == "wearable") + { + inType = 18; + switch (assetType) + { + case "bodypart": + assType = 13; + break; + case "clothing": + assType = 5; + break; + } + } + else if (inventoryType == "mesh") + { + inType = (sbyte)InventoryType.Mesh; + assType = (sbyte)AssetType.Mesh; + } + + AssetBase asset; + asset = new AssetBase(assetID, assetName, assType, AgentID.ToString()); + asset.Data = data; + + if (m_scene.AssetService != null) + m_scene.AssetService.Store(asset); + + InventoryItemBase item = new InventoryItemBase(); + item.Owner = AgentID; + item.CreatorId = AgentID.ToString(); + item.ID = inventoryItem; + item.AssetID = asset.FullID; + item.Description = assetDescription; + item.Name = assetName; + item.AssetType = assType; + item.InvType = inType; + item.Folder = parentFolder; + item.CurrentPermissions = (uint)PermissionMask.All; + item.BasePermissions = (uint)PermissionMask.All; + item.EveryOnePermissions = 0; + item.NextPermissions = (uint)(PermissionMask.Move | PermissionMask.Modify | PermissionMask.Transfer); + item.CreationDate = Util.UnixTimeSinceEpoch(); + m_scene.AddInventoryItem(item); + + } + } +} diff --git a/OpenSim/Region/CoreModules/Avatar/Attachments/AttachmentsModule.cs b/OpenSim/Region/CoreModules/Avatar/Attachments/AttachmentsModule.cs index ff3036aca8..1f49a015da 100644 --- a/OpenSim/Region/CoreModules/Avatar/Attachments/AttachmentsModule.cs +++ b/OpenSim/Region/CoreModules/Avatar/Attachments/AttachmentsModule.cs @@ -29,6 +29,7 @@ using System; using System.Collections.Generic; using System.Reflection; using log4net; +using Mono.Addins; using Nini.Config; using OpenMetaverse; using OpenMetaverse.Packets; @@ -36,41 +37,68 @@ using OpenSim.Framework; using OpenSim.Region.Framework; using OpenSim.Region.Framework.Interfaces; using OpenSim.Region.Framework.Scenes; +using OpenSim.Region.Framework.Scenes.Serialization; namespace OpenSim.Region.CoreModules.Avatar.Attachments { - public class AttachmentsModule : IAttachmentsModule, IRegionModule + [Extension(Path = "/OpenSim/RegionModules", NodeName = "RegionModule", Id = "AttachmentsModule")] + public class AttachmentsModule : IAttachmentsModule, INonSharedRegionModule { private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); protected Scene m_scene = null; + + public string Name { get { return "Attachments Module"; } } + public Type ReplaceableInterface { get { return null; } } - public void Initialise(Scene scene, IConfigSource source) + public void Initialise(IConfigSource source) {} + + public void AddRegion(Scene scene) { - scene.RegisterModuleInterface(this); m_scene = scene; + m_scene.RegisterModuleInterface(this); + m_scene.EventManager.OnNewClient += SubscribeToClientEvents; + // TODO: Should probably be subscribing to CloseClient too, but this doesn't yet give us IClientAPI } - - public void PostInitialise() + + public void RemoveRegion(Scene scene) { + m_scene.UnregisterModuleInterface(this); + m_scene.EventManager.OnNewClient -= SubscribeToClientEvents; } - - public void Close() + + public void RegionLoaded(Scene scene) {} + + public void Close() { + RemoveRegion(m_scene); } - - public string Name + + public void SubscribeToClientEvents(IClientAPI client) { - get { return "Attachments Module"; } + client.OnRezSingleAttachmentFromInv += RezSingleAttachmentFromInventory; + client.OnRezMultipleAttachmentsFromInv += RezMultipleAttachmentsFromInventory; + client.OnObjectAttach += AttachObject; + client.OnObjectDetach += DetachObject; + client.OnDetachAttachmentIntoInv += ShowDetachInUserInventory; } - - public bool IsSharedModule + + public void UnsubscribeFromClientEvents(IClientAPI client) { - get { return false; } + client.OnRezSingleAttachmentFromInv -= RezSingleAttachmentFromInventory; + client.OnRezMultipleAttachmentsFromInv -= RezMultipleAttachmentsFromInventory; + client.OnObjectAttach -= AttachObject; + client.OnObjectDetach -= DetachObject; + client.OnDetachAttachmentIntoInv -= ShowDetachInUserInventory; } - - // Called by client - // + + /// + /// Called by client + /// + /// + /// + /// + /// public void AttachObject(IClientAPI remoteClient, uint objectLocalID, uint AttachmentPt, bool silent) { m_log.Debug("[ATTACHMENTS MODULE]: Invoking AttachObject"); @@ -83,7 +111,16 @@ namespace OpenSim.Region.CoreModules.Avatar.Attachments return; if (!m_scene.Permissions.CanTakeObject(part.UUID, remoteClient.AgentId)) + { + remoteClient.SendAgentAlertMessage( + "You don't have sufficient permissions to attach this object", false); + return; + } + + // TODO: this short circuits multiple attachments functionality in LL viewer 2.1+ and should + // be removed when that functionality is implemented in opensim + AttachmentPt &= 0x7f; // Calls attach with a Zero position if (AttachObject(remoteClient, part.ParentGroup, AttachmentPt, false)) @@ -91,15 +128,12 @@ namespace OpenSim.Region.CoreModules.Avatar.Attachments m_scene.EventManager.TriggerOnAttach(objectLocalID, part.ParentGroup.GetFromItemID(), remoteClient.AgentId); // Save avatar attachment information - ScenePresence presence; - if (m_scene.AvatarFactory != null && m_scene.TryGetScenePresence(remoteClient.AgentId, out presence)) - { - m_log.Info( - "[ATTACHMENTS MODULE]: Saving avatar attachment. AgentID: " + remoteClient.AgentId - + ", AttachmentPoint: " + AttachmentPt); + m_log.Info( + "[ATTACHMENTS MODULE]: Saving avatar attachment. AgentID: " + remoteClient.AgentId + + ", AttachmentPoint: " + AttachmentPt); - m_scene.AvatarFactory.UpdateDatabase(remoteClient.AgentId, presence.Appearance); - } + if (m_scene.AvatarFactory != null) + m_scene.AvatarFactory.QueueAppearanceSave(remoteClient.AgentId); } } catch (Exception e) @@ -112,77 +146,66 @@ namespace OpenSim.Region.CoreModules.Avatar.Attachments { Vector3 attachPos = group.AbsolutePosition; - if (m_scene.Permissions.CanTakeObject(group.UUID, remoteClient.AgentId)) + // TODO: this short circuits multiple attachments functionality in LL viewer 2.1+ and should + // be removed when that functionality is implemented in opensim + AttachmentPt &= 0x7f; + + // If the attachment point isn't the same as the one previously used + // set it's offset position = 0 so that it appears on the attachment point + // and not in a weird location somewhere unknown. + if (AttachmentPt != 0 && AttachmentPt != (uint)group.GetAttachmentPoint()) { - // If the attachment point isn't the same as the one previously used - // set it's offset position = 0 so that it appears on the attachment point - // and not in a weird location somewhere unknown. - if (AttachmentPt != 0 && AttachmentPt != (uint)group.GetAttachmentPoint()) - { - attachPos = Vector3.Zero; - } + attachPos = Vector3.Zero; + } - // AttachmentPt 0 means the client chose to 'wear' the attachment. - if (AttachmentPt == 0) - { - // Check object for stored attachment point - AttachmentPt = (uint)group.GetAttachmentPoint(); - } + // AttachmentPt 0 means the client chose to 'wear' the attachment. + if (AttachmentPt == 0) + { + // Check object for stored attachment point + AttachmentPt = (uint)group.GetAttachmentPoint(); + } - // if we still didn't find a suitable attachment point....... - if (AttachmentPt == 0) - { - // Stick it on left hand with Zero Offset from the attachment point. - AttachmentPt = (uint)AttachmentPoint.LeftHand; - attachPos = Vector3.Zero; - } + // if we still didn't find a suitable attachment point....... + if (AttachmentPt == 0) + { + // Stick it on left hand with Zero Offset from the attachment point. + AttachmentPt = (uint)AttachmentPoint.LeftHand; + attachPos = Vector3.Zero; + } - group.SetAttachmentPoint((byte)AttachmentPt); - group.AbsolutePosition = attachPos; + group.SetAttachmentPoint((byte)AttachmentPt); + group.AbsolutePosition = attachPos; - // Remove any previous attachments - ScenePresence sp = m_scene.GetScenePresence(remoteClient.AgentId); - UUID itemID = UUID.Zero; - if (sp != null) + // Remove any previous attachments + ScenePresence sp = m_scene.GetScenePresence(remoteClient.AgentId); + UUID itemID = UUID.Zero; + if (sp != null) + { + foreach (SceneObjectGroup grp in sp.Attachments) { - foreach(SceneObjectGroup grp in sp.Attachments) + if (grp.GetAttachmentPoint() == (byte)AttachmentPt) { - if (grp.GetAttachmentPoint() == (byte)AttachmentPt) - { - itemID = grp.GetFromItemID(); - break; - } + itemID = grp.GetFromItemID(); + break; } - if (itemID != UUID.Zero) - DetachSingleAttachmentToInv(itemID, remoteClient); } + if (itemID != UUID.Zero) + DetachSingleAttachmentToInv(itemID, remoteClient); + } - if (group.GetFromItemID() == UUID.Zero) - { - m_scene.attachObjectAssetStore(remoteClient, group, remoteClient.AgentId, out itemID); - } - else - { - itemID = group.GetFromItemID(); - } - - SetAttachmentInventoryStatus(remoteClient, AttachmentPt, itemID, group); - - group.AttachToAgent(remoteClient.AgentId, AttachmentPt, attachPos, silent); - - // In case it is later dropped again, don't let - // it get cleaned up - group.RootPart.RemFlag(PrimFlags.TemporaryOnRez); - group.HasGroupChanged = false; + if (group.GetFromItemID() == UUID.Zero) + { + m_scene.attachObjectAssetStore(remoteClient, group, remoteClient.AgentId, out itemID); } else { - remoteClient.SendAgentAlertMessage( - "You don't have sufficient permissions to attach this object", false); - - return false; + itemID = group.GetFromItemID(); } + ShowAttachInUserInventory(remoteClient, AttachmentPt, itemID, group); + + AttachToAgent(sp, group, AttachmentPt, attachPos, silent); + return true; } @@ -199,31 +222,35 @@ namespace OpenSim.Region.CoreModules.Avatar.Attachments public UUID RezSingleAttachmentFromInventory(IClientAPI remoteClient, UUID itemID, uint AttachmentPt) { - m_log.DebugFormat("[ATTACHMENTS MODULE]: Rezzing single attachment from item {0} for {1}", itemID, remoteClient.Name); - return RezSingleAttachmentFromInventory(remoteClient, itemID, AttachmentPt, true); } public UUID RezSingleAttachmentFromInventory( IClientAPI remoteClient, UUID itemID, uint AttachmentPt, bool updateInventoryStatus) - { + { + m_log.DebugFormat( + "[ATTACHMENTS MODULE]: Rezzing attachment to point {0} from item {1} for {2}", + (AttachmentPoint)AttachmentPt, itemID, remoteClient.Name); + + // TODO: this short circuits multiple attachments functionality in LL viewer 2.1+ and should + // be removed when that functionality is implemented in opensim + AttachmentPt &= 0x7f; + SceneObjectGroup att = RezSingleAttachmentFromInventoryInternal(remoteClient, itemID, AttachmentPt); if (updateInventoryStatus) { if (att == null) - { ShowDetachInUserInventory(itemID, remoteClient); - } - - SetAttachmentInventoryStatus(att, remoteClient, itemID, AttachmentPt); + else + ShowAttachInUserInventory(att, remoteClient, itemID, AttachmentPt); } if (null == att) return UUID.Zero; else - return att.UUID; - } + return att.UUID; + } protected SceneObjectGroup RezSingleAttachmentFromInventoryInternal( IClientAPI remoteClient, UUID itemID, uint AttachmentPt) @@ -241,19 +268,32 @@ namespace OpenSim.Region.CoreModules.Avatar.Attachments if (objatt != null) { + // Loading the inventory from XML will have set this, but + // there is no way the object could have changed yet, + // since scripts aren't running yet. So, clear it here. + objatt.HasGroupChanged = false; bool tainted = false; if (AttachmentPt != 0 && AttachmentPt != objatt.GetAttachmentPoint()) tainted = true; - AttachObject(remoteClient, objatt, AttachmentPt, false); - //objatt.ScheduleGroupForFullUpdate(); + // This will throw if the attachment fails + try + { + AttachObject(remoteClient, objatt, AttachmentPt, false); + } + catch + { + // Make sure the object doesn't stick around and bail + m_scene.DeleteSceneObject(objatt, false); + return null; + } if (tainted) objatt.HasGroupChanged = true; // Fire after attach, so we don't get messy perms dialogs - // 3 == AttachedRez - objatt.CreateScriptInstances(0, true, m_scene.DefaultScriptEngine, 3); + // 4 == AttachedRez + objatt.CreateScriptInstances(0, true, m_scene.DefaultScriptEngine, 4); objatt.ResumeScripts(); // Do this last so that event listeners have access to all the effects of the attachment @@ -270,14 +310,22 @@ namespace OpenSim.Region.CoreModules.Avatar.Attachments } return null; - } + } - public UUID SetAttachmentInventoryStatus( + /// + /// Update the user inventory to the attachment of an item + /// + /// + /// + /// + /// + /// + protected UUID ShowAttachInUserInventory( SceneObjectGroup att, IClientAPI remoteClient, UUID itemID, uint AttachmentPt) { - m_log.DebugFormat( - "[ATTACHMENTS MODULE]: Updating inventory of {0} to show attachment of {1} (item ID {2})", - remoteClient.Name, att.Name, itemID); +// m_log.DebugFormat( +// "[ATTACHMENTS MODULE]: Updating inventory of {0} to show attachment of {1} (item ID {2})", +// remoteClient.Name, att.Name, itemID); if (!att.IsDeleted) AttachmentPt = att.RootPart.AttachmentPoint; @@ -301,7 +349,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Attachments /// /// /// - public void SetAttachmentInventoryStatus( + protected void ShowAttachInUserInventory( IClientAPI remoteClient, uint AttachmentPt, UUID itemID, SceneObjectGroup att) { // m_log.DebugFormat( @@ -335,7 +383,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Attachments presence.Appearance.SetAttachment((int)AttachmentPt, itemID, item.AssetID /* att.UUID */); if (m_scene.AvatarFactory != null) - m_scene.AvatarFactory.UpdateDatabase(remoteClient.AgentId, presence.Appearance); + m_scene.AvatarFactory.QueueAppearanceSave(remoteClient.AgentId); } } @@ -357,11 +405,9 @@ namespace OpenSim.Region.CoreModules.Avatar.Attachments presence.Appearance.DetachAttachment(itemID); // Save avatar attachment information + m_log.Debug("[ATTACHMENTS MODULE]: Detaching from UserID: " + remoteClient.AgentId + ", ItemID: " + itemID); if (m_scene.AvatarFactory != null) - { - m_log.Debug("[ATTACHMENTS MODULE]: Dettaching from UserID: " + remoteClient.AgentId + ", ItemID: " + itemID); - m_scene.AvatarFactory.UpdateDatabase(remoteClient.AgentId, presence.Appearance); - } + m_scene.AvatarFactory.QueueAppearanceSave(remoteClient.AgentId); } DetachSingleAttachmentToInv(itemID, remoteClient); @@ -373,21 +419,23 @@ namespace OpenSim.Region.CoreModules.Avatar.Attachments if (part == null || part.ParentGroup == null) return; + if (part.ParentGroup.RootPart.AttachedAvatar != remoteClient.AgentId) + return; + UUID inventoryID = part.ParentGroup.GetFromItemID(); ScenePresence presence; if (m_scene.TryGetScenePresence(remoteClient.AgentId, out presence)) { if (!m_scene.Permissions.CanRezObject( - part.ParentGroup.Children.Count, remoteClient.AgentId, presence.AbsolutePosition)) + part.ParentGroup.PrimCount, remoteClient.AgentId, presence.AbsolutePosition)) return; presence.Appearance.DetachAttachment(itemID); if (m_scene.AvatarFactory != null) - { - m_scene.AvatarFactory.UpdateDatabase(remoteClient.AgentId, presence.Appearance); - } + m_scene.AvatarFactory.QueueAppearanceSave(remoteClient.AgentId); + part.ParentGroup.DetachToGround(); List uuids = new List(); @@ -408,7 +456,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Attachments // We can NOT use the dictionries here, as we are looking // for an entity by the fromAssetID, which is NOT the prim UUID - List detachEntities = m_scene.GetEntities(); + EntityBase[] detachEntities = m_scene.GetEntities(); SceneObjectGroup group; foreach (EntityBase entity in detachEntities) @@ -421,12 +469,140 @@ namespace OpenSim.Region.CoreModules.Avatar.Attachments m_scene.EventManager.TriggerOnAttach(group.LocalId, itemID, UUID.Zero); group.DetachToInventoryPrep(); m_log.Debug("[ATTACHMENTS MODULE]: Saving attachpoint: " + ((uint)group.GetAttachmentPoint()).ToString()); - m_scene.UpdateKnownItem(remoteClient, group,group.GetFromItemID(), group.OwnerID); + + // If an item contains scripts, it's always changed. + // This ensures script state is saved on detach + foreach (SceneObjectPart p in group.Parts) + if (p.Inventory.ContainsScripts()) + group.HasGroupChanged = true; + + UpdateKnownItem(remoteClient, group, group.GetFromItemID(), group.OwnerID); m_scene.DeleteSceneObject(group, false); return; } } } } + + /// + /// Update the attachment asset for the new sog details if they have changed. + /// + /// + /// This is essential for preserving attachment attributes such as permission. Unlike normal scene objects, + /// these details are not stored on the region. + /// + /// + /// + /// + /// + public void UpdateKnownItem(IClientAPI remoteClient, SceneObjectGroup grp, UUID itemID, UUID agentID) + { + if (grp != null) + { + if (!grp.HasGroupChanged) + { + m_log.WarnFormat("[ATTACHMENTS MODULE]: Save request for {0} which is unchanged", grp.UUID); + return; + } + + m_log.DebugFormat( + "[ATTACHMENTS MODULE]: Updating asset for attachment {0}, attachpoint {1}", + grp.UUID, grp.GetAttachmentPoint()); + + string sceneObjectXml = SceneObjectSerializer.ToOriginalXmlFormat(grp); + InventoryItemBase item = new InventoryItemBase(itemID, remoteClient.AgentId); + item = m_scene.InventoryService.GetItem(item); + + if (item != null) + { + AssetBase asset = m_scene.CreateAsset( + grp.GetPartName(grp.LocalId), + grp.GetPartDescription(grp.LocalId), + (sbyte)AssetType.Object, + Utils.StringToBytes(sceneObjectXml), + remoteClient.AgentId); + m_scene.AssetService.Store(asset); + + item.AssetID = asset.FullID; + item.Description = asset.Description; + item.Name = asset.Name; + item.AssetType = asset.Type; + item.InvType = (int)InventoryType.Object; + + m_scene.InventoryService.UpdateItem(item); + + // this gets called when the agent logs off! + if (remoteClient != null) + remoteClient.SendInventoryItemCreateUpdate(item, 0); + } + } + } + + /// + /// Attach this scene object to the given avatar. + /// + /// + /// This isn't publicly available since attachments should always perform the corresponding inventory + /// operation (to show the attach in user inventory and update the asset with positional information). + /// + /// + /// + /// + /// + /// + protected void AttachToAgent(ScenePresence avatar, SceneObjectGroup so, uint attachmentpoint, Vector3 AttachOffset, bool silent) + { + // don't attach attachments to child agents + if (avatar.IsChildAgent) return; + +// m_log.DebugFormat("[ATTACHMENTS MODULE]: Adding attachment {0} to avatar {1}", Name, avatar.Name); + + so.DetachFromBackup(); + + // Remove from database and parcel prim count + m_scene.DeleteFromStorage(so.UUID); + m_scene.EventManager.TriggerParcelPrimCountTainted(); + + so.RootPart.AttachedAvatar = avatar.UUID; + + //Anakin Lohner bug #3839 + SceneObjectPart[] parts = so.Parts; + for (int i = 0; i < parts.Length; i++) + parts[i].AttachedAvatar = avatar.UUID; + + if (so.RootPart.PhysActor != null) + { + m_scene.PhysicsScene.RemovePrim(so.RootPart.PhysActor); + so.RootPart.PhysActor = null; + } + + so.AbsolutePosition = AttachOffset; + so.RootPart.AttachedPos = AttachOffset; + so.RootPart.IsAttachment = true; + + so.RootPart.SetParentLocalId(avatar.LocalId); + so.SetAttachmentPoint(Convert.ToByte(attachmentpoint)); + + avatar.AddAttachment(so); + + if (!silent) + { + // Killing it here will cause the client to deselect it + // It then reappears on the avatar, deselected + // through the full update below + // + if (so.IsSelected) + { + m_scene.SendKillObject(so.RootPart.LocalId); + } + + so.IsSelected = false; // fudge.... + so.ScheduleGroupForFullUpdate(); + } + + // In case it is later dropped again, don't let + // it get cleaned up + so.RootPart.RemFlag(PrimFlags.TemporaryOnRez); + } } } diff --git a/OpenSim/Region/CoreModules/Avatar/AvatarFactory/AvatarFactoryModule.cs b/OpenSim/Region/CoreModules/Avatar/AvatarFactory/AvatarFactoryModule.cs index 7e5a8ec9f1..0df4585eec 100644 --- a/OpenSim/Region/CoreModules/Avatar/AvatarFactory/AvatarFactoryModule.cs +++ b/OpenSim/Region/CoreModules/Avatar/AvatarFactory/AvatarFactoryModule.cs @@ -32,6 +32,10 @@ using Nini.Config; using OpenMetaverse; using OpenSim.Framework; +using System.Threading; +using System.Timers; +using System.Collections.Generic; + using OpenSim.Region.Framework.Interfaces; using OpenSim.Region.Framework.Scenes; using OpenSim.Services.Interfaces; @@ -42,48 +46,45 @@ namespace OpenSim.Region.CoreModules.Avatar.AvatarFactory { private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); private Scene m_scene = null; - private static readonly AvatarAppearance def = new AvatarAppearance(); - public bool TryGetAvatarAppearance(UUID avatarId, out AvatarAppearance appearance) - { - AvatarData avatar = m_scene.AvatarService.GetAvatar(avatarId); - //if ((profile != null) && (profile.RootFolder != null)) - if (avatar != null) - { - appearance = avatar.ToAvatarAppearance(avatarId); - return true; - } + private int m_savetime = 5; // seconds to wait before saving changed appearance + private int m_sendtime = 2; // seconds to wait before sending changed appearance - m_log.ErrorFormat("[APPEARANCE]: Appearance not found for {0}, creating default", avatarId); - appearance = CreateDefault(avatarId); - return false; - } + private int m_checkTime = 500; // milliseconds to wait between checks for appearance updates + private System.Timers.Timer m_updateTimer = new System.Timers.Timer(); + private Dictionary m_savequeue = new Dictionary(); + private Dictionary m_sendqueue = new Dictionary(); - private AvatarAppearance CreateDefault(UUID avatarId) - { - AvatarAppearance appearance = null; - AvatarWearable[] wearables; - byte[] visualParams; - GetDefaultAvatarAppearance(out wearables, out visualParams); - appearance = new AvatarAppearance(avatarId, wearables, visualParams); + private object m_setAppearanceLock = new object(); - return appearance; - } + #region RegionModule Members - public void Initialise(Scene scene, IConfigSource source) + public void Initialise(Scene scene, IConfigSource config) { scene.RegisterModuleInterface(this); scene.EventManager.OnNewClient += NewClient; - if (m_scene == null) + if (config != null) { - m_scene = scene; + IConfig sconfig = config.Configs["Startup"]; + if (sconfig != null) + { + m_savetime = Convert.ToInt32(sconfig.GetString("DelayBeforeAppearanceSave",Convert.ToString(m_savetime))); + m_sendtime = Convert.ToInt32(sconfig.GetString("DelayBeforeAppearanceSend",Convert.ToString(m_sendtime))); + // m_log.InfoFormat("[AVFACTORY] configured for {0} save and {1} send",m_savetime,m_sendtime); + } } + if (m_scene == null) + m_scene = scene; } public void PostInitialise() { + m_updateTimer.Enabled = false; + m_updateTimer.AutoReset = true; + m_updateTimer.Interval = m_checkTime; // 500 milliseconds wait to start async ops + m_updateTimer.Elapsed += new ElapsedEventHandler(HandleAppearanceUpdateTimer); } public void Close() @@ -102,6 +103,8 @@ namespace OpenSim.Region.CoreModules.Avatar.AvatarFactory public void NewClient(IClientAPI client) { + client.OnRequestWearables += SendWearables; + client.OnSetAppearance += SetAppearance; client.OnAvatarNowWearing += AvatarIsWearing; } @@ -110,42 +113,249 @@ namespace OpenSim.Region.CoreModules.Avatar.AvatarFactory // client.OnAvatarNowWearing -= AvatarIsWearing; } - public void SetAppearanceAssets(UUID userID, ref AvatarAppearance appearance) + #endregion + + public bool ValidateBakedTextureCache(IClientAPI client) { - IInventoryService invService = m_scene.InventoryService; - - if (invService.GetRootFolder(userID) != null) + ScenePresence sp = m_scene.GetScenePresence(client.AgentId); + if (sp == null) { - for (int i = 0; i < 13; i++) - { - if (appearance.Wearables[i].ItemID == UUID.Zero) - { - appearance.Wearables[i].AssetID = UUID.Zero; - } - else - { - InventoryItemBase baseItem = new InventoryItemBase(appearance.Wearables[i].ItemID, userID); - baseItem = invService.GetItem(baseItem); + m_log.WarnFormat("[AVFACTORY]: SetAppearance unable to find presence for {0}", client.AgentId); + return false; + } - if (baseItem != null) - { - appearance.Wearables[i].AssetID = baseItem.AssetID; - } - else - { - m_log.ErrorFormat( - "[APPEARANCE]: Can't find inventory item {0} for {1}, setting to default", - appearance.Wearables[i].ItemID, (WearableType)i); - - appearance.Wearables[i].AssetID = def.Wearables[i].AssetID; - } + bool defonly = true; // are we only using default textures + + // Process the texture entry + for (int i = 0; i < AvatarAppearance.BAKE_INDICES.Length; i++) + { + int idx = AvatarAppearance.BAKE_INDICES[i]; + Primitive.TextureEntryFace face = sp.Appearance.Texture.FaceTextures[idx]; + if (face == null || face.TextureID != AppearanceManager.DEFAULT_AVATAR_TEXTURE) + continue; + + defonly = false; // found a non-default texture reference + + if (! CheckBakedTextureAsset(client,face.TextureID,idx)) + return false; + } + + // If we only found default textures, then the appearance is not cached + return (defonly ? false : true); + } + + /// + /// Set appearance data (textureentry and slider settings) received from the client + /// + /// + /// + public void SetAppearance(IClientAPI client, Primitive.TextureEntry textureEntry, byte[] visualParams) + { + ScenePresence sp = m_scene.GetScenePresence(client.AgentId); + if (sp == null) + { + m_log.WarnFormat("[AVFACTORY]: SetAppearance unable to find presence for {0}",client.AgentId); + return; + } + + // m_log.WarnFormat("[AVFACTORY]: Start SetAppearance for {0}",client.AgentId); + + bool changed = false; + + // Process the texture entry transactionally, this doesn't guarantee that Appearance is + // going to be handled correctly but it does serialize the updates to the appearance + lock (m_setAppearanceLock) + { + if (textureEntry != null) + { + changed = sp.Appearance.SetTextureEntries(textureEntry); + + // m_log.WarnFormat("[AVFACTORY]: Prepare to check textures for {0}",client.AgentId); + + for (int i = 0; i < AvatarAppearance.BAKE_INDICES.Length; i++) + { + int idx = AvatarAppearance.BAKE_INDICES[i]; + Primitive.TextureEntryFace face = sp.Appearance.Texture.FaceTextures[idx]; + if (face != null && face.TextureID != AppearanceManager.DEFAULT_AVATAR_TEXTURE) + Util.FireAndForget(delegate(object o) { + if (! CheckBakedTextureAsset(client,face.TextureID,idx)) + client.SendRebakeAvatarTextures(face.TextureID); + }); + } + + // m_log.WarnFormat("[AVFACTORY]: Complete texture check for {0}",client.AgentId); + } + + // Process the visual params, this may change height as well + if (visualParams != null) + { + if (sp.Appearance.SetVisualParams(visualParams)) + { + changed = true; + if (sp.Appearance.AvatarHeight > 0) + sp.SetHeight(sp.Appearance.AvatarHeight); + } + } + + // Send the appearance back to the avatar, not clear that this is needed + sp.ControllingClient.SendAvatarDataImmediate(sp); + // AvatarAppearance avp = sp.Appearance; + // sp.ControllingClient.SendAppearance(avp.Owner,avp.VisualParams,avp.Texture.GetBytes()); + + } + + + // If something changed in the appearance then queue an appearance save + if (changed) + QueueAppearanceSave(client.AgentId); + + // And always queue up an appearance update to send out + QueueAppearanceSend(client.AgentId); + + // m_log.WarnFormat("[AVFACTORY]: Complete SetAppearance for {0}:\n{1}",client.AgentId,sp.Appearance.ToString()); + } + + /// + /// Checks for the existance of a baked texture asset and + /// requests the viewer rebake if the asset is not found + /// + /// + /// + /// + private bool CheckBakedTextureAsset(IClientAPI client, UUID textureID, int idx) + { + if (m_scene.AssetService.Get(textureID.ToString()) == null) + { + m_log.WarnFormat("[AVFACTORY]: Missing baked texture {0} ({1}) for avatar {2}", + textureID, idx, client.Name); + return false; + } + return true; + } + + #region UpdateAppearanceTimer + + public void QueueAppearanceSend(UUID agentid) + { + // m_log.WarnFormat("[AVFACTORY]: Queue appearance send for {0}", agentid); + + // 10000 ticks per millisecond, 1000 milliseconds per second + long timestamp = DateTime.Now.Ticks + Convert.ToInt64(m_sendtime * 1000 * 10000); + lock (m_sendqueue) + { + m_sendqueue[agentid] = timestamp; + m_updateTimer.Start(); + } + } + + public void QueueAppearanceSave(UUID agentid) + { + // m_log.WarnFormat("[AVFACTORY]: Queue appearance save for {0}", agentid); + + // 10000 ticks per millisecond, 1000 milliseconds per second + long timestamp = DateTime.Now.Ticks + Convert.ToInt64(m_savetime * 1000 * 10000); + lock (m_savequeue) + { + m_savequeue[agentid] = timestamp; + m_updateTimer.Start(); + } + } + + private void HandleAppearanceSend(UUID agentid) + { + ScenePresence sp = m_scene.GetScenePresence(agentid); + if (sp == null) + { + m_log.WarnFormat("[AVFACTORY]: Agent {0} no longer in the scene", agentid); + return; + } + + // m_log.WarnFormat("[AVFACTORY]: Handle appearance send for {0}", agentid); + + // Send the appearance to everyone in the scene + sp.SendAppearanceToAllOtherAgents(); + // sp.ControllingClient.SendAvatarDataImmediate(sp); + + // Send the appearance back to the avatar + // AvatarAppearance avp = sp.Appearance; + // sp.ControllingClient.SendAppearance(avp.Owner, avp.VisualParams, avp.Texture.GetBytes()); + +/* +// this needs to be fixed, the flag should be on scene presence not the region module + // Start the animations if necessary + if (!m_startAnimationSet) + { + sp.Animator.UpdateMovementAnimations(); + m_startAnimationSet = true; + } +*/ + } + + private void HandleAppearanceSave(UUID agentid) + { + ScenePresence sp = m_scene.GetScenePresence(agentid); + if (sp == null) + { + m_log.WarnFormat("[AVFACTORY]: Agent {0} no longer in the scene", agentid); + return; + } + + // m_log.WarnFormat("[AVFACTORY] avatar {0} save appearance",agentid); + + m_scene.AvatarService.SetAppearance(agentid, sp.Appearance); + } + + private void HandleAppearanceUpdateTimer(object sender, EventArgs ea) + { + long now = DateTime.Now.Ticks; + + lock (m_sendqueue) + { + Dictionary sends = new Dictionary(m_sendqueue); + foreach (KeyValuePair kvp in sends) + { + if (kvp.Value < now) + { + Util.FireAndForget(delegate(object o) { HandleAppearanceSend(kvp.Key); }); + m_sendqueue.Remove(kvp.Key); } } } - else + + lock (m_savequeue) { - m_log.WarnFormat("[APPEARANCE]: user {0} has no inventory, appearance isn't going to work", userID); + Dictionary saves = new Dictionary(m_savequeue); + foreach (KeyValuePair kvp in saves) + { + if (kvp.Value < now) + { + Util.FireAndForget(delegate(object o) { HandleAppearanceSave(kvp.Key); }); + m_savequeue.Remove(kvp.Key); + } + } } + + if (m_savequeue.Count == 0 && m_sendqueue.Count == 0) + m_updateTimer.Stop(); + } + + #endregion + + /// + /// Tell the client for this scene presence what items it should be wearing now + /// + public void SendWearables(IClientAPI client) + { + ScenePresence sp = m_scene.GetScenePresence(client.AgentId); + if (sp == null) + { + m_log.WarnFormat("[AVFACTORY]: SendWearables unable to find presence for {0}", client.AgentId); + return; + } + + // m_log.WarnFormat("[AVFACTORY]: Received request for wearables of {0}", client.AgentId); + + client.SendWearables(sp.Appearance.Wearables, sp.Appearance.Serial++); } /// @@ -153,65 +363,74 @@ namespace OpenSim.Region.CoreModules.Avatar.AvatarFactory /// /// /// - public void AvatarIsWearing(Object sender, AvatarWearingArgs e) + public void AvatarIsWearing(IClientAPI client, AvatarWearingArgs e) { - m_log.DebugFormat("[APPEARANCE]: AvatarIsWearing"); - - IClientAPI clientView = (IClientAPI)sender; - ScenePresence sp = m_scene.GetScenePresence(clientView.AgentId); - - if (sp == null) + ScenePresence sp = m_scene.GetScenePresence(client.AgentId); + if (sp == null) { - m_log.Error("[APPEARANCE]: Avatar is child agent, ignoring AvatarIsWearing event"); + m_log.WarnFormat("[AVFACTORY]: AvatarIsWearing unable to find presence for {0}", client.AgentId); return; } - AvatarAppearance avatAppearance = sp.Appearance; - //if (!TryGetAvatarAppearance(clientView.AgentId, out avatAppearance)) - //{ - // m_log.Warn("[APPEARANCE]: We didn't seem to find the appearance, falling back to ScenePresence"); - // avatAppearance = sp.Appearance; - //} - - //m_log.DebugFormat("[APPEARANCE]: Received wearables for {0}", clientView.Name); - + // m_log.WarnFormat("[AVFACTORY]: AvatarIsWearing called for {0}", client.AgentId); + + AvatarAppearance avatAppearance = new AvatarAppearance(sp.Appearance, false); + foreach (AvatarWearingArgs.Wearable wear in e.NowWearing) { - if (wear.Type < 13) + if (wear.Type < AvatarWearable.MAX_WEARABLES) + avatAppearance.Wearables[wear.Type].Add(wear.ItemID, UUID.Zero); + } + + avatAppearance.GetAssetsFrom(sp.Appearance); + + // This could take awhile since it needs to pull inventory + SetAppearanceAssets(sp.UUID, ref avatAppearance); + + // could get fancier with the locks here, but in the spirit of "last write wins" + // this should work correctly + sp.Appearance = avatAppearance; + m_scene.AvatarService.SetAppearance(client.AgentId, sp.Appearance); + } + + private void SetAppearanceAssets(UUID userID, ref AvatarAppearance appearance) + { + IInventoryService invService = m_scene.InventoryService; + + if (invService.GetRootFolder(userID) != null) + { + for (int i = 0; i < AvatarWearable.MAX_WEARABLES; i++) { - avatAppearance.Wearables[wear.Type].ItemID = wear.ItemID; + for (int j = 0; j < appearance.Wearables[j].Count; j++) + { + if (appearance.Wearables[i][j].ItemID == UUID.Zero) + continue; + + // Ignore ruth's assets + if (appearance.Wearables[i][j].ItemID == AvatarWearable.DefaultWearables[i][0].ItemID) + continue; + InventoryItemBase baseItem = new InventoryItemBase(appearance.Wearables[i][j].ItemID, userID); + baseItem = invService.GetItem(baseItem); + + if (baseItem != null) + { + appearance.Wearables[i].Add(appearance.Wearables[i][j].ItemID, baseItem.AssetID); + } + else + { + m_log.ErrorFormat( + "[AVFACTORY]: Can't find inventory item {0} for {1}, setting to default", + appearance.Wearables[i][j].ItemID, (WearableType)i); + + appearance.Wearables[i].RemoveItem(appearance.Wearables[i][j].ItemID); + } + } } } - - SetAppearanceAssets(sp.UUID, ref avatAppearance); - AvatarData adata = new AvatarData(avatAppearance); - m_scene.AvatarService.SetAvatar(clientView.AgentId, adata); - - sp.Appearance = avatAppearance; - } - - public static void GetDefaultAvatarAppearance(out AvatarWearable[] wearables, out byte[] visualParams) - { - visualParams = GetDefaultVisualParams(); - wearables = AvatarWearable.DefaultWearables; - } - - public void UpdateDatabase(UUID user, AvatarAppearance appearance) - { - m_log.DebugFormat("[APPEARANCE]: UpdateDatabase"); - AvatarData adata = new AvatarData(appearance); - m_scene.AvatarService.SetAvatar(user, adata); - } - - private static byte[] GetDefaultVisualParams() - { - byte[] visualParams; - visualParams = new byte[218]; - for (int i = 0; i < 218; i++) + else { - visualParams[i] = 100; + m_log.WarnFormat("[AVFACTORY]: user {0} has no inventory, appearance isn't going to work", userID); } - return visualParams; } } } diff --git a/OpenSim/Region/CoreModules/Avatar/Chat/ChatModule.cs b/OpenSim/Region/CoreModules/Avatar/Chat/ChatModule.cs index 02f0968c40..4359c01d5d 100644 --- a/OpenSim/Region/CoreModules/Avatar/Chat/ChatModule.cs +++ b/OpenSim/Region/CoreModules/Avatar/Chat/ChatModule.cs @@ -167,7 +167,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Chat // sanity check: if (c.Sender == null) { - m_log.ErrorFormat("[CHAT] OnChatFromClient from {0} has empty Sender field!", sender); + m_log.ErrorFormat("[CHAT]: OnChatFromClient from {0} has empty Sender field!", sender); return; } @@ -220,26 +220,32 @@ namespace OpenSim.Region.CoreModules.Avatar.Chat if (message.Length >= 1000) // libomv limit message = message.Substring(0, 1000); - // m_log.DebugFormat("[CHAT]: DCTA: fromID {0} fromName {1}, cType {2}, sType {3}", fromID, fromName, c.Type, sourceType); +// m_log.DebugFormat( +// "[CHAT]: DCTA: fromID {0} fromName {1}, region{2}, cType {3}, sType {4}", +// fromID, fromName, scene.RegionInfo.RegionName, c.Type, sourceType); + HashSet receiverIDs = new HashSet(); + foreach (Scene s in m_scenes) { s.ForEachScenePresence( delegate(ScenePresence presence) { - TrySendChatMessage(presence, fromPos, regionPos, fromID, fromName, c.Type, message, sourceType); + if (TrySendChatMessage(presence, fromPos, regionPos, fromID, fromName, c.Type, message, sourceType)) + receiverIDs.Add(presence.UUID); } ); } + + (scene as Scene).EventManager.TriggerOnChatToClients( + fromID, receiverIDs, message, c.Type, fromPos, fromName, sourceType, ChatAudibleLevel.Fully); } static private Vector3 CenterOfRegion = new Vector3(128, 128, 30); public virtual void OnChatBroadcast(Object sender, OSChatMessage c) { - // unless the chat to be broadcast is of type Region, we - // drop it if its channel is neither 0 nor DEBUG_CHANNEL - if (c.Channel != 0 && c.Channel != DEBUG_CHANNEL && c.Type != ChatTypeEnum.Region) return; + if (c.Channel != 0 && c.Channel != DEBUG_CHANNEL) return; ChatTypeEnum cType = c.Type; if (c.Channel == DEBUG_CHANNEL) @@ -271,6 +277,8 @@ namespace OpenSim.Region.CoreModules.Avatar.Chat // m_log.DebugFormat("[CHAT] Broadcast: fromID {0} fromName {1}, cType {2}, sType {3}", fromID, fromName, cType, sourceType); + HashSet receiverIDs = new HashSet(); + ((Scene)c.Scene).ForEachScenePresence( delegate(ScenePresence presence) { @@ -288,16 +296,32 @@ namespace OpenSim.Region.CoreModules.Avatar.Chat client.SendChatMessage(c.Message, (byte)cType, CenterOfRegion, fromName, fromID, (byte)sourceType, (byte)ChatAudibleLevel.Fully); + receiverIDs.Add(presence.UUID); }); + + (c.Scene as Scene).EventManager.TriggerOnChatToClients( + fromID, receiverIDs, c.Message, cType, CenterOfRegion, fromName, sourceType, ChatAudibleLevel.Fully); } - - protected virtual void TrySendChatMessage(ScenePresence presence, Vector3 fromPos, Vector3 regionPos, + /// + /// Try to send a message to the given presence + /// + /// The receiver + /// + /// /param> + /// + /// + /// + /// + /// + /// true if the message was sent to the receiver, false if it was not sent due to failing a + /// precondition + protected virtual bool TrySendChatMessage(ScenePresence presence, Vector3 fromPos, Vector3 regionPos, UUID fromAgentID, string fromName, ChatTypeEnum type, string message, ChatSourceType src) { // don't send stuff to child agents - if (presence.IsChildAgent) return; + if (presence.IsChildAgent) return false; Vector3 fromRegionPos = fromPos + regionPos; Vector3 toRegionPos = presence.AbsolutePosition + @@ -310,12 +334,14 @@ namespace OpenSim.Region.CoreModules.Avatar.Chat type == ChatTypeEnum.Say && dis > m_saydistance || type == ChatTypeEnum.Shout && dis > m_shoutdistance) { - return; + return false; } // TODO: should change so the message is sent through the avatar rather than direct to the ClientView presence.ControllingClient.SendChatMessage(message, (byte) type, fromPos, fromName, - fromAgentID,(byte)src,(byte)ChatAudibleLevel.Fully); + fromAgentID, (byte)src, (byte)ChatAudibleLevel.Fully); + + return true; } } } diff --git a/OpenSim/Region/CoreModules/Avatar/Combat/CombatModule.cs b/OpenSim/Region/CoreModules/Avatar/Combat/CombatModule.cs index a895d6e838..a5fcb493bd 100644 --- a/OpenSim/Region/CoreModules/Avatar/Combat/CombatModule.cs +++ b/OpenSim/Region/CoreModules/Avatar/Combat/CombatModule.cs @@ -93,7 +93,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Combat.CombatModule { string deadAvatarMessage; ScenePresence killingAvatar = null; - string killingAvatarMessage; +// string killingAvatarMessage; if (killerObjectLocalID == 0) deadAvatarMessage = "You committed suicide!"; @@ -115,24 +115,30 @@ namespace OpenSim.Region.CoreModules.Avatar.Combat.CombatModule // Try to find the avatar wielding the killing object killingAvatar = deadAvatar.Scene.GetScenePresence(part.OwnerID); if (killingAvatar == null) - deadAvatarMessage = String.Format("You impaled yourself on {0} owned by {1}!", part.Name, deadAvatar.Scene.GetUserName(part.OwnerID)); + { + IUserManagement userManager = deadAvatar.Scene.RequestModuleInterface(); + string userName = "Unkown User"; + if (userManager != null) + userName = userManager.GetUserName(part.OwnerID); + deadAvatarMessage = String.Format("You impaled yourself on {0} owned by {1}!", part.Name, userName); + } else { - killingAvatarMessage = String.Format("You fragged {0}!", deadAvatar.Name); + // killingAvatarMessage = String.Format("You fragged {0}!", deadAvatar.Name); deadAvatarMessage = String.Format("You got killed by {0}!", killingAvatar.Name); } } } else { - killingAvatarMessage = String.Format("You fragged {0}!", deadAvatar.Name); +// killingAvatarMessage = String.Format("You fragged {0}!", deadAvatar.Name); deadAvatarMessage = String.Format("You got killed by {0}!", killingAvatar.Name); } } try { deadAvatar.ControllingClient.SendAgentAlertMessage(deadAvatarMessage, true); - if(killingAvatar != null) + if (killingAvatar != null) killingAvatar.ControllingClient.SendAlertMessage("You fragged " + deadAvatar.Firstname + " " + deadAvatar.Lastname); } catch (InvalidOperationException) @@ -143,7 +149,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Combat.CombatModule } private void AvatarEnteringParcel(ScenePresence avatar, int localLandID, UUID regionID) - { + { try { ILandObject obj = avatar.Scene.LandChannel.GetLandObject(avatar.AbsolutePosition.X, avatar.AbsolutePosition.Y); diff --git a/OpenSim/Region/CoreModules/Avatar/Dialog/DialogModule.cs b/OpenSim/Region/CoreModules/Avatar/Dialog/DialogModule.cs index 72fff948ed..2b3d2a9b14 100644 --- a/OpenSim/Region/CoreModules/Avatar/Dialog/DialogModule.cs +++ b/OpenSim/Region/CoreModules/Avatar/Dialog/DialogModule.cs @@ -51,10 +51,15 @@ namespace OpenSim.Region.CoreModules.Avatar.Dialog m_scene.RegisterModuleInterface(this); m_scene.AddCommand( - this, "alert", "alert ", "Send an alert to a user", HandleAlertConsoleCommand); + this, "alert", "alert ", + "Send an alert to a user", + HandleAlertConsoleCommand); m_scene.AddCommand( - this, "alert general", "alert general ", "Send an alert to everyone", HandleAlertConsoleCommand); + this, "alert general", "alert [general] ", + "Send an alert to everyone", + "If keyword 'general' is omitted, then must be surrounded by quotation marks.", + HandleAlertConsoleCommand); } public void PostInitialise() {} @@ -96,7 +101,8 @@ namespace OpenSim.Region.CoreModules.Avatar.Dialog { m_scene.ForEachScenePresence(delegate(ScenePresence presence) { - presence.ControllingClient.SendAlertMessage(message); + if (!presence.IsChildAgent) + presence.ControllingClient.SendAlertMessage(message); }); } @@ -172,20 +178,49 @@ namespace OpenSim.Region.CoreModules.Avatar.Dialog if (m_scene.ConsoleScene() != null && m_scene.ConsoleScene() != m_scene) return; - if (cmdparams[1] == "general") + bool isGeneral = false; + string firstName = string.Empty; + string lastName = string.Empty; + string message = string.Empty; + + if (cmdparams.Length > 1) { - string message = CombineParams(cmdparams, 2); + firstName = cmdparams[1]; + isGeneral = firstName.ToLower().Equals("general"); + } + if (cmdparams.Length == 2 && !isGeneral) + { + // alert "message" + message = cmdparams[1]; + isGeneral = true; + } + else if (cmdparams.Length > 2 && isGeneral) + { + // alert general + message = CombineParams(cmdparams, 2); + } + else if (cmdparams.Length > 3) + { + // alert + lastName = cmdparams[2]; + message = CombineParams(cmdparams, 3); + } + else + { + OpenSim.Framework.Console.MainConsole.Instance.Output( + "Usage: alert \"message\" | alert general | alert "); + return; + } + if (isGeneral) + { m_log.InfoFormat( - "[DIALOG]: Sending general alert in region {0} with message {1}", m_scene.RegionInfo.RegionName, message); + "[DIALOG]: Sending general alert in region {0} with message {1}", + m_scene.RegionInfo.RegionName, message); SendGeneralAlert(message); } else { - string firstName = cmdparams[1]; - string lastName = cmdparams[2]; - string message = CombineParams(cmdparams, 3); - m_log.InfoFormat( "[DIALOG]: Sending alert in region {0} to {1} {2} with message {3}", m_scene.RegionInfo.RegionName, firstName, lastName, message); @@ -204,4 +239,4 @@ namespace OpenSim.Region.CoreModules.Avatar.Dialog return result; } } -} +} \ No newline at end of file diff --git a/OpenSim/Region/CoreModules/Avatar/Friends/FriendsModule.cs b/OpenSim/Region/CoreModules/Avatar/Friends/FriendsModule.cs index 6f044cb8f1..b3f0a2516a 100644 --- a/OpenSim/Region/CoreModules/Avatar/Friends/FriendsModule.cs +++ b/OpenSim/Region/CoreModules/Avatar/Friends/FriendsModule.cs @@ -54,7 +54,6 @@ namespace OpenSim.Region.CoreModules.Avatar.Friends public UUID PrincipalID; public FriendInfo[] Friends; public int Refcount; - public UUID RegionID; public bool IsFriend(string friend) { @@ -67,7 +66,8 @@ namespace OpenSim.Region.CoreModules.Avatar.Friends return false; } } - + + private static readonly FriendInfo[] EMPTY_FRIENDS = new FriendInfo[0]; private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); protected List m_Scenes = new List(); @@ -79,7 +79,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Friends protected Dictionary m_Friends = new Dictionary(); - protected List m_NeedsListOfFriends = new List(); + protected HashSet m_NeedsListOfFriends = new HashSet(); protected IPresenceService PresenceService { @@ -146,7 +146,6 @@ namespace OpenSim.Region.CoreModules.Avatar.Friends // Instantiate the request handler IHttpServer server = MainServer.GetHttpServer((uint)mPort); server.AddStreamHandler(new FriendsRequestHandler(this)); - } if (m_FriendsService == null) @@ -173,7 +172,6 @@ namespace OpenSim.Region.CoreModules.Avatar.Friends scene.EventManager.OnNewClient += OnNewClient; scene.EventManager.OnClientClosed += OnClientClosed; scene.EventManager.OnMakeRootAgent += OnMakeRootAgent; - scene.EventManager.OnMakeChildAgent += OnMakeChildAgent; scene.EventManager.OnClientLogin += OnClientLogin; } @@ -198,16 +196,13 @@ namespace OpenSim.Region.CoreModules.Avatar.Friends public uint GetFriendPerms(UUID principalID, UUID friendID) { - if (!m_Friends.ContainsKey(principalID)) - return 0; - - UserFriendData data = m_Friends[principalID]; - - foreach (FriendInfo fi in data.Friends) + FriendInfo[] friends = GetFriends(principalID); + foreach (FriendInfo fi in friends) { if (fi.Friend == friendID.ToString()) return (uint)fi.TheirFlags; } + return 0; } @@ -217,73 +212,59 @@ namespace OpenSim.Region.CoreModules.Avatar.Friends client.OnApproveFriendRequest += OnApproveFriendRequest; client.OnDenyFriendRequest += OnDenyFriendRequest; client.OnTerminateFriendship += OnTerminateFriendship; - client.OnGrantUserRights += OnGrantUserRights; - lock (m_Friends) - { - if (m_Friends.ContainsKey(client.AgentId)) + // Asynchronously fetch the friends list or increment the refcount for the existing + // friends list + Util.FireAndForget( + delegate(object o) { - m_Friends[client.AgentId].Refcount++; - return; + lock (m_Friends) + { + UserFriendData friendsData; + if (m_Friends.TryGetValue(client.AgentId, out friendsData)) + { + friendsData.Refcount++; + } + else + { + friendsData = new UserFriendData(); + friendsData.PrincipalID = client.AgentId; + friendsData.Friends = FriendsService.GetFriends(client.AgentId); + friendsData.Refcount = 1; + + m_Friends[client.AgentId] = friendsData; + } + } } - - UserFriendData newFriends = new UserFriendData(); - - newFriends.PrincipalID = client.AgentId; - newFriends.Friends = m_FriendsService.GetFriends(client.AgentId); - newFriends.Refcount = 1; - newFriends.RegionID = UUID.Zero; - - m_Friends.Add(client.AgentId, newFriends); - } - + ); } private void OnClientClosed(UUID agentID, Scene scene) { ScenePresence sp = scene.GetScenePresence(agentID); if (sp != null && !sp.IsChildAgent) + { // do this for root agents closing out StatusChange(agentID, false); + } lock (m_Friends) - if (m_Friends.ContainsKey(agentID)) + { + UserFriendData friendsData; + if (m_Friends.TryGetValue(agentID, out friendsData)) { - if (m_Friends[agentID].Refcount == 1) + friendsData.Refcount--; + if (friendsData.Refcount <= 0) m_Friends.Remove(agentID); - else - m_Friends[agentID].Refcount--; } + } } private void OnMakeRootAgent(ScenePresence sp) { UUID agentID = sp.ControllingClient.AgentId; - - if (m_Friends.ContainsKey(agentID)) - { - // This is probably an overkill, but just - // to make sure we have the latest and greatest - // friends list -- always pull OnMakeRoot - m_Friends[agentID].Friends = - m_FriendsService.GetFriends(agentID); - - m_Friends[agentID].RegionID = - sp.ControllingClient.Scene.RegionInfo.RegionID; - } - } - - - private void OnMakeChildAgent(ScenePresence sp) - { - UUID agentID = sp.ControllingClient.AgentId; - - if (m_Friends.ContainsKey(agentID)) - { - if (m_Friends[agentID].RegionID == sp.ControllingClient.Scene.RegionInfo.RegionID) - m_Friends[agentID].RegionID = UUID.Zero; - } + UpdateFriendsCache(agentID); } private void OnClientLogin(IClientAPI client) @@ -295,75 +276,62 @@ namespace OpenSim.Region.CoreModules.Avatar.Friends // Register that we need to send the list of online friends to this user lock (m_NeedsListOfFriends) - if (!m_NeedsListOfFriends.Contains(agentID)) - { - m_NeedsListOfFriends.Add(agentID); - } + m_NeedsListOfFriends.Add(agentID); } public void SendFriendsOnlineIfNeeded(IClientAPI client) { UUID agentID = client.AgentId; - if (m_NeedsListOfFriends.Contains(agentID)) + + // Check if the online friends list is needed + lock (m_NeedsListOfFriends) { - if (!m_Friends.ContainsKey(agentID)) - { - m_log.DebugFormat("[FRIENDS MODULE]: agent {0} not found in local cache", agentID); + if (!m_NeedsListOfFriends.Remove(agentID)) return; - } + } - // - // Send the friends online - // - List online = GetOnlineFriends(agentID); - if (online.Count > 0) - { - m_log.DebugFormat("[FRIENDS MODULE]: User {0} in region {1} has {2} friends online", client.AgentId, client.Scene.RegionInfo.RegionName, online.Count); - client.SendAgentOnline(online.ToArray()); - } + // Send the friends online + List online = GetOnlineFriends(agentID); + if (online.Count > 0) + { + m_log.DebugFormat("[FRIENDS MODULE]: User {0} in region {1} has {2} friends online", client.AgentId, client.Scene.RegionInfo.RegionName, online.Count); + client.SendAgentOnline(online.ToArray()); + } - // - // Send outstanding friendship offers - // - if (m_Friends.ContainsKey(agentID)) - { - List outstanding = new List(); + // Send outstanding friendship offers + List outstanding = new List(); + FriendInfo[] friends = GetFriends(agentID); + foreach (FriendInfo fi in friends) + { + if (fi.TheirFlags == -1) + outstanding.Add(fi.Friend); + } - foreach (FriendInfo fi in m_Friends[agentID].Friends) - if (fi.TheirFlags == -1) - outstanding.Add(fi.Friend); + GridInstantMessage im = new GridInstantMessage(client.Scene, UUID.Zero, String.Empty, agentID, (byte)InstantMessageDialog.FriendshipOffered, + "Will you be my friend?", true, Vector3.Zero); - GridInstantMessage im = new GridInstantMessage(client.Scene, UUID.Zero, "", agentID, (byte)InstantMessageDialog.FriendshipOffered, "Will you be my friend?", true, Vector3.Zero); - foreach (string fid in outstanding) - { - try - { - im.fromAgentID = new Guid(fid); - } - catch - { - continue; - } + foreach (string fid in outstanding) + { + UUID fromAgentID; + if (!UUID.TryParse(fid, out fromAgentID)) + continue; - UserAccount account = m_Scenes[0].UserAccountService.GetUserAccount(client.Scene.RegionInfo.ScopeID, new UUID(im.fromAgentID)); - im.fromAgentName = account.FirstName + " " + account.LastName; + UserAccount account = m_Scenes[0].UserAccountService.GetUserAccount(client.Scene.RegionInfo.ScopeID, fromAgentID); - PresenceInfo presence = null; - PresenceInfo[] presences = PresenceService.GetAgents(new string[] { fid }); - if (presences != null && presences.Length > 0) - presence = presences[0]; - if (presence != null) - im.offline = 0; + PresenceInfo presence = null; + PresenceInfo[] presences = PresenceService.GetAgents(new string[] { fid }); + if (presences != null && presences.Length > 0) + presence = presences[0]; + if (presence != null) + im.offline = 0; - im.imSessionID = im.fromAgentID; + im.fromAgentID = fromAgentID.Guid; + im.fromAgentName = account.FirstName + " " + account.LastName; + im.offline = (byte)((presence == null) ? 1 : 0); + im.imSessionID = im.fromAgentID; - // Finally - LocalFriendshipOffered(agentID, im); - } - } - - lock (m_NeedsListOfFriends) - m_NeedsListOfFriends.Remove(agentID); + // Finally + LocalFriendshipOffered(agentID, im); } } @@ -372,44 +340,46 @@ namespace OpenSim.Region.CoreModules.Avatar.Friends List friendList = new List(); List online = new List(); - foreach (FriendInfo fi in m_Friends[userID].Friends) + FriendInfo[] friends = GetFriends(userID); + foreach (FriendInfo fi in friends) { if (((fi.TheirFlags & 1) != 0) && (fi.TheirFlags != -1)) friendList.Add(fi.Friend); } - if (friendList.Count == 0) - // no friends whatsoever - return online; - - PresenceInfo[] presence = PresenceService.GetAgents(friendList.ToArray()); - - foreach (PresenceInfo pi in presence) - online.Add(new UUID(pi.UserID)); - //m_log.DebugFormat("[XXX] {0} friend online {1}", userID, pi.UserID); + if (friendList.Count > 0) + { + PresenceInfo[] presence = PresenceService.GetAgents(friendList.ToArray()); + foreach (PresenceInfo pi in presence) + { + UUID presenceID; + if (UUID.TryParse(pi.UserID, out presenceID)) + online.Add(presenceID); + } + } return online; } - // - // Find the client for a ID - // + /// + /// Find the client for a ID + /// public IClientAPI LocateClientObject(UUID agentID) { Scene scene = GetClientScene(agentID); - if (scene == null) - return null; + if (scene != null) + { + ScenePresence presence = scene.GetScenePresence(agentID); + if (presence != null) + return presence.ControllingClient; + } - ScenePresence presence = scene.GetScenePresence(agentID); - if (presence == null) - return null; - - return presence.ControllingClient; + return null; } - // - // Find the scene for an agent - // + /// + /// Find the scene for an agent + /// private Scene GetClientScene(UUID agentId) { lock (m_Scenes) @@ -417,13 +387,11 @@ namespace OpenSim.Region.CoreModules.Avatar.Friends foreach (Scene scene in m_Scenes) { ScenePresence presence = scene.GetScenePresence(agentId); - if (presence != null) - { - if (!presence.IsChildAgent) - return scene; - } + if (presence != null && !presence.IsChildAgent) + return scene; } } + return null; } @@ -434,35 +402,33 @@ namespace OpenSim.Region.CoreModules.Avatar.Friends /// private void StatusChange(UUID agentID, bool online) { - //m_log.DebugFormat("[FRIENDS]: StatusChange {0}", online); - if (m_Friends.ContainsKey(agentID)) + FriendInfo[] friends = GetFriends(agentID); + if (friends.Length > 0) { - //m_log.DebugFormat("[FRIENDS]: # of friends: {0}", m_Friends[agentID].Friends.Length); List friendList = new List(); - foreach (FriendInfo fi in m_Friends[agentID].Friends) + foreach (FriendInfo fi in friends) { if (((fi.MyFlags & 1) != 0) && (fi.TheirFlags != -1)) friendList.Add(fi); } - Util.FireAndForget(delegate - { - foreach (FriendInfo fi in friendList) + Util.FireAndForget( + delegate { - //m_log.DebugFormat("[FRIENDS]: Notifying {0}", fi.PrincipalID); - // Notify about this user status - StatusNotify(fi, agentID, online); + foreach (FriendInfo fi in friendList) + { + //m_log.DebugFormat("[FRIENDS]: Notifying {0}", fi.PrincipalID); + // Notify about this user status + StatusNotify(fi, agentID, online); + } } - }); + ); } - else - m_log.WarnFormat("[FRIENDS]: {0} not found in cache", agentID); } private void StatusNotify(FriendInfo friend, UUID userID, bool online) { - UUID friendID = UUID.Zero; - + UUID friendID; if (UUID.TryParse(friend.Friend, out friendID)) { // Try local @@ -492,12 +458,14 @@ namespace OpenSim.Region.CoreModules.Avatar.Friends // Friend is not online. Ignore. } else + { m_log.WarnFormat("[FRIENDS]: Error parsing friend ID {0}", friend.Friend); + } } private void OnInstantMessage(IClientAPI client, GridInstantMessage im) { - if (im.dialog == (byte)OpenMetaverse.InstantMessageDialog.FriendshipOffered) + if ((InstantMessageDialog)im.dialog == InstantMessageDialog.FriendshipOffered) { // we got a friendship offer UUID principalID = new UUID(im.fromAgentID); @@ -547,9 +515,9 @@ namespace OpenSim.Region.CoreModules.Avatar.Friends FriendsService.StoreFriend(agentID, friendID.ToString(), 1); FriendsService.StoreFriend(friendID, agentID.ToString(), 1); - // update the local cache - m_Friends[agentID].Friends = FriendsService.GetFriends(agentID); + // Update the local cache + UpdateFriendsCache(agentID); // // Notify the friend @@ -612,7 +580,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Friends FriendsService.Delete(exfriendID, agentID.ToString()); // Update local cache - m_Friends[agentID].Friends = FriendsService.GetFriends(agentID); + UpdateFriendsCache(agentID); client.SendTerminateFriend(exfriendID); @@ -638,16 +606,18 @@ namespace OpenSim.Region.CoreModules.Avatar.Friends private void OnGrantUserRights(IClientAPI remoteClient, UUID requester, UUID target, int rights) { - if (!m_Friends.ContainsKey(remoteClient.AgentId)) + FriendInfo[] friends = GetFriends(remoteClient.AgentId); + if (friends.Length == 0) return; m_log.DebugFormat("[FRIENDS MODULE]: User {0} changing rights to {1} for friend {2}", requester, rights, target); // Let's find the friend in this user's friend list - UserFriendData fd = m_Friends[remoteClient.AgentId]; FriendInfo friend = null; - foreach (FriendInfo fi in fd.Friends) + foreach (FriendInfo fi in friends) + { if (fi.Friend == target.ToString()) friend = fi; + } if (friend != null) // Found it { @@ -708,8 +678,10 @@ namespace OpenSim.Region.CoreModules.Avatar.Friends GridInstantMessage im = new GridInstantMessage(Scene, userID, userName, friendID, (byte)OpenMetaverse.InstantMessageDialog.FriendshipAccepted, userID.ToString(), false, Vector3.Zero); friendClient.SendInstantMessage(im); - // update the local cache - m_Friends[friendID].Friends = FriendsService.GetFriends(friendID); + + // Update the local cache + UpdateFriendsCache(friendID); + // we're done return true; } @@ -723,7 +695,6 @@ namespace OpenSim.Region.CoreModules.Avatar.Friends if (friendClient != null) { // the prospective friend in this sim as root agent - GridInstantMessage im = new GridInstantMessage(Scene, userID, userName, friendID, (byte)OpenMetaverse.InstantMessageDialog.FriendshipDeclined, userID.ToString(), false, Vector3.Zero); friendClient.SendInstantMessage(im); @@ -742,7 +713,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Friends // the friend in this sim as root agent friendClient.SendTerminateFriend(exfriendID); // update local cache - m_Friends[exfriendID].Friends = FriendsService.GetFriends(exfriendID); + UpdateFriendsCache(exfriendID); // we're done return true; } @@ -771,11 +742,16 @@ namespace OpenSim.Region.CoreModules.Avatar.Friends } - // update local cache - //m_Friends[friendID].Friends = m_FriendsService.GetFriends(friendID); - foreach (FriendInfo finfo in m_Friends[friendID].Friends) - if (finfo.Friend == userID.ToString()) - finfo.TheirFlags = rights; + // Update local cache + lock (m_Friends) + { + FriendInfo[] friends = GetFriends(friendID); + foreach (FriendInfo finfo in friends) + { + if (finfo.Friend == userID.ToString()) + finfo.TheirFlags = rights; + } + } return true; } @@ -801,7 +777,30 @@ namespace OpenSim.Region.CoreModules.Avatar.Friends return false; } + #endregion + private FriendInfo[] GetFriends(UUID agentID) + { + UserFriendData friendsData; + + lock (m_Friends) + { + if (m_Friends.TryGetValue(agentID, out friendsData)) + return friendsData.Friends; + } + + return EMPTY_FRIENDS; + } + + private void UpdateFriendsCache(UUID agentID) + { + lock (m_Friends) + { + UserFriendData friendsData; + if (m_Friends.TryGetValue(agentID, out friendsData)) + friendsData.Friends = FriendsService.GetFriends(agentID); + } + } } } diff --git a/OpenSim/Region/CoreModules/Avatar/Gods/GodsModule.cs b/OpenSim/Region/CoreModules/Avatar/Gods/GodsModule.cs index 50171a391e..5ec64d5141 100644 --- a/OpenSim/Region/CoreModules/Avatar/Gods/GodsModule.cs +++ b/OpenSim/Region/CoreModules/Avatar/Gods/GodsModule.cs @@ -47,6 +47,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Gods m_scene = scene; m_dialogModule = m_scene.RequestModuleInterface(); m_scene.RegisterModuleInterface(this); + m_scene.EventManager.OnNewClient += SubscribeToClientEvents; } public void PostInitialise() {} @@ -54,6 +55,18 @@ namespace OpenSim.Region.CoreModules.Avatar.Gods public string Name { get { return "Gods Module"; } } public bool IsSharedModule { get { return false; } } + public void SubscribeToClientEvents(IClientAPI client) + { + client.OnGodKickUser += KickUser; + client.OnRequestGodlikePowers += RequestGodlikePowers; + } + + public void UnsubscribeFromClientEvents(IClientAPI client) + { + client.OnGodKickUser -= KickUser; + client.OnRequestGodlikePowers -= RequestGodlikePowers; + } + public void RequestGodlikePowers( UUID agentID, UUID sessionID, UUID token, bool godLike, IClientAPI controllingClient) { diff --git a/OpenSim/Region/CoreModules/Avatar/InstantMessage/InstantMessageModule.cs b/OpenSim/Region/CoreModules/Avatar/InstantMessage/InstantMessageModule.cs index ab141eb46a..af395657dd 100644 --- a/OpenSim/Region/CoreModules/Avatar/InstantMessage/InstantMessageModule.cs +++ b/OpenSim/Region/CoreModules/Avatar/InstantMessage/InstantMessageModule.cs @@ -158,11 +158,14 @@ namespace OpenSim.Region.CoreModules.Avatar.InstantMessage if (m_TransferModule != null) { + if (client != null) + im.fromAgentName = client.FirstName + " " + client.LastName; m_TransferModule.SendInstantMessage(im, delegate(bool success) { if (dialog == (uint)InstantMessageDialog.StartTyping || - dialog == (uint)InstantMessageDialog.StopTyping) + dialog == (uint)InstantMessageDialog.StopTyping || + dialog == (uint)InstantMessageDialog.MessageFromObject) { return; } diff --git a/OpenSim/Region/CoreModules/Avatar/InstantMessage/MessageTransferModule.cs b/OpenSim/Region/CoreModules/Avatar/InstantMessage/MessageTransferModule.cs index 83209fc86f..918fa04143 100644 --- a/OpenSim/Region/CoreModules/Avatar/InstantMessage/MessageTransferModule.cs +++ b/OpenSim/Region/CoreModules/Avatar/InstantMessage/MessageTransferModule.cs @@ -132,20 +132,21 @@ namespace OpenSim.Region.CoreModules.Avatar.InstantMessage { UUID toAgentID = new UUID(im.toAgentID); - m_log.DebugFormat("[INSTANT MESSAGE]: Attempting delivery of IM from {0} to {1}", im.fromAgentName, toAgentID.ToString()); - // Try root avatar only first foreach (Scene scene in m_Scenes) { if (scene.Entities.ContainsKey(toAgentID) && scene.Entities[toAgentID] is ScenePresence) { - m_log.DebugFormat("[INSTANT MESSAGE]: Looking for {0} in {1}", toAgentID.ToString(), scene.RegionInfo.RegionName); - // Local message +// m_log.DebugFormat( +// "[INSTANT MESSAGE]: Looking for root agent {0} in {1}", +// toAgentID.ToString(), scene.RegionInfo.RegionName); + ScenePresence user = (ScenePresence) scene.Entities[toAgentID]; if (!user.IsChildAgent) { - m_log.DebugFormat("[INSTANT MESSAGE]: Delivering to client"); + // Local message + m_log.DebugFormat("[INSTANT MESSAGE]: Delivering IM to root agent {0} {1}", user.Name, toAgentID); user.ControllingClient.SendInstantMessage(im); // Message sent @@ -167,7 +168,7 @@ namespace OpenSim.Region.CoreModules.Avatar.InstantMessage // Local message ScenePresence user = (ScenePresence) scene.Entities[toAgentID]; - m_log.DebugFormat("[INSTANT MESSAGE]: Delivering to client"); + m_log.DebugFormat("[INSTANT MESSAGE]: Delivering IM to child agent {0} {1}", user.Name, toAgentID); user.ControllingClient.SendInstantMessage(im); // Message sent @@ -176,6 +177,7 @@ namespace OpenSim.Region.CoreModules.Avatar.InstantMessage } } + m_log.DebugFormat("[INSTANT MESSAGE]: Delivering IM to {0} via XMLRPC", im.toAgentID); SendGridInstantMessageViaXMLRPC(im, result); return; @@ -185,13 +187,16 @@ namespace OpenSim.Region.CoreModules.Avatar.InstantMessage { UndeliveredMessage handlerUndeliveredMessage = OnUndeliveredMessage; - // If this event has handlers, then the IM will be considered - // delivered. This will suppress the error message. + // If this event has handlers, then an IM from an agent will be + // considered delivered. This will suppress the error message. // if (handlerUndeliveredMessage != null) { handlerUndeliveredMessage(im); - result(true); + if (im.dialog == (byte)InstantMessageDialog.MessageFromAgent) + result(true); + else + result(false); return; } @@ -369,7 +374,7 @@ namespace OpenSim.Region.CoreModules.Avatar.InstantMessage gim.fromAgentName = fromAgentName; gim.fromGroup = fromGroup; gim.imSessionID = imSessionID.Guid; - gim.RegionID = RegionID.Guid; + gim.RegionID = UUID.Zero.Guid; // RegionID.Guid; gim.timestamp = timestamp; gim.toAgentID = toAgentID.Guid; gim.message = message; @@ -495,7 +500,16 @@ namespace OpenSim.Region.CoreModules.Avatar.InstantMessage // Non-cached user agent lookup. PresenceInfo[] presences = PresenceService.GetAgents(new string[] { toAgentID.ToString() }); if (presences != null && presences.Length > 0) - upd = presences[0]; + { + foreach (PresenceInfo p in presences) + { + if (p.RegionID != UUID.Zero) + { + upd = p; + break; + } + } + } if (upd != null) { @@ -504,14 +518,14 @@ namespace OpenSim.Region.CoreModules.Avatar.InstantMessage // if (upd.RegionID == prevRegionID) { - m_log.Error("[GRID INSTANT MESSAGE]: Unable to deliver an instant message"); + // m_log.Error("[GRID INSTANT MESSAGE]: Unable to deliver an instant message"); HandleUndeliveredMessage(im, result); return; } } else { - m_log.Error("[GRID INSTANT MESSAGE]: Unable to deliver an instant message"); + // m_log.Error("[GRID INSTANT MESSAGE]: Unable to deliver an instant message"); HandleUndeliveredMessage(im, result); return; } diff --git a/OpenSim/Region/CoreModules/Avatar/Inventory/Archiver/InventoryArchiveReadRequest.cs b/OpenSim/Region/CoreModules/Avatar/Inventory/Archiver/InventoryArchiveReadRequest.cs index 31dfe145f5..046b05f48e 100644 --- a/OpenSim/Region/CoreModules/Avatar/Inventory/Archiver/InventoryArchiveReadRequest.cs +++ b/OpenSim/Region/CoreModules/Avatar/Inventory/Archiver/InventoryArchiveReadRequest.cs @@ -33,6 +33,7 @@ using System.Reflection; using System.Threading; using System.Text; using System.Xml; +using System.Xml.Linq; using log4net; using OpenMetaverse; using OpenSim.Framework; @@ -50,10 +51,21 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver { private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); + /// + /// The maximum major version of archive that we can read. Minor versions shouldn't need a max number since version + /// bumps here should be compatible. + /// + public static int MAX_MAJOR_VERSION = 0; + protected TarArchiveReader archive; private UserAccount m_userInfo; private string m_invPath; + + /// + /// Do we want to merge this load with existing inventory? + /// + protected bool m_merge; /// /// We only use this to request modules @@ -66,19 +78,21 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver private Stream m_loadStream; public InventoryArchiveReadRequest( - Scene scene, UserAccount userInfo, string invPath, string loadPath) + Scene scene, UserAccount userInfo, string invPath, string loadPath, bool merge) : this( scene, userInfo, invPath, - new GZipStream(ArchiveHelpers.GetStream(loadPath), CompressionMode.Decompress)) + new GZipStream(ArchiveHelpers.GetStream(loadPath), CompressionMode.Decompress), + merge) { } public InventoryArchiveReadRequest( - Scene scene, UserAccount userInfo, string invPath, Stream loadStream) + Scene scene, UserAccount userInfo, string invPath, Stream loadStream, bool merge) { m_scene = scene; + m_merge = merge; m_userInfo = userInfo; m_invPath = invPath; m_loadStream = loadStream; @@ -91,7 +105,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver /// A list of the inventory nodes loaded. If folders were loaded then only the root folders are /// returned /// - public List Execute() + public HashSet Execute() { try { @@ -100,7 +114,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver int failedAssetRestores = 0; int successfulItemRestores = 0; - List loadedNodes = new List(); + HashSet loadedNodes = new HashSet(); List folderCandidates = InventoryArchiveUtils.FindFolderByPath( @@ -126,7 +140,11 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver while ((data = archive.ReadEntry(out filePath, out entryType)) != null) { - if (filePath.StartsWith(ArchiveConstants.ASSETS_PATH)) + if (filePath == ArchiveConstants.CONTROL_FILE_PATH) + { + LoadControlFile(filePath, data); + } + else if (filePath.StartsWith(ArchiveConstants.ASSETS_PATH)) { if (LoadAsset(filePath, data)) successfulAssetRestores++; @@ -158,9 +176,9 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver { successfulItemRestores++; - // If we're loading an item directly into the given destination folder then we need to record - // it separately from any loaded root folders - if (rootDestinationFolder == foundFolder) + // If we aren't loading the folder containing the item then well need to update the + // viewer separately for that item. + if (!loadedNodes.Contains(foundFolder)) loadedNodes.Add(item); } } @@ -172,14 +190,14 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver m_log.DebugFormat( "[INVENTORY ARCHIVER]: Successfully loaded {0} assets with {1} failures", successfulAssetRestores, failedAssetRestores); - m_log.InfoFormat("[INVENTORY ARCHIVER]: Successfully loaded {0} items", successfulItemRestores); + m_log.InfoFormat("[INVENTORY ARCHIVER]: Successfully loaded {0} items", successfulItemRestores); return loadedNodes; } finally { m_loadStream.Close(); - } + } } public void Close() @@ -194,7 +212,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver /// The item archive path to replicate /// The root folder for the inventory load /// - /// The folders that we have resolved so far for a given archive path. + /// The folders that we have resolved so far for a given archive path. /// This method will add more folders if necessary /// /// @@ -205,14 +223,15 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver string iarPath, InventoryFolderBase rootDestFolder, Dictionary resolvedFolders, - List loadedNodes) + HashSet loadedNodes) { string iarPathExisting = iarPath; // m_log.DebugFormat( // "[INVENTORY ARCHIVER]: Loading folder {0} {1}", rootDestFolder.Name, rootDestFolder.ID); - InventoryFolderBase destFolder = ResolveDestinationFolder(rootDestFolder, ref iarPathExisting, resolvedFolders); + InventoryFolderBase destFolder + = ResolveDestinationFolder(rootDestFolder, ref iarPathExisting, resolvedFolders); // m_log.DebugFormat( // "[INVENTORY ARCHIVER]: originalArchivePath [{0}], section already loaded [{1}]", @@ -238,59 +257,68 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver /// The root folder for the inventory load /// /// - /// The folders that we have resolved so far for a given archive path. + /// The folders that we have resolved so far for a given archive path. /// /// /// The folder in the user's inventory that matches best the archive path given. If no such folder was found /// then the passed in root destination folder is returned. - /// + /// protected InventoryFolderBase ResolveDestinationFolder( - InventoryFolderBase rootDestFolder, - ref string archivePath, + InventoryFolderBase rootDestFolder, + ref string archivePath, Dictionary resolvedFolders) - { + { // string originalArchivePath = archivePath; - InventoryFolderBase destFolder = null; - - if (archivePath.Length > 0) + while (archivePath.Length > 0) { - while (null == destFolder && archivePath.Length > 0) +// m_log.DebugFormat("[INVENTORY ARCHIVER]: Trying to resolve destination folder {0}", archivePath); + + if (resolvedFolders.ContainsKey(archivePath)) { -// m_log.DebugFormat("[INVENTORY ARCHIVER]: Trying to resolve destination folder {0}", archivePath); - - if (resolvedFolders.ContainsKey(archivePath)) +// m_log.DebugFormat( +// "[INVENTORY ARCHIVER]: Found previously created folder from archive path {0}", archivePath); + return resolvedFolders[archivePath]; + } + else + { + if (m_merge) { -// m_log.DebugFormat( -// "[INVENTORY ARCHIVER]: Found previously created folder from archive path {0}", archivePath); - destFolder = resolvedFolders[archivePath]; + // TODO: Using m_invPath is totally wrong - what we need to do is strip the uuid from the + // iar name and try to find that instead. + string plainPath = ArchiveConstants.ExtractPlainPathFromIarPath(archivePath); + List folderCandidates + = InventoryArchiveUtils.FindFolderByPath( + m_scene.InventoryService, m_userInfo.PrincipalID, plainPath); + + if (folderCandidates.Count != 0) + { + InventoryFolderBase destFolder = folderCandidates[0]; + resolvedFolders[archivePath] = destFolder; + return destFolder; + } + } + + // Don't include the last slash so find the penultimate one + int penultimateSlashIndex = archivePath.LastIndexOf("/", archivePath.Length - 2); + + if (penultimateSlashIndex >= 0) + { + // Remove the last section of path so that we can see if we've already resolved the parent + archivePath = archivePath.Remove(penultimateSlashIndex + 1); } else { - // Don't include the last slash so find the penultimate one - int penultimateSlashIndex = archivePath.LastIndexOf("/", archivePath.Length - 2); - - if (penultimateSlashIndex >= 0) - { - // Remove the last section of path so that we can see if we've already resolved the parent - archivePath = archivePath.Remove(penultimateSlashIndex + 1); - } - else - { -// m_log.DebugFormat( -// "[INVENTORY ARCHIVER]: Found no previously created folder for archive path {0}", -// originalArchivePath); - archivePath = string.Empty; - destFolder = rootDestFolder; - } +// m_log.DebugFormat( +// "[INVENTORY ARCHIVER]: Found no previously created folder for archive path {0}", +// originalArchivePath); + archivePath = string.Empty; + return rootDestFolder; } } } - if (null == destFolder) - destFolder = rootDestFolder; - - return destFolder; + return rootDestFolder; } /// @@ -316,24 +344,21 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver string iarPathExisting, string iarPathToReplicate, Dictionary resolvedFolders, - List loadedNodes) + HashSet loadedNodes) { string[] rawDirsToCreate = iarPathToReplicate.Split(new char[] { '/' }, StringSplitOptions.RemoveEmptyEntries); - int i = 0; - while (i < rawDirsToCreate.Length) + for (int i = 0; i < rawDirsToCreate.Length; i++) { // m_log.DebugFormat("[INVENTORY ARCHIVER]: Creating folder {0} from IAR", rawDirsToCreate[i]); + if (!rawDirsToCreate[i].Contains(ArchiveConstants.INVENTORY_NODE_NAME_COMPONENT_SEPARATOR)) + continue; + int identicalNameIdentifierIndex = rawDirsToCreate[i].LastIndexOf( ArchiveConstants.INVENTORY_NODE_NAME_COMPONENT_SEPARATOR); - if (identicalNameIdentifierIndex < 0) - { - i++; - continue; - } string newFolderName = rawDirsToCreate[i].Remove(identicalNameIdentifierIndex); newFolderName = InventoryArchiveUtils.UnescapeArchivePath(newFolderName); @@ -356,9 +381,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver if (0 == i) loadedNodes.Add(destFolder); - - i++; - } + } } /// @@ -394,8 +417,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver // Reset folder ID to the one in which we want to load it item.Folder = loadFolder.ID; - //m_userInfo.AddItem(item); - m_scene.InventoryService.AddItem(item); + m_scene.AddInventoryItem(item); return item; } @@ -450,5 +472,29 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver return false; } } + + /// + /// Load control file + /// + /// + /// + protected void LoadControlFile(string path, byte[] data) + { + XDocument doc = XDocument.Parse(Encoding.ASCII.GetString(data)); + XElement archiveElement = doc.Element("archive"); + int majorVersion = int.Parse(archiveElement.Attribute("major_version").Value); + int minorVersion = int.Parse(archiveElement.Attribute("minor_version").Value); + string version = string.Format("{0}.{1}", majorVersion, minorVersion); + + if (majorVersion > MAX_MAJOR_VERSION) + { + throw new Exception( + string.Format( + "The IAR you are trying to load has major version number of {0} but this version of OpenSim can only load IARs with major version number {1} and below", + majorVersion, MAX_MAJOR_VERSION)); + } + + m_log.InfoFormat("[INVENTORY ARCHIVER]: Loading IAR with version {0}", version); + } } } \ No newline at end of file diff --git a/OpenSim/Region/CoreModules/Avatar/Inventory/Archiver/InventoryArchiveUtils.cs b/OpenSim/Region/CoreModules/Avatar/Inventory/Archiver/InventoryArchiveUtils.cs index 84afb40b8c..47e34dcdd6 100644 --- a/OpenSim/Region/CoreModules/Avatar/Inventory/Archiver/InventoryArchiveUtils.cs +++ b/OpenSim/Region/CoreModules/Avatar/Inventory/Archiver/InventoryArchiveUtils.cs @@ -120,6 +120,11 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver foundFolders.Add(startFolder); return foundFolders; } + + // If the path isn't just / then trim any starting extraneous slashes + path = path.TrimStart(new char[] { PATH_DELIMITER }); + +// m_log.DebugFormat("[INVENTORY ARCHIVE UTILS]: Adjusted path in FindFolderByPath() is [{0}]", path); string[] components = SplitEscapedPath(path); components[0] = UnescapePath(components[0]); @@ -199,6 +204,9 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver public static InventoryItemBase FindItemByPath( IInventoryService inventoryService, InventoryFolderBase startFolder, string path) { + // If the path isn't just / then trim any starting extraneous slashes + path = path.TrimStart(new char[] { PATH_DELIMITER }); + string[] components = SplitEscapedPath(path); components[0] = UnescapePath(components[0]); diff --git a/OpenSim/Region/CoreModules/Avatar/Inventory/Archiver/InventoryArchiveWriteRequest.cs b/OpenSim/Region/CoreModules/Avatar/Inventory/Archiver/InventoryArchiveWriteRequest.cs index 25a78ff618..d81703a827 100644 --- a/OpenSim/Region/CoreModules/Avatar/Inventory/Archiver/InventoryArchiveWriteRequest.cs +++ b/OpenSim/Region/CoreModules/Avatar/Inventory/Archiver/InventoryArchiveWriteRequest.cs @@ -119,13 +119,10 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver protected void ReceivedAllAssets(ICollection assetsFoundUuids, ICollection assetsNotFoundUuids) { Exception reportedException = null; - bool succeeded = true; + bool succeeded = true; try { - // We're almost done. Just need to write out the control file now - m_archiveWriter.WriteFile(ArchiveConstants.CONTROL_FILE_PATH, Create0p1ControlFile()); - m_log.InfoFormat("[ARCHIVER]: Added control file to archive."); m_archiveWriter.Close(); } catch (Exception e) @@ -136,7 +133,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver finally { m_saveStream.Close(); - } + } m_module.TriggerInventoryArchiveSaved( m_id, succeeded, m_userInfo, m_invPath, m_saveStream, reportedException); @@ -176,28 +173,6 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver InventoryCollection contents = m_scene.InventoryService.GetFolderContent(inventoryFolder.Owner, inventoryFolder.ID); - //List childFolders = inventoryFolder.RequestListOfFolderImpls(); - //List items = inventoryFolder.RequestListOfItems(); - - /* - Dictionary identicalFolderNames = new Dictionary(); - - foreach (InventoryFolderImpl folder in inventories) - { - if (!identicalFolderNames.ContainsKey(folder.Name)) - identicalFolderNames[folder.Name] = 0; - else - identicalFolderNames[folder.Name] = identicalFolderNames[folder.Name]++; - - int folderNameNumber = identicalFolderName[folder.Name]; - - SaveInvDir( - folder, - string.Format( - "{0}{1}{2}/", - path, ArchiveConstants.INVENTORY_NODE_NAME_COMPONENT_SEPARATOR, folderNameNumber)); - } - */ foreach (InventoryFolderBase childFolder in contents.Folders) { @@ -221,7 +196,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver InventoryItemBase inventoryItem = null; InventoryFolderBase rootFolder = m_scene.InventoryService.GetRootFolder(m_userInfo.PrincipalID); - bool foundStar = false; + bool saveFolderContentsOnly = false; // Eliminate double slashes and any leading / on the path. string[] components @@ -234,7 +209,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver // folder itself. This may get more sophisicated later on if (maxComponentIndex >= 0 && components[maxComponentIndex] == STAR_WILDCARD) { - foundStar = true; + saveFolderContentsOnly = true; maxComponentIndex--; } @@ -270,21 +245,28 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver { // We couldn't find the path indicated string errorMessage = string.Format("Aborted save. Could not find inventory path {0}", m_invPath); - Exception e = new InventoryArchiverException(errorMessage); + Exception e = new InventoryArchiverException(errorMessage); m_module.TriggerInventoryArchiveSaved(m_id, false, m_userInfo, m_invPath, m_saveStream, e); throw e; } m_archiveWriter = new TarArchiveWriter(m_saveStream); + // Write out control file. This has to be done first so that subsequent loaders will see this file first + // XXX: I know this is a weak way of doing it since external non-OAR aware tar executables will not do this + m_archiveWriter.WriteFile(ArchiveConstants.CONTROL_FILE_PATH, Create0p1ControlFile()); + m_log.InfoFormat("[INVENTORY ARCHIVER]: Added control file to archive."); + if (inventoryFolder != null) { m_log.DebugFormat( "[INVENTORY ARCHIVER]: Found folder {0} {1} at {2}", - inventoryFolder.Name, inventoryFolder.ID, m_invPath); + inventoryFolder.Name, + inventoryFolder.ID, + m_invPath == String.Empty ? InventoryFolderImpl.PATH_DELIMITER : m_invPath); //recurse through all dirs getting dirs and files - SaveInvFolder(inventoryFolder, ArchiveConstants.INVENTORY_PATH, !foundStar); + SaveInvFolder(inventoryFolder, ArchiveConstants.INVENTORY_PATH, !saveFolderContentsOnly); } else if (inventoryItem != null) { @@ -299,7 +281,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver //SaveUsers(); new AssetsRequest( - new AssetsArchiver(m_archiveWriter), m_assetUuids, m_scene.AssetService, ReceivedAllAssets).Execute(); + new AssetsArchiver(m_archiveWriter), m_assetUuids, m_scene.AssetService, ReceivedAllAssets).Execute(); } catch (Exception) { @@ -397,13 +379,17 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver /// public static string Create0p1ControlFile() { + int majorVersion = 0, minorVersion = 1; + + m_log.InfoFormat("[INVENTORY ARCHIVER]: Creating version {0}.{1} IAR", majorVersion, minorVersion); + StringWriter sw = new StringWriter(); XmlTextWriter xtw = new XmlTextWriter(sw); xtw.Formatting = Formatting.Indented; xtw.WriteStartDocument(); xtw.WriteStartElement("archive"); - xtw.WriteAttributeString("major_version", "0"); - xtw.WriteAttributeString("minor_version", "1"); + xtw.WriteAttributeString("major_version", majorVersion.ToString()); + xtw.WriteAttributeString("minor_version", minorVersion.ToString()); xtw.WriteEndElement(); xtw.Flush(); diff --git a/OpenSim/Region/CoreModules/Avatar/Inventory/Archiver/InventoryArchiverException.cs b/OpenSim/Region/CoreModules/Avatar/Inventory/Archiver/InventoryArchiverException.cs index e07e2ca689..5fd1a7ee82 100644 --- a/OpenSim/Region/CoreModules/Avatar/Inventory/Archiver/InventoryArchiverException.cs +++ b/OpenSim/Region/CoreModules/Avatar/Inventory/Archiver/InventoryArchiverException.cs @@ -33,7 +33,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver /// Signals an inventory archiving problem /// public class InventoryArchiverException : Exception - { + { public InventoryArchiverException(string message) : base(message) {} public InventoryArchiverException(string message, Exception e) : base(message, e) {} } diff --git a/OpenSim/Region/CoreModules/Avatar/Inventory/Archiver/InventoryArchiverModule.cs b/OpenSim/Region/CoreModules/Avatar/Inventory/Archiver/InventoryArchiverModule.cs index f7a2b098f5..2eaca499b0 100644 --- a/OpenSim/Region/CoreModules/Avatar/Inventory/Archiver/InventoryArchiverModule.cs +++ b/OpenSim/Region/CoreModules/Avatar/Inventory/Archiver/InventoryArchiverModule.cs @@ -91,12 +91,12 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver scene.AddCommand( this, "load iar", - "load iar []", + "load iar []", //"load iar [--merge] []", "Load user inventory archive (IAR).", - //"--merge is an option which merges the loaded IAR with existing inventory folders where possible, rather than always creating new ones" + //"--merge is an option which merges the loaded IAR with existing inventory folders where possible, rather than always creating new ones" //+ " is user's first name." + Environment.NewLine - " is user's first name." + Environment.NewLine + " is user's first name." + Environment.NewLine + " is user's last name." + Environment.NewLine + " is the path inside the user's inventory where the IAR should be loaded." + Environment.NewLine + " is the user's password." + Environment.NewLine @@ -136,16 +136,16 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver if (handlerInventoryArchiveSaved != null) handlerInventoryArchiveSaved(id, succeeded, userInfo, invPath, saveStream, reportedException); } - + public bool ArchiveInventory( - Guid id, string firstName, string lastName, string invPath, string pass, Stream saveStream) - { - return ArchiveInventory(id, firstName, lastName, invPath, pass, saveStream, new Dictionary()); - } + Guid id, string firstName, string lastName, string invPath, string pass, Stream saveStream) + { + return ArchiveInventory(id, firstName, lastName, invPath, pass, saveStream, new Dictionary()); + } public bool ArchiveInventory( - Guid id, string firstName, string lastName, string invPath, string pass, Stream saveStream, - Dictionary options) + Guid id, string firstName, string lastName, string invPath, string pass, Stream saveStream, + Dictionary options) { if (m_scenes.Count > 0) { @@ -184,8 +184,8 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver } public bool ArchiveInventory( - Guid id, string firstName, string lastName, string invPath, string pass, string savePath, - Dictionary options) + Guid id, string firstName, string lastName, string invPath, string pass, string savePath, + Dictionary options) { if (m_scenes.Count > 0) { @@ -224,13 +224,13 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver } public bool DearchiveInventory(string firstName, string lastName, string invPath, string pass, Stream loadStream) - { - return DearchiveInventory(firstName, lastName, invPath, pass, loadStream, new Dictionary()); - } - + { + return DearchiveInventory(firstName, lastName, invPath, pass, loadStream, new Dictionary()); + } + public bool DearchiveInventory( - string firstName, string lastName, string invPath, string pass, Stream loadStream, - Dictionary options) + string firstName, string lastName, string invPath, string pass, Stream loadStream, + Dictionary options) { if (m_scenes.Count > 0) { @@ -241,10 +241,11 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver if (CheckPresence(userInfo.PrincipalID)) { InventoryArchiveReadRequest request; + bool merge = (options.ContainsKey("merge") ? (bool)options["merge"] : false); try { - request = new InventoryArchiveReadRequest(m_aScene, userInfo, invPath, loadStream); + request = new InventoryArchiveReadRequest(m_aScene, userInfo, invPath, loadStream, merge); } catch (EntryPointNotFoundException e) { @@ -273,8 +274,8 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver } public bool DearchiveInventory( - string firstName, string lastName, string invPath, string pass, string loadPath, - Dictionary options) + string firstName, string lastName, string invPath, string pass, string loadPath, + Dictionary options) { if (m_scenes.Count > 0) { @@ -285,10 +286,11 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver if (CheckPresence(userInfo.PrincipalID)) { InventoryArchiveReadRequest request; + bool merge = (options.ContainsKey("merge") ? (bool)options["merge"] : false); try { - request = new InventoryArchiveReadRequest(m_aScene, userInfo, invPath, loadPath); + request = new InventoryArchiveReadRequest(m_aScene, userInfo, invPath, loadPath, merge); } catch (EntryPointNotFoundException e) { @@ -323,20 +325,20 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver protected void HandleLoadInvConsoleCommand(string module, string[] cmdparams) { try - { - m_log.Info("[INVENTORY ARCHIVER]: PLEASE NOTE THAT THIS FACILITY IS EXPERIMENTAL. BUG REPORTS WELCOME."); - - Dictionary options = new Dictionary(); + { + m_log.Info("[INVENTORY ARCHIVER]: PLEASE NOTE THAT THIS FACILITY IS EXPERIMENTAL. BUG REPORTS WELCOME."); + + Dictionary options = new Dictionary(); OptionSet optionSet = new OptionSet().Add("m|merge", delegate (string v) { options["merge"] = v != null; }); List mainParams = optionSet.Parse(cmdparams); - + if (mainParams.Count < 6) { m_log.Error( - "[INVENTORY ARCHIVER]: usage is load iar []"); + "[INVENTORY ARCHIVER]: usage is load iar [--merge] []"); return; - } + } string firstName = mainParams[2]; string lastName = mainParams[3]; @@ -351,12 +353,12 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver if (DearchiveInventory(firstName, lastName, invPath, pass, loadPath, options)) m_log.InfoFormat( "[INVENTORY ARCHIVER]: Loaded archive {0} for {1} {2}", - loadPath, firstName, lastName); + loadPath, firstName, lastName); } catch (InventoryArchiverException e) { m_log.ErrorFormat("[INVENTORY ARCHIVER]: {0}", e.Message); - } + } } /// @@ -388,7 +390,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver "[INVENTORY ARCHIVER]: Saving archive {0} using inventory path {1} for {2} {3}", savePath, invPath, firstName, lastName); - ArchiveInventory(id, firstName, lastName, invPath, pass, savePath, new Dictionary()); + ArchiveInventory(id, firstName, lastName, invPath, pass, savePath, new Dictionary()); } catch (InventoryArchiverException e) { @@ -396,7 +398,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver } lock (m_pendingConsoleSaves) - m_pendingConsoleSaves.Add(id); + m_pendingConsoleSaves.Add(id); } private void SaveInvConsoleCommandCompleted( @@ -469,7 +471,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver /// Notify the client of loaded nodes if they are logged in /// /// Can be empty. In which case, nothing happens - private void UpdateClientWithLoadedNodes(UserAccount userInfo, List loadedNodes) + private void UpdateClientWithLoadedNodes(UserAccount userInfo, HashSet loadedNodes) { if (loadedNodes.Count == 0) return; diff --git a/OpenSim/Region/CoreModules/Avatar/Inventory/Archiver/Tests/InventoryArchiverTests.cs b/OpenSim/Region/CoreModules/Avatar/Inventory/Archiver/Tests/InventoryArchiverTests.cs index 4531bfdfb2..938886b2d3 100644 --- a/OpenSim/Region/CoreModules/Avatar/Inventory/Archiver/Tests/InventoryArchiverTests.cs +++ b/OpenSim/Region/CoreModules/Avatar/Inventory/Archiver/Tests/InventoryArchiverTests.cs @@ -55,12 +55,58 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver.Tests { protected ManualResetEvent mre = new ManualResetEvent(false); + /// + /// Stream of data representing a common IAR that can be reused in load tests. + /// + protected MemoryStream m_iarStream; + + protected UserAccount m_ua1 + = new UserAccount { + PrincipalID = UUID.Parse("00000000-0000-0000-0000-000000000555"), + FirstName = "Mr", + LastName = "Tiddles" }; + protected UserAccount m_ua2 + = new UserAccount { + PrincipalID = UUID.Parse("00000000-0000-0000-0000-000000000666"), + FirstName = "Lord", + LastName = "Lucan" }; + string m_item1Name = "b.lsl"; + private void SaveCompleted( Guid id, bool succeeded, UserAccount userInfo, string invPath, Stream saveStream, Exception reportedException) { mre.Set(); } + + [SetUp] + public void Init() + { + ConstructDefaultIarForTestLoad(); + } + + protected void ConstructDefaultIarForTestLoad() + { + string archiveItemName = InventoryArchiveWriteRequest.CreateArchiveItemName(m_item1Name, UUID.Random()); + + MemoryStream archiveWriteStream = new MemoryStream(); + TarArchiveWriter tar = new TarArchiveWriter(archiveWriteStream); + + InventoryItemBase item1 = new InventoryItemBase(); + item1.Name = m_item1Name; + item1.AssetID = UUID.Random(); + item1.GroupID = UUID.Random(); + item1.CreatorId = OspResolver.MakeOspa(m_ua2.FirstName, m_ua2.LastName); + //item1.CreatorId = userUuid.ToString(); + //item1.CreatorId = "00000000-0000-0000-0000-000000000444"; + item1.Owner = UUID.Zero; + + string item1FileName + = string.Format("{0}{1}", ArchiveConstants.INVENTORY_PATH, archiveItemName); + tar.WriteFile(item1FileName, UserInventoryItemSerializer.Serialize(item1)); + tar.Close(); + m_iarStream = new MemoryStream(archiveWriteStream.ToArray()); + } /// /// Test saving an inventory path to a V0.1 OpenSim Inventory Archive @@ -117,11 +163,12 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver.Tests InventoryFolderBase objsFolder = InventoryArchiveUtils.FindFolderByPath(scene.InventoryService, userId, "Objects")[0]; item1.Folder = objsFolder.ID; - scene.AddInventoryItem(userId, item1); + scene.AddInventoryItem(item1); MemoryStream archiveWriteStream = new MemoryStream(); archiverModule.OnInventoryArchiveSaved += SaveCompleted; + // Test saving a particular path mre.Reset(); archiverModule.ArchiveInventory( Guid.NewGuid(), userFirstName, userLastName, "Objects", userPassword, archiveWriteStream); @@ -148,7 +195,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver.Tests while (tar.ReadEntry(out filePath, out tarEntryType) != null) { - Console.WriteLine("Got {0}", filePath); +// Console.WriteLine("Got {0}", filePath); // if (ArchiveConstants.CONTROL_FILE_PATH == filePath) // { @@ -235,7 +282,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver.Tests InventoryFolderBase objsFolder = InventoryArchiveUtils.FindFolderByPath(scene.InventoryService, userId, "Objects")[0]; item1.Folder = objsFolder.ID; - scene.AddInventoryItem(userId, item1); + scene.AddInventoryItem(item1); MemoryStream archiveWriteStream = new MemoryStream(); archiverModule.OnInventoryArchiveSaved += SaveCompleted; @@ -294,7 +341,31 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver.Tests // Assert.That(gotObject2File, Is.True, "No object2 file in archive"); // TODO: Test presence of more files and contents of files. - } + } + + /// + /// Test that things work when the load path specified starts with a slash + /// + [Test] + public void TestLoadIarPathStartsWithSlash() + { + TestHelper.InMethod(); +// log4net.Config.XmlConfigurator.Configure(); + + SerialiserModule serialiserModule = new SerialiserModule(); + InventoryArchiverModule archiverModule = new InventoryArchiverModule(true); + Scene scene = SceneSetupHelpers.SetupScene("inventory"); + SceneSetupHelpers.SetupSceneModules(scene, serialiserModule, archiverModule); + + UserProfileTestUtils.CreateUserWithInventory(scene, m_ua1, "password"); + archiverModule.DearchiveInventory(m_ua1.FirstName, m_ua1.LastName, "/Objects", "password", m_iarStream); + + InventoryItemBase foundItem1 + = InventoryArchiveUtils.FindItemByPath( + scene.InventoryService, m_ua1.PrincipalID, "/Objects/" + m_item1Name); + + Assert.That(foundItem1, Is.Not.Null, "Didn't find loaded item 1 in TestLoadIarFolderStartsWithSlash()"); + } /// /// Test loading a V0.1 OpenSim Inventory Archive (subject to change since there is no fixed format yet) where @@ -305,37 +376,9 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver.Tests [Test] public void TestLoadIarV0_1ExistingUsers() { - TestHelper.InMethod(); + TestHelper.InMethod(); //log4net.Config.XmlConfigurator.Configure(); - string userFirstName = "Mr"; - string userLastName = "Tiddles"; - UUID userUuid = UUID.Parse("00000000-0000-0000-0000-000000000555"); - string userItemCreatorFirstName = "Lord"; - string userItemCreatorLastName = "Lucan"; - UUID userItemCreatorUuid = UUID.Parse("00000000-0000-0000-0000-000000000666"); - - string item1Name = "b.lsl"; - string archiveItemName = InventoryArchiveWriteRequest.CreateArchiveItemName(item1Name, UUID.Random()); - - MemoryStream archiveWriteStream = new MemoryStream(); - TarArchiveWriter tar = new TarArchiveWriter(archiveWriteStream); - - InventoryItemBase item1 = new InventoryItemBase(); - item1.Name = item1Name; - item1.AssetID = UUID.Random(); - item1.GroupID = UUID.Random(); - item1.CreatorId = OspResolver.MakeOspa(userItemCreatorFirstName, userItemCreatorLastName); - //item1.CreatorId = userUuid.ToString(); - //item1.CreatorId = "00000000-0000-0000-0000-000000000444"; - item1.Owner = UUID.Zero; - - string item1FileName - = string.Format("{0}{1}", ArchiveConstants.INVENTORY_PATH, archiveItemName); - tar.WriteFile(item1FileName, UserInventoryItemSerializer.Serialize(item1)); - tar.Close(); - - MemoryStream archiveReadStream = new MemoryStream(archiveWriteStream.ToArray()); SerialiserModule serialiserModule = new SerialiserModule(); InventoryArchiverModule archiverModule = new InventoryArchiverModule(true); @@ -343,16 +386,14 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver.Tests Scene scene = SceneSetupHelpers.SetupScene("inventory"); SceneSetupHelpers.SetupSceneModules(scene, serialiserModule, archiverModule); - - UserProfileTestUtils.CreateUserWithInventory( - scene, userFirstName, userLastName, userUuid, "meowfood"); - UserProfileTestUtils.CreateUserWithInventory( - scene, userItemCreatorFirstName, userItemCreatorLastName, userItemCreatorUuid, "hampshire"); - archiverModule.DearchiveInventory(userFirstName, userLastName, "/", "meowfood", archiveReadStream); + UserProfileTestUtils.CreateUserWithInventory(scene, m_ua1, "meowfood"); + UserProfileTestUtils.CreateUserWithInventory(scene, m_ua2, "hampshire"); + + archiverModule.DearchiveInventory(m_ua1.FirstName, m_ua1.LastName, "/", "meowfood", m_iarStream); InventoryItemBase foundItem1 - = InventoryArchiveUtils.FindItemByPath(scene.InventoryService, userUuid, item1Name); + = InventoryArchiveUtils.FindItemByPath(scene.InventoryService, m_ua1.PrincipalID, m_item1Name); Assert.That(foundItem1, Is.Not.Null, "Didn't find loaded item 1"); @@ -362,31 +403,31 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver.Tests // foundItem1.CreatorId, Is.EqualTo(item1.CreatorId), // "Loaded item non-uuid creator doesn't match original"); Assert.That( - foundItem1.CreatorId, Is.EqualTo(userItemCreatorUuid.ToString()), + foundItem1.CreatorId, Is.EqualTo(m_ua2.PrincipalID.ToString()), "Loaded item non-uuid creator doesn't match original"); Assert.That( - foundItem1.CreatorIdAsUuid, Is.EqualTo(userItemCreatorUuid), + foundItem1.CreatorIdAsUuid, Is.EqualTo(m_ua2.PrincipalID), "Loaded item uuid creator doesn't match original"); - Assert.That(foundItem1.Owner, Is.EqualTo(userUuid), + Assert.That(foundItem1.Owner, Is.EqualTo(m_ua1.PrincipalID), "Loaded item owner doesn't match inventory reciever"); // Now try loading to a root child folder - UserInventoryTestUtils.CreateInventoryFolder(scene.InventoryService, userUuid, "xA"); - archiveReadStream = new MemoryStream(archiveReadStream.ToArray()); - archiverModule.DearchiveInventory(userFirstName, userLastName, "xA", "meowfood", archiveReadStream); + UserInventoryTestUtils.CreateInventoryFolder(scene.InventoryService, m_ua1.PrincipalID, "xA"); + MemoryStream archiveReadStream = new MemoryStream(m_iarStream.ToArray()); + archiverModule.DearchiveInventory(m_ua1.FirstName, m_ua1.LastName, "xA", "meowfood", archiveReadStream); InventoryItemBase foundItem2 - = InventoryArchiveUtils.FindItemByPath(scene.InventoryService, userUuid, "xA/" + item1Name); + = InventoryArchiveUtils.FindItemByPath(scene.InventoryService, m_ua1.PrincipalID, "xA/" + m_item1Name); Assert.That(foundItem2, Is.Not.Null, "Didn't find loaded item 2"); // Now try loading to a more deeply nested folder - UserInventoryTestUtils.CreateInventoryFolder(scene.InventoryService, userUuid, "xB/xC"); + UserInventoryTestUtils.CreateInventoryFolder(scene.InventoryService, m_ua1.PrincipalID, "xB/xC"); archiveReadStream = new MemoryStream(archiveReadStream.ToArray()); - archiverModule.DearchiveInventory(userFirstName, userLastName, "xB/xC", "meowfood", archiveReadStream); + archiverModule.DearchiveInventory(m_ua1.FirstName, m_ua1.LastName, "xB/xC", "meowfood", archiveReadStream); InventoryItemBase foundItem3 - = InventoryArchiveUtils.FindItemByPath(scene.InventoryService, userUuid, "xB/xC/" + item1Name); + = InventoryArchiveUtils.FindItemByPath(scene.InventoryService, m_ua1.PrincipalID, "xB/xC/" + m_item1Name); Assert.That(foundItem3, Is.Not.Null, "Didn't find loaded item 3"); } @@ -409,7 +450,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver.Tests string userFirstName = "Jock"; string userLastName = "Stirrup"; UUID userId = UUID.Parse("00000000-0000-0000-0000-000000000020"); - UserProfileTestUtils.CreateUserWithInventory(scene, userFirstName, userLastName, userId, "meowfood"); + UserProfileTestUtils.CreateUserWithInventory(scene, userFirstName, userLastName, userId, "meowfood"); // Create asset SceneObjectGroup object1; @@ -444,7 +485,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver.Tests InventoryFolderBase objsFolder = InventoryArchiveUtils.FindFolderByPath(scene.InventoryService, userId, "Objects")[0]; item1.Folder = objsFolder.ID; - scene.AddInventoryItem(userId, item1); + scene.AddInventoryItem(item1); MemoryStream archiveWriteStream = new MemoryStream(); archiverModule.OnInventoryArchiveSaved += SaveCompleted; @@ -483,7 +524,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver.Tests [Test] public void TestLoadIarV0_1AbsentUsers() { - TestHelper.InMethod(); + TestHelper.InMethod(); //log4net.Config.XmlConfigurator.Configure(); string userFirstName = "Charlie"; @@ -521,7 +562,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver.Tests Scene scene = SceneSetupHelpers.SetupScene("inventory"); SceneSetupHelpers.SetupSceneModules(scene, serialiserModule, archiverModule); - UserProfileTestUtils.CreateUserWithInventory(scene, userFirstName, userLastName, userUuid, "meowfood"); + UserProfileTestUtils.CreateUserWithInventory(scene, userFirstName, userLastName, userUuid, "meowfood"); archiverModule.DearchiveInventory(userFirstName, userLastName, "/", "meowfood", archiveReadStream); @@ -629,7 +670,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver.Tests UserAccount ua1 = UserProfileTestUtils.CreateUserWithInventory(scene); Dictionary foldersCreated = new Dictionary(); - List nodesLoaded = new List(); + HashSet nodesLoaded = new HashSet(); string folder1Name = "1"; string folder2aName = "2a"; @@ -639,12 +680,12 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver.Tests string folder2aArchiveName = InventoryArchiveWriteRequest.CreateArchiveFolderName(folder2aName, UUID.Random()); string folder2bArchiveName = InventoryArchiveWriteRequest.CreateArchiveFolderName(folder2bName, UUID.Random()); - string iarPath1 = string.Join("", new string[] { folder1ArchiveName, folder2aArchiveName }); - string iarPath2 = string.Join("", new string[] { folder1ArchiveName, folder2bArchiveName }); + string iarPath1 = string.Join("", new string[] { folder1ArchiveName, folder2aArchiveName }); + string iarPath2 = string.Join("", new string[] { folder1ArchiveName, folder2bArchiveName }); { // Test replication of path1 - new InventoryArchiveReadRequest(scene, ua1, null, (Stream)null) + new InventoryArchiveReadRequest(scene, ua1, null, (Stream)null, false) .ReplicateArchivePathToUserInventory( iarPath1, scene.InventoryService.GetRootFolder(ua1.PrincipalID), foldersCreated, nodesLoaded); @@ -653,7 +694,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver.Tests = InventoryArchiveUtils.FindFolderByPath(scene.InventoryService, ua1.PrincipalID, folder1Name); Assert.That(folder1Candidates.Count, Is.EqualTo(1)); - InventoryFolderBase folder1 = folder1Candidates[0]; + InventoryFolderBase folder1 = folder1Candidates[0]; List folder2aCandidates = InventoryArchiveUtils.FindFolderByPath(scene.InventoryService, folder1, folder2aName); Assert.That(folder2aCandidates.Count, Is.EqualTo(1)); @@ -661,7 +702,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver.Tests { // Test replication of path2 - new InventoryArchiveReadRequest(scene, ua1, null, (Stream)null) + new InventoryArchiveReadRequest(scene, ua1, null, (Stream)null, false) .ReplicateArchivePathToUserInventory( iarPath2, scene.InventoryService.GetRootFolder(ua1.PrincipalID), foldersCreated, nodesLoaded); @@ -674,11 +715,11 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver.Tests List folder2aCandidates = InventoryArchiveUtils.FindFolderByPath(scene.InventoryService, folder1, folder2aName); - Assert.That(folder2aCandidates.Count, Is.EqualTo(1)); + Assert.That(folder2aCandidates.Count, Is.EqualTo(1)); List folder2bCandidates = InventoryArchiveUtils.FindFolderByPath(scene.InventoryService, folder1, folder2bName); - Assert.That(folder2bCandidates.Count, Is.EqualTo(1)); + Assert.That(folder2bCandidates.Count, Is.EqualTo(1)); } } @@ -700,17 +741,17 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver.Tests InventoryFolderBase folder1 = UserInventoryTestUtils.CreateInventoryFolder( - scene.InventoryService, ua1.PrincipalID, folder1ExistingName); + scene.InventoryService, ua1.PrincipalID, folder1ExistingName); string folder1ArchiveName = InventoryArchiveWriteRequest.CreateArchiveFolderName(folder1ExistingName, UUID.Random()); string folder2ArchiveName = InventoryArchiveWriteRequest.CreateArchiveFolderName(folder2Name, UUID.Random()); string itemArchivePath = string.Join("", new string[] { folder1ArchiveName, folder2ArchiveName }); - new InventoryArchiveReadRequest(scene, ua1, null, (Stream)null) + new InventoryArchiveReadRequest(scene, ua1, null, (Stream)null, false) .ReplicateArchivePathToUserInventory( itemArchivePath, scene.InventoryService.GetRootFolder(ua1.PrincipalID), - new Dictionary(), new List()); + new Dictionary(), new HashSet()); List folder1PostCandidates = InventoryArchiveUtils.FindFolderByPath(scene.InventoryService, ua1.PrincipalID, folder1ExistingName); @@ -731,6 +772,46 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver.Tests List folder2PostCandidates = InventoryArchiveUtils.FindFolderByPath(scene.InventoryService, folder1Post, "b"); Assert.That(folder2PostCandidates.Count, Is.EqualTo(1)); - } + } + + /// + /// Test replication of a partly existing archive path to the user's inventory. This should create + /// a merged path. + /// + [Test] + public void TestMergeIarPath() + { + TestHelper.InMethod(); +// log4net.Config.XmlConfigurator.Configure(); + + Scene scene = SceneSetupHelpers.SetupScene("inventory"); + UserAccount ua1 = UserProfileTestUtils.CreateUserWithInventory(scene); + + string folder1ExistingName = "a"; + string folder2Name = "b"; + + InventoryFolderBase folder1 + = UserInventoryTestUtils.CreateInventoryFolder( + scene.InventoryService, ua1.PrincipalID, folder1ExistingName); + + string folder1ArchiveName = InventoryArchiveWriteRequest.CreateArchiveFolderName(folder1ExistingName, UUID.Random()); + string folder2ArchiveName = InventoryArchiveWriteRequest.CreateArchiveFolderName(folder2Name, UUID.Random()); + + string itemArchivePath = string.Join("", new string[] { folder1ArchiveName, folder2ArchiveName }); + + new InventoryArchiveReadRequest(scene, ua1, folder1ExistingName, (Stream)null, true) + .ReplicateArchivePathToUserInventory( + itemArchivePath, scene.InventoryService.GetRootFolder(ua1.PrincipalID), + new Dictionary(), new HashSet()); + + List folder1PostCandidates + = InventoryArchiveUtils.FindFolderByPath(scene.InventoryService, ua1.PrincipalID, folder1ExistingName); + Assert.That(folder1PostCandidates.Count, Is.EqualTo(1)); + Assert.That(folder1PostCandidates[0].ID, Is.EqualTo(folder1.ID)); + + List folder2PostCandidates + = InventoryArchiveUtils.FindFolderByPath(scene.InventoryService, folder1PostCandidates[0], "b"); + Assert.That(folder2PostCandidates.Count, Is.EqualTo(1)); + } } } \ No newline at end of file diff --git a/OpenSim/Region/CoreModules/Avatar/Inventory/Transfer/InventoryTransferModule.cs b/OpenSim/Region/CoreModules/Avatar/Inventory/Transfer/InventoryTransferModule.cs index 2f1e9dd74e..e3d49692f3 100644 --- a/OpenSim/Region/CoreModules/Avatar/Inventory/Transfer/InventoryTransferModule.cs +++ b/OpenSim/Region/CoreModules/Avatar/Inventory/Transfer/InventoryTransferModule.cs @@ -32,7 +32,6 @@ using log4net; using Nini.Config; using OpenMetaverse; using OpenSim.Framework; - using OpenSim.Region.Framework.Interfaces; using OpenSim.Region.Framework.Scenes; using OpenSim.Services.Interfaces; @@ -82,6 +81,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Transfer scene.EventManager.OnNewClient += OnNewClient; scene.EventManager.OnClientClosed += ClientLoggedOut; scene.EventManager.OnIncomingInstantMessage += OnGridInstantMessage; + scene.EventManager.OnSetRootAgentScene += OnSetRootAgentScene; } public void RegionLoaded(Scene scene) @@ -91,16 +91,16 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Transfer m_TransferModule = m_Scenelist[0].RequestModuleInterface(); if (m_TransferModule == null) { - m_log.Error("[INVENTORY TRANSFER] No Message transfer module found, transfers will be local only"); + m_log.Error("[INVENTORY TRANSFER]: No Message transfer module found, transfers will be local only"); m_Enabled = false; m_Scenelist.Clear(); scene.EventManager.OnNewClient -= OnNewClient; scene.EventManager.OnClientClosed -= ClientLoggedOut; scene.EventManager.OnIncomingInstantMessage -= OnGridInstantMessage; + scene.EventManager.OnSetRootAgentScene -= OnSetRootAgentScene; } } - } public void RemoveRegion(Scene scene) @@ -108,6 +108,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Transfer scene.EventManager.OnNewClient -= OnNewClient; scene.EventManager.OnClientClosed -= ClientLoggedOut; scene.EventManager.OnIncomingInstantMessage -= OnGridInstantMessage; + scene.EventManager.OnSetRootAgentScene -= OnSetRootAgentScene; m_Scenelist.Remove(scene); } @@ -136,6 +137,11 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Transfer // Inventory giving is conducted via instant message client.OnInstantMessage += OnInstantMessage; } + + protected void OnSetRootAgentScene(UUID id, Scene scene) + { + m_AgentRegions[id] = scene; + } private Scene FindClientScene(UUID agentId) { @@ -153,14 +159,15 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Transfer private void OnInstantMessage(IClientAPI client, GridInstantMessage im) { - m_log.InfoFormat("[INVENTORY TRANSFER]: OnInstantMessage {0}", im.dialog); - +// m_log.DebugFormat( +// "[INVENTORY TRANSFER]: {0} IM type received from {1}", +// (InstantMessageDialog)im.dialog, client.Name); + Scene scene = FindClientScene(client.AgentId); if (scene == null) // Something seriously wrong here. return; - if (im.dialog == (byte) InstantMessageDialog.InventoryOffered) { //m_log.DebugFormat("Asset type {0}", ((AssetType)im.binaryBucket[0])); @@ -179,7 +186,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Transfer { UUID folderID = new UUID(im.binaryBucket, 1); - m_log.DebugFormat("[AGENT INVENTORY]: Inserting original folder {0} "+ + m_log.DebugFormat("[INVENTORY TRANSFER]: Inserting original folder {0} "+ "into agent {1}'s inventory", folderID, new UUID(im.toAgentID)); @@ -215,7 +222,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Transfer UUID itemID = new UUID(im.binaryBucket, 1); - m_log.DebugFormat("[AGENT INVENTORY]: (giving) Inserting item {0} "+ + m_log.DebugFormat("[INVENTORY TRANSFER]: (giving) Inserting item {0} "+ "into agent {1}'s inventory", itemID, new UUID(im.toAgentID)); @@ -280,10 +287,6 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Transfer // inventory is loaded. Courtesy of the above bulk update, // It will have been pushed to the client, too // - - //CachedUserInfo userInfo = - // scene.CommsManager.UserProfileCacheService. - // GetUserDetails(client.AgentId); IInventoryService invService = scene.InventoryService; InventoryFolderBase trashFolder = @@ -346,11 +349,6 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Transfer } } - public void SetRootAgentScene(UUID agentID, Scene scene) - { - m_AgentRegions[agentID] = scene; - } - public bool NeedSceneCacheClear(UUID agentID, Scene scene) { if (!m_AgentRegions.ContainsKey(agentID)) diff --git a/OpenSim/Region/CoreModules/Avatar/ObjectCaps/UploadObjectAssetModule.cs b/OpenSim/Region/CoreModules/Avatar/ObjectCaps/UploadObjectAssetModule.cs new file mode 100644 index 0000000000..09b97196bf --- /dev/null +++ b/OpenSim/Region/CoreModules/Avatar/ObjectCaps/UploadObjectAssetModule.cs @@ -0,0 +1,377 @@ +/* + * Copyright (c) Contributors, http://opensimulator.org/ + * See CONTRIBUTORS.TXT for a full list of copyright holders. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * * Neither the name of the OpenSimulator Project nor the + * names of its contributors may be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE DEVELOPERS ``AS IS'' AND ANY + * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED + * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + * DISCLAIMED. IN NO EVENT SHALL THE CONTRIBUTORS BE LIABLE FOR ANY + * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES + * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND + * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS + * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +using System; +using System.Collections; +using System.Collections.Specialized; +using System.Reflection; +using System.IO; +using System.Web; +using Mono.Addins; +using log4net; +using Nini.Config; +using OpenMetaverse; +using OpenMetaverse.StructuredData; +using OpenMetaverse.Messages.Linden; +using OpenSim.Framework; +using OpenSim.Framework.Servers; +using OpenSim.Framework.Servers.HttpServer; +using OpenSim.Region.Framework.Interfaces; +using OpenSim.Region.Framework.Scenes; +using OpenSim.Services.Interfaces; +using Caps = OpenSim.Framework.Capabilities.Caps; +using OSD = OpenMetaverse.StructuredData.OSD; +using OSDMap = OpenMetaverse.StructuredData.OSDMap; +using OpenSim.Framework.Capabilities; +using ExtraParamType = OpenMetaverse.ExtraParamType; + +namespace OpenSim.Region.CoreModules.Avatar.ObjectCaps +{ + [Extension(Path = "/OpenSim/RegionModules", NodeName = "RegionModule")] + public class UploadObjectAssetModule : INonSharedRegionModule + { + private static readonly ILog m_log = + LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); + private Scene m_scene; + + #region IRegionModuleBase Members + + + public Type ReplaceableInterface + { + get { return null; } + } + + public void Initialise(IConfigSource source) + { + + } + + public void AddRegion(Scene pScene) + { + m_scene = pScene; + } + + public void RemoveRegion(Scene scene) + { + + m_scene.EventManager.OnRegisterCaps -= RegisterCaps; + m_scene = null; + } + + public void RegionLoaded(Scene scene) + { + + m_scene.EventManager.OnRegisterCaps += RegisterCaps; + } + + #endregion + + + #region IRegionModule Members + + + + public void Close() { } + + public string Name { get { return "UploadObjectAssetModuleModule"; } } + + + public void RegisterCaps(UUID agentID, Caps caps) + { + UUID capID = UUID.Random(); + + m_log.Info("[UploadObjectAssetModule]: /CAPS/" + capID); + caps.RegisterHandler("UploadObjectAsset", + new RestHTTPHandler("POST", "/CAPS/OA/" + capID + "/", + delegate(Hashtable m_dhttpMethod) + { + return ProcessAdd(m_dhttpMethod, agentID, caps); + })); + /* + caps.RegisterHandler("NewFileAgentInventoryVariablePrice", + + new LLSDStreamhandler("POST", + "/CAPS/" + capID.ToString(), + delegate(LLSDAssetUploadRequest req) + { + return NewAgentInventoryRequest(req,agentID); + })); + */ + + } + + #endregion + + + /// + /// Parses ad request + /// + /// + /// + /// + /// + public Hashtable ProcessAdd(Hashtable request, UUID AgentId, Caps cap) + { + Hashtable responsedata = new Hashtable(); + responsedata["int_response_code"] = 400; //501; //410; //404; + responsedata["content_type"] = "text/plain"; + responsedata["keepalive"] = false; + responsedata["str_response_string"] = "Request wasn't what was expected"; + ScenePresence avatar; + + if (!m_scene.TryGetScenePresence(AgentId, out avatar)) + return responsedata; + + OSDMap r = (OSDMap)OSDParser.Deserialize((string)request["requestbody"]); + UploadObjectAssetMessage message = new UploadObjectAssetMessage(); + try + { + message.Deserialize(r); + + } + catch (Exception ex) + { + m_log.Error("[UploadObjectAssetModule]: Error deserializing message " + ex.ToString()); + message = null; + } + + if (message == null) + { + responsedata["int_response_code"] = 400; //501; //410; //404; + responsedata["content_type"] = "text/plain"; + responsedata["keepalive"] = false; + responsedata["str_response_string"] = + "errorError parsing Object"; + + return responsedata; + } + + Vector3 pos = avatar.AbsolutePosition + (Vector3.UnitX * avatar.Rotation); + Quaternion rot = Quaternion.Identity; + Vector3 rootpos = Vector3.Zero; + Quaternion rootrot = Quaternion.Identity; + + SceneObjectGroup rootGroup = null; + SceneObjectGroup[] allparts = new SceneObjectGroup[message.Objects.Length]; + for (int i = 0; i < message.Objects.Length; i++) + { + UploadObjectAssetMessage.Object obj = message.Objects[i]; + PrimitiveBaseShape pbs = PrimitiveBaseShape.CreateBox(); + + if (i == 0) + { + rootpos = obj.Position; + rootrot = obj.Rotation; + + } + + + // Combine the extraparams data into it's ugly blob again.... + //int bytelength = 0; + //for (int extparams = 0; extparams < obj.ExtraParams.Length; extparams++) + //{ + // bytelength += obj.ExtraParams[extparams].ExtraParamData.Length; + //} + //byte[] extraparams = new byte[bytelength]; + //int position = 0; + + + + //for (int extparams = 0; extparams < obj.ExtraParams.Length; extparams++) + //{ + // Buffer.BlockCopy(obj.ExtraParams[extparams].ExtraParamData, 0, extraparams, position, + // obj.ExtraParams[extparams].ExtraParamData.Length); + // + // position += obj.ExtraParams[extparams].ExtraParamData.Length; + // } + + //pbs.ExtraParams = extraparams; + for (int extparams = 0; extparams < obj.ExtraParams.Length; extparams++) + { + UploadObjectAssetMessage.Object.ExtraParam extraParam = obj.ExtraParams[extparams]; + switch ((ushort)extraParam.Type) + { + case (ushort)ExtraParamType.Sculpt: + Primitive.SculptData sculpt = new Primitive.SculptData(extraParam.ExtraParamData, 0); + + pbs.SculptEntry = true; + + pbs.SculptTexture = obj.SculptID; + pbs.SculptType = (byte)sculpt.Type; + + break; + case (ushort)ExtraParamType.Flexible: + Primitive.FlexibleData flex = new Primitive.FlexibleData(extraParam.ExtraParamData, 0); + pbs.FlexiEntry = true; + pbs.FlexiDrag = flex.Drag; + pbs.FlexiForceX = flex.Force.X; + pbs.FlexiForceY = flex.Force.Y; + pbs.FlexiForceZ = flex.Force.Z; + pbs.FlexiGravity = flex.Gravity; + pbs.FlexiSoftness = flex.Softness; + pbs.FlexiTension = flex.Tension; + pbs.FlexiWind = flex.Wind; + break; + case (ushort)ExtraParamType.Light: + Primitive.LightData light = new Primitive.LightData(extraParam.ExtraParamData, 0); + pbs.LightColorA = light.Color.A; + pbs.LightColorB = light.Color.B; + pbs.LightColorG = light.Color.G; + pbs.LightColorR = light.Color.R; + pbs.LightCutoff = light.Cutoff; + pbs.LightEntry = true; + pbs.LightFalloff = light.Falloff; + pbs.LightIntensity = light.Intensity; + pbs.LightRadius = light.Radius; + break; + case 0x40: + pbs.ReadProjectionData(extraParam.ExtraParamData, 0); + break; + + } + + + } + pbs.PathBegin = (ushort) obj.PathBegin; + pbs.PathCurve = (byte) obj.PathCurve; + pbs.PathEnd = (ushort) obj.PathEnd; + pbs.PathRadiusOffset = (sbyte) obj.RadiusOffset; + pbs.PathRevolutions = (byte) obj.Revolutions; + pbs.PathScaleX = (byte) obj.ScaleX; + pbs.PathScaleY = (byte) obj.ScaleY; + pbs.PathShearX = (byte) obj.ShearX; + pbs.PathShearY = (byte) obj.ShearY; + pbs.PathSkew = (sbyte) obj.Skew; + pbs.PathTaperX = (sbyte) obj.TaperX; + pbs.PathTaperY = (sbyte) obj.TaperY; + pbs.PathTwist = (sbyte) obj.Twist; + pbs.PathTwistBegin = (sbyte) obj.TwistBegin; + pbs.HollowShape = (HollowShape) obj.ProfileHollow; + pbs.PCode = (byte) PCode.Prim; + pbs.ProfileBegin = (ushort) obj.ProfileBegin; + pbs.ProfileCurve = (byte) obj.ProfileCurve; + pbs.ProfileEnd = (ushort) obj.ProfileEnd; + pbs.Scale = obj.Scale; + pbs.State = (byte) 0; + SceneObjectPart prim = new SceneObjectPart(); + prim.UUID = UUID.Random(); + prim.CreatorID = AgentId; + prim.OwnerID = AgentId; + prim.GroupID = obj.GroupID; + prim.LastOwnerID = prim.OwnerID; + prim.CreationDate = Util.UnixTimeSinceEpoch(); + prim.Name = obj.Name; + prim.Description = ""; + + prim.PayPrice[0] = -2; + prim.PayPrice[1] = -2; + prim.PayPrice[2] = -2; + prim.PayPrice[3] = -2; + prim.PayPrice[4] = -2; + Primitive.TextureEntry tmp = + new Primitive.TextureEntry(UUID.Parse("89556747-24cb-43ed-920b-47caed15465f")); + + for (int j = 0; j < obj.Faces.Length; j++) + { + UploadObjectAssetMessage.Object.Face face = obj.Faces[j]; + + Primitive.TextureEntryFace primFace = tmp.CreateFace((uint) j); + + primFace.Bump = face.Bump; + primFace.RGBA = face.Color; + primFace.Fullbright = face.Fullbright; + primFace.Glow = face.Glow; + primFace.TextureID = face.ImageID; + primFace.Rotation = face.ImageRot; + primFace.MediaFlags = ((face.MediaFlags & 1) != 0); + + primFace.OffsetU = face.OffsetS; + primFace.OffsetV = face.OffsetT; + primFace.RepeatU = face.ScaleS; + primFace.RepeatV = face.ScaleT; + primFace.TexMapType = (MappingType) (face.MediaFlags & 6); + } + pbs.TextureEntry = tmp.GetBytes(); + prim.Shape = pbs; + prim.Scale = obj.Scale; + + + SceneObjectGroup grp = new SceneObjectGroup(); + + grp.SetRootPart(prim); + prim.ParentID = 0; + if (i == 0) + { + rootGroup = grp; + + } + grp.AttachToScene(m_scene); + grp.AbsolutePosition = obj.Position; + prim.RotationOffset = obj.Rotation; + + grp.RootPart.IsAttachment = false; + // Required for linking + grp.RootPart.UpdateFlag = 0; + + if (m_scene.Permissions.CanRezObject(1, avatar.UUID, pos)) + { + m_scene.AddSceneObject(grp); + grp.AbsolutePosition = obj.Position; + } + allparts[i] = grp; + + } + + for (int j = 1; j < allparts.Length; j++) + { + rootGroup.RootPart.UpdateFlag = 0; + allparts[j].RootPart.UpdateFlag = 0; + rootGroup.LinkToGroup(allparts[j]); + } + + rootGroup.ScheduleGroupForFullUpdate(); + pos = m_scene.GetNewRezLocation(Vector3.Zero, rootpos, UUID.Zero, rot, (byte)1, 1, true, allparts[0].GroupScale(), false); + + responsedata["int_response_code"] = 200; //501; //410; //404; + responsedata["content_type"] = "text/plain"; + responsedata["keepalive"] = false; + responsedata["str_response_string"] = String.Format("local_id{0}", ConvertUintToBytes(allparts[0].LocalId)); + + return responsedata; + + + } + private string ConvertUintToBytes(uint val) + { + byte[] resultbytes = Utils.UIntToBytes(val); + if (BitConverter.IsLittleEndian) + Array.Reverse(resultbytes); + return String.Format("{0}", Convert.ToBase64String(resultbytes)); + } + } +} diff --git a/OpenSim/Region/CoreModules/Framework/EntityTransfer/EntityTransferModule.cs b/OpenSim/Region/CoreModules/Framework/EntityTransfer/EntityTransferModule.cs index bae63e82b5..cb2c2e03df 100644 --- a/OpenSim/Region/CoreModules/Framework/EntityTransfer/EntityTransferModule.cs +++ b/OpenSim/Region/CoreModules/Framework/EntityTransfer/EntityTransferModule.cs @@ -1,4 +1,4 @@ -/* +/* * Copyright (c) Contributors, http://opensimulator.org/ * See CONTRIBUTORS.TXT for a full list of copyright holders. * @@ -174,9 +174,7 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer position.Z = newPosZ; } - // Only send this if the event queue is null - if (eq == null) - sp.ControllingClient.SendTeleportLocationStart(); + sp.ControllingClient.SendTeleportStart(teleportFlags); sp.ControllingClient.SendLocalTeleport(position, lookAt, teleportFlags); sp.Teleport(position); @@ -195,13 +193,23 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer GridRegion finalDestination = GetFinalDestination(reg); if (finalDestination == null) { - m_log.DebugFormat("[ENTITY TRANSFER MODULE]: Final destination is having problems. Unable to teleport agent."); + m_log.WarnFormat("[ENTITY TRANSFER MODULE]: Final destination is having problems. Unable to teleport agent."); sp.ControllingClient.SendTeleportFailed("Problem at destination"); return; } + m_log.DebugFormat("[ENTITY TRANSFER MODULE]: Final destination is x={0} y={1} uuid={2}", finalDestination.RegionLocX / Constants.RegionSize, finalDestination.RegionLocY / Constants.RegionSize, finalDestination.RegionID); + // Check that these are not the same coordinates + if (finalDestination.RegionLocX == sp.Scene.RegionInfo.RegionLocX && + finalDestination.RegionLocY == sp.Scene.RegionInfo.RegionLocY) + { + // Can't do. Viewer crashes + sp.ControllingClient.SendTeleportFailed("Space warp! You would crash. Move to a different region and try again."); + return; + } + // // This is it // @@ -233,7 +241,7 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer } catch (Exception e) { - m_log.DebugFormat("[ENTITY TRANSFER MODULE]: Exception on teleport: {0}\n{1}", e.Message, e.StackTrace); + m_log.WarnFormat("[ENTITY TRANSFER MODULE]: Exception on teleport: {0}\n{1}", e.Message, e.StackTrace); sp.ControllingClient.SendTeleportFailed("Internal error"); } } @@ -257,9 +265,6 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer ulong destinationHandle = finalDestination.RegionHandle; - if (eq == null) - sp.ControllingClient.SendTeleportLocationStart(); - // Let's do DNS resolution only once in this process, please! // This may be a costly operation. The reg.ExternalEndPoint field is not a passive field, // it's actually doing a lot of work. @@ -277,6 +282,8 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer return; } + sp.ControllingClient.SendTeleportStart(teleportFlags); + // the avatar.Close below will clear the child region list. We need this below for (possibly) // closing the child agents, so save it here (we need a copy as it is Clear()-ed). //List childRegions = new List(avatar.GetKnownRegionList()); @@ -295,7 +302,11 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer if (currentAgentCircuit != null) { agentCircuit.ServiceURLs = currentAgentCircuit.ServiceURLs; + agentCircuit.IPAddress = currentAgentCircuit.IPAddress; agentCircuit.Viewer = currentAgentCircuit.Viewer; + agentCircuit.Channel = currentAgentCircuit.Channel; + agentCircuit.Mac = currentAgentCircuit.Mac; + agentCircuit.Id0 = currentAgentCircuit.Id0; } if (NeedsNewAgent(oldRegionX, newRegionX, oldRegionY, newRegionY)) @@ -307,7 +318,8 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer string reason = String.Empty; // Let's create an agent there if one doesn't exist yet. - if (!CreateAgent(sp, reg, finalDestination, agentCircuit, teleportFlags, out reason)) + bool logout = false; + if (!CreateAgent(sp, reg, finalDestination, agentCircuit, teleportFlags, out reason, out logout)) { sp.ControllingClient.SendTeleportFailed(String.Format("Destination refused: {0}", reason)); @@ -319,6 +331,8 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer if (NeedsNewAgent(oldRegionX, newRegionX, oldRegionY, newRegionY)) { + //sp.ControllingClient.SendTeleportProgress(teleportFlags, "Creating agent..."); + #region IP Translation for NAT IClientIPEndpoint ipepClient; if (sp.ClientView.TryGet(out ipepClient)) @@ -396,6 +410,8 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer agent.Position = position; SetCallbackURL(agent, sp.Scene.RegionInfo); + //sp.ControllingClient.SendTeleportProgress(teleportFlags, "Updating agent..."); + if (!UpdateAgent(reg, finalDestination, agent)) { // Region doesn't take it @@ -406,7 +422,6 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer m_log.DebugFormat( "[ENTITY TRANSFER MODULE]: Sending new CAPS seed url {0} to client {1}", capsPath, sp.UUID); - if (eq != null) { eq.TeleportFinishEvent(destinationHandle, 13, endPoint, @@ -434,11 +449,18 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer // CrossAttachmentsIntoNewRegion is a synchronous call. We shouldn't need to wait after it CrossAttachmentsIntoNewRegion(finalDestination, sp, true); + // Well, this is it. The agent is over there. + KillEntity(sp.Scene, sp.LocalId); + // May need to logout or other cleanup + AgentHasMovedAway(sp.ControllingClient.SessionId, logout); + // Now let's make it officially a child agent sp.MakeChildAgent(); + sp.Scene.CleanDroppedAttachments(); + // Finally, let's close this previously-known-as-root agent, when the jump is outside the view zone if (NeedsClosing(oldRegionX, newRegionX, oldRegionY, newRegionY, reg)) @@ -483,8 +505,9 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer } - protected virtual bool CreateAgent(ScenePresence sp, GridRegion reg, GridRegion finalDestination, AgentCircuitData agentCircuit, uint teleportFlags, out string reason) + protected virtual bool CreateAgent(ScenePresence sp, GridRegion reg, GridRegion finalDestination, AgentCircuitData agentCircuit, uint teleportFlags, out string reason, out bool logout) { + logout = false; return m_aScene.SimulationService.CreateAgent(finalDestination, agentCircuit, teleportFlags, out reason); } @@ -500,6 +523,10 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer } + protected virtual void AgentHasMovedAway(UUID sessionID, bool logout) + { + } + protected void KillEntity(Scene scene, uint localID) { scene.SendKillObject(localID); @@ -556,6 +583,7 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer client.SendTeleportFailed("Your home region could not be found."); return; } + m_log.DebugFormat("[ENTITY TRANSFER MODULE]: User's home region is {0} {1} ({2}-{3})", regionInfo.RegionName, regionInfo.RegionID, regionInfo.RegionLocX / Constants.RegionSize, regionInfo.RegionLocY / Constants.RegionSize); @@ -934,16 +962,16 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer agent.CapsPath = CapsUtil.GetRandomCapsObjectPath(); agent.ChildrenCapSeeds = new Dictionary(sp.Scene.CapsModule.GetChildrenSeeds(sp.UUID)); - m_log.DebugFormat("[XXX] Seeds 1 {0}", agent.ChildrenCapSeeds.Count); + //m_log.DebugFormat("[XXX] Seeds 1 {0}", agent.ChildrenCapSeeds.Count); if (!agent.ChildrenCapSeeds.ContainsKey(sp.Scene.RegionInfo.RegionHandle)) agent.ChildrenCapSeeds.Add(sp.Scene.RegionInfo.RegionHandle, sp.ControllingClient.RequestClientInfo().CapsPath); - m_log.DebugFormat("[XXX] Seeds 2 {0}", agent.ChildrenCapSeeds.Count); + //m_log.DebugFormat("[XXX] Seeds 2 {0}", agent.ChildrenCapSeeds.Count); sp.AddNeighbourRegion(region.RegionHandle, agent.CapsPath); - foreach (ulong h in agent.ChildrenCapSeeds.Keys) - m_log.DebugFormat("[XXX] --> {0}", h); - m_log.DebugFormat("[XXX] Adding {0}", region.RegionHandle); + //foreach (ulong h in agent.ChildrenCapSeeds.Keys) + // m_log.DebugFormat("[XXX] --> {0}", h); + //m_log.DebugFormat("[XXX] Adding {0}", region.RegionHandle); agent.ChildrenCapSeeds.Add(region.RegionHandle, agent.CapsPath); if (sp.Scene.CapsModule != null) @@ -954,7 +982,11 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer if (currentAgentCircuit != null) { agent.ServiceURLs = currentAgentCircuit.ServiceURLs; + agent.IPAddress = currentAgentCircuit.IPAddress; agent.Viewer = currentAgentCircuit.Viewer; + agent.Channel = currentAgentCircuit.Channel; + agent.Mac = currentAgentCircuit.Mac; + agent.Id0 = currentAgentCircuit.Id0; } InformClientOfNeighbourDelegate d = InformClientOfNeighbourAsync; @@ -1043,7 +1075,11 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer if (currentAgentCircuit != null) { agent.ServiceURLs = currentAgentCircuit.ServiceURLs; + agent.IPAddress = currentAgentCircuit.IPAddress; agent.Viewer = currentAgentCircuit.Viewer; + agent.Channel = currentAgentCircuit.Channel; + agent.Mac = currentAgentCircuit.Mac; + agent.Id0 = currentAgentCircuit.Id0; } if (newRegions.Contains(neighbour.RegionHandle)) @@ -1155,7 +1191,7 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer Utils.LongToUInts(reg.RegionHandle, out x, out y); x = x / Constants.RegionSize; y = y / Constants.RegionSize; - m_log.Info("[ENTITY TRANSFER MODULE]: Starting to inform client about neighbour " + x + ", " + y + "(" + endPoint.ToString() + ")"); + m_log.Debug("[ENTITY TRANSFER MODULE]: Starting to inform client about neighbour " + x + ", " + y + "(" + endPoint.ToString() + ")"); string capsPath = "http://" + reg.ExternalHostName + ":" + reg.HttpPort + "/CAPS/" + a.CapsPath + "0000/"; @@ -1191,12 +1227,17 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer // TODO: make Event Queue disablable! } - m_log.Info("[ENTITY TRANSFER MODULE]: Completed inform client about neighbour " + endPoint.ToString()); - + m_log.Debug("[ENTITY TRANSFER MODULE]: Completed inform client about neighbour " + endPoint.ToString()); } - } + /// + /// Return the list of regions that are considered to be neighbours to the given scene. + /// + /// + /// + /// + /// protected List RequestNeighbours(Scene pScene, uint pRegionLocX, uint pRegionLocY) { m_log.DebugFormat("[ENTITY TRANSFER MODULE] Request neighbors for {0} at {1}/{2}", @@ -1267,18 +1308,18 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer return handles; } - private void Dump(string msg, List handles) - { - m_log.InfoFormat("-------------- HANDLE DUMP ({0}) ---------", msg); - foreach (ulong handle in handles) - { - uint x, y; - Utils.LongToUInts(handle, out x, out y); - x = x / Constants.RegionSize; - y = y / Constants.RegionSize; - m_log.InfoFormat("({0}, {1})", x, y); - } - } +// private void Dump(string msg, List handles) +// { +// m_log.InfoFormat("-------------- HANDLE DUMP ({0}) ---------", msg); +// foreach (ulong handle in handles) +// { +// uint x, y; +// Utils.LongToUInts(handle, out x, out y); +// x = x / Constants.RegionSize; +// y = y / Constants.RegionSize; +// m_log.InfoFormat("({0}, {1})", x, y); +// } +// } #endregion diff --git a/OpenSim/Region/CoreModules/Framework/EntityTransfer/HGEntityTransferModule.cs b/OpenSim/Region/CoreModules/Framework/EntityTransfer/HGEntityTransferModule.cs index 7d26e3ff5f..1ac7508c20 100644 --- a/OpenSim/Region/CoreModules/Framework/EntityTransfer/HGEntityTransferModule.cs +++ b/OpenSim/Region/CoreModules/Framework/EntityTransfer/HGEntityTransferModule.cs @@ -140,9 +140,17 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer return false; } - protected override bool CreateAgent(ScenePresence sp, GridRegion reg, GridRegion finalDestination, AgentCircuitData agentCircuit, uint teleportFlags, out string reason) + protected override void AgentHasMovedAway(UUID sessionID, bool logout) + { + if (logout) + // Log them out of this grid + m_aScene.PresenceService.LogoutAgent(sessionID); + } + + protected override bool CreateAgent(ScenePresence sp, GridRegion reg, GridRegion finalDestination, AgentCircuitData agentCircuit, uint teleportFlags, out string reason, out bool logout) { reason = string.Empty; + logout = false; int flags = m_aScene.GridService.GetRegionFlags(m_aScene.RegionInfo.ScopeID, reg.RegionID); if (flags == -1 /* no region in DB */ || (flags & (int)OpenSim.Data.RegionFlags.Hyperlink) != 0) { @@ -152,9 +160,7 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer string userAgentDriver = agentCircuit.ServiceURLs["HomeURI"].ToString(); IUserAgentService connector = new UserAgentServiceConnector(userAgentDriver); bool success = connector.LoginAgentToGrid(agentCircuit, reg, finalDestination, out reason); - if (success) - // Log them out of this grid - m_aScene.PresenceService.LogoutAgent(agentCircuit.SessionID); + logout = success; // flag for later logout from this grid; this is an HG TP return success; } diff --git a/OpenSim/Region/CoreModules/Framework/EventQueue/EventQueueGetModule.cs b/OpenSim/Region/CoreModules/Framework/EventQueue/EventQueueGetModule.cs index 0c6cb1bdfa..05fe3eee04 100644 --- a/OpenSim/Region/CoreModules/Framework/EventQueue/EventQueueGetModule.cs +++ b/OpenSim/Region/CoreModules/Framework/EventQueue/EventQueueGetModule.cs @@ -34,6 +34,7 @@ using System.Threading; using log4net; using Nini.Config; using OpenMetaverse; +using OpenMetaverse.Messages.Linden; using OpenMetaverse.Packets; using OpenMetaverse.StructuredData; using OpenSim.Framework; @@ -137,10 +138,11 @@ namespace OpenSim.Region.CoreModules.Framework.EventQueue { if (!queues.ContainsKey(agentId)) { + /* m_log.DebugFormat( "[EVENTQUEUE]: Adding new queue for agent {0} in region {1}", agentId, m_scene.RegionInfo.RegionName); - + */ queues[agentId] = new Queue(); } @@ -200,7 +202,7 @@ namespace OpenSim.Region.CoreModules.Framework.EventQueue private void ClientClosed(UUID AgentID, Scene scene) { - m_log.DebugFormat("[EVENTQUEUE]: Closed client {0} in region {1}", AgentID, m_scene.RegionInfo.RegionName); + //m_log.DebugFormat("[EVENTQUEUE]: Closed client {0} in region {1}", AgentID, m_scene.RegionInfo.RegionName); int count = 0; while (queues.ContainsKey(AgentID) && queues[AgentID].Count > 0 && count++ < 5) @@ -284,7 +286,7 @@ namespace OpenSim.Region.CoreModules.Framework.EventQueue // Reuse open queues. The client does! if (m_AvatarQueueUUIDMapping.ContainsKey(agentID)) { - m_log.DebugFormat("[EVENTQUEUE]: Found Existing UUID!"); + //m_log.DebugFormat("[EVENTQUEUE]: Found Existing UUID!"); EventQueueGetUUID = m_AvatarQueueUUIDMapping[agentID]; } else @@ -365,7 +367,7 @@ namespace OpenSim.Region.CoreModules.Framework.EventQueue { // Send it a fake event to keep the client polling! It doesn't like 502s like the proxys say! array.Add(EventQueueHelper.KeepAliveEvent()); - m_log.DebugFormat("[EVENTQUEUE]: adding fake event for {0} in region {1}", pAgentId, m_scene.RegionInfo.RegionName); + //m_log.DebugFormat("[EVENTQUEUE]: adding fake event for {0} in region {1}", pAgentId, m_scene.RegionInfo.RegionName); } else { @@ -394,8 +396,8 @@ namespace OpenSim.Region.CoreModules.Framework.EventQueue responsedata["keepalive"] = false; responsedata["reusecontext"] = false; responsedata["str_response_string"] = OSDParser.SerializeLLSDXmlString(events); + //m_log.DebugFormat("[EVENTQUEUE]: sending response for {0} in region {1}: {2}", pAgentId, m_scene.RegionInfo.RegionName, responsedata["str_response_string"]); return responsedata; - //m_log.DebugFormat("[EVENTQUEUE]: sending response for {0} in region {1}: {2}", agentID, m_scene.RegionInfo.RegionName, responsedata["str_response_string"]); } public Hashtable NoEvents(UUID requestID, UUID agentID) @@ -461,7 +463,7 @@ namespace OpenSim.Region.CoreModules.Framework.EventQueue { // Send it a fake event to keep the client polling! It doesn't like 502s like the proxys say! array.Add(EventQueueHelper.KeepAliveEvent()); - m_log.DebugFormat("[EVENTQUEUE]: adding fake event for {0} in region {1}", agentID, m_scene.RegionInfo.RegionName); + //m_log.DebugFormat("[EVENTQUEUE]: adding fake event for {0} in region {1}", agentID, m_scene.RegionInfo.RegionName); } else { @@ -697,9 +699,9 @@ namespace OpenSim.Region.CoreModules.Framework.EventQueue //m_log.InfoFormat("########### eq ChatterBoxSessionAgentListUpdates #############\n{0}", item); } - public void ParcelProperties(ParcelPropertiesPacket parcelPropertiesPacket, UUID avatarID) + public void ParcelProperties(ParcelPropertiesMessage parcelPropertiesMessage, UUID avatarID) { - OSD item = EventQueueHelper.ParcelProperties(parcelPropertiesPacket); + OSD item = EventQueueHelper.ParcelProperties(parcelPropertiesMessage); Enqueue(item, avatarID); } diff --git a/OpenSim/Region/CoreModules/Framework/EventQueue/EventQueueHelper.cs b/OpenSim/Region/CoreModules/Framework/EventQueue/EventQueueHelper.cs index efa60bbb1e..0d7d16a2ba 100644 --- a/OpenSim/Region/CoreModules/Framework/EventQueue/EventQueueHelper.cs +++ b/OpenSim/Region/CoreModules/Framework/EventQueue/EventQueueHelper.cs @@ -30,6 +30,7 @@ using System.Net; using OpenMetaverse; using OpenMetaverse.Packets; using OpenMetaverse.StructuredData; +using OpenMetaverse.Messages.Linden; namespace OpenSim.Region.CoreModules.Framework.EventQueue { @@ -53,14 +54,12 @@ namespace OpenSim.Region.CoreModules.Framework.EventQueue }; } - private static byte[] uintToByteArray(uint uIntValue) - { - byte[] resultbytes = Utils.UIntToBytes(uIntValue); - if (BitConverter.IsLittleEndian) - Array.Reverse(resultbytes); - - return resultbytes; - } +// private static byte[] uintToByteArray(uint uIntValue) +// { +// byte[] result = new byte[4]; +// Utils.UIntToBytesBig(uIntValue, result, 0); +// return result; +// } public static OSD buildEvent(string eventName, OSD eventBody) { @@ -160,7 +159,7 @@ namespace OpenSim.Region.CoreModules.Framework.EventQueue info.Add("SimAccess", OSD.FromInteger(simAccess)); info.Add("SimIP", OSD.FromBinary(regionExternalEndPoint.Address.GetAddressBytes())); info.Add("SimPort", OSD.FromInteger(regionExternalEndPoint.Port)); - info.Add("TeleportFlags", OSD.FromBinary(1L << 4)); // AgentManager.TeleportFlags.ViaLocation + info.Add("TeleportFlags", OSD.FromULong(1L << 4)); // AgentManager.TeleportFlags.ViaLocation OSDArray infoArr = new OSDArray(); infoArr.Add(info); @@ -311,116 +310,6 @@ namespace OpenSim.Region.CoreModules.Framework.EventQueue return chatterBoxSessionAgentListUpdates; } - public static OSD ParcelProperties(ParcelPropertiesPacket parcelPropertiesPacket) - { - OSDMap parcelProperties = new OSDMap(); - OSDMap body = new OSDMap(); - - OSDArray ageVerificationBlock = new OSDArray(); - OSDMap ageVerificationMap = new OSDMap(); - ageVerificationMap.Add("RegionDenyAgeUnverified", - OSD.FromBoolean(parcelPropertiesPacket.AgeVerificationBlock.RegionDenyAgeUnverified)); - ageVerificationBlock.Add(ageVerificationMap); - body.Add("AgeVerificationBlock", ageVerificationBlock); - - // LL sims send media info in this event queue message but it's not in the UDP - // packet we construct this event queue message from. This should be refactored in - // other areas of the code so it can all be send in the same message. Until then we will - // still send the media info via UDP - - //OSDArray mediaData = new OSDArray(); - //OSDMap mediaDataMap = new OSDMap(); - //mediaDataMap.Add("MediaDesc", OSD.FromString("")); - //mediaDataMap.Add("MediaHeight", OSD.FromInteger(0)); - //mediaDataMap.Add("MediaLoop", OSD.FromInteger(0)); - //mediaDataMap.Add("MediaType", OSD.FromString("type/type")); - //mediaDataMap.Add("MediaWidth", OSD.FromInteger(0)); - //mediaDataMap.Add("ObscureMedia", OSD.FromInteger(0)); - //mediaDataMap.Add("ObscureMusic", OSD.FromInteger(0)); - //mediaData.Add(mediaDataMap); - //body.Add("MediaData", mediaData); - - OSDArray parcelData = new OSDArray(); - OSDMap parcelDataMap = new OSDMap(); - OSDArray AABBMax = new OSDArray(3); - AABBMax.Add(OSD.FromReal(parcelPropertiesPacket.ParcelData.AABBMax.X)); - AABBMax.Add(OSD.FromReal(parcelPropertiesPacket.ParcelData.AABBMax.Y)); - AABBMax.Add(OSD.FromReal(parcelPropertiesPacket.ParcelData.AABBMax.Z)); - parcelDataMap.Add("AABBMax", AABBMax); - - OSDArray AABBMin = new OSDArray(3); - AABBMin.Add(OSD.FromReal(parcelPropertiesPacket.ParcelData.AABBMin.X)); - AABBMin.Add(OSD.FromReal(parcelPropertiesPacket.ParcelData.AABBMin.Y)); - AABBMin.Add(OSD.FromReal(parcelPropertiesPacket.ParcelData.AABBMin.Z)); - parcelDataMap.Add("AABBMin", AABBMin); - - parcelDataMap.Add("Area", OSD.FromInteger(parcelPropertiesPacket.ParcelData.Area)); - parcelDataMap.Add("AuctionID", OSD.FromBinary(uintToByteArray(parcelPropertiesPacket.ParcelData.AuctionID))); - parcelDataMap.Add("AuthBuyerID", OSD.FromUUID(parcelPropertiesPacket.ParcelData.AuthBuyerID)); - parcelDataMap.Add("Bitmap", OSD.FromBinary(parcelPropertiesPacket.ParcelData.Bitmap)); - parcelDataMap.Add("Category", OSD.FromInteger((int)parcelPropertiesPacket.ParcelData.Category)); - parcelDataMap.Add("ClaimDate", OSD.FromInteger(parcelPropertiesPacket.ParcelData.ClaimDate)); - parcelDataMap.Add("ClaimPrice", OSD.FromInteger(parcelPropertiesPacket.ParcelData.ClaimPrice)); - parcelDataMap.Add("Desc", OSD.FromString(Utils.BytesToString(parcelPropertiesPacket.ParcelData.Desc))); - parcelDataMap.Add("GroupID", OSD.FromUUID(parcelPropertiesPacket.ParcelData.GroupID)); - parcelDataMap.Add("GroupPrims", OSD.FromInteger(parcelPropertiesPacket.ParcelData.GroupPrims)); - parcelDataMap.Add("IsGroupOwned", OSD.FromBoolean(parcelPropertiesPacket.ParcelData.IsGroupOwned)); - parcelDataMap.Add("LandingType", OSD.FromInteger(parcelPropertiesPacket.ParcelData.LandingType)); - parcelDataMap.Add("LocalID", OSD.FromInteger(parcelPropertiesPacket.ParcelData.LocalID)); - parcelDataMap.Add("MaxPrims", OSD.FromInteger(parcelPropertiesPacket.ParcelData.MaxPrims)); - parcelDataMap.Add("MediaAutoScale", OSD.FromInteger((int)parcelPropertiesPacket.ParcelData.MediaAutoScale)); - parcelDataMap.Add("MediaID", OSD.FromUUID(parcelPropertiesPacket.ParcelData.MediaID)); - parcelDataMap.Add("MediaURL", OSD.FromString(Utils.BytesToString(parcelPropertiesPacket.ParcelData.MediaURL))); - parcelDataMap.Add("MusicURL", OSD.FromString(Utils.BytesToString(parcelPropertiesPacket.ParcelData.MusicURL))); - parcelDataMap.Add("Name", OSD.FromString(Utils.BytesToString(parcelPropertiesPacket.ParcelData.Name))); - parcelDataMap.Add("OtherCleanTime", OSD.FromInteger(parcelPropertiesPacket.ParcelData.OtherCleanTime)); - parcelDataMap.Add("OtherCount", OSD.FromInteger(parcelPropertiesPacket.ParcelData.OtherCount)); - parcelDataMap.Add("OtherPrims", OSD.FromInteger(parcelPropertiesPacket.ParcelData.OtherPrims)); - parcelDataMap.Add("OwnerID", OSD.FromUUID(parcelPropertiesPacket.ParcelData.OwnerID)); - parcelDataMap.Add("OwnerPrims", OSD.FromInteger(parcelPropertiesPacket.ParcelData.OwnerPrims)); - parcelDataMap.Add("ParcelFlags", OSD.FromBinary(uintToByteArray(parcelPropertiesPacket.ParcelData.ParcelFlags))); - parcelDataMap.Add("ParcelPrimBonus", OSD.FromReal(parcelPropertiesPacket.ParcelData.ParcelPrimBonus)); - parcelDataMap.Add("PassHours", OSD.FromReal(parcelPropertiesPacket.ParcelData.PassHours)); - parcelDataMap.Add("PassPrice", OSD.FromInteger(parcelPropertiesPacket.ParcelData.PassPrice)); - parcelDataMap.Add("PublicCount", OSD.FromInteger(parcelPropertiesPacket.ParcelData.PublicCount)); - parcelDataMap.Add("RegionDenyAnonymous", OSD.FromBoolean(parcelPropertiesPacket.ParcelData.RegionDenyAnonymous)); - parcelDataMap.Add("RegionDenyIdentified", OSD.FromBoolean(parcelPropertiesPacket.ParcelData.RegionDenyIdentified)); - parcelDataMap.Add("RegionDenyTransacted", OSD.FromBoolean(parcelPropertiesPacket.ParcelData.RegionDenyTransacted)); - - parcelDataMap.Add("RegionPushOverride", OSD.FromBoolean(parcelPropertiesPacket.ParcelData.RegionPushOverride)); - parcelDataMap.Add("RentPrice", OSD.FromInteger(parcelPropertiesPacket.ParcelData.RentPrice)); - parcelDataMap.Add("RequestResult", OSD.FromInteger(parcelPropertiesPacket.ParcelData.RequestResult)); - parcelDataMap.Add("SalePrice", OSD.FromInteger(parcelPropertiesPacket.ParcelData.SalePrice)); - parcelDataMap.Add("SelectedPrims", OSD.FromInteger(parcelPropertiesPacket.ParcelData.SelectedPrims)); - parcelDataMap.Add("SelfCount", OSD.FromInteger(parcelPropertiesPacket.ParcelData.SelfCount)); - parcelDataMap.Add("SequenceID", OSD.FromInteger(parcelPropertiesPacket.ParcelData.SequenceID)); - parcelDataMap.Add("SimWideMaxPrims", OSD.FromInteger(parcelPropertiesPacket.ParcelData.SimWideMaxPrims)); - parcelDataMap.Add("SimWideTotalPrims", OSD.FromInteger(parcelPropertiesPacket.ParcelData.SimWideTotalPrims)); - parcelDataMap.Add("SnapSelection", OSD.FromBoolean(parcelPropertiesPacket.ParcelData.SnapSelection)); - parcelDataMap.Add("SnapshotID", OSD.FromUUID(parcelPropertiesPacket.ParcelData.SnapshotID)); - parcelDataMap.Add("Status", OSD.FromInteger((int)parcelPropertiesPacket.ParcelData.Status)); - parcelDataMap.Add("TotalPrims", OSD.FromInteger(parcelPropertiesPacket.ParcelData.TotalPrims)); - - OSDArray UserLocation = new OSDArray(3); - UserLocation.Add(OSD.FromReal(parcelPropertiesPacket.ParcelData.UserLocation.X)); - UserLocation.Add(OSD.FromReal(parcelPropertiesPacket.ParcelData.UserLocation.Y)); - UserLocation.Add(OSD.FromReal(parcelPropertiesPacket.ParcelData.UserLocation.Z)); - parcelDataMap.Add("UserLocation", UserLocation); - - OSDArray UserLookAt = new OSDArray(3); - UserLookAt.Add(OSD.FromReal(parcelPropertiesPacket.ParcelData.UserLookAt.X)); - UserLookAt.Add(OSD.FromReal(parcelPropertiesPacket.ParcelData.UserLookAt.Y)); - UserLookAt.Add(OSD.FromReal(parcelPropertiesPacket.ParcelData.UserLookAt.Z)); - parcelDataMap.Add("UserLookAt", UserLookAt); - - parcelData.Add(parcelDataMap); - body.Add("ParcelData", parcelData); - parcelProperties.Add("body", body); - parcelProperties.Add("message", OSD.FromString("ParcelProperties")); - - return parcelProperties; - } - public static OSD GroupMembership(AgentGroupDataUpdatePacket groupUpdatePacket) { OSDMap groupUpdate = new OSDMap(); @@ -497,5 +386,14 @@ namespace OpenSim.Region.CoreModules.Framework.EventQueue return placesReply; } + public static OSD ParcelProperties(ParcelPropertiesMessage parcelPropertiesMessage) + { + OSDMap message = new OSDMap(); + message.Add("message", OSD.FromString("ParcelProperties")); + OSD message_body = parcelPropertiesMessage.Serialize(); + message.Add("body", message_body); + return message; + } + } } diff --git a/OpenSim/Region/CoreModules/Framework/InventoryAccess/HGAssetMapper.cs b/OpenSim/Region/CoreModules/Framework/InventoryAccess/HGAssetMapper.cs index b13b9d8fc5..ccb892e1e4 100644 --- a/OpenSim/Region/CoreModules/Framework/InventoryAccess/HGAssetMapper.cs +++ b/OpenSim/Region/CoreModules/Framework/InventoryAccess/HGAssetMapper.cs @@ -95,7 +95,7 @@ namespace OpenSim.Region.CoreModules.Framework.InventoryAccess try { asset1.ID = url + "/" + asset.ID; - UUID temp = UUID.Zero; +// UUID temp = UUID.Zero; // TODO: if the creator is local, stick this grid's URL in front //if (UUID.TryParse(asset.Metadata.CreatorID, out temp)) // asset1.Metadata.CreatorID = ??? + "/" + asset.Metadata.CreatorID; diff --git a/OpenSim/Region/CoreModules/Framework/InventoryAccess/HGInventoryAccessModule.cs b/OpenSim/Region/CoreModules/Framework/InventoryAccess/HGInventoryAccessModule.cs index 8ccc941c18..125a397d0e 100644 --- a/OpenSim/Region/CoreModules/Framework/InventoryAccess/HGInventoryAccessModule.cs +++ b/OpenSim/Region/CoreModules/Framework/InventoryAccess/HGInventoryAccessModule.cs @@ -1,4 +1,4 @@ -/* +/* * Copyright (c) Contributors, http://opensimulator.org/ * See CONTRIBUTORS.TXT for a full list of copyright holders. * @@ -54,7 +54,7 @@ namespace OpenSim.Region.CoreModules.Framework.InventoryAccess get { return m_assMapper; } } - private bool m_Initialized = false; +// private bool m_Initialized = false; #region INonSharedRegionModule @@ -132,7 +132,7 @@ namespace OpenSim.Region.CoreModules.Framework.InventoryAccess } // DO NOT OVERRIDE THE BASE METHOD - public virtual UUID DeleteToInventory(DeRezAction action, UUID folderID, + public new virtual UUID DeleteToInventory(DeRezAction action, UUID folderID, SceneObjectGroup objectGroup, IClientAPI remoteClient) { UUID assetID = base.DeleteToInventory(action, folderID, new List() {objectGroup}, remoteClient); diff --git a/OpenSim/Region/CoreModules/Framework/InventoryAccess/InventoryAccessModule.cs b/OpenSim/Region/CoreModules/Framework/InventoryAccess/InventoryAccessModule.cs index 1a7da61105..67732ffd75 100644 --- a/OpenSim/Region/CoreModules/Framework/InventoryAccess/InventoryAccessModule.cs +++ b/OpenSim/Region/CoreModules/Framework/InventoryAccess/InventoryAccessModule.cs @@ -1,4 +1,4 @@ -/* +/* * Copyright (c) Contributors, http://opensimulator.org/ * See CONTRIBUTORS.TXT for a full list of copyright holders. * @@ -196,13 +196,27 @@ namespace OpenSim.Region.CoreModules.Framework.InventoryAccess // currently calls this with multiple items. UUID ret = UUID.Zero; + Dictionary> deletes = + new Dictionary>(); + foreach (SceneObjectGroup g in objectGroups) - ret = DeleteToInventory(action, folderID, g, remoteClient); + { + if (!deletes.ContainsKey(g.OwnerID)) + deletes[g.OwnerID] = new List(); + + deletes[g.OwnerID].Add(g); + } + + foreach (List objlist in deletes.Values) + { + foreach (SceneObjectGroup g in objlist) + ret = DeleteToInventory(action, folderID, g, remoteClient); + } return ret; } - public virtual UUID DeleteToInventory(DeRezAction action, UUID folderID, + private UUID DeleteToInventory(DeRezAction action, UUID folderID, SceneObjectGroup objectGroup, IClientAPI remoteClient) { UUID assetID = UUID.Zero; @@ -315,10 +329,20 @@ namespace OpenSim.Region.CoreModules.Framework.InventoryAccess } else { - // Catch all. Use lost & found - // + if (remoteClient == null || + objectGroup.OwnerID != remoteClient.AgentId) + { + // Taking copy of another person's item. Take to + // Objects folder. + folder = m_Scene.InventoryService.GetFolderForType(userID, AssetType.Object); + } + else + { + // Catch all. Use lost & found + // - folder = m_Scene.InventoryService.GetFolderForType(userID, AssetType.LostAndFoundFolder); + folder = m_Scene.InventoryService.GetFolderForType(userID, AssetType.LostAndFoundFolder); + } } } @@ -346,6 +370,7 @@ namespace OpenSim.Region.CoreModules.Framework.InventoryAccess item = new InventoryItemBase(); item.CreatorId = objectGroup.RootPart.CreatorID.ToString(); + item.CreatorData = objectGroup.RootPart.CreatorData; item.ID = UUID.Random(); item.InvType = (int)InventoryType.Object; item.Folder = folder.ID; @@ -425,7 +450,7 @@ namespace OpenSim.Region.CoreModules.Framework.InventoryAccess item.Name = asset.Name; item.AssetType = asset.Type; - m_Scene.InventoryService.AddItem(item); + m_Scene.AddInventoryItem(item); if (remoteClient != null && item.Owner == remoteClient.AgentId) { @@ -526,7 +551,7 @@ namespace OpenSim.Region.CoreModules.Framework.InventoryAccess group.RootPart.CreateSelected = true; if (!m_Scene.Permissions.CanRezObject( - group.Children.Count, remoteClient.AgentId, pos) + group.PrimCount, remoteClient.AgentId, pos) && !attachment) { // The client operates in no fail mode. It will @@ -543,14 +568,22 @@ namespace OpenSim.Region.CoreModules.Framework.InventoryAccess if (attachment) { - group.RootPart.ObjectFlags |= (uint)PrimFlags.Phantom; + group.RootPart.Flags |= PrimFlags.Phantom; group.RootPart.IsAttachment = true; - } - // If we're rezzing an attachment then don't ask AddNewSceneObject() to update the client since - // we'll be doing that later on. Scheduling more than one full update during the attachment - // process causes some clients to fail to display the attachment properly. - m_Scene.AddNewSceneObject(group, true, false); + // If we're rezzing an attachment then don't ask + // AddNewSceneObject() to update the client since + // we'll be doing that later on. Scheduling more + // than one full update during the attachment + // process causes some clients to fail to display + // the attachment properly. + // Also, don't persist attachments. + m_Scene.AddNewSceneObject(group, false, false); + } + else + { + m_Scene.AddNewSceneObject(group, true, false); + } // m_log.InfoFormat("ray end point for inventory rezz is {0} {1} {2} ", RayEnd.X, RayEnd.Y, RayEnd.Z); // if attachment we set it's asset id so object updates can reflect that @@ -594,8 +627,6 @@ namespace OpenSim.Region.CoreModules.Framework.InventoryAccess rootPart.Name = item.Name; rootPart.Description = item.Description; - List partList = new List(group.Children.Values); - group.SetGroup(remoteClient.ActiveGroupId, remoteClient); if ((rootPart.OwnerID != item.Owner) || (item.CurrentPermissions & 16) != 0) { @@ -605,7 +636,7 @@ namespace OpenSim.Region.CoreModules.Framework.InventoryAccess if (m_Scene.Permissions.PropagatePermissions()) { - foreach (SceneObjectPart part in partList) + foreach (SceneObjectPart part in group.Parts) { part.EveryoneMask = item.EveryOnePermissions; part.NextOwnerMask = item.NextPermissions; @@ -616,7 +647,7 @@ namespace OpenSim.Region.CoreModules.Framework.InventoryAccess } } - foreach (SceneObjectPart part in partList) + foreach (SceneObjectPart part in group.Parts) { if ((part.OwnerID != item.Owner) || (item.CurrentPermissions & 16) != 0) { @@ -639,7 +670,7 @@ namespace OpenSim.Region.CoreModules.Framework.InventoryAccess } // Fire on_rez - group.CreateScriptInstances(0, true, m_Scene.DefaultScriptEngine, 0); + group.CreateScriptInstances(0, true, m_Scene.DefaultScriptEngine, 1); rootPart.ParentGroup.ResumeScripts(); rootPart.ScheduleFullUpdate(); diff --git a/OpenSim/Region/CoreModules/Framework/Library/LibraryModule.cs b/OpenSim/Region/CoreModules/Framework/Library/LibraryModule.cs index 36dae6ba9f..d570608369 100644 --- a/OpenSim/Region/CoreModules/Framework/Library/LibraryModule.cs +++ b/OpenSim/Region/CoreModules/Framework/Library/LibraryModule.cs @@ -1,4 +1,4 @@ -/* +/* * Copyright (c) Contributors, http://opensimulator.org/ * See CONTRIBUTORS.TXT for a full list of copyright holders. * @@ -51,7 +51,7 @@ namespace OpenSim.Region.CoreModules.Framework.Library private static bool m_HasRunOnce = false; private bool m_Enabled = false; - private string m_LibraryName = "OpenSim Library"; +// private string m_LibraryName = "OpenSim Library"; private Scene m_Scene; private ILibraryService m_Library; @@ -173,16 +173,16 @@ namespace OpenSim.Region.CoreModules.Framework.Library m_log.InfoFormat("[LIBRARY MODULE]: Loading library archive {0} ({1})...", iarFileName, simpleName); simpleName = GetInventoryPathFromName(simpleName); - InventoryArchiveReadRequest archread = new InventoryArchiveReadRequest(m_MockScene, uinfo, simpleName, iarFileName); + InventoryArchiveReadRequest archread = new InventoryArchiveReadRequest(m_MockScene, uinfo, simpleName, iarFileName, false); try { - List nodes = archread.Execute(); + HashSet nodes = archread.Execute(); if (nodes != null && nodes.Count == 0) { // didn't find the subfolder with the given name; place it on the top m_log.InfoFormat("[LIBRARY MODULE]: Didn't find {0} in library. Placing archive on the top level", simpleName); archread.Close(); - archread = new InventoryArchiveReadRequest(m_MockScene, uinfo, "/", iarFileName); + archread = new InventoryArchiveReadRequest(m_MockScene, uinfo, "/", iarFileName, false); archread.Execute(); } foreach (InventoryNodeBase node in nodes) @@ -212,13 +212,13 @@ namespace OpenSim.Region.CoreModules.Framework.Library } } - private void DumpLibrary() - { - InventoryFolderImpl lib = m_Library.LibraryRootFolder; - - m_log.DebugFormat(" - folder {0}", lib.Name); - DumpFolder(lib); - } +// private void DumpLibrary() +// { +// InventoryFolderImpl lib = m_Library.LibraryRootFolder; +// +// m_log.DebugFormat(" - folder {0}", lib.Name); +// DumpFolder(lib); +// } // // private void DumpLibrary() // { diff --git a/OpenSim/Region/CoreModules/Framework/Statistics/Logging/BinaryLoggingModule.cs b/OpenSim/Region/CoreModules/Framework/Statistics/Logging/BinaryLoggingModule.cs new file mode 100644 index 0000000000..a75ff6234e --- /dev/null +++ b/OpenSim/Region/CoreModules/Framework/Statistics/Logging/BinaryLoggingModule.cs @@ -0,0 +1,169 @@ +/* + * Copyright (c) Contributors, http://opensimulator.org/ + * See CONTRIBUTORS.TXT for a full list of copyright holders. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * * Neither the name of the OpenSimulator Project nor the + * names of its contributors may be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE DEVELOPERS ``AS IS'' AND ANY + * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED + * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + * DISCLAIMED. IN NO EVENT SHALL THE CONTRIBUTORS BE LIABLE FOR ANY + * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES + * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND + * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS + * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +using System; +using System.Collections.Generic; +using System.IO; +using System.Reflection; +using log4net; +using Mono.Addins; +using Nini.Config; +using OpenMetaverse; +using OpenMetaverse.Packets; +using OpenSim.Framework; +using OpenSim.Region.Framework; +using OpenSim.Region.Framework.Interfaces; +using OpenSim.Region.Framework.Scenes; + +namespace OpenSim.Region.CoreModules.Avatar.Attachments +{ + [Extension(Path = "/OpenSim/RegionModules", NodeName = "RegionModule", Id = "BinaryLoggingModule")] + public class BinaryLoggingModule : INonSharedRegionModule + { + private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); + + protected bool m_collectStats; + protected Scene m_scene = null; + + public string Name { get { return "Binary Statistics Logging Module"; } } + public Type ReplaceableInterface { get { return null; } } + + public void Initialise(IConfigSource source) + { + try + { + IConfig statConfig = source.Configs["Statistics.Binary"]; + if (statConfig.Contains("enabled") && statConfig.GetBoolean("enabled")) + { + if (statConfig.Contains("collect_region_stats")) + { + if (statConfig.GetBoolean("collect_region_stats")) + { + m_collectStats = true; + } + } + if (statConfig.Contains("region_stats_period_seconds")) + { + m_statLogPeriod = TimeSpan.FromSeconds(statConfig.GetInt("region_stats_period_seconds")); + } + if (statConfig.Contains("stats_dir")) + { + m_statsDir = statConfig.GetString("stats_dir"); + } + } + } + catch + { + // if it doesn't work, we don't collect anything + } + } + + public void AddRegion(Scene scene) + { + m_scene = scene; + } + + public void RemoveRegion(Scene scene) + { + } + + public void RegionLoaded(Scene scene) + { + if (m_collectStats) + m_scene.StatsReporter.OnSendStatsResult += LogSimStats; + } + + public void Close() + { + } + + public class StatLogger + { + public DateTime StartTime; + public string Path; + public System.IO.BinaryWriter Log; + } + + static StatLogger m_statLog = null; + static TimeSpan m_statLogPeriod = TimeSpan.FromSeconds(300); + static string m_statsDir = String.Empty; + static Object m_statLockObject = new Object(); + + private void LogSimStats(SimStats stats) + { + SimStatsPacket pack = new SimStatsPacket(); + pack.Region = new SimStatsPacket.RegionBlock(); + pack.Region.RegionX = stats.RegionX; + pack.Region.RegionY = stats.RegionY; + pack.Region.RegionFlags = stats.RegionFlags; + pack.Region.ObjectCapacity = stats.ObjectCapacity; + //pack.Region = //stats.RegionBlock; + pack.Stat = stats.StatsBlock; + pack.Header.Reliable = false; + + // note that we are inside the reporter lock when called + DateTime now = DateTime.Now; + + // hide some time information into the packet + pack.Header.Sequence = (uint)now.Ticks; + + lock (m_statLockObject) // m_statLog is shared so make sure there is only executer here + { + try + { + if (m_statLog == null || now > m_statLog.StartTime + m_statLogPeriod) + { + // First log file or time has expired, start writing to a new log file + if (m_statLog != null && m_statLog.Log != null) + { + m_statLog.Log.Close(); + } + m_statLog = new StatLogger(); + m_statLog.StartTime = now; + m_statLog.Path = (m_statsDir.Length > 0 ? m_statsDir + System.IO.Path.DirectorySeparatorChar.ToString() : "") + + String.Format("stats-{0}.log", now.ToString("yyyyMMddHHmmss")); + m_statLog.Log = new BinaryWriter(File.Open(m_statLog.Path, FileMode.Append, FileAccess.Write)); + } + + // Write the serialized data to disk + if (m_statLog != null && m_statLog.Log != null) + m_statLog.Log.Write(pack.ToBytes()); + } + catch (Exception ex) + { + m_log.Error("statistics gathering failed: " + ex.Message, ex); + if (m_statLog != null && m_statLog.Log != null) + { + m_statLog.Log.Close(); + } + m_statLog = null; + } + } + return; + } + } +} diff --git a/OpenSim/Region/CoreModules/Framework/UserManagement/UserManagementModule.cs b/OpenSim/Region/CoreModules/Framework/UserManagement/UserManagementModule.cs new file mode 100644 index 0000000000..0d94baa2fa --- /dev/null +++ b/OpenSim/Region/CoreModules/Framework/UserManagement/UserManagementModule.cs @@ -0,0 +1,310 @@ +/* + * Copyright (c) Contributors, http://opensimulator.org/ + * See CONTRIBUTORS.TXT for a full list of copyright holders. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * * Neither the name of the OpenSimulator Project nor the + * names of its contributors may be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE DEVELOPERS ``AS IS'' AND ANY + * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED + * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + * DISCLAIMED. IN NO EVENT SHALL THE CONTRIBUTORS BE LIABLE FOR ANY + * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES + * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND + * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS + * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ +using System; +using System.Collections.Generic; +using System.IO; +using System.Reflection; + +using OpenSim.Framework; + +using OpenSim.Region.Framework; +using OpenSim.Region.Framework.Interfaces; +using OpenSim.Region.Framework.Scenes; +using OpenSim.Services.Interfaces; + +using OpenMetaverse; +using log4net; +using Nini.Config; + +namespace OpenSim.Region.CoreModules.Framework.UserManagement +{ + struct UserData + { + public UUID Id; + public string FirstName; + public string LastName; + public string ProfileURL; + } + + public class UserManagementModule : ISharedRegionModule, IUserManagement + { + private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); + + private List m_Scenes = new List(); + + // The cache + Dictionary m_UserCache = new Dictionary(); + + #region ISharedRegionModule + + public void Initialise(IConfigSource config) + { + //m_Enabled = config.Configs["Modules"].GetBoolean("LibraryModule", m_Enabled); + //if (m_Enabled) + //{ + // IConfig libConfig = config.Configs["LibraryService"]; + // if (libConfig != null) + // { + // string dllName = libConfig.GetString("LocalServiceModule", string.Empty); + // m_log.Debug("[LIBRARY MODULE]: Library service dll is " + dllName); + // if (dllName != string.Empty) + // { + // Object[] args = new Object[] { config }; + // m_Library = ServerUtils.LoadPlugin(dllName, args); + // } + // } + //} + } + + public bool IsSharedModule + { + get { return true; } + } + + public string Name + { + get { return "UserManagement Module"; } + } + + public Type ReplaceableInterface + { + get { return null; } + } + + public void AddRegion(Scene scene) + { + m_Scenes.Add(scene); + + scene.RegisterModuleInterface(this); + scene.EventManager.OnNewClient += new EventManager.OnNewClientDelegate(EventManager_OnNewClient); + } + + public void RemoveRegion(Scene scene) + { + scene.UnregisterModuleInterface(this); + m_Scenes.Remove(scene); + } + + public void RegionLoaded(Scene scene) + { + } + + public void PostInitialise() + { + foreach (Scene s in m_Scenes) + { + // let's sniff all the user names referenced by objects in the scene + m_log.DebugFormat("[USER MANAGEMENT MODULE]: Caching creators' data from {0} ({1} objects)...", s.RegionInfo.RegionName, s.GetEntities().Length); + s.ForEachSOG(delegate(SceneObjectGroup sog) { CacheCreators(sog); }); + } + } + + public void Close() + { + m_Scenes.Clear(); + m_UserCache.Clear(); + } + + #endregion ISharedRegionModule + + + #region Event Handlers + + void EventManager_OnNewClient(IClientAPI client) + { + client.OnNameFromUUIDRequest += new UUIDNameRequest(HandleUUIDNameRequest); + } + + void HandleUUIDNameRequest(UUID uuid, IClientAPI remote_client) + { + if (m_Scenes[0].LibraryService != null && (m_Scenes[0].LibraryService.LibraryRootFolder.Owner == uuid)) + { + remote_client.SendNameReply(uuid, "Mr", "OpenSim"); + } + else + { + string[] names = GetUserNames(uuid); + if (names.Length == 2) + { + remote_client.SendNameReply(uuid, names[0], names[1]); + } + + } + } + + #endregion Event Handlers + + private void CacheCreators(SceneObjectGroup sog) + { + //m_log.DebugFormat("[USER MANAGEMENT MODULE]: processing {0} {1}; {2}", sog.RootPart.Name, sog.RootPart.CreatorData, sog.RootPart.CreatorIdentification); + AddUser(sog.RootPart.CreatorID, sog.RootPart.CreatorData); + + foreach (SceneObjectPart sop in sog.Parts) + { + AddUser(sop.CreatorID, sop.CreatorData); + foreach (TaskInventoryItem item in sop.TaskInventory.Values) + AddUser(item.CreatorID, item.CreatorData); + } + } + + + private string[] GetUserNames(UUID uuid) + { + string[] returnstring = new string[2]; + + if (m_UserCache.ContainsKey(uuid)) + { + returnstring[0] = m_UserCache[uuid].FirstName; + returnstring[1] = m_UserCache[uuid].LastName; + return returnstring; + } + + UserAccount account = m_Scenes[0].UserAccountService.GetUserAccount(m_Scenes[0].RegionInfo.ScopeID, uuid); + + if (account != null) + { + returnstring[0] = account.FirstName; + returnstring[1] = account.LastName; + + UserData user = new UserData(); + user.FirstName = account.FirstName; + user.LastName = account.LastName; + + lock (m_UserCache) + m_UserCache[uuid] = user; + } + else + { + returnstring[0] = "Unknown"; + returnstring[1] = "User"; + } + + return returnstring; + } + + #region IUserManagement + + public string GetUserName(UUID uuid) + { + string[] names = GetUserNames(uuid); + if (names.Length == 2) + { + string firstname = names[0]; + string lastname = names[1]; + + return firstname + " " + lastname; + + } + return "(hippos)"; + } + + public void AddUser(UUID id, string creatorData) + { + if (m_UserCache.ContainsKey(id)) + return; + + UserData user = new UserData(); + user.Id = id; + + UserAccount account = m_Scenes[0].UserAccountService.GetUserAccount(m_Scenes[0].RegionInfo.ScopeID, id); + + if (account != null) + { + user.FirstName = account.FirstName; + user.LastName = account.LastName; + // user.ProfileURL = we should initialize this to the default + } + else + { + if (creatorData != null && creatorData != string.Empty) + { + //creatorData = ; + + string[] parts = creatorData.Split(';'); + if (parts.Length >= 1) + { + user.ProfileURL = parts[0]; + try + { + Uri uri = new Uri(parts[0]); + user.LastName = "@" + uri.Authority; + } + catch + { + m_log.DebugFormat("[SCENE]: Unable to parse Uri {0}", parts[0]); + user.LastName = "@unknown"; + } + } + if (parts.Length >= 2) + user.FirstName = parts[1].Replace(' ', '.'); + } + else + { + user.FirstName = "Unknown"; + user.LastName = "User"; + } + } + + lock (m_UserCache) + m_UserCache[id] = user; + + m_log.DebugFormat("[USER MANAGEMENT MODULE]: Added user {0} {1} {2} {3}", user.Id, user.FirstName, user.LastName, user.ProfileURL); + } + + //public void AddUser(UUID uuid, string userData) + //{ + // if (m_UserCache.ContainsKey(uuid)) + // return; + + // UserData user = new UserData(); + // user.Id = uuid; + + // // userData = ; + // string[] parts = userData.Split(';'); + // if (parts.Length >= 1) + // user.ProfileURL = parts[0].Trim(); + // if (parts.Length >= 2) + // { + // string[] name = parts[1].Trim().Split(' '); + // if (name.Length >= 1) + // user.FirstName = name[0]; + // if (name.Length >= 2) + // user.LastName = name[1]; + // else + // user.LastName = "?"; + // } + + // lock (m_UserCache) + // m_UserCache.Add(uuid, user); + + // m_log.DebugFormat("[USER MANAGEMENT MODULE]: Added user {0} {1} {2} {3}", user.Id, user.FirstName, user.LastName, user.ProfileURL); + + //} + + #endregion IUserManagement + } +} diff --git a/OpenSim/Region/CoreModules/InterGrid/OpenGridProtocolModule.cs b/OpenSim/Region/CoreModules/InterGrid/OpenGridProtocolModule.cs index e95d2f8fef..fd0e879e05 100644 --- a/OpenSim/Region/CoreModules/InterGrid/OpenGridProtocolModule.cs +++ b/OpenSim/Region/CoreModules/InterGrid/OpenGridProtocolModule.cs @@ -91,7 +91,7 @@ namespace OpenSim.Region.CoreModules.InterGrid private string httpsCN = ""; private bool httpSSL = false; private uint httpsslport = 0; - private bool GridMode = false; +// private bool GridMode = false; #region IRegionModule Members @@ -100,7 +100,7 @@ namespace OpenSim.Region.CoreModules.InterGrid bool enabled = false; IConfig cfg = null; IConfig httpcfg = null; - IConfig startupcfg = null; +// IConfig startupcfg = null; try { cfg = config.Configs["OpenGridProtocol"]; @@ -117,19 +117,19 @@ namespace OpenSim.Region.CoreModules.InterGrid { } - try - { - startupcfg = config.Configs["Startup"]; - } - catch (NullReferenceException) - { +// try +// { +// startupcfg = config.Configs["Startup"]; +// } +// catch (NullReferenceException) +// { +// +// } - } - - if (startupcfg != null) - { - GridMode = enabled = startupcfg.GetBoolean("gridmode", false); - } +// if (startupcfg != null) +// { +// GridMode = enabled = startupcfg.GetBoolean("gridmode", false); +// } if (cfg != null) { @@ -1213,18 +1213,19 @@ namespace OpenSim.Region.CoreModules.InterGrid } } - private string CreateRandomStr(int len) - { - Random rnd = new Random(Environment.TickCount); - string returnstring = ""; - string chars = "abcdefghijklmnopqrstuvwxyz0123456789"; - - for (int i = 0; i < len; i++) - { - returnstring += chars.Substring(rnd.Next(chars.Length), 1); - } - return returnstring; - } +// private string CreateRandomStr(int len) +// { +// Random rnd = new Random(Environment.TickCount); +// string returnstring = ""; +// string chars = "abcdefghijklmnopqrstuvwxyz0123456789"; +// +// for (int i = 0; i < len; i++) +// { +// returnstring += chars.Substring(rnd.Next(chars.Length), 1); +// } +// return returnstring; +// } + // Temporary hack to allow teleporting to and from Vaak private static bool customXertificateValidation(object sender, X509Certificate cert, X509Chain chain, SslPolicyErrors error) { diff --git a/OpenSim/Region/CoreModules/LightShare/LightShareModule.cs b/OpenSim/Region/CoreModules/LightShare/LightShareModule.cs index e6cab1d381..88f392dcdb 100644 --- a/OpenSim/Region/CoreModules/LightShare/LightShareModule.cs +++ b/OpenSim/Region/CoreModules/LightShare/LightShareModule.cs @@ -91,6 +91,7 @@ namespace OpenSim.Region.CoreModules.World.LightShare m_scene.EventManager.OnMakeRootAgent += EventManager_OnMakeRootAgent; m_scene.EventManager.OnSaveNewWindlightProfile += EventManager_OnSaveNewWindlightProfile; m_scene.EventManager.OnSendNewWindlightProfileTargeted += EventManager_OnSendNewWindlightProfileTargeted; + m_scene.LoadWindlightProfile(); } InstallCommands(); @@ -193,7 +194,8 @@ namespace OpenSim.Region.CoreModules.World.LightShare } private void EventManager_OnSaveNewWindlightProfile() { - m_scene.ForEachScenePresence(SendProfileToClient); + if (m_scene.RegionInfo.WindlightSettings.valid) + m_scene.ForEachScenePresence(SendProfileToClient); } public void PostInitialise() diff --git a/OpenSim/Region/CoreModules/RegionSync/RegionSyncModule/RegionSyncAvatar.cs b/OpenSim/Region/CoreModules/RegionSync/RegionSyncModule/RegionSyncAvatar.cs index 717e660306..0eb046a0fa 100644 --- a/OpenSim/Region/CoreModules/RegionSync/RegionSyncModule/RegionSyncAvatar.cs +++ b/OpenSim/Region/CoreModules/RegionSync/RegionSyncModule/RegionSyncAvatar.cs @@ -88,7 +88,7 @@ namespace OpenSim.Region.CoreModules.RegionSync.RegionSyncModule public event DeRezObject OnDeRezObject; public event Action OnRegionHandShakeReply; - public event GenericCall2 OnRequestWearables; + public event GenericCall1 OnRequestWearables; public event GenericCall1 OnCompleteMovementToRegion; public event UpdateAgent OnPreAgentUpdate; public event UpdateAgent OnAgentUpdate; @@ -571,6 +571,14 @@ namespace OpenSim.Region.CoreModules.RegionSync.RegionSyncModule { } + public void SendTeleportStart(uint flags) + { + } + + public void SendTeleportProgress(uint flags, string message) + { + } + public virtual void SendTeleportLocationStart() { } diff --git a/OpenSim/Region/CoreModules/RegionSync/RegionSyncModule/RegionSyncClient.cs b/OpenSim/Region/CoreModules/RegionSync/RegionSyncModule/RegionSyncClient.cs index d51b6f265e..09e498ec54 100644 --- a/OpenSim/Region/CoreModules/RegionSync/RegionSyncModule/RegionSyncClient.cs +++ b/OpenSim/Region/CoreModules/RegionSync/RegionSyncModule/RegionSyncClient.cs @@ -679,24 +679,8 @@ namespace OpenSim.Region.CoreModules.RegionSync.RegionSyncModule Primitive.TextureEntry te = Primitive.TextureEntry.FromOSD(data["te"]); byte[] vp = data["vp"].AsBinary(); - bool missingBakes = false; - byte[] BAKE_INDICES = new byte[] { 8, 9, 10, 11, 19, 20 }; - for (int i = 0; i < BAKE_INDICES.Length; i++) - { - int j = BAKE_INDICES[i]; - Primitive.TextureEntryFace face = te.FaceTextures[j]; - if (face != null && face.TextureID != AppearanceManager.DEFAULT_AVATAR_TEXTURE) - { - if (m_scene.AssetService.Get(face.TextureID.ToString()) == null) - { - RegionSyncMessage.HandlerDebug(LogHeader, msg, "Missing baked texture " + face.TextureID + " (" + j + ") for avatar " + name); - missingBakes = true; - } - } - } - - //m_log.WarnFormat("{0} Calling presence.SetAppearance for {1} (\"{2}\") {3}", LogHeader, agentID, presence.Name, missingBakes ? "MISSING BAKES" : "GOT BAKES"); - presence.SetAppearance(te, vp); + m_log.WarnFormat("{0} Calling presence.SetAppearance for {1} (\"{2}\")", LogHeader, agentID, presence.Name); + m_scene.AvatarFactory.SetAppearance(presence.ControllingClient, te, vp); RegionSyncMessage.HandleSuccess(LogHeader, msg, String.Format("Set appearance for {0}", name)); } else @@ -981,7 +965,7 @@ namespace OpenSim.Region.CoreModules.RegionSync.RegionSyncModule // Set the appearance on the presence. This will generate the needed exchange with the client if rebakes need to take place. m_log.WarnFormat("{0} Setting appearance on ScenePresence {1} \"{2}\"", LogHeader, sp.UUID, sp.Name); - sp.SetAppearance(te, vp); + m_scene.AvatarFactory.SetAppearance(sp.ControllingClient, te, vp); if (te != null) { diff --git a/OpenSim/Region/CoreModules/RegionSync/RegionSyncModule/RegionSyncClientView.cs b/OpenSim/Region/CoreModules/RegionSync/RegionSyncModule/RegionSyncClientView.cs index 07aa077dca..688b00d362 100644 --- a/OpenSim/Region/CoreModules/RegionSync/RegionSyncModule/RegionSyncClientView.cs +++ b/OpenSim/Region/CoreModules/RegionSync/RegionSyncModule/RegionSyncClientView.cs @@ -312,7 +312,7 @@ namespace OpenSim.Region.CoreModules.RegionSync.RegionSyncModule } case RegionSyncMessage.MsgType.GetObjects: { - List entities = m_scene.GetEntities(); + EntityBase[] entities = m_scene.GetEntities(); foreach(EntityBase e in entities) { if (e is SceneObjectGroup) @@ -484,7 +484,7 @@ namespace OpenSim.Region.CoreModules.RegionSync.RegionSyncModule ScenePresence presence; if (m_scene.TryGetScenePresence(agentID, out presence)) { - int delay = 30000; + int delay = 5000; string name = presence.Name; m_log.WarnFormat("{0} Waiting {1}ms before setting appearance on presence {2} <{3}>", LogHeader, delay, name, msgID); Timer appearanceSetter = new Timer(delegate(object obj) @@ -493,36 +493,17 @@ namespace OpenSim.Region.CoreModules.RegionSync.RegionSyncModule Primitive.TextureEntry te = Primitive.TextureEntry.FromOSD(data["te"]); byte[] vp = data["vp"].AsBinary(); - bool missingBakes = false; - byte[] BAKE_INDICES = new byte[] { 8, 9, 10, 11, 19, 20 }; - for (int i = 0; i < BAKE_INDICES.Length; i++) - { - int j = BAKE_INDICES[i]; - Primitive.TextureEntryFace face = te.FaceTextures[j]; - if (face != null && face.TextureID != AppearanceManager.DEFAULT_AVATAR_TEXTURE) - { - if (m_scene.AssetService.Get(face.TextureID.ToString()) == null) - { - RegionSyncMessage.HandlerDebug(LogHeader, msg, "Missing baked texture " + face.TextureID + " (" + j + ") for avatar " + name); - missingBakes = true; - } - } - } - - m_log.DebugFormat("{0} {1} Calling presence.SetAppearance {2} <{3}>", LogHeader, name, (missingBakes ? "MISSING BAKES" : "GOT BAKES"), msgID); + m_log.DebugFormat("{0} {1} Calling presence.SetAppearance <{2}>", LogHeader, name, msgID); try { - presence.SetAppearance(te, vp); + m_scene.AvatarFactory.SetAppearance(presence.ControllingClient, te, vp); } catch (Exception e) { m_log.WarnFormat("{0} Caught exception setting appearance for {1} (probably was removed from scene): {2}", LogHeader, name, e.Message); } - if (!missingBakes) - RegionSyncMessage.HandleSuccess(LogHeader, msg, String.Format("Set appearance for {0} <{1}>", name, msgID)); - else - RegionSyncMessage.HandleWarning(LogHeader, msg, String.Format("Set appearance for {0} but has missing bakes. <{1}>", name, msgID)); - m_log.DebugFormat("{0} Calling RegionsSyncServerModule.SendAppearance for {1} {2} <{3}>", LogHeader, name, (missingBakes ? "MISSING BAKES" : "GOT BAKES"), msgID); + RegionSyncMessage.HandleSuccess(LogHeader, msg, String.Format("Set appearance for {0} <{1}>", name, msgID)); + m_log.DebugFormat("{0} Calling RegionsSyncServerModule.SendAppearance for {1} <{2}>", LogHeader, name, msgID); m_scene.RegionSyncServerModule.SendAppearance(presence.UUID, presence.Appearance.VisualParams, presence.Appearance.Texture); lock (m_appearanceTimers) m_appearanceTimers.Remove(agentID); diff --git a/OpenSim/Region/CoreModules/RegionSync/RegionSyncModule/SceneToScriptEngineConnector.cs b/OpenSim/Region/CoreModules/RegionSync/RegionSyncModule/SceneToScriptEngineConnector.cs index 6e9e174eb4..258ce57482 100644 --- a/OpenSim/Region/CoreModules/RegionSync/RegionSyncModule/SceneToScriptEngineConnector.cs +++ b/OpenSim/Region/CoreModules/RegionSync/RegionSyncModule/SceneToScriptEngineConnector.cs @@ -609,7 +609,7 @@ namespace OpenSim.Region.CoreModules.RegionSync.RegionSyncModule //a certain space. (Or use DB that supports spatial queries.) List GetObjectsInGivenSpace(Scene scene, Dictionary quarkSubscriptions) { - List entities = m_scene.GetEntities(); + EntityBase[] entities = m_scene.GetEntities(); List sogList = new List(); foreach (EntityBase e in entities) { diff --git a/OpenSim/Region/CoreModules/RegionSync/RegionSyncModule/SceneToScriptEngineSyncServer.cs b/OpenSim/Region/CoreModules/RegionSync/RegionSyncModule/SceneToScriptEngineSyncServer.cs index 7c94e6ce0b..c430be939d 100644 --- a/OpenSim/Region/CoreModules/RegionSync/RegionSyncModule/SceneToScriptEngineSyncServer.cs +++ b/OpenSim/Region/CoreModules/RegionSync/RegionSyncModule/SceneToScriptEngineSyncServer.cs @@ -513,7 +513,7 @@ namespace OpenSim.Region.CoreModules.RegionSync.RegionSyncModule else { //Before the load is migrated from overloaded script engine to the idle engine, sync with the DB to update the state in DB - List entities = m_scene.GetEntities(); + EntityBase[] entities = m_scene.GetEntities(); foreach (EntityBase entity in entities) { if (!entity.IsDeleted && entity is SceneObjectGroup && ((SceneObjectGroup)entity).HasGroupChanged) diff --git a/OpenSim/Region/CoreModules/RegionSync/RegionSyncModule/ScriptEngineToSceneConnector.cs b/OpenSim/Region/CoreModules/RegionSync/RegionSyncModule/ScriptEngineToSceneConnector.cs index 6e48a82b7f..95719aeddb 100644 --- a/OpenSim/Region/CoreModules/RegionSync/RegionSyncModule/ScriptEngineToSceneConnector.cs +++ b/OpenSim/Region/CoreModules/RegionSync/RegionSyncModule/ScriptEngineToSceneConnector.cs @@ -1050,7 +1050,7 @@ namespace OpenSim.Region.CoreModules.RegionSync.RegionSyncModule //set the LocX,LocY information of each object's copy, so that later we can figure out which SEtoSceneConnector to forwards setproperty request OpenSim.Services.Interfaces.GridRegion regionInfo = m_validLocalScene.GridService.GetRegionByName(UUID.Zero, regionName); - List entities = m_validLocalScene.GetEntities(); + EntityBase[] entities = m_validLocalScene.GetEntities(); foreach (EntityBase group in entities) { if (group is SceneObjectGroup) @@ -1083,7 +1083,7 @@ namespace OpenSim.Region.CoreModules.RegionSync.RegionSyncModule m_log.Debug(LogHeader + ": next start script instances"); //m_validLocalScene.CreateScriptInstances(); - List entities = m_validLocalScene.GetEntities(); + EntityBase[] entities = m_validLocalScene.GetEntities(); foreach (EntityBase group in entities) { if (group is SceneObjectGroup) @@ -1313,7 +1313,7 @@ namespace OpenSim.Region.CoreModules.RegionSync.RegionSyncModule //the script's state, and migrate the state to the receiving end. private void HandleScriptStateSyncRequest(RegionSyncMessage msg) { - List entities = m_validLocalScene.GetEntities(); + EntityBase[] entities = m_validLocalScene.GetEntities(); List sogInMigrationSpace = new List(); //Inform the receiving end the script state synchronization now starts. diff --git a/OpenSim/Region/CoreModules/Resources/CoreModulePlugin.addin.xml b/OpenSim/Region/CoreModules/Resources/CoreModulePlugin.addin.xml index ee070756fd..cfa41095c8 100644 --- a/OpenSim/Region/CoreModules/Resources/CoreModulePlugin.addin.xml +++ b/OpenSim/Region/CoreModules/Resources/CoreModulePlugin.addin.xml @@ -8,6 +8,7 @@ + @@ -18,6 +19,7 @@ + @@ -75,6 +77,8 @@ \ \ + \ + \ diff --git a/OpenSim/Region/CoreModules/Scripting/LoadImageURL/LoadImageURLModule.cs b/OpenSim/Region/CoreModules/Scripting/LoadImageURL/LoadImageURLModule.cs index c23cea539a..ed3e516631 100644 --- a/OpenSim/Region/CoreModules/Scripting/LoadImageURL/LoadImageURLModule.cs +++ b/OpenSim/Region/CoreModules/Scripting/LoadImageURL/LoadImageURLModule.cs @@ -176,44 +176,44 @@ namespace OpenSim.Region.CoreModules.Scripting.LoadImageURL stream = response.GetResponseStream(); if (stream != null) { - Bitmap image = new Bitmap(stream); - Size newsize; - - // TODO: make this a bit less hard coded - if ((image.Height < 64) && (image.Width < 64)) - { - newsize = new Size(32, 32); - } - else if ((image.Height < 128) && (image.Width < 128)) - { - newsize = new Size(64, 64); - } - else if ((image.Height < 256) && (image.Width < 256)) - { - newsize = new Size(128, 128); - } - else if ((image.Height < 512 && image.Width < 512)) - { - newsize = new Size(256, 256); - } - else if ((image.Height < 1024 && image.Width < 1024)) - { - newsize = new Size(512, 512); - } - else - { - newsize = new Size(1024, 1024); - } - - Bitmap resize = new Bitmap(image, newsize); - try { + Bitmap image = new Bitmap(stream); + Size newsize; + + // TODO: make this a bit less hard coded + if ((image.Height < 64) && (image.Width < 64)) + { + newsize = new Size(32, 32); + } + else if ((image.Height < 128) && (image.Width < 128)) + { + newsize = new Size(64, 64); + } + else if ((image.Height < 256) && (image.Width < 256)) + { + newsize = new Size(128, 128); + } + else if ((image.Height < 512 && image.Width < 512)) + { + newsize = new Size(256, 256); + } + else if ((image.Height < 1024 && image.Width < 1024)) + { + newsize = new Size(512, 512); + } + else + { + newsize = new Size(1024, 1024); + } + + Bitmap resize = new Bitmap(image, newsize); + imageJ2000 = OpenJPEG.EncodeFromImage(resize, true); } catch (Exception) { - m_log.Error("[LOADIMAGEURLMODULE]: OpenJpeg Encode Failed. Empty byte data returned!"); + m_log.Error("[LOADIMAGEURLMODULE]: OpenJpeg Conversion Failed. Empty byte data returned!"); } } else diff --git a/OpenSim/Region/CoreModules/ServiceConnectorsIn/Hypergrid/HypergridServiceInConnectorModule.cs b/OpenSim/Region/CoreModules/ServiceConnectorsIn/Hypergrid/HypergridServiceInConnectorModule.cs index 235914a0b0..2f96bcb1ab 100644 --- a/OpenSim/Region/CoreModules/ServiceConnectorsIn/Hypergrid/HypergridServiceInConnectorModule.cs +++ b/OpenSim/Region/CoreModules/ServiceConnectorsIn/Hypergrid/HypergridServiceInConnectorModule.cs @@ -115,6 +115,7 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsIn.Hypergrid m_HypergridHandler = new GatekeeperServiceInConnector(m_Config, MainServer.Instance, simService); new UserAgentServerConnector(m_Config, MainServer.Instance); + new HeloServiceInConnector(m_Config, MainServer.Instance, "HeloService"); } scene.RegisterModuleInterface(m_HypergridHandler.GateKeeper); } diff --git a/OpenSim/Region/CoreModules/ServiceConnectorsIn/Land/LandServiceInConnectorModule.cs b/OpenSim/Region/CoreModules/ServiceConnectorsIn/Land/LandServiceInConnectorModule.cs index bce160a92a..23251c9b1c 100644 --- a/OpenSim/Region/CoreModules/ServiceConnectorsIn/Land/LandServiceInConnectorModule.cs +++ b/OpenSim/Region/CoreModules/ServiceConnectorsIn/Land/LandServiceInConnectorModule.cs @@ -121,7 +121,7 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsIn.Land #region ILandService - public LandData GetLandData(ulong regionHandle, uint x, uint y) + public LandData GetLandData(ulong regionHandle, uint x, uint y, out byte regionAccess) { m_log.DebugFormat("[LAND IN CONNECTOR]: GetLandData for {0}. Count = {1}", regionHandle, m_Scenes.Count); @@ -130,10 +130,12 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsIn.Land if (s.RegionInfo.RegionHandle == regionHandle) { m_log.Debug("[LAND IN CONNECTOR]: Found region to GetLandData from"); + regionAccess = s.RegionInfo.AccessLevel; return s.GetLandData(x, y); } } m_log.DebugFormat("[LAND IN CONNECTOR]: region handle {0} not found", regionHandle); + regionAccess = 42; return null; } diff --git a/OpenSim/Region/CoreModules/ServiceConnectorsOut/Asset/HGAssetBroker.cs b/OpenSim/Region/CoreModules/ServiceConnectorsOut/Asset/HGAssetBroker.cs index 034e69272e..e31be21a8c 100644 --- a/OpenSim/Region/CoreModules/ServiceConnectorsOut/Asset/HGAssetBroker.cs +++ b/OpenSim/Region/CoreModules/ServiceConnectorsOut/Asset/HGAssetBroker.cs @@ -219,11 +219,8 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Asset else asset = m_GridService.Get(id); - if (asset != null) - { - if (m_Cache != null) - m_Cache.Cache(asset); - } + if (m_Cache != null) + m_Cache.Cache(asset); return asset; } @@ -273,18 +270,10 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Asset } if (IsHG(id)) - asset = m_HGService.Get(id); + return m_HGService.GetData(id); else - asset = m_GridService.Get(id); + return m_GridService.GetData(id); - if (asset != null) - { - if (m_Cache != null) - m_Cache.Cache(asset); - return asset.Data; - } - - return null; } public bool Get(string id, Object sender, AssetRetrieved handler) @@ -304,7 +293,7 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Asset { return m_HGService.Get(id, sender, delegate (string assetID, Object s, AssetBase a) { - if (a != null && m_Cache != null) + if (m_Cache != null) m_Cache.Cache(a); handler(assetID, s, a); }); @@ -313,7 +302,7 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Asset { return m_GridService.Get(id, sender, delegate (string assetID, Object s, AssetBase a) { - if (a != null && m_Cache != null) + if (m_Cache != null) m_Cache.Cache(a); handler(assetID, s, a); }); @@ -331,12 +320,30 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Asset m_Cache.Cache(asset); if (asset.Temporary || asset.Local) + { + if (m_Cache != null) + m_Cache.Cache(asset); return asset.ID; + } + string id = string.Empty; if (IsHG(asset.ID)) - return m_HGService.Store(asset); + id = m_HGService.Store(asset); else - return m_GridService.Store(asset); + id = m_GridService.Store(asset); + + if (id != String.Empty) + { + // Placing this here, so that this work with old asset servers that don't send any reply back + // SynchronousRestObjectRequester returns somethins that is not an empty string + if (id != null) + asset.ID = id; + + if (m_Cache != null) + m_Cache.Cache(asset); + } + return id; + } public bool UpdateContent(string id, byte[] data) @@ -363,10 +370,16 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Asset if (m_Cache != null) m_Cache.Expire(id); + bool result = false; if (IsHG(id)) - return m_HGService.Delete(id); + result = m_HGService.Delete(id); else - return m_GridService.Delete(id); + result = m_GridService.Delete(id); + + if (result && m_Cache != null) + m_Cache.Expire(id); + + return result; } #region IHyperAssetService diff --git a/OpenSim/Region/CoreModules/ServiceConnectorsOut/Avatar/LocalAvatarServiceConnector.cs b/OpenSim/Region/CoreModules/ServiceConnectorsOut/Avatar/LocalAvatarServiceConnector.cs index 47f19a3038..9ee19f8f25 100644 --- a/OpenSim/Region/CoreModules/ServiceConnectorsOut/Avatar/LocalAvatarServiceConnector.cs +++ b/OpenSim/Region/CoreModules/ServiceConnectorsOut/Avatar/LocalAvatarServiceConnector.cs @@ -30,6 +30,7 @@ using System.Collections.Generic; using System.Reflection; using log4net; using Nini.Config; +using OpenSim.Framework; using OpenSim.Region.Framework.Interfaces; using OpenSim.Region.Framework.Scenes; using OpenSim.Server.Base; @@ -137,6 +138,16 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Avatar #region IAvatarService + public AvatarAppearance GetAppearance(UUID userID) + { + return m_AvatarService.GetAppearance(userID); + } + + public bool SetAppearance(UUID userID, AvatarAppearance appearance) + { + return m_AvatarService.SetAppearance(userID,appearance); + } + public AvatarData GetAvatar(UUID userID) { return m_AvatarService.GetAvatar(userID); diff --git a/OpenSim/Region/CoreModules/ServiceConnectorsOut/Grid/LocalGridServiceConnector.cs b/OpenSim/Region/CoreModules/ServiceConnectorsOut/Grid/LocalGridServiceConnector.cs index b2e3f4f7f5..023a44c601 100644 --- a/OpenSim/Region/CoreModules/ServiceConnectorsOut/Grid/LocalGridServiceConnector.cs +++ b/OpenSim/Region/CoreModules/ServiceConnectorsOut/Grid/LocalGridServiceConnector.cs @@ -233,6 +233,11 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Grid return m_GridService.GetFallbackRegions(scopeID, x, y); } + public List GetHyperlinks(UUID scopeID) + { + return m_GridService.GetHyperlinks(scopeID); + } + public int GetRegionFlags(UUID scopeID, UUID regionID) { return m_GridService.GetRegionFlags(scopeID, regionID); diff --git a/OpenSim/Region/CoreModules/ServiceConnectorsOut/Grid/Tests/GridConnectorsTests.cs b/OpenSim/Region/CoreModules/ServiceConnectorsOut/Grid/Tests/GridConnectorsTests.cs index 95d8737122..e54ee02f43 100644 --- a/OpenSim/Region/CoreModules/ServiceConnectorsOut/Grid/Tests/GridConnectorsTests.cs +++ b/OpenSim/Region/CoreModules/ServiceConnectorsOut/Grid/Tests/GridConnectorsTests.cs @@ -57,6 +57,10 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Grid.Tests config.Configs["Modules"].Set("GridServices", "LocalGridServicesConnector"); config.Configs["GridService"].Set("LocalServiceModule", "OpenSim.Services.GridService.dll:GridService"); config.Configs["GridService"].Set("StorageProvider", "OpenSim.Data.Null.dll"); + config.Configs["GridService"].Set("Region_Test_Region_1", "DefaultRegion"); + config.Configs["GridService"].Set("Region_Test_Region_2", "FallbackRegion"); + config.Configs["GridService"].Set("Region_Test_Region_3", "FallbackRegion"); + config.Configs["GridService"].Set("Region_Other_Region_4", "FallbackRegion"); m_LocalConnector = new LocalGridServicesConnector(config); } @@ -69,7 +73,7 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Grid.Tests { SetUp(); - // Create 3 regions + // Create 4 regions GridRegion r1 = new GridRegion(); r1.RegionName = "Test Region 1"; r1.RegionID = new UUID(1); @@ -82,7 +86,6 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Grid.Tests s.RegionInfo.RegionID = r1.RegionID; m_LocalConnector.AddRegion(s); - GridRegion r2 = new GridRegion(); r2.RegionName = "Test Region 2"; r2.RegionID = new UUID(2); @@ -107,11 +110,28 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Grid.Tests s.RegionInfo.RegionID = r3.RegionID; m_LocalConnector.AddRegion(s); + GridRegion r4 = new GridRegion(); + r4.RegionName = "Other Region 4"; + r4.RegionID = new UUID(4); + r4.RegionLocX = 1004 * (int)Constants.RegionSize; + r4.RegionLocY = 1002 * (int)Constants.RegionSize; + r4.ExternalHostName = "127.0.0.1"; + r4.HttpPort = 9004; + r4.InternalEndPoint = new System.Net.IPEndPoint(System.Net.IPAddress.Parse("0.0.0.0"), 0); + s = new Scene(new RegionInfo()); + s.RegionInfo.RegionID = r4.RegionID; + m_LocalConnector.AddRegion(s); + m_LocalConnector.RegisterRegion(UUID.Zero, r1); + GridRegion result = m_LocalConnector.GetRegionByName(UUID.Zero, "Test"); Assert.IsNotNull(result, "Retrieved GetRegionByName is null"); Assert.That(result.RegionName, Is.EqualTo("Test Region 1"), "Retrieved region's name does not match"); + m_LocalConnector.RegisterRegion(UUID.Zero, r2); + m_LocalConnector.RegisterRegion(UUID.Zero, r3); + m_LocalConnector.RegisterRegion(UUID.Zero, r4); + result = m_LocalConnector.GetRegionByUUID(UUID.Zero, new UUID(1)); Assert.IsNotNull(result, "Retrieved GetRegionByUUID is null"); Assert.That(result.RegionID, Is.EqualTo(new UUID(1)), "Retrieved region's UUID does not match"); @@ -120,22 +140,57 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Grid.Tests Assert.IsNotNull(result, "Retrieved GetRegionByPosition is null"); Assert.That(result.RegionLocX, Is.EqualTo(1000 * (int)Constants.RegionSize), "Retrieved region's position does not match"); - m_LocalConnector.RegisterRegion(UUID.Zero, r2); - m_LocalConnector.RegisterRegion(UUID.Zero, r3); - List results = m_LocalConnector.GetNeighbours(UUID.Zero, new UUID(1)); Assert.IsNotNull(results, "Retrieved neighbours list is null"); Assert.That(results.Count, Is.EqualTo(1), "Retrieved neighbour collection is greater than expected"); Assert.That(results[0].RegionID, Is.EqualTo(new UUID(2)), "Retrieved region's UUID does not match"); results = m_LocalConnector.GetRegionsByName(UUID.Zero, "Test", 10); - Assert.IsNotNull(results, "Retrieved GetRegionsByName list is null"); + Assert.IsNotNull(results, "Retrieved GetRegionsByName collection is null"); Assert.That(results.Count, Is.EqualTo(3), "Retrieved neighbour collection is less than expected"); results = m_LocalConnector.GetRegionRange(UUID.Zero, 900 * (int)Constants.RegionSize, 1002 * (int)Constants.RegionSize, 900 * (int)Constants.RegionSize, 1100 * (int)Constants.RegionSize); - Assert.IsNotNull(results, "Retrieved GetRegionRange list is null"); + Assert.IsNotNull(results, "Retrieved GetRegionRange collection is null"); Assert.That(results.Count, Is.EqualTo(2), "Retrieved neighbour collection is not the number expected"); + + results = m_LocalConnector.GetDefaultRegions(UUID.Zero); + Assert.IsNotNull(results, "Retrieved GetDefaultRegions collection is null"); + Assert.That(results.Count, Is.EqualTo(1), "Retrieved default regions collection has not the expected size"); + Assert.That(results[0].RegionID, Is.EqualTo(new UUID(1)), "Retrieved default region's UUID does not match"); + + results = m_LocalConnector.GetFallbackRegions(UUID.Zero, r1.RegionLocX, r1.RegionLocY); + Assert.IsNotNull(results, "Retrieved GetFallbackRegions collection for region 1 is null"); + Assert.That(results.Count, Is.EqualTo(3), "Retrieved fallback regions collection for region 1 has not the expected size"); + Assert.That(results[0].RegionID, Is.EqualTo(new UUID(2)), "Retrieved fallback regions for default region are not in the expected order 2-4-3"); + Assert.That(results[1].RegionID, Is.EqualTo(new UUID(4)), "Retrieved fallback regions for default region are not in the expected order 2-4-3"); + Assert.That(results[2].RegionID, Is.EqualTo(new UUID(3)), "Retrieved fallback regions for default region are not in the expected order 2-4-3"); + + results = m_LocalConnector.GetFallbackRegions(UUID.Zero, r2.RegionLocX, r2.RegionLocY); + Assert.IsNotNull(results, "Retrieved GetFallbackRegions collection for region 2 is null"); + Assert.That(results.Count, Is.EqualTo(3), "Retrieved fallback regions collection for region 2 has not the expected size"); + Assert.That(results[0].RegionID, Is.EqualTo(new UUID(2)), "Retrieved fallback regions are not in the expected order 2-4-3"); + Assert.That(results[1].RegionID, Is.EqualTo(new UUID(4)), "Retrieved fallback regions are not in the expected order 2-4-3"); + Assert.That(results[2].RegionID, Is.EqualTo(new UUID(3)), "Retrieved fallback regions are not in the expected order 2-4-3"); + + results = m_LocalConnector.GetFallbackRegions(UUID.Zero, r3.RegionLocX, r3.RegionLocY); + Assert.IsNotNull(results, "Retrieved GetFallbackRegions collection for region 3 is null"); + Assert.That(results.Count, Is.EqualTo(3), "Retrieved fallback regions collection for region 3 has not the expected size"); + Assert.That(results[0].RegionID, Is.EqualTo(new UUID(3)), "Retrieved fallback regions are not in the expected order 3-4-2"); + Assert.That(results[1].RegionID, Is.EqualTo(new UUID(4)), "Retrieved fallback regions are not in the expected order 3-4-2"); + Assert.That(results[2].RegionID, Is.EqualTo(new UUID(2)), "Retrieved fallback regions are not in the expected order 3-4-2"); + + results = m_LocalConnector.GetFallbackRegions(UUID.Zero, r4.RegionLocX, r4.RegionLocY); + Assert.IsNotNull(results, "Retrieved GetFallbackRegions collection for region 4 is null"); + Assert.That(results.Count, Is.EqualTo(3), "Retrieved fallback regions collection for region 4 has not the expected size"); + Assert.That(results[0].RegionID, Is.EqualTo(new UUID(4)), "Retrieved fallback regions are not in the expected order 4-3-2"); + Assert.That(results[1].RegionID, Is.EqualTo(new UUID(3)), "Retrieved fallback regions are not in the expected order 4-3-2"); + Assert.That(results[2].RegionID, Is.EqualTo(new UUID(2)), "Retrieved fallback regions are not in the expected order 4-3-2"); + + results = m_LocalConnector.GetHyperlinks(UUID.Zero); + Assert.IsNotNull(results, "Retrieved GetHyperlinks list is null"); + Assert.That(results.Count, Is.EqualTo(0), "Retrieved linked regions collection is not the number expected"); + } } } diff --git a/OpenSim/Region/CoreModules/ServiceConnectorsOut/GridUser/ActivityDetector.cs b/OpenSim/Region/CoreModules/ServiceConnectorsOut/GridUser/ActivityDetector.cs index 83c8eac8b3..65438456b9 100644 --- a/OpenSim/Region/CoreModules/ServiceConnectorsOut/GridUser/ActivityDetector.cs +++ b/OpenSim/Region/CoreModules/ServiceConnectorsOut/GridUser/ActivityDetector.cs @@ -1,4 +1,4 @@ -/* +/* * Copyright (c) Contributors, http://opensimulator.org/ * See CONTRIBUTORS.TXT for a full list of copyright holders. * @@ -42,7 +42,6 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.GridUser private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); private IGridUserService m_GridUserService; - private Scene m_aScene; public ActivityDetector(IGridUserService guservice) { @@ -56,9 +55,6 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.GridUser // But we could trigger the position update more often scene.EventManager.OnMakeRootAgent += OnMakeRootAgent; scene.EventManager.OnNewClient += OnNewClient; - - if (m_aScene == null) - m_aScene = scene; } public void RemoveRegion(Scene scene) @@ -69,9 +65,8 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.GridUser public void OnMakeRootAgent(ScenePresence sp) { - m_log.DebugFormat("[ACTIVITY DETECTOR]: Detected root presence {0} in {1}", sp.UUID, sp.Scene.RegionInfo.RegionName); - - m_GridUserService.SetLastPosition(sp.UUID.ToString(), sp.Scene.RegionInfo.RegionID, sp.AbsolutePosition, sp.Lookat); +// m_log.DebugFormat("[ACTIVITY DETECTOR]: Detected root presence {0} in {1}", sp.UUID, sp.Scene.RegionInfo.RegionName); + m_GridUserService.SetLastPosition(sp.UUID.ToString(), UUID.Zero, sp.Scene.RegionInfo.RegionID, sp.AbsolutePosition, sp.Lookat); } public void OnNewClient(IClientAPI client) @@ -99,7 +94,7 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.GridUser } } m_log.DebugFormat("[ACTIVITY DETECTOR]: Detected client logout {0} in {1}", client.AgentId, client.Scene.RegionInfo.RegionName); - m_GridUserService.LoggedOut(client.AgentId.ToString(), client.Scene.RegionInfo.RegionID, position, lookat); + m_GridUserService.LoggedOut(client.AgentId.ToString(), client.SessionId, client.Scene.RegionInfo.RegionID, position, lookat); } } diff --git a/OpenSim/Region/CoreModules/ServiceConnectorsOut/GridUser/LocalGridUserServiceConnector.cs b/OpenSim/Region/CoreModules/ServiceConnectorsOut/GridUser/LocalGridUserServiceConnector.cs index d914a576e1..985aceca5d 100644 --- a/OpenSim/Region/CoreModules/ServiceConnectorsOut/GridUser/LocalGridUserServiceConnector.cs +++ b/OpenSim/Region/CoreModules/ServiceConnectorsOut/GridUser/LocalGridUserServiceConnector.cs @@ -152,9 +152,9 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.GridUser return m_GridUserService.LoggedIn(userID); } - public bool LoggedOut(string userID, UUID regionID, Vector3 lastPosition, Vector3 lastLookAt) + public bool LoggedOut(string userID, UUID sessionID, UUID regionID, Vector3 lastPosition, Vector3 lastLookAt) { - return m_GridUserService.LoggedOut(userID, regionID, lastPosition, lastLookAt); + return m_GridUserService.LoggedOut(userID, sessionID, regionID, lastPosition, lastLookAt); } public bool SetHome(string userID, UUID homeID, Vector3 homePosition, Vector3 homeLookAt) @@ -162,9 +162,9 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.GridUser return m_GridUserService.SetHome(userID, homeID, homePosition, homeLookAt); } - public bool SetLastPosition(string userID, UUID regionID, Vector3 lastPosition, Vector3 lastLookAt) + public bool SetLastPosition(string userID, UUID sessionID, UUID regionID, Vector3 lastPosition, Vector3 lastLookAt) { - return m_GridUserService.SetLastPosition(userID, regionID, lastPosition, lastLookAt); + return m_GridUserService.SetLastPosition(userID, sessionID, regionID, lastPosition, lastLookAt); } public GridUserInfo GetGridUserInfo(string userID) diff --git a/OpenSim/Region/CoreModules/ServiceConnectorsOut/GridUser/RemoteGridUserServiceConnector.cs b/OpenSim/Region/CoreModules/ServiceConnectorsOut/GridUser/RemoteGridUserServiceConnector.cs index e3e2e619c1..95b3591ab4 100644 --- a/OpenSim/Region/CoreModules/ServiceConnectorsOut/GridUser/RemoteGridUserServiceConnector.cs +++ b/OpenSim/Region/CoreModules/ServiceConnectorsOut/GridUser/RemoteGridUserServiceConnector.cs @@ -126,9 +126,9 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.GridUser return null; } - public bool LoggedOut(string userID, UUID region, Vector3 position, Vector3 lookat) + public bool LoggedOut(string userID, UUID sessionID, UUID region, Vector3 position, Vector3 lookat) { - return m_RemoteConnector.LoggedOut(userID, region, position, lookat); + return m_RemoteConnector.LoggedOut(userID, sessionID, region, position, lookat); } @@ -137,9 +137,9 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.GridUser return m_RemoteConnector.SetHome(userID, regionID, position, lookAt); } - public bool SetLastPosition(string userID, UUID regionID, Vector3 position, Vector3 lookAt) + public bool SetLastPosition(string userID, UUID sessionID, UUID regionID, Vector3 position, Vector3 lookAt) { - return m_RemoteConnector.SetLastPosition(userID, regionID, position, lookAt); + return m_RemoteConnector.SetLastPosition(userID, sessionID, regionID, position, lookAt); } public GridUserInfo GetGridUserInfo(string userID) diff --git a/OpenSim/Region/CoreModules/ServiceConnectorsOut/Inventory/BaseInventoryConnector.cs b/OpenSim/Region/CoreModules/ServiceConnectorsOut/Inventory/BaseInventoryConnector.cs index 1e51187900..dcf08e3d80 100644 --- a/OpenSim/Region/CoreModules/ServiceConnectorsOut/Inventory/BaseInventoryConnector.cs +++ b/OpenSim/Region/CoreModules/ServiceConnectorsOut/Inventory/BaseInventoryConnector.cs @@ -27,15 +27,12 @@ using System; using System.Collections.Generic; - using OpenMetaverse; using Nini.Config; using log4net; - using OpenSim.Framework; using OpenSim.Services.Interfaces; - namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Inventory { public abstract class BaseInventoryConnector : IInventoryService diff --git a/OpenSim/Region/CoreModules/ServiceConnectorsOut/Inventory/HGInventoryBroker.cs b/OpenSim/Region/CoreModules/ServiceConnectorsOut/Inventory/HGInventoryBroker.cs index 97161fcbd1..39410b561b 100644 --- a/OpenSim/Region/CoreModules/ServiceConnectorsOut/Inventory/HGInventoryBroker.cs +++ b/OpenSim/Region/CoreModules/ServiceConnectorsOut/Inventory/HGInventoryBroker.cs @@ -1,4 +1,4 @@ -/* +/* * Copyright (c) Contributors, http://opensimulator.org/ * See CONTRIBUTORS.TXT for a full list of copyright holders. * @@ -37,6 +37,7 @@ using OpenSim.Region.Framework.Interfaces; using OpenSim.Region.Framework.Scenes; using OpenSim.Services.Interfaces; using OpenSim.Services.Connectors; +using OpenSim.Services.Connectors.SimianGrid; using OpenMetaverse; namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Inventory @@ -538,12 +539,14 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Inventory } else { - // We're instantiating this class explicitly, but this won't - // work in general, because the remote grid may be running - // an inventory server that has a different protocol. - // Eventually we will want a piece of protocol asking - // the remote server about its kind. Definitely cool thing to do! - connector = new RemoteXInventoryServicesConnector(url); + // Still not as flexible as I would like this to be, + // but good enough for now + string connectorType = new HeloServicesConnector(url).Helo(); + m_log.DebugFormat("[HG INVENTORY SERVICE]: HELO returned {0}", connectorType); + if (connectorType == "opensim-simian") + connector = new SimianInventoryServiceConnector(url); + else + connector = new RemoteXInventoryServicesConnector(url); m_connectors.Add(url, connector); } } diff --git a/OpenSim/Region/CoreModules/ServiceConnectorsOut/Inventory/InventoryCache.cs b/OpenSim/Region/CoreModules/ServiceConnectorsOut/Inventory/InventoryCache.cs index c97ab9e8da..2322d7cb45 100644 --- a/OpenSim/Region/CoreModules/ServiceConnectorsOut/Inventory/InventoryCache.cs +++ b/OpenSim/Region/CoreModules/ServiceConnectorsOut/Inventory/InventoryCache.cs @@ -161,6 +161,8 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Inventory /// public InventoryFolderBase GetFolderForType(UUID userID, AssetType type) { + m_log.DebugFormat("[INVENTORY CACHE]: Getting folder for asset type {0} for user {1}", type, userID); + Dictionary folders = null; lock (m_InventoryCache) @@ -177,8 +179,13 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Inventory if ((folders != null) && folders.ContainsKey(type)) { + m_log.DebugFormat( + "[INVENTORY CACHE]: Returning folder {0} as type {1} for {2}", folders[type], type, userID); + return folders[type]; } + + m_log.WarnFormat("[INVENTORY CACHE]: Could not find folder for system type {0} for {1}", type, userID); return null; } diff --git a/OpenSim/Region/CoreModules/ServiceConnectorsOut/Inventory/LocalInventoryServiceConnector.cs b/OpenSim/Region/CoreModules/ServiceConnectorsOut/Inventory/LocalInventoryServiceConnector.cs index 22bd04cd65..c7244c88ef 100644 --- a/OpenSim/Region/CoreModules/ServiceConnectorsOut/Inventory/LocalInventoryServiceConnector.cs +++ b/OpenSim/Region/CoreModules/ServiceConnectorsOut/Inventory/LocalInventoryServiceConnector.cs @@ -49,6 +49,21 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Inventory private IInventoryService m_InventoryService; + private Scene m_Scene; + + private IUserManagement m_UserManager; + private IUserManagement UserManager + { + get + { + if (m_UserManager == null) + { + m_UserManager = m_Scene.RequestModuleInterface(); + } + return m_UserManager; + } + } + private bool m_Enabled = false; public Type ReplaceableInterface @@ -115,6 +130,9 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Inventory return; scene.RegisterModuleInterface(this); + + if (m_Scene == null) + m_Scene = scene; } public void RemoveRegion(Scene scene) @@ -163,7 +181,12 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Inventory public InventoryCollection GetFolderContent(UUID userID, UUID folderID) { - return m_InventoryService.GetFolderContent(userID, folderID); + InventoryCollection invCol = m_InventoryService.GetFolderContent(userID, folderID); + if (UserManager != null) + foreach (InventoryItemBase item in invCol.Items) + UserManager.AddUser(item.CreatorIdAsUuid, item.CreatorData); + + return invCol; } public List GetFolderItems(UUID userID, UUID folderID) @@ -216,13 +239,12 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Inventory return m_InventoryService.PurgeFolder(folder); } - /// - /// Add a new item to the user's inventory - /// - /// - /// true if the item was successfully added public bool AddItem(InventoryItemBase item) { +// m_log.DebugFormat( +// "[LOCAL INVENTORY SERVICES CONNECTOR]: Adding inventory item {0} to user {1} folder {2}", +// item.Name, item.Owner, item.Folder); + return m_InventoryService.AddItem(item); } @@ -236,7 +258,6 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Inventory return m_InventoryService.UpdateItem(item); } - public bool MoveItems(UUID ownerID, List items) { return m_InventoryService.MoveItems(ownerID, items); diff --git a/OpenSim/Region/CoreModules/ServiceConnectorsOut/Inventory/RemoteInventoryServiceConnector.cs b/OpenSim/Region/CoreModules/ServiceConnectorsOut/Inventory/RemoteInventoryServiceConnector.cs index aa3b30d55e..9213132866 100644 --- a/OpenSim/Region/CoreModules/ServiceConnectorsOut/Inventory/RemoteInventoryServiceConnector.cs +++ b/OpenSim/Region/CoreModules/ServiceConnectorsOut/Inventory/RemoteInventoryServiceConnector.cs @@ -32,7 +32,6 @@ using System.Reflection; using Nini.Config; using OpenSim.Framework; using OpenSim.Framework.Statistics; - using OpenSim.Services.Connectors; using OpenSim.Region.Framework.Interfaces; using OpenSim.Region.Framework.Scenes; @@ -51,6 +50,20 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Inventory private Scene m_Scene; private InventoryServicesConnector m_RemoteConnector; + private IUserManagement m_UserManager; + private IUserManagement UserManager + { + get + { + if (m_UserManager == null) + { + m_UserManager = m_Scene.RequestModuleInterface(); + } + return m_UserManager; + } + } + + public Type ReplaceableInterface { get { return null; } @@ -76,7 +89,6 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Inventory base.Init(source); } - #region ISharedRegionModule public void Initialise(IConfigSource source) @@ -105,7 +117,7 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Inventory public void AddRegion(Scene scene) { - m_Scene = scene; +// m_Scene = scene; //m_log.Debug("[XXXX] Adding scene " + m_Scene.RegionInfo.RegionName); if (!m_Enabled) @@ -118,6 +130,9 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Inventory scene.RegisterModuleInterface(this); m_cache.AddRegion(scene); + + if (m_Scene == null) + m_Scene = scene; } public void RemoveRegion(Scene scene) @@ -188,7 +203,10 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Inventory UUID sessionID = GetSessionID(userID); try { - return m_RemoteConnector.GetFolderContent(userID.ToString(), folderID, sessionID); + InventoryCollection invCol = m_RemoteConnector.GetFolderContent(userID.ToString(), folderID, sessionID); + foreach (InventoryItemBase item in invCol.Items) + UserManager.AddUser(item.CreatorIdAsUuid, item.CreatorData); + return invCol; } catch (Exception e) { diff --git a/OpenSim/Region/CoreModules/ServiceConnectorsOut/Inventory/RemoteXInventoryServiceConnector.cs b/OpenSim/Region/CoreModules/ServiceConnectorsOut/Inventory/RemoteXInventoryServiceConnector.cs index 277060d2aa..bd01bb944f 100644 --- a/OpenSim/Region/CoreModules/ServiceConnectorsOut/Inventory/RemoteXInventoryServiceConnector.cs +++ b/OpenSim/Region/CoreModules/ServiceConnectorsOut/Inventory/RemoteXInventoryServiceConnector.cs @@ -32,7 +32,6 @@ using System.Reflection; using Nini.Config; using OpenSim.Framework; using OpenSim.Framework.Statistics; - using OpenSim.Services.Connectors; using OpenSim.Region.Framework.Interfaces; using OpenSim.Region.Framework.Scenes; @@ -48,7 +47,7 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Inventory private bool m_Enabled = false; private bool m_Initialized = false; - private Scene m_Scene; +// private Scene m_Scene; private XInventoryServicesConnector m_RemoteConnector; public Type ReplaceableInterface @@ -109,7 +108,7 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Inventory public void AddRegion(Scene scene) { - m_Scene = scene; +// m_Scene = scene; //m_log.Debug("[XXXX] Adding scene " + m_Scene.RegionInfo.RegionName); if (!m_Enabled) @@ -262,7 +261,7 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Inventory public InventoryItemBase GetItem(InventoryItemBase item) { - m_log.DebugFormat("[XINVENTORY CONNECTOR]: GetItem {0}", item.ID); + //m_log.DebugFormat("[XINVENTORY CONNECTOR]: GetItem {0}", item.ID); if (item == null) return null; @@ -273,7 +272,7 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Inventory public InventoryFolderBase GetFolder(InventoryFolderBase folder) { - m_log.DebugFormat("[XINVENTORY CONNECTOR]: GetFolder {0}", folder.ID); + //m_log.DebugFormat("[XINVENTORY CONNECTOR]: GetFolder {0}", folder.ID); if (folder == null) return null; @@ -295,9 +294,6 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Inventory return m_RemoteConnector.GetAssetPermissions(userID, assetID); } - #endregion - - } -} +} \ No newline at end of file diff --git a/OpenSim/Region/CoreModules/ServiceConnectorsOut/Land/LocalLandServiceConnector.cs b/OpenSim/Region/CoreModules/ServiceConnectorsOut/Land/LocalLandServiceConnector.cs index cb87f6f847..e15f624d70 100644 --- a/OpenSim/Region/CoreModules/ServiceConnectorsOut/Land/LocalLandServiceConnector.cs +++ b/OpenSim/Region/CoreModules/ServiceConnectorsOut/Land/LocalLandServiceConnector.cs @@ -116,8 +116,9 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Land #region ILandService - public LandData GetLandData(ulong regionHandle, uint x, uint y) + public LandData GetLandData(ulong regionHandle, uint x, uint y, out byte regionAccess) { + regionAccess = 2; m_log.DebugFormat("[LAND CONNECTOR]: request for land data in {0} at {1}, {2}", regionHandle, x, y); @@ -126,6 +127,7 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Land if (s.RegionInfo.RegionHandle == regionHandle) { LandData land = s.GetLandData(x, y); + regionAccess = s.RegionInfo.AccessLevel; return land; } } diff --git a/OpenSim/Region/CoreModules/ServiceConnectorsOut/Land/RemoteLandServiceConnector.cs b/OpenSim/Region/CoreModules/ServiceConnectorsOut/Land/RemoteLandServiceConnector.cs index b0ace3959d..252d9e7286 100644 --- a/OpenSim/Region/CoreModules/ServiceConnectorsOut/Land/RemoteLandServiceConnector.cs +++ b/OpenSim/Region/CoreModules/ServiceConnectorsOut/Land/RemoteLandServiceConnector.cs @@ -90,7 +90,6 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Land if (!m_Enabled) return; - m_GridService = scene.GridService; m_LocalService.AddRegion(scene); scene.RegisterModuleInterface(this); } @@ -103,18 +102,20 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Land public void RegionLoaded(Scene scene) { + if (m_Enabled) + m_GridService = scene.GridService; } #region ILandService - public override LandData GetLandData(ulong regionHandle, uint x, uint y) + public override LandData GetLandData(ulong regionHandle, uint x, uint y, out byte regionAccess) { - LandData land = m_LocalService.GetLandData(regionHandle, x, y); + LandData land = m_LocalService.GetLandData(regionHandle, x, y, out regionAccess); if (land != null) return land; - return base.GetLandData(regionHandle, x, y); + return base.GetLandData(regionHandle, x, y, out regionAccess); } #endregion ILandService diff --git a/OpenSim/Region/CoreModules/ServiceConnectorsOut/Presence/PresenceDetector.cs b/OpenSim/Region/CoreModules/ServiceConnectorsOut/Presence/PresenceDetector.cs index 62b8278b22..fa5b8737b3 100644 --- a/OpenSim/Region/CoreModules/ServiceConnectorsOut/Presence/PresenceDetector.cs +++ b/OpenSim/Region/CoreModules/ServiceConnectorsOut/Presence/PresenceDetector.cs @@ -1,4 +1,4 @@ -/* +/* * Copyright (c) Contributors, http://opensimulator.org/ * See CONTRIBUTORS.TXT for a full list of copyright holders. * @@ -71,7 +71,7 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Presence public void OnMakeRootAgent(ScenePresence sp) { - m_log.DebugFormat("[PRESENCE DETECTOR]: Detected root presence {0} in {1}", sp.UUID, sp.Scene.RegionInfo.RegionName); +// m_log.DebugFormat("[PRESENCE DETECTOR]: Detected root presence {0} in {1}", sp.UUID, sp.Scene.RegionInfo.RegionName); m_PresenceService.ReportAgent(sp.ControllingClient.SessionId, sp.Scene.RegionInfo.RegionID); } diff --git a/OpenSim/Region/CoreModules/ServiceConnectorsOut/UserAccounts/UserAccountCache.cs b/OpenSim/Region/CoreModules/ServiceConnectorsOut/UserAccounts/UserAccountCache.cs index e1bc243c9e..155335bded 100644 --- a/OpenSim/Region/CoreModules/ServiceConnectorsOut/UserAccounts/UserAccountCache.cs +++ b/OpenSim/Region/CoreModules/ServiceConnectorsOut/UserAccounts/UserAccountCache.cs @@ -36,6 +36,8 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.UserAccounts { public class UserAccountCache { + private const double CACHE_EXPIRATION_SECONDS = 120000.0; // 33 hours! + private static readonly ILog m_log = LogManager.GetLogger( MethodBase.GetCurrentMethod().DeclaringType); @@ -51,11 +53,11 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.UserAccounts public void Cache(UUID userID, UserAccount account) { // Cache even null accounts - m_UUIDCache.AddOrUpdate(userID, account, DateTime.Now + TimeSpan.FromMinutes(2.0d)); + m_UUIDCache.AddOrUpdate(userID, account, CACHE_EXPIRATION_SECONDS); if (account != null) - m_NameCache.AddOrUpdate(account.Name, account.PrincipalID, DateTime.Now + TimeSpan.FromMinutes(2.0d)); + m_NameCache.AddOrUpdate(account.Name, account.PrincipalID, CACHE_EXPIRATION_SECONDS); - m_log.DebugFormat("[USER CACHE]: cached user {0}", userID); + //m_log.DebugFormat("[USER CACHE]: cached user {0}", userID); } public UserAccount Get(UUID userID, out bool inCache) diff --git a/OpenSim/Region/CoreModules/World/Archiver/ArchiveHelpers.cs b/OpenSim/Region/CoreModules/World/Archiver/ArchiveHelpers.cs index ddc3dd7644..c72acc332b 100644 --- a/OpenSim/Region/CoreModules/World/Archiver/ArchiveHelpers.cs +++ b/OpenSim/Region/CoreModules/World/Archiver/ArchiveHelpers.cs @@ -33,7 +33,7 @@ using OpenSim.Framework.Serialization; using OpenSim.Region.Framework.Scenes; namespace OpenSim.Region.CoreModules.World.Archiver -{ +{ /// /// Helper methods for archive manipulation /// @@ -50,7 +50,7 @@ namespace OpenSim.Region.CoreModules.World.Archiver public static string CreateObjectFilename(SceneObjectGroup sog) { return ArchiveConstants.CreateOarObjectFilename(sog.Name, sog.UUID, sog.AbsolutePosition); - } + } /// /// Create the path used to store an object in an OpenSim Archive. @@ -62,7 +62,7 @@ namespace OpenSim.Region.CoreModules.World.Archiver public static string CreateObjectPath(SceneObjectGroup sog) { return ArchiveConstants.CreateOarObjectPath(sog.Name, sog.UUID, sog.AbsolutePosition); - } + } /// /// Resolve path to a working FileStream @@ -123,6 +123,6 @@ namespace OpenSim.Region.CoreModules.World.Archiver // return new BufferedStream(file, (int) response.ContentLength); return new BufferedStream(file, 1000000); - } + } } } \ No newline at end of file diff --git a/OpenSim/Region/CoreModules/World/Archiver/ArchiveReadRequest.cs b/OpenSim/Region/CoreModules/World/Archiver/ArchiveReadRequest.cs index bc653ce5e9..3238a8160e 100644 --- a/OpenSim/Region/CoreModules/World/Archiver/ArchiveReadRequest.cs +++ b/OpenSim/Region/CoreModules/World/Archiver/ArchiveReadRequest.cs @@ -51,6 +51,12 @@ namespace OpenSim.Region.CoreModules.World.Archiver public class ArchiveReadRequest { private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); + + /// + /// The maximum major version of OAR that we can read. Minor versions shouldn't need a max number since version + /// bumps here should be compatible. + /// + public static int MAX_MAJOR_VERSION = 1; protected Scene m_scene; protected Stream m_loadStream; @@ -72,6 +78,19 @@ namespace OpenSim.Region.CoreModules.World.Archiver /// private IDictionary m_validUserUuids = new Dictionary(); + private IUserManagement m_UserMan; + private IUserManagement UserManager + { + get + { + if (m_UserMan == null) + { + m_UserMan = m_scene.RequestModuleInterface(); + } + return m_UserMan; + } + } + public ArchiveReadRequest(Scene scene, string loadPath, bool merge, bool skipAssets, Guid requestId) { m_scene = scene; @@ -243,10 +262,15 @@ namespace OpenSim.Region.CoreModules.World.Archiver // to the same scene (when this is possible). sceneObject.ResetIDs(); - foreach (SceneObjectPart part in sceneObject.Children.Values) + foreach (SceneObjectPart part in sceneObject.Parts) { - if (!ResolveUserUuid(part.CreatorID)) - part.CreatorID = m_scene.RegionInfo.EstateSettings.EstateOwner; + if (part.CreatorData == null || part.CreatorData == string.Empty) + { + if (!ResolveUserUuid(part.CreatorID)) + part.CreatorID = m_scene.RegionInfo.EstateSettings.EstateOwner; + } + if (UserManager != null) + UserManager.AddUser(part.CreatorID, part.CreatorData); if (!ResolveUserUuid(part.OwnerID)) part.OwnerID = m_scene.RegionInfo.EstateSettings.EstateOwner; @@ -270,10 +294,13 @@ namespace OpenSim.Region.CoreModules.World.Archiver { kvp.Value.OwnerID = m_scene.RegionInfo.EstateSettings.EstateOwner; } - if (!ResolveUserUuid(kvp.Value.CreatorID)) + if (kvp.Value.CreatorData == null || kvp.Value.CreatorData == string.Empty) { - kvp.Value.CreatorID = m_scene.RegionInfo.EstateSettings.EstateOwner; + if (!ResolveUserUuid(kvp.Value.CreatorID)) + kvp.Value.CreatorID = m_scene.RegionInfo.EstateSettings.EstateOwner; } + if (UserManager != null) + UserManager.AddUser(kvp.Value.CreatorID, kvp.Value.CreatorData); } } } @@ -475,17 +502,11 @@ namespace OpenSim.Region.CoreModules.World.Archiver /// /// /// - private void LoadControlFile(string path, byte[] data) + protected void LoadControlFile(string path, byte[] data) { - //Create the XmlNamespaceManager. - NameTable nt = new NameTable(); - XmlNamespaceManager nsmgr = new XmlNamespaceManager(nt); - - // Create the XmlParserContext. + XmlNamespaceManager nsmgr = new XmlNamespaceManager(new NameTable()); XmlParserContext context = new XmlParserContext(null, nsmgr, null, XmlSpace.None); - - XmlTextReader xtr - = new XmlTextReader(Encoding.ASCII.GetString(data), XmlNodeType.Document, context); + XmlTextReader xtr = new XmlTextReader(Encoding.ASCII.GetString(data), XmlNodeType.Document, context); RegionSettings currentRegionSettings = m_scene.RegionInfo.RegionSettings; @@ -497,6 +518,22 @@ namespace OpenSim.Region.CoreModules.World.Archiver { if (xtr.NodeType == XmlNodeType.Element) { + if (xtr.Name.ToString() == "archive") + { + int majorVersion = int.Parse(xtr["major_version"]); + int minorVersion = int.Parse(xtr["minor_version"]); + string version = string.Format("{0}.{1}", majorVersion, minorVersion); + + if (majorVersion > MAX_MAJOR_VERSION) + { + throw new Exception( + string.Format( + "The OAR you are trying to load has major version number of {0} but this version of OpenSim can only load OARs with major version number {1} and below", + majorVersion, MAX_MAJOR_VERSION)); + } + + m_log.InfoFormat("[ARCHIVER]: Loading OAR with version {0}", version); + } if (xtr.Name.ToString() == "datetime") { int value; @@ -508,10 +545,9 @@ namespace OpenSim.Region.CoreModules.World.Archiver currentRegionSettings.LoadedCreationID = xtr.ReadElementContentAsString(); } } - } currentRegionSettings.Save(); } } -} +} \ No newline at end of file diff --git a/OpenSim/Region/CoreModules/World/Archiver/ArchiveWriteRequestExecution.cs b/OpenSim/Region/CoreModules/World/Archiver/ArchiveWriteRequestExecution.cs index 586d98e322..f8a599a232 100644 --- a/OpenSim/Region/CoreModules/World/Archiver/ArchiveWriteRequestExecution.cs +++ b/OpenSim/Region/CoreModules/World/Archiver/ArchiveWriteRequestExecution.cs @@ -60,6 +60,7 @@ namespace OpenSim.Region.CoreModules.World.Archiver protected Scene m_scene; protected TarArchiveWriter m_archiveWriter; protected Guid m_requestId; + protected Dictionary m_options; public ArchiveWriteRequestExecution( List sceneObjects, @@ -67,7 +68,8 @@ namespace OpenSim.Region.CoreModules.World.Archiver IRegionSerialiserModule serialiser, Scene scene, TarArchiveWriter archiveWriter, - Guid requestId) + Guid requestId, + Dictionary options) { m_sceneObjects = sceneObjects; m_terrainModule = terrainModule; @@ -75,6 +77,7 @@ namespace OpenSim.Region.CoreModules.World.Archiver m_scene = scene; m_archiveWriter = archiveWriter; m_requestId = requestId; + m_options = options; } protected internal void ReceivedAllAssets( @@ -105,12 +108,6 @@ namespace OpenSim.Region.CoreModules.World.Archiver // "[ARCHIVER]: Received {0} of {1} assets requested", // assetsFoundUuids.Count, assetsFoundUuids.Count + assetsNotFoundUuids.Count); - m_log.InfoFormat("[ARCHIVER]: Creating archive file. This may take some time."); - - // Write out control file - m_archiveWriter.WriteFile(ArchiveConstants.CONTROL_FILE_PATH, Create0p2ControlFile()); - m_log.InfoFormat("[ARCHIVER]: Added control file to archive."); - // Write out region settings string settingsPath = String.Format("{0}{1}.xml", ArchiveConstants.SETTINGS_PATH, m_scene.RegionInfo.RegionName); @@ -140,47 +137,19 @@ namespace OpenSim.Region.CoreModules.World.Archiver m_log.InfoFormat("[ARCHIVER]: Added terrain information to archive."); + // Write out scene object metadata foreach (SceneObjectGroup sceneObject in m_sceneObjects) { //m_log.DebugFormat("[ARCHIVER]: Saving {0} {1}, {2}", entity.Name, entity.UUID, entity.GetType()); - string serializedObject = m_serialiser.SerializeGroupToXml2(sceneObject); + string serializedObject = m_serialiser.SerializeGroupToXml2(sceneObject, m_options); m_archiveWriter.WriteFile(ArchiveHelpers.CreateObjectPath(sceneObject), serializedObject); } m_log.InfoFormat("[ARCHIVER]: Added scene objects to archive."); } - /// - /// Create the control file for a 0.2 version archive - /// - /// - public static string Create0p2ControlFile() - { - StringWriter sw = new StringWriter(); - XmlTextWriter xtw = new XmlTextWriter(sw); - xtw.Formatting = Formatting.Indented; - xtw.WriteStartDocument(); - xtw.WriteStartElement("archive"); - xtw.WriteAttributeString("major_version", "0"); - xtw.WriteAttributeString("minor_version", "3"); - xtw.WriteStartElement("creation_info"); - DateTime now = DateTime.UtcNow; - TimeSpan t = now - new DateTime(1970, 1, 1); - xtw.WriteElementString("datetime", ((int)t.TotalSeconds).ToString()); - xtw.WriteElementString("id", UUID.Random().ToString()); - xtw.WriteEndElement(); - xtw.WriteEndElement(); - - xtw.Flush(); - xtw.Close(); - - String s = sw.ToString(); - sw.Close(); - - return s; - } } } diff --git a/OpenSim/Region/CoreModules/World/Archiver/ArchiveWriteRequestPreparation.cs b/OpenSim/Region/CoreModules/World/Archiver/ArchiveWriteRequestPreparation.cs index b25636ffcb..b987b5ac82 100644 --- a/OpenSim/Region/CoreModules/World/Archiver/ArchiveWriteRequestPreparation.cs +++ b/OpenSim/Region/CoreModules/World/Archiver/ArchiveWriteRequestPreparation.cs @@ -32,6 +32,7 @@ using System.IO.Compression; using System.Reflection; using System.Text.RegularExpressions; using System.Threading; +using System.Xml; using log4net; using OpenMetaverse; using OpenSim.Framework; @@ -48,7 +49,17 @@ namespace OpenSim.Region.CoreModules.World.Archiver public class ArchiveWriteRequestPreparation { private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); - + + /// + /// The minimum major version of OAR that we can write. + /// + public static int MIN_MAJOR_VERSION = 0; + + /// + /// The maximum major version of OAR that we can write. + /// + public static int MAX_MAJOR_VERSION = 1; + protected Scene m_scene; protected Stream m_saveStream; protected Guid m_requestId; @@ -98,78 +109,163 @@ namespace OpenSim.Region.CoreModules.World.Archiver /// Archive the region requested. /// /// if there was an io problem with creating the file - public void ArchiveRegion() + public void ArchiveRegion(Dictionary options) { - Dictionary assetUuids = new Dictionary(); - - List entities = m_scene.GetEntities(); - List sceneObjects = new List(); - - /* - foreach (ILandObject lo in m_scene.LandChannel.AllParcels()) - { - if (name == lo.LandData.Name) + try + { + Dictionary assetUuids = new Dictionary(); + + EntityBase[] entities = m_scene.GetEntities(); + List sceneObjects = new List(); + + /* + foreach (ILandObject lo in m_scene.LandChannel.AllParcels()) { - // This is the parcel we want + if (name == lo.LandData.Name) + { + // This is the parcel we want + } + } + */ + + // Filter entities so that we only have scene objects. + // FIXME: Would be nicer to have this as a proper list in SceneGraph, since lots of methods + // end up having to do this + foreach (EntityBase entity in entities) + { + if (entity is SceneObjectGroup) + { + SceneObjectGroup sceneObject = (SceneObjectGroup)entity; + + if (!sceneObject.IsDeleted && !sceneObject.IsAttachment) + sceneObjects.Add((SceneObjectGroup)entity); } } - */ - - // Filter entities so that we only have scene objects. - // FIXME: Would be nicer to have this as a proper list in SceneGraph, since lots of methods - // end up having to do this - foreach (EntityBase entity in entities) - { - if (entity is SceneObjectGroup) + + UuidGatherer assetGatherer = new UuidGatherer(m_scene.AssetService); + + foreach (SceneObjectGroup sceneObject in sceneObjects) { - SceneObjectGroup sceneObject = (SceneObjectGroup)entity; - - if (!sceneObject.IsDeleted && !sceneObject.IsAttachment) - sceneObjects.Add((SceneObjectGroup)entity); + assetGatherer.GatherAssetUuids(sceneObject, assetUuids); + } + + m_log.DebugFormat( + "[ARCHIVER]: {0} scene objects to serialize requiring save of {1} assets", + sceneObjects.Count, assetUuids.Count); + + // Make sure that we also request terrain texture assets + RegionSettings regionSettings = m_scene.RegionInfo.RegionSettings; + + if (regionSettings.TerrainTexture1 != RegionSettings.DEFAULT_TERRAIN_TEXTURE_1) + assetUuids[regionSettings.TerrainTexture1] = AssetType.Texture; + + if (regionSettings.TerrainTexture2 != RegionSettings.DEFAULT_TERRAIN_TEXTURE_2) + assetUuids[regionSettings.TerrainTexture2] = AssetType.Texture; + + if (regionSettings.TerrainTexture3 != RegionSettings.DEFAULT_TERRAIN_TEXTURE_3) + assetUuids[regionSettings.TerrainTexture3] = AssetType.Texture; + + if (regionSettings.TerrainTexture4 != RegionSettings.DEFAULT_TERRAIN_TEXTURE_4) + assetUuids[regionSettings.TerrainTexture4] = AssetType.Texture; + + TarArchiveWriter archiveWriter = new TarArchiveWriter(m_saveStream); + + // Asynchronously request all the assets required to perform this archive operation + ArchiveWriteRequestExecution awre + = new ArchiveWriteRequestExecution( + sceneObjects, + m_scene.RequestModuleInterface(), + m_scene.RequestModuleInterface(), + m_scene, + archiveWriter, + m_requestId, + options); + + m_log.InfoFormat("[ARCHIVER]: Creating archive file. This may take some time."); + + // Write out control file. This has to be done first so that subsequent loaders will see this file first + // XXX: I know this is a weak way of doing it since external non-OAR aware tar executables will not do this + archiveWriter.WriteFile(ArchiveConstants.CONTROL_FILE_PATH, CreateControlFile(options)); + m_log.InfoFormat("[ARCHIVER]: Added control file to archive."); + + new AssetsRequest( + new AssetsArchiver(archiveWriter), assetUuids, + m_scene.AssetService, awre.ReceivedAllAssets).Execute(); + } + catch (Exception) + { + m_saveStream.Close(); + throw; + } + } + + /// + /// Create the control file for the most up to date archive + /// + /// + public static string CreateControlFile(Dictionary options) + { + int majorVersion = MAX_MAJOR_VERSION, minorVersion = 0; + + if (options.ContainsKey("version")) + { + string[] parts = options["version"].ToString().Split('.'); + if (parts.Length >= 1) + { + majorVersion = Int32.Parse(parts[0]); + + if (parts.Length >= 2) + minorVersion = Int32.Parse(parts[1]); } } - UuidGatherer assetGatherer = new UuidGatherer(m_scene.AssetService); - - foreach (SceneObjectGroup sceneObject in sceneObjects) + if (majorVersion < MIN_MAJOR_VERSION || majorVersion > MAX_MAJOR_VERSION) { - assetGatherer.GatherAssetUuids(sceneObject, assetUuids); + throw new Exception( + string.Format( + "OAR version number for save must be between {0} and {1}", + MIN_MAJOR_VERSION, MAX_MAJOR_VERSION)); } + else if (majorVersion == MAX_MAJOR_VERSION) + { + // Force 1.0 + minorVersion = 0; + } + else if (majorVersion == MIN_MAJOR_VERSION) + { + // Force 0.4 + minorVersion = 4; + } + + m_log.InfoFormat("[ARCHIVER]: Creating version {0}.{1} OAR", majorVersion, minorVersion); + if (majorVersion == 1) + { + m_log.WarnFormat("[ARCHIVER]: Please be aware that version 1.0 OARs are not compatible with OpenSim 0.7.0.2 and earlier. Please use the --version=0 option if you want to produce a compatible OAR"); + } + + StringWriter sw = new StringWriter(); + XmlTextWriter xtw = new XmlTextWriter(sw); + xtw.Formatting = Formatting.Indented; + xtw.WriteStartDocument(); + xtw.WriteStartElement("archive"); + xtw.WriteAttributeString("major_version", majorVersion.ToString()); + xtw.WriteAttributeString("minor_version", minorVersion.ToString()); - m_log.DebugFormat( - "[ARCHIVER]: {0} scene objects to serialize requiring save of {1} assets", - sceneObjects.Count, assetUuids.Count); - - // Make sure that we also request terrain texture assets - RegionSettings regionSettings = m_scene.RegionInfo.RegionSettings; + xtw.WriteStartElement("creation_info"); + DateTime now = DateTime.UtcNow; + TimeSpan t = now - new DateTime(1970, 1, 1); + xtw.WriteElementString("datetime", ((int)t.TotalSeconds).ToString()); + xtw.WriteElementString("id", UUID.Random().ToString()); + xtw.WriteEndElement(); + xtw.WriteEndElement(); - if (regionSettings.TerrainTexture1 != RegionSettings.DEFAULT_TERRAIN_TEXTURE_1) - assetUuids[regionSettings.TerrainTexture1] = AssetType.Texture; - - if (regionSettings.TerrainTexture2 != RegionSettings.DEFAULT_TERRAIN_TEXTURE_2) - assetUuids[regionSettings.TerrainTexture2] = AssetType.Texture; - - if (regionSettings.TerrainTexture3 != RegionSettings.DEFAULT_TERRAIN_TEXTURE_3) - assetUuids[regionSettings.TerrainTexture3] = AssetType.Texture; - - if (regionSettings.TerrainTexture4 != RegionSettings.DEFAULT_TERRAIN_TEXTURE_4) - assetUuids[regionSettings.TerrainTexture4] = AssetType.Texture; + xtw.Flush(); + xtw.Close(); - TarArchiveWriter archiveWriter = new TarArchiveWriter(m_saveStream); - - // Asynchronously request all the assets required to perform this archive operation - ArchiveWriteRequestExecution awre - = new ArchiveWriteRequestExecution( - sceneObjects, - m_scene.RequestModuleInterface(), - m_scene.RequestModuleInterface(), - m_scene, - archiveWriter, - m_requestId); - - new AssetsRequest( - new AssetsArchiver(archiveWriter), assetUuids, - m_scene.AssetService, awre.ReceivedAllAssets).Execute(); + String s = sw.ToString(); + sw.Close(); + + return s; } } } diff --git a/OpenSim/Region/CoreModules/World/Archiver/ArchiverModule.cs b/OpenSim/Region/CoreModules/World/Archiver/ArchiverModule.cs index 82ede01d01..2d7244e48b 100644 --- a/OpenSim/Region/CoreModules/World/Archiver/ArchiverModule.cs +++ b/OpenSim/Region/CoreModules/World/Archiver/ArchiverModule.cs @@ -122,37 +122,45 @@ namespace OpenSim.Region.CoreModules.World.Archiver /// public void HandleSaveOarConsoleCommand(string module, string[] cmdparams) { - if (cmdparams.Length > 2) + Dictionary options = new Dictionary(); + + OptionSet ops = new OptionSet(); + ops.Add("v|version=", delegate(string v) { options["version"] = v; }); + ops.Add("p|profile=", delegate(string v) { options["profile"] = v; }); + + List mainParams = ops.Parse(cmdparams); + + if (mainParams.Count > 2) { - ArchiveRegion(cmdparams[2]); + ArchiveRegion(mainParams[2], options); } else { - ArchiveRegion(DEFAULT_OAR_BACKUP_FILENAME); + ArchiveRegion(DEFAULT_OAR_BACKUP_FILENAME, options); } } - public void ArchiveRegion(string savePath) + public void ArchiveRegion(string savePath, Dictionary options) { - ArchiveRegion(savePath, Guid.Empty); + ArchiveRegion(savePath, Guid.Empty, options); } - - public void ArchiveRegion(string savePath, Guid requestId) + + public void ArchiveRegion(string savePath, Guid requestId, Dictionary options) { m_log.InfoFormat( "[ARCHIVER]: Writing archive for region {0} to {1}", m_scene.RegionInfo.RegionName, savePath); - new ArchiveWriteRequestPreparation(m_scene, savePath, requestId).ArchiveRegion(); + new ArchiveWriteRequestPreparation(m_scene, savePath, requestId).ArchiveRegion(options); } - + public void ArchiveRegion(Stream saveStream) { ArchiveRegion(saveStream, Guid.Empty); } - + public void ArchiveRegion(Stream saveStream, Guid requestId) { - new ArchiveWriteRequestPreparation(m_scene, saveStream, requestId).ArchiveRegion(); + new ArchiveWriteRequestPreparation(m_scene, saveStream, requestId).ArchiveRegion(new Dictionary()); } public void DearchiveRegion(string loadPath) diff --git a/OpenSim/Region/CoreModules/World/Archiver/AssetsRequest.cs b/OpenSim/Region/CoreModules/World/Archiver/AssetsRequest.cs index a1451ce705..d4a09b45f7 100644 --- a/OpenSim/Region/CoreModules/World/Archiver/AssetsRequest.cs +++ b/OpenSim/Region/CoreModules/World/Archiver/AssetsRequest.cs @@ -188,7 +188,7 @@ namespace OpenSim.Region.CoreModules.World.Archiver m_log.ErrorFormat( "[ARCHIVER]: (... {0} more not shown)", uuids.Count - MAX_UUID_DISPLAY_ON_TIMEOUT); - m_log.Error("[ARCHIVER]: OAR save aborted."); + m_log.Error("[ARCHIVER]: OAR save aborted. PLEASE DO NOT USE THIS OAR, IT WILL BE INCOMPLETE."); } catch (Exception e) { diff --git a/OpenSim/Region/CoreModules/World/Archiver/Tests/ArchiverTests.cs b/OpenSim/Region/CoreModules/World/Archiver/Tests/ArchiverTests.cs index 58698ee189..04b6e3d3f9 100644 --- a/OpenSim/Region/CoreModules/World/Archiver/Tests/ArchiverTests.cs +++ b/OpenSim/Region/CoreModules/World/Archiver/Tests/ArchiverTests.cs @@ -48,6 +48,7 @@ using OpenSim.Tests.Common.Setup; using ArchiveConstants = OpenSim.Framework.Serialization.ArchiveConstants; using TarArchiveReader = OpenSim.Framework.Serialization.TarArchiveReader; using TarArchiveWriter = OpenSim.Framework.Serialization.TarArchiveWriter; +using RegionSettings = OpenSim.Framework.RegionSettings; namespace OpenSim.Region.CoreModules.World.Archiver.Tests { @@ -121,13 +122,13 @@ namespace OpenSim.Region.CoreModules.World.Archiver.Tests } /// - /// Test saving a V0.2 OpenSim Region Archive. + /// Test saving an OpenSim Region Archive. /// [Test] - public void TestSaveOarV0_2() + public void TestSaveOar() { TestHelper.InMethod(); - //log4net.Config.XmlConfigurator.Configure(); +// log4net.Config.XmlConfigurator.Configure(); SceneObjectPart part1 = CreateSceneObjectPart1(); SceneObjectGroup sog1 = new SceneObjectGroup(part1); @@ -135,7 +136,9 @@ namespace OpenSim.Region.CoreModules.World.Archiver.Tests SceneObjectPart part2 = CreateSceneObjectPart2(); - AssetNotecard nc = new AssetNotecard("Hello World!"); + AssetNotecard nc = new AssetNotecard(); + nc.BodyText = "Hello World!"; + nc.Encode(); UUID ncAssetUuid = new UUID("00000000-0000-0000-1000-000000000000"); UUID ncItemUuid = new UUID("00000000-0000-0000-1100-000000000000"); AssetBase ncAsset @@ -209,13 +212,13 @@ namespace OpenSim.Region.CoreModules.World.Archiver.Tests } /// - /// Test loading a V0.2 OpenSim Region Archive. + /// Test loading an OpenSim Region Archive. /// [Test] - public void TestLoadOarV0_2() + public void TestLoadOar() { TestHelper.InMethod(); - //log4net.Config.XmlConfigurator.Configure(); +// log4net.Config.XmlConfigurator.Configure(); MemoryStream archiveWriteStream = new MemoryStream(); TarArchiveWriter tar = new TarArchiveWriter(archiveWriteStream); @@ -227,7 +230,7 @@ namespace OpenSim.Region.CoreModules.World.Archiver.Tests // upset load tar.WriteDir(ArchiveConstants.TERRAINS_PATH); - tar.WriteFile(ArchiveConstants.CONTROL_FILE_PATH, ArchiveWriteRequestExecution.Create0p2ControlFile()); + tar.WriteFile(ArchiveConstants.CONTROL_FILE_PATH, ArchiveWriteRequestPreparation.CreateControlFile(new Dictionary())); SceneObjectPart part1 = CreateSceneObjectPart1(); SceneObjectGroup object1 = new SceneObjectGroup(part1); @@ -314,10 +317,10 @@ namespace OpenSim.Region.CoreModules.World.Archiver.Tests } /// - /// Test loading the region settings of a V0.2 OpenSim Region Archive. + /// Test loading the region settings of an OpenSim Region Archive. /// [Test] - public void TestLoadOarV0_2RegionSettings() + public void TestLoadOarRegionSettings() { TestHelper.InMethod(); //log4net.Config.XmlConfigurator.Configure(); @@ -326,7 +329,7 @@ namespace OpenSim.Region.CoreModules.World.Archiver.Tests TarArchiveWriter tar = new TarArchiveWriter(archiveWriteStream); tar.WriteDir(ArchiveConstants.TERRAINS_PATH); - tar.WriteFile(ArchiveConstants.CONTROL_FILE_PATH, ArchiveWriteRequestExecution.Create0p2ControlFile()); + tar.WriteFile(ArchiveConstants.CONTROL_FILE_PATH, ArchiveWriteRequestPreparation.CreateControlFile(new Dictionary())); RegionSettings rs = new RegionSettings(); rs.AgentLimit = 17; @@ -406,10 +409,10 @@ namespace OpenSim.Region.CoreModules.World.Archiver.Tests } /// - /// Test merging a V0.2 OpenSim Region Archive into an existing scene + /// Test merging an OpenSim Region Archive into an existing scene /// //[Test] - public void TestMergeOarV0_2() + public void TestMergeOar() { TestHelper.InMethod(); //XmlConfigurator.Configure(); diff --git a/OpenSim/Region/CoreModules/World/Estate/EstateManagementModule.cs b/OpenSim/Region/CoreModules/World/Estate/EstateManagementModule.cs index 940b535921..622fc0802d 100644 --- a/OpenSim/Region/CoreModules/World/Estate/EstateManagementModule.cs +++ b/OpenSim/Region/CoreModules/World/Estate/EstateManagementModule.cs @@ -343,7 +343,6 @@ namespace OpenSim.Region.CoreModules.World.Estate { if (!s.IsChildAgent) { - s.ControllingClient.SendTeleportLocationStart(); m_scene.TeleportClientHome(user, s.ControllingClient); } } @@ -478,7 +477,6 @@ namespace OpenSim.Region.CoreModules.World.Estate ScenePresence s = m_scene.GetScenePresence(prey); if (s != null) { - s.ControllingClient.SendTeleportLocationStart(); m_scene.TeleportClientHome(prey, s.ControllingClient); } } @@ -498,7 +496,6 @@ namespace OpenSim.Region.CoreModules.World.Estate // Also make sure they are actually in the region if (p != null && !p.IsChildAgent) { - p.ControllingClient.SendTeleportLocationStart(); m_scene.TeleportClientHome(p.UUID, p.ControllingClient); } } @@ -673,6 +670,7 @@ namespace OpenSim.Region.CoreModules.World.Estate args.useEstateSun = m_scene.RegionInfo.RegionSettings.UseEstateSun; args.waterHeight = (float)m_scene.RegionInfo.RegionSettings.WaterHeight; args.simName = m_scene.RegionInfo.RegionName; + args.regionType = m_scene.RegionInfo.RegionType; remote_client.SendRegionInfoToEstateMenu(args); } @@ -684,6 +682,9 @@ namespace OpenSim.Region.CoreModules.World.Estate private void HandleLandStatRequest(int parcelID, uint reportType, uint requestFlags, string filter, IClientAPI remoteClient) { + if (!m_scene.Permissions.CanIssueEstateCommand(remoteClient.AgentId, false)) + return; + Dictionary SceneData = new Dictionary(); List uuidNameLookupList = new List(); @@ -770,8 +771,14 @@ namespace OpenSim.Region.CoreModules.World.Estate for (int i = 0; i < uuidarr.Length; i++) { // string lookupname = m_scene.CommsManager.UUIDNameRequestString(uuidarr[i]); - m_scene.GetUserName(uuidarr[i]); + + IUserManagement userManager = m_scene.RequestModuleInterface(); + string userName = "Unkown User"; + if (userManager != null) + userName = userManager.GetUserName(uuidarr[i]); + // we drop it. It gets cached though... so we're ready for the next request. + // diva commnent 11/21/2010: uh?!? wft? } } #endregion @@ -1097,12 +1104,14 @@ namespace OpenSim.Region.CoreModules.World.Estate if (m_scene.RegionInfo.RegionSettings.AllowLandJoinDivide) flags |= RegionFlags.AllowParcelChanges; if (m_scene.RegionInfo.RegionSettings.BlockShowInSearch) - flags |= (RegionFlags)(1 << 29); + flags |= RegionFlags.BlockParcelSearch; if (m_scene.RegionInfo.RegionSettings.FixedSun) flags |= RegionFlags.SunFixed; if (m_scene.RegionInfo.RegionSettings.Sandbox) flags |= RegionFlags.Sandbox; + if (m_scene.RegionInfo.EstateSettings.AllowVoice) + flags |= RegionFlags.AllowVoice; // Fudge these to always on, so the menu options activate // diff --git a/OpenSim/Region/CoreModules/World/Land/LandManagementModule.cs b/OpenSim/Region/CoreModules/World/Land/LandManagementModule.cs index 4ccd0f03cb..695202f741 100644 --- a/OpenSim/Region/CoreModules/World/Land/LandManagementModule.cs +++ b/OpenSim/Region/CoreModules/World/Land/LandManagementModule.cs @@ -33,6 +33,8 @@ using System.Reflection; using log4net; using Nini.Config; using OpenMetaverse; +using OpenMetaverse.StructuredData; +using OpenMetaverse.Messages.Linden; using OpenSim.Framework; using OpenSim.Framework.Capabilities; using OpenSim.Framework.Servers; @@ -51,6 +53,7 @@ namespace OpenSim.Region.CoreModules.World.Land public LandData LandData; public ulong RegionHandle; public uint X, Y; + public byte RegionAccess; } public class LandManagementModule : INonSharedRegionModule @@ -69,12 +72,12 @@ namespace OpenSim.Region.CoreModules.World.Land #pragma warning restore 0429 /// - /// Local land ids at specified region co-ordinates (region size / 4) + /// Local land ids at specified region co-ordinates (region size / 4) /// private readonly int[,] m_landIDList = new int[landArrayMax, landArrayMax]; /// - /// Land objects keyed by local id + /// Land objects keyed by local id /// private readonly Dictionary m_landList = new Dictionary(); @@ -85,12 +88,13 @@ namespace OpenSim.Region.CoreModules.World.Land // caches ExtendedLandData private Cache parcelInfoCache; - private Vector3? forcedPosition = null; + private Dictionary forcedPosition = + new Dictionary(); #region INonSharedRegionModule Members - public Type ReplaceableInterface - { + public Type ReplaceableInterface + { get { return null; } } @@ -138,12 +142,12 @@ namespace OpenSim.Region.CoreModules.World.Land { } - private bool OnVerifyUserConnection(ScenePresence scenePresence, out string reason) - { - ILandObject nearestParcel = m_scene.GetNearestAllowedParcel(scenePresence.UUID, scenePresence.AbsolutePosition.X, scenePresence.AbsolutePosition.Y); - reason = "You are not allowed to enter this sim."; - return nearestParcel != null; - } +// private bool OnVerifyUserConnection(ScenePresence scenePresence, out string reason) +// { +// ILandObject nearestParcel = m_scene.GetNearestAllowedParcel(scenePresence.UUID, scenePresence.AbsolutePosition.X, scenePresence.AbsolutePosition.Y); +// reason = "You are not allowed to enter this sim."; +// return nearestParcel != null; +// } void EventManagerOnNewClient(IClientAPI client) { @@ -160,7 +164,6 @@ namespace OpenSim.Region.CoreModules.World.Land client.OnParcelGodForceOwner += ClientOnParcelGodForceOwner; client.OnParcelReclaim += ClientOnParcelReclaim; client.OnParcelInfoRequest += ClientOnParcelInfoRequest; - client.OnParcelDwellRequest += ClientOnParcelDwellRequest; client.OnParcelDeedToGroup += ClientOnParcelDeedToGroup; client.OnPreAgentUpdate += ClientOnPreAgentUpdate; @@ -175,7 +178,7 @@ namespace OpenSim.Region.CoreModules.World.Land void ClientOnPreAgentUpdate(IClientAPI remoteClient, AgentUpdateArgs agentData) { //If we are forcing a position for them to go - if (forcedPosition != null) + if (forcedPosition.ContainsKey(remoteClient.AgentId)) { ScenePresence clientAvatar = m_scene.GetScenePresence(remoteClient.AgentId); @@ -185,23 +188,23 @@ namespace OpenSim.Region.CoreModules.World.Land //Make sure we stop if they get about to the right place to prevent yoyo and prevents getting stuck on banlines - if (Vector3.Distance(clientAvatar.AbsolutePosition, forcedPosition.Value) < .2) + if (Vector3.Distance(clientAvatar.AbsolutePosition, forcedPosition[remoteClient.AgentId]) < .2) { - Debug.WriteLine(string.Format("Stopping force position because {0} is close enough to position {1}", forcedPosition.Value, clientAvatar.AbsolutePosition)); - forcedPosition = null; + Debug.WriteLine(string.Format("Stopping force position because {0} is close enough to position {1}", forcedPosition[remoteClient.AgentId], clientAvatar.AbsolutePosition)); + forcedPosition.Remove(remoteClient.AgentId); } - //if we are far away, teleport - else if (Vector3.Distance(clientAvatar.AbsolutePosition, forcedPosition.Value) > 3) + //if we are far away, teleport + else if (Vector3.Distance(clientAvatar.AbsolutePosition, forcedPosition[remoteClient.AgentId]) > 3) { - Debug.WriteLine(string.Format("Teleporting out because {0} is too far from avatar position {1}", forcedPosition.Value, clientAvatar.AbsolutePosition)); - clientAvatar.Teleport(forcedPosition.Value); - forcedPosition = null; + Debug.WriteLine(string.Format("Teleporting out because {0} is too far from avatar position {1}", forcedPosition[remoteClient.AgentId], clientAvatar.AbsolutePosition)); + clientAvatar.Teleport(forcedPosition[remoteClient.AgentId]); + forcedPosition.Remove(remoteClient.AgentId); } else { //Forces them toward the forced position we want if they aren't there yet agentData.UseClientAgentPosition = true; - agentData.ClientAgentPosition = forcedPosition.Value; + agentData.ClientAgentPosition = forcedPosition[remoteClient.AgentId]; } } } @@ -319,14 +322,12 @@ namespace OpenSim.Region.CoreModules.World.Land } } - - private void ForceAvatarToPosition(ScenePresence avatar, Vector3? position) { if (m_scene.Permissions.IsGod(avatar.UUID)) return; if (position.HasValue) { - forcedPosition = position; + forcedPosition[avatar.ControllingClient.AgentId] = (Vector3)position; } } @@ -334,7 +335,6 @@ namespace OpenSim.Region.CoreModules.World.Land { avatar.ControllingClient.SendAlertMessage( "You are not allowed on this parcel because the land owner has restricted access."); - } public void EventManagerOnAvatarEnteringNewParcel(ScenePresence avatar, int localLandID, UUID regionID) @@ -446,7 +446,7 @@ namespace OpenSim.Region.CoreModules.World.Land if (clientAvatar.AbsolutePosition.Z < LandChannel.BAN_LINE_SAFETY_HIEGHT && clientAvatar.sentMessageAboutRestrictedParcelFlyingDown) { - EventManagerOnAvatarEnteringNewParcel(clientAvatar, parcel.LandData.LocalID, + EventManagerOnAvatarEnteringNewParcel(clientAvatar, parcel.LandData.LocalID, m_scene.RegionInfo.RegionID); //They are going under the safety line! if (!parcel.IsBannedFromLand(clientAvatar.UUID)) @@ -458,7 +458,7 @@ namespace OpenSim.Region.CoreModules.World.Land parcel.IsBannedFromLand(clientAvatar.UUID)) { //once we've sent the message once, keep going toward the target until we are done - if (forcedPosition == null) + if (forcedPosition.ContainsKey(clientAvatar.ControllingClient.AgentId)) { SendYouAreBannedNotice(clientAvatar); ForceAvatarToPosition(clientAvatar, m_scene.GetNearestAllowedPosition(clientAvatar)); @@ -467,7 +467,7 @@ namespace OpenSim.Region.CoreModules.World.Land else if (parcel.IsRestrictedFromLand(clientAvatar.UUID)) { //once we've sent the message once, keep going toward the target until we are done - if (forcedPosition == null) + if (forcedPosition.ContainsKey(clientAvatar.ControllingClient.AgentId)) { SendYouAreRestrictedNotice(clientAvatar); ForceAvatarToPosition(clientAvatar, m_scene.GetNearestAllowedPosition(clientAvatar)); @@ -476,7 +476,7 @@ namespace OpenSim.Region.CoreModules.World.Land else { //when we are finally in a safe place, lets release the forced position lock - forcedPosition = null; + forcedPosition.Remove(clientAvatar.ControllingClient.AgentId); } } } @@ -650,7 +650,7 @@ namespace OpenSim.Region.CoreModules.World.Land if (x_float > Constants.RegionSize || x_float <= 0 || y_float > Constants.RegionSize || y_float <= 0) return null; - + try { x = Convert.ToInt32(Math.Floor(Convert.ToDouble(x_float) / 4.0)); @@ -665,7 +665,7 @@ namespace OpenSim.Region.CoreModules.World.Land { return null; } - + lock (m_landList) { // Corner case. If an autoreturn happens during sim startup @@ -685,7 +685,7 @@ namespace OpenSim.Region.CoreModules.World.Land // they happen every time at border crossings throw new Exception("Error: Parcel not found at point " + x + ", " + y); } - + lock (m_landIDList) { try @@ -739,7 +739,6 @@ namespace OpenSim.Region.CoreModules.World.Land public void EventManagerOnObjectBeingRemovedFromScene(SceneObjectGroup obj) { - lock (m_landList) { foreach (LandObject p in m_landList.Values) @@ -792,7 +791,8 @@ namespace OpenSim.Region.CoreModules.World.Land public void EventManagerOnParcelPrimCountUpdate() { ResetAllLandPrimCounts(); - foreach (EntityBase obj in m_scene.Entities) + EntityBase[] entities = m_scene.Entities.GetEntities(); + foreach (EntityBase obj in entities) { if (obj != null) { @@ -933,7 +933,7 @@ namespace OpenSim.Region.CoreModules.World.Land return; } } - + lock (m_landList) { foreach (ILandObject slaveLandObject in selectedLandObjects) @@ -1065,7 +1065,6 @@ namespace OpenSim.Region.CoreModules.World.Land { for (int y = 0; y < inc_y; y++) { - ILandObject currentParcel = GetLandObject(start_x + x, start_y + y); if (currentParcel != null) @@ -1076,7 +1075,6 @@ namespace OpenSim.Region.CoreModules.World.Land temp.Add(currentParcel); } } - } } @@ -1102,7 +1100,11 @@ namespace OpenSim.Region.CoreModules.World.Land m_landList.TryGetValue(localID, out land); } - if (land != null) land.UpdateLandProperties(args, remote_client); + if (land != null) + { + land.UpdateLandProperties(args, remote_client); + m_scene.EventManager.TriggerOnParcelPropertiesUpdateRequest(args, localID, remote_client); + } } public void ClientOnParcelDivideRequest(int west, int south, int east, int north, IClientAPI remote_client) @@ -1115,7 +1117,7 @@ namespace OpenSim.Region.CoreModules.World.Land join(west, south, east, north, remote_client.AgentId); } - public void ClientOnParcelSelectObjects(int local_id, int request_type, + public void ClientOnParcelSelectObjects(int local_id, int request_type, List returnIDs, IClientAPI remote_client) { m_landList[local_id].SendForceObjectSelect(local_id, request_type, returnIDs, remote_client); @@ -1352,8 +1354,72 @@ namespace OpenSim.Region.CoreModules.World.Land { return RemoteParcelRequest(request, path, param, agentID, caps); })); + UUID parcelCapID = UUID.Random(); + caps.RegisterHandler("ParcelPropertiesUpdate", + new RestStreamHandler("POST", "/CAPS/" + parcelCapID, + delegate(string request, string path, string param, + OSHttpRequest httpRequest, OSHttpResponse httpResponse) + { + return ProcessPropertiesUpdate(request, path, param, agentID, caps); + })); } + private string ProcessPropertiesUpdate(string request, string path, string param, UUID agentID, Caps caps) + { + IClientAPI client; + if (! m_scene.TryGetClient(agentID, out client)) { + m_log.WarnFormat("[LAND] unable to retrieve IClientAPI for {0}", agentID.ToString()); + return LLSDHelpers.SerialiseLLSDReply(new LLSDEmpty()); + } + ParcelPropertiesUpdateMessage properties = new ParcelPropertiesUpdateMessage(); + OpenMetaverse.StructuredData.OSDMap args = (OpenMetaverse.StructuredData.OSDMap) OSDParser.DeserializeLLSDXml(request); + + properties.Deserialize(args); + + LandUpdateArgs land_update = new LandUpdateArgs(); + int parcelID = properties.LocalID; + land_update.AuthBuyerID = properties.AuthBuyerID; + land_update.Category = properties.Category; + land_update.Desc = properties.Desc; + land_update.GroupID = properties.GroupID; + land_update.LandingType = (byte) properties.Landing; + land_update.MediaAutoScale = (byte) Convert.ToInt32(properties.MediaAutoScale); + land_update.MediaID = properties.MediaID; + land_update.MediaURL = properties.MediaURL; + land_update.MusicURL = properties.MusicURL; + land_update.Name = properties.Name; + land_update.ParcelFlags = (uint) properties.ParcelFlags; + land_update.PassHours = (int) properties.PassHours; + land_update.PassPrice = (int) properties.PassPrice; + land_update.SalePrice = (int) properties.SalePrice; + land_update.SnapshotID = properties.SnapshotID; + land_update.UserLocation = properties.UserLocation; + land_update.UserLookAt = properties.UserLookAt; + land_update.MediaDescription = properties.MediaDesc; + land_update.MediaType = properties.MediaType; + land_update.MediaWidth = properties.MediaWidth; + land_update.MediaHeight = properties.MediaHeight; + land_update.MediaLoop = properties.MediaLoop; + land_update.ObscureMusic = properties.ObscureMusic; + land_update.ObscureMedia = properties.ObscureMedia; + + ILandObject land; + lock (m_landList) + { + m_landList.TryGetValue(parcelID, out land); + } + + if (land != null) + { + land.UpdateLandProperties(land_update, client); + m_scene.EventManager.TriggerOnParcelPropertiesUpdateRequest(land_update, parcelID, client); + } + else + { + m_log.WarnFormat("[LAND] unable to find parcelID {0}", parcelID); + } + return LLSDHelpers.SerialiseLLSDReply(new LLSDEmpty()); + } // we cheat here: As we don't have (and want) a grid-global parcel-store, we can't return the // "real" parcelID, because we wouldn't be able to map that to the region the parcel belongs to. // So, we create a "fake" parcelID by using the regionHandle (64 bit), and the local (integer) x @@ -1425,47 +1491,37 @@ namespace OpenSim.Region.CoreModules.World.Land #endregion - private void ClientOnParcelDwellRequest(int localID, IClientAPI remoteClient) - { - ILandObject selectedParcel = null; - lock (m_landList) - { - if (!m_landList.TryGetValue(localID, out selectedParcel)) - return; - } - - remoteClient.SendParcelDwellReply(localID, selectedParcel.LandData.GlobalID, selectedParcel.LandData.Dwell); - } - private void ClientOnParcelInfoRequest(IClientAPI remoteClient, UUID parcelID) { if (parcelID == UUID.Zero) return; - ExtendedLandData data = - (ExtendedLandData)parcelInfoCache.Get(parcelID.ToString(), - delegate(string id) + ExtendedLandData data = + (ExtendedLandData)parcelInfoCache.Get(parcelID.ToString(), + delegate(string id) { UUID parcel = UUID.Zero; UUID.TryParse(id, out parcel); // assume we've got the parcelID we just computed in RemoteParcelRequest ExtendedLandData extLandData = new ExtendedLandData(); - Util.ParseFakeParcelID(parcel, out extLandData.RegionHandle, + Util.ParseFakeParcelID(parcel, out extLandData.RegionHandle, out extLandData.X, out extLandData.Y); m_log.DebugFormat("[LAND] got parcelinfo request for regionHandle {0}, x/y {1}/{2}", extLandData.RegionHandle, extLandData.X, extLandData.Y); - + // for this region or for somewhere else? if (extLandData.RegionHandle == m_scene.RegionInfo.RegionHandle) { extLandData.LandData = this.GetLandObject(extLandData.X, extLandData.Y).LandData; + extLandData.RegionAccess = m_scene.RegionInfo.AccessLevel; } else { ILandService landService = m_scene.RequestModuleInterface(); extLandData.LandData = landService.GetLandData(extLandData.RegionHandle, extLandData.X, - extLandData.Y); + extLandData.Y, + out extLandData.RegionAccess); if (extLandData.LandData == null) { // we didn't find the region/land => don't cache @@ -1497,6 +1553,7 @@ namespace OpenSim.Region.CoreModules.World.Land r.RegionName = info.RegionName; r.RegionLocX = (uint)info.RegionLocX; r.RegionLocY = (uint)info.RegionLocY; + r.RegionSettings.Maturity = (int)Util.ConvertAccessLevelToMaturity(data.RegionAccess); remoteClient.SendParcelInfo(r, data.LandData, parcelID, data.X, data.Y); } else diff --git a/OpenSim/Region/CoreModules/World/Land/LandObject.cs b/OpenSim/Region/CoreModules/World/Land/LandObject.cs index 2a87da28bb..d87352f849 100644 --- a/OpenSim/Region/CoreModules/World/Land/LandObject.cs +++ b/OpenSim/Region/CoreModules/World/Land/LandObject.cs @@ -229,6 +229,13 @@ namespace OpenSim.Region.CoreModules.World.Land newData.SnapshotID = args.SnapshotID; newData.UserLocation = args.UserLocation; newData.UserLookAt = args.UserLookAt; + newData.MediaType = args.MediaType; + newData.MediaDescription = args.MediaDescription; + newData.MediaWidth = args.MediaWidth; + newData.MediaHeight = args.MediaHeight; + newData.MediaLoop = args.MediaLoop; + newData.ObscureMusic = args.ObscureMusic; + newData.ObscureMedia = args.ObscureMedia; m_scene.LandChannel.UpdateLandObject(LandData.LocalID, newData); @@ -283,6 +290,9 @@ namespace OpenSim.Region.CoreModules.World.Land public bool IsBannedFromLand(UUID avatar) { + if (m_scene.Permissions.IsAdministrator(avatar)) + return false; + if ((LandData.Flags & (uint) ParcelFlags.UseBanList) > 0) { ParcelManager.ParcelAccessEntry entry = new ParcelManager.ParcelAccessEntry(); @@ -301,6 +311,9 @@ namespace OpenSim.Region.CoreModules.World.Land public bool IsRestrictedFromLand(UUID avatar) { + if (m_scene.Permissions.IsAdministrator(avatar)) + return false; + if ((LandData.Flags & (uint) ParcelFlags.UseAccessList) > 0) { ParcelManager.ParcelAccessEntry entry = new ParcelManager.ParcelAccessEntry(); diff --git a/OpenSim/Region/CoreModules/World/WorldMap/IMapTileTerrainRenderer.cs b/OpenSim/Region/CoreModules/World/LegacyMap/IMapTileTerrainRenderer.cs similarity index 97% rename from OpenSim/Region/CoreModules/World/WorldMap/IMapTileTerrainRenderer.cs rename to OpenSim/Region/CoreModules/World/LegacyMap/IMapTileTerrainRenderer.cs index de9bb1d471..e892b1479c 100644 --- a/OpenSim/Region/CoreModules/World/WorldMap/IMapTileTerrainRenderer.cs +++ b/OpenSim/Region/CoreModules/World/LegacyMap/IMapTileTerrainRenderer.cs @@ -29,7 +29,7 @@ using System.Drawing; using Nini.Config; using OpenSim.Region.Framework.Scenes; -namespace OpenSim.Region.CoreModules.World.WorldMap +namespace OpenSim.Region.CoreModules.World.LegacyMap { public interface IMapTileTerrainRenderer { diff --git a/OpenSim/Region/CoreModules/World/WorldMap/MapImageModule.cs b/OpenSim/Region/CoreModules/World/LegacyMap/MapImageModule.cs similarity index 92% rename from OpenSim/Region/CoreModules/World/WorldMap/MapImageModule.cs rename to OpenSim/Region/CoreModules/World/LegacyMap/MapImageModule.cs index b96d95a09c..f86c7906a4 100644 --- a/OpenSim/Region/CoreModules/World/WorldMap/MapImageModule.cs +++ b/OpenSim/Region/CoreModules/World/LegacyMap/MapImageModule.cs @@ -37,7 +37,7 @@ using OpenSim.Framework; using OpenSim.Region.Framework.Interfaces; using OpenSim.Region.Framework.Scenes; -namespace OpenSim.Region.CoreModules.World.WorldMap +namespace OpenSim.Region.CoreModules.World.LegacyMap { public enum DrawRoutine { @@ -59,7 +59,7 @@ namespace OpenSim.Region.CoreModules.World.WorldMap public face[] trns; } - public class MapImageModule : IMapImageGenerator, IRegionModule + public class MapImageModule : IMapImageGenerator, INonSharedRegionModule { private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); @@ -67,10 +67,11 @@ namespace OpenSim.Region.CoreModules.World.WorldMap private Scene m_scene; private IConfigSource m_config; private IMapTileTerrainRenderer terrainRenderer; + private bool m_Enabled = false; #region IMapImageGenerator Members - public Bitmap CreateMapTile(string gradientmap) + public Bitmap CreateMapTile() { bool drawPrimVolume = true; bool textureTerrain = false; @@ -113,11 +114,11 @@ namespace OpenSim.Region.CoreModules.World.WorldMap return mapbmp; } - public byte[] WriteJpeg2000Image(string gradientmap) + public byte[] WriteJpeg2000Image() { try { - using (Bitmap mapbmp = CreateMapTile(gradientmap)) + using (Bitmap mapbmp = CreateMapTile()) return OpenJPEG.EncodeFromImage(mapbmp, true); } catch (Exception e) // LEGIT: Catching problems caused by OpenJPEG p/invoke @@ -132,9 +133,8 @@ namespace OpenSim.Region.CoreModules.World.WorldMap #region IRegionModule Members - public void Initialise(Scene scene, IConfigSource source) + public void Initialise(IConfigSource source) { - m_scene = scene; m_config = source; IConfig startupConfig = m_config.Configs["Startup"]; @@ -142,10 +142,24 @@ namespace OpenSim.Region.CoreModules.World.WorldMap "MapImageModule") return; + m_Enabled = true; + } + + public void AddRegion(Scene scene) + { + if (!m_Enabled) + return; + + m_scene = scene; + m_scene.RegisterModuleInterface(this); } - public void PostInitialise() + public void RegionLoaded(Scene scene) + { + } + + public void RemoveRegion(Scene scene) { } @@ -158,9 +172,9 @@ namespace OpenSim.Region.CoreModules.World.WorldMap get { return "MapImageModule"; } } - public bool IsSharedModule + public Type ReplaceableInterface { - get { return false; } + get { return null; } } #endregion @@ -212,7 +226,7 @@ namespace OpenSim.Region.CoreModules.World.WorldMap double[,] hm = whichScene.Heightmap.GetDoubles(); tc = Environment.TickCount; m_log.Info("[MAPTILE]: Generating Maptile Step 2: Object Volume Profile"); - List objs = whichScene.GetEntities(); + EntityBase[] objs = whichScene.GetEntities(); Dictionary z_sort = new Dictionary(); //SortedList z_sort = new SortedList(); List z_sortheights = new List(); @@ -227,8 +241,9 @@ namespace OpenSim.Region.CoreModules.World.WorldMap { SceneObjectGroup mapdot = (SceneObjectGroup)obj; Color mapdotspot = Color.Gray; // Default color when prim color is white + // Loop over prim in group - foreach (SceneObjectPart part in mapdot.Children.Values) + foreach (SceneObjectPart part in mapdot.Parts) { if (part == null) continue; @@ -545,43 +560,9 @@ namespace OpenSim.Region.CoreModules.World.WorldMap return returnpt; } -// TODO: unused: -// #region Deprecated Maptile Generation. Adam may update this -// private Bitmap TerrainToBitmap(string gradientmap) -// { -// Bitmap gradientmapLd = new Bitmap(gradientmap); -// -// int pallete = gradientmapLd.Height; -// -// Bitmap bmp = new Bitmap(m_scene.Heightmap.Width, m_scene.Heightmap.Height); -// Color[] colours = new Color[pallete]; -// -// for (int i = 0; i < pallete; i++) -// { -// colours[i] = gradientmapLd.GetPixel(0, i); -// } -// -// lock (m_scene.Heightmap) -// { -// ITerrainChannel copy = m_scene.Heightmap; -// for (int y = 0; y < copy.Height; y++) -// { -// for (int x = 0; x < copy.Width; x++) -// { -// // 512 is the largest possible height before colours clamp -// int colorindex = (int) (Math.Max(Math.Min(1.0, copy[x, y] / 512.0), 0.0) * (pallete - 1)); -// -// // Handle error conditions -// if (colorindex > pallete - 1 || colorindex < 0) -// bmp.SetPixel(x, copy.Height - y - 1, Color.Red); -// else -// bmp.SetPixel(x, copy.Height - y - 1, colours[colorindex]); -// } -// } -// ShadeBuildings(bmp); -// return bmp; -// } -// } -// #endregion + public Bitmap CreateViewImage(Vector3 camPos, Vector3 camDir, float fov, int width, int height, bool useTextures) + { + return null; + } } } diff --git a/OpenSim/Region/CoreModules/World/WorldMap/ShadedMapTileRenderer.cs b/OpenSim/Region/CoreModules/World/LegacyMap/ShadedMapTileRenderer.cs similarity index 99% rename from OpenSim/Region/CoreModules/World/WorldMap/ShadedMapTileRenderer.cs rename to OpenSim/Region/CoreModules/World/LegacyMap/ShadedMapTileRenderer.cs index fef2ef3995..eb1a27f9ec 100644 --- a/OpenSim/Region/CoreModules/World/WorldMap/ShadedMapTileRenderer.cs +++ b/OpenSim/Region/CoreModules/World/LegacyMap/ShadedMapTileRenderer.cs @@ -33,7 +33,7 @@ using Nini.Config; using OpenSim.Framework; using OpenSim.Region.Framework.Scenes; -namespace OpenSim.Region.CoreModules.World.WorldMap +namespace OpenSim.Region.CoreModules.World.LegacyMap { public class ShadedMapTileRenderer : IMapTileTerrainRenderer { diff --git a/OpenSim/Region/CoreModules/World/WorldMap/TexturedMapTileRenderer.cs b/OpenSim/Region/CoreModules/World/LegacyMap/TexturedMapTileRenderer.cs similarity index 99% rename from OpenSim/Region/CoreModules/World/WorldMap/TexturedMapTileRenderer.cs rename to OpenSim/Region/CoreModules/World/LegacyMap/TexturedMapTileRenderer.cs index 8b34f6ebdc..071314ac9a 100644 --- a/OpenSim/Region/CoreModules/World/WorldMap/TexturedMapTileRenderer.cs +++ b/OpenSim/Region/CoreModules/World/LegacyMap/TexturedMapTileRenderer.cs @@ -36,7 +36,7 @@ using OpenMetaverse.Imaging; using OpenSim.Framework; using OpenSim.Region.Framework.Scenes; -namespace OpenSim.Region.CoreModules.World.WorldMap +namespace OpenSim.Region.CoreModules.World.LegacyMap { // Hue, Saturation, Value; used for color-interpolation struct HSV { diff --git a/OpenSim/Region/CoreModules/World/Media/Moap/MoapModule.cs b/OpenSim/Region/CoreModules/World/Media/Moap/MoapModule.cs new file mode 100644 index 0000000000..7c5d044347 --- /dev/null +++ b/OpenSim/Region/CoreModules/World/Media/Moap/MoapModule.cs @@ -0,0 +1,596 @@ +/* + * Copyright (c) Contributors, http://opensimulator.org/ + * See CONTRIBUTORS.TXT for a full list of copyright holders. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * * Neither the name of the OpenSimulator Project nor the + * names of its contributors may be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE DEVELOPERS ``AS IS'' AND ANY + * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED + * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + * DISCLAIMED. IN NO EVENT SHALL THE CONTRIBUTORS BE LIABLE FOR ANY + * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES + * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND + * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS + * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +using System; +using System.Collections; +using System.Collections.Generic; +using System.Collections.Specialized; +using System.Reflection; +using System.IO; +using System.Web; +using System.Xml; +using log4net; +using Mono.Addins; +using Nini.Config; +using OpenMetaverse; +using OpenMetaverse.Messages.Linden; +using OpenMetaverse.StructuredData; +using OpenSim.Framework; +using OpenSim.Framework.Capabilities; +using OpenSim.Framework.Servers; +using OpenSim.Framework.Servers.HttpServer; +using OpenSim.Region.Framework.Interfaces; +using OpenSim.Region.Framework.Scenes; +using OpenSim.Services.Interfaces; +using Caps = OpenSim.Framework.Capabilities.Caps; +using OSDArray = OpenMetaverse.StructuredData.OSDArray; +using OSDMap = OpenMetaverse.StructuredData.OSDMap; + +namespace OpenSim.Region.CoreModules.Media.Moap +{ + [Extension(Path = "/OpenSim/RegionModules", NodeName = "RegionModule", Id = "MoapModule")] + public class MoapModule : INonSharedRegionModule, IMoapModule + { + private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); + + public string Name { get { return "MoapModule"; } } + public Type ReplaceableInterface { get { return null; } } + + /// + /// Is this module enabled? + /// + protected bool m_isEnabled = true; + + /// + /// The scene to which this module is attached + /// + protected Scene m_scene; + + /// + /// Track the ObjectMedia capabilities given to users keyed by path + /// + protected Dictionary m_omCapUsers = new Dictionary(); + + /// + /// Track the ObjectMedia capabilities given to users keyed by agent. Lock m_omCapUsers to manipulate. + /// + protected Dictionary m_omCapUrls = new Dictionary(); + + /// + /// Track the ObjectMediaUpdate capabilities given to users keyed by path + /// + protected Dictionary m_omuCapUsers = new Dictionary(); + + /// + /// Track the ObjectMediaUpdate capabilities given to users keyed by agent. Lock m_omuCapUsers to manipulate + /// + protected Dictionary m_omuCapUrls = new Dictionary(); + + public void Initialise(IConfigSource configSource) + { + IConfig config = configSource.Configs["MediaOnAPrim"]; + + if (config != null && !config.GetBoolean("Enabled", false)) + m_isEnabled = false; +// else +// m_log.Debug("[MOAP]: Initialised module.")l + } + + public void AddRegion(Scene scene) + { + if (!m_isEnabled) + return; + + m_scene = scene; + m_scene.RegisterModuleInterface(this); + } + + public void RemoveRegion(Scene scene) {} + + public void RegionLoaded(Scene scene) + { + if (!m_isEnabled) + return; + + m_scene.EventManager.OnRegisterCaps += OnRegisterCaps; + m_scene.EventManager.OnDeregisterCaps += OnDeregisterCaps; + m_scene.EventManager.OnSceneObjectPartCopy += OnSceneObjectPartCopy; + } + + public void Close() + { + if (!m_isEnabled) + return; + + m_scene.EventManager.OnRegisterCaps -= OnRegisterCaps; + m_scene.EventManager.OnDeregisterCaps -= OnDeregisterCaps; + m_scene.EventManager.OnSceneObjectPartCopy -= OnSceneObjectPartCopy; + } + + public void OnRegisterCaps(UUID agentID, Caps caps) + { +// m_log.DebugFormat( +// "[MOAP]: Registering ObjectMedia and ObjectMediaNavigate capabilities for agent {0}", agentID); + + string omCapUrl = "/CAPS/" + UUID.Random(); + + lock (m_omCapUsers) + { + m_omCapUsers[omCapUrl] = agentID; + m_omCapUrls[agentID] = omCapUrl; + + // Even though we're registering for POST we're going to get GETS and UPDATES too + caps.RegisterHandler( + "ObjectMedia", new RestStreamHandler("POST", omCapUrl, HandleObjectMediaMessage)); + } + + string omuCapUrl = "/CAPS/" + UUID.Random(); + + lock (m_omuCapUsers) + { + m_omuCapUsers[omuCapUrl] = agentID; + m_omuCapUrls[agentID] = omuCapUrl; + + // Even though we're registering for POST we're going to get GETS and UPDATES too + caps.RegisterHandler( + "ObjectMediaNavigate", new RestStreamHandler("POST", omuCapUrl, HandleObjectMediaNavigateMessage)); + } + } + + public void OnDeregisterCaps(UUID agentID, Caps caps) + { + lock (m_omCapUsers) + { + string path = m_omCapUrls[agentID]; + m_omCapUrls.Remove(agentID); + m_omCapUsers.Remove(path); + } + + lock (m_omuCapUsers) + { + string path = m_omuCapUrls[agentID]; + m_omuCapUrls.Remove(agentID); + m_omuCapUsers.Remove(path); + } + } + + protected void OnSceneObjectPartCopy(SceneObjectPart copy, SceneObjectPart original, bool userExposed) + { + if (original.Shape.Media != null) + { + PrimitiveBaseShape.MediaList dupeMedia = new PrimitiveBaseShape.MediaList(); + lock (original.Shape.Media) + { + foreach (MediaEntry me in original.Shape.Media) + { + if (me != null) + dupeMedia.Add(MediaEntry.FromOSD(me.GetOSD())); + else + dupeMedia.Add(null); + } + } + + copy.Shape.Media = dupeMedia; + } + } + + public MediaEntry GetMediaEntry(SceneObjectPart part, int face) + { + MediaEntry me = null; + + CheckFaceParam(part, face); + + List media = part.Shape.Media; + + if (null == media) + { + me = null; + } + else + { + lock (media) + me = media[face]; + + // TODO: Really need a proper copy constructor down in libopenmetaverse + if (me != null) + me = MediaEntry.FromOSD(me.GetOSD()); + } + +// m_log.DebugFormat("[MOAP]: GetMediaEntry for {0} face {1} found {2}", part.Name, face, me); + + return me; + } + + public void SetMediaEntry(SceneObjectPart part, int face, MediaEntry me) + { + CheckFaceParam(part, face); + + if (null == part.Shape.Media) + part.Shape.Media = new PrimitiveBaseShape.MediaList(new MediaEntry[part.GetNumberOfSides()]); + + lock (part.Shape.Media) + part.Shape.Media[face] = me; + + UpdateMediaUrl(part, UUID.Zero); + part.ScheduleFullUpdate(); + part.TriggerScriptChangedEvent(Changed.MEDIA); + } + + public void ClearMediaEntry(SceneObjectPart part, int face) + { + SetMediaEntry(part, face, null); + } + + /// + /// Sets or gets per face media textures. + /// + /// + /// + /// + /// + /// + /// + protected string HandleObjectMediaMessage( + string request, string path, string param, OSHttpRequest httpRequest, OSHttpResponse httpResponse) + { +// m_log.DebugFormat("[MOAP]: Got ObjectMedia path [{0}], raw request [{1}]", path, request); + + OSDMap osd = (OSDMap)OSDParser.DeserializeLLSDXml(request); + ObjectMediaMessage omm = new ObjectMediaMessage(); + omm.Deserialize(osd); + + if (omm.Request is ObjectMediaRequest) + return HandleObjectMediaRequest(omm.Request as ObjectMediaRequest); + else if (omm.Request is ObjectMediaUpdate) + return HandleObjectMediaUpdate(path, omm.Request as ObjectMediaUpdate); + + throw new Exception( + string.Format( + "[MOAP]: ObjectMediaMessage has unrecognized ObjectMediaBlock of {0}", + omm.Request.GetType())); + } + + /// + /// Handle a fetch request for media textures + /// + /// + /// + protected string HandleObjectMediaRequest(ObjectMediaRequest omr) + { + UUID primId = omr.PrimID; + + SceneObjectPart part = m_scene.GetSceneObjectPart(primId); + + if (null == part) + { + m_log.WarnFormat( + "[MOAP]: Received a GET ObjectMediaRequest for prim {0} but this doesn't exist in region {1}", + primId, m_scene.RegionInfo.RegionName); + return string.Empty; + } + + if (null == part.Shape.Media) + return string.Empty; + + ObjectMediaResponse resp = new ObjectMediaResponse(); + + resp.PrimID = primId; + + lock (part.Shape.Media) + resp.FaceMedia = part.Shape.Media.ToArray(); + + resp.Version = part.MediaUrl; + + string rawResp = OSDParser.SerializeLLSDXmlString(resp.Serialize()); + +// m_log.DebugFormat("[MOAP]: Got HandleObjectMediaRequestGet raw response is [{0}]", rawResp); + + return rawResp; + } + + /// + /// Handle an update of media textures. + /// + /// Path on which this request was made + /// /param> + /// + protected string HandleObjectMediaUpdate(string path, ObjectMediaUpdate omu) + { + UUID primId = omu.PrimID; + + SceneObjectPart part = m_scene.GetSceneObjectPart(primId); + + if (null == part) + { + m_log.WarnFormat( + "[MOAP]: Received an UPDATE ObjectMediaRequest for prim {0} but this doesn't exist in region {1}", + primId, m_scene.RegionInfo.RegionName); + return string.Empty; + } + +// m_log.DebugFormat("[MOAP]: Received {0} media entries for prim {1}", omu.FaceMedia.Length, primId); + +// for (int i = 0; i < omu.FaceMedia.Length; i++) +// { +// MediaEntry me = omu.FaceMedia[i]; +// string v = (null == me ? "null": OSDParser.SerializeLLSDXmlString(me.GetOSD())); +// m_log.DebugFormat("[MOAP]: Face {0} [{1}]", i, v); +// } + + if (omu.FaceMedia.Length > part.GetNumberOfSides()) + { + m_log.WarnFormat( + "[MOAP]: Received {0} media entries from client for prim {1} {2} but this prim has only {3} faces. Dropping request.", + omu.FaceMedia.Length, part.Name, part.UUID, part.GetNumberOfSides()); + return string.Empty; + } + + UUID agentId = default(UUID); + + lock (m_omCapUsers) + agentId = m_omCapUsers[path]; + + List media = part.Shape.Media; + + if (null == media) + { +// m_log.DebugFormat("[MOAP]: Setting all new media list for {0}", part.Name); + part.Shape.Media = new PrimitiveBaseShape.MediaList(omu.FaceMedia); + + for (int i = 0; i < omu.FaceMedia.Length; i++) + { + if (omu.FaceMedia[i] != null) + { + // FIXME: Race condition here since some other texture entry manipulator may overwrite/get + // overwritten. Unfortunately, PrimitiveBaseShape does not allow us to change texture entry + // directly. + Primitive.TextureEntry te = part.Shape.Textures; + Primitive.TextureEntryFace face = te.CreateFace((uint)i); + face.MediaFlags = true; + part.Shape.Textures = te; +// m_log.DebugFormat( +// "[MOAP]: Media flags for face {0} is {1}", +// i, part.Shape.Textures.FaceTextures[i].MediaFlags); + } + } + } + else + { + // We need to go through the media textures one at a time to make sure that we have permission + // to change them + + // FIXME: Race condition here since some other texture entry manipulator may overwrite/get + // overwritten. Unfortunately, PrimitiveBaseShape does not allow us to change texture entry + // directly. + Primitive.TextureEntry te = part.Shape.Textures; + + lock (media) + { + for (int i = 0; i < media.Count; i++) + { + if (m_scene.Permissions.CanControlPrimMedia(agentId, part.UUID, i)) + { + media[i] = omu.FaceMedia[i]; + + // When a face is cleared this is done by setting the MediaFlags in the TextureEntry via a normal + // texture update, so we don't need to worry about clearing MediaFlags here. + if (null == media[i]) + continue; + + Primitive.TextureEntryFace face = te.CreateFace((uint)i); + face.MediaFlags = true; + + // m_log.DebugFormat( + // "[MOAP]: Media flags for face {0} is {1}", + // i, face.MediaFlags); + // m_log.DebugFormat("[MOAP]: Set media entry for face {0} on {1}", i, part.Name); + } + } + } + + part.Shape.Textures = te; + +// for (int i2 = 0; i2 < part.Shape.Textures.FaceTextures.Length; i2++) +// m_log.DebugFormat("[MOAP]: FaceTexture[{0}] is {1}", i2, part.Shape.Textures.FaceTextures[i2]); + } + + UpdateMediaUrl(part, agentId); + + // Arguably, we could avoid sending a full update to the avatar that just changed the texture. + part.ScheduleFullUpdate(); + + part.TriggerScriptChangedEvent(Changed.MEDIA); + + return string.Empty; + } + + /// + /// Received from the viewer if a user has changed the url of a media texture. + /// + /// + /// + /// + /// /param> + /// /param> + /// + protected string HandleObjectMediaNavigateMessage( + string request, string path, string param, OSHttpRequest httpRequest, OSHttpResponse httpResponse) + { +// m_log.DebugFormat("[MOAP]: Got ObjectMediaNavigate request [{0}]", request); + + OSDMap osd = (OSDMap)OSDParser.DeserializeLLSDXml(request); + ObjectMediaNavigateMessage omn = new ObjectMediaNavigateMessage(); + omn.Deserialize(osd); + + UUID primId = omn.PrimID; + + SceneObjectPart part = m_scene.GetSceneObjectPart(primId); + + if (null == part) + { + m_log.WarnFormat( + "[MOAP]: Received an ObjectMediaNavigateMessage for prim {0} but this doesn't exist in region {1}", + primId, m_scene.RegionInfo.RegionName); + return string.Empty; + } + + UUID agentId = default(UUID); + + lock (m_omuCapUsers) + agentId = m_omuCapUsers[path]; + + if (!m_scene.Permissions.CanInteractWithPrimMedia(agentId, part.UUID, omn.Face)) + return string.Empty; + +// m_log.DebugFormat( +// "[MOAP]: Received request to update media entry for face {0} on prim {1} {2} to {3}", +// omn.Face, part.Name, part.UUID, omn.URL); + + // If media has never been set for this prim, then just return. + if (null == part.Shape.Media) + return string.Empty; + + MediaEntry me = null; + + lock (part.Shape.Media) + me = part.Shape.Media[omn.Face]; + + // Do the same if media has not been set up for a specific face + if (null == me) + return string.Empty; + + if (me.EnableWhiteList) + { + if (!CheckUrlAgainstWhitelist(omn.URL, me.WhiteList)) + { +// m_log.DebugFormat( +// "[MOAP]: Blocking change of face {0} on prim {1} {2} to {3} since it's not on the enabled whitelist", +// omn.Face, part.Name, part.UUID, omn.URL); + + return string.Empty; + } + } + + me.CurrentURL = omn.URL; + + UpdateMediaUrl(part, agentId); + + part.ScheduleFullUpdate(); + + part.TriggerScriptChangedEvent(Changed.MEDIA); + + return OSDParser.SerializeLLSDXmlString(new OSD()); + } + + /// + /// Check that the face number is valid for the given prim. + /// + /// + /// + protected void CheckFaceParam(SceneObjectPart part, int face) + { + if (face < 0) + throw new ArgumentException("Face cannot be less than zero"); + + int maxFaces = part.GetNumberOfSides() - 1; + if (face > maxFaces) + throw new ArgumentException( + string.Format("Face argument was {0} but max is {1}", face, maxFaces)); + } + + /// + /// Update the media url of the given part + /// + /// + /// + /// The id to attach to this update. Normally, this is the user that changed the + /// texture + /// + protected void UpdateMediaUrl(SceneObjectPart part, UUID updateId) + { + if (null == part.MediaUrl) + { + // TODO: We can't set the last changer until we start tracking which cap we give to which agent id + part.MediaUrl = "x-mv:0000000000/" + updateId; + } + else + { + string rawVersion = part.MediaUrl.Substring(5, 10); + int version = int.Parse(rawVersion); + part.MediaUrl = string.Format("x-mv:{0:D10}/{1}", ++version, updateId); + } + +// m_log.DebugFormat("[MOAP]: Storing media url [{0}] in prim {1} {2}", part.MediaUrl, part.Name, part.UUID); + } + + /// + /// Check the given url against the given whitelist. + /// + /// + /// + /// true if the url matches an entry on the whitelist, false otherwise + protected bool CheckUrlAgainstWhitelist(string rawUrl, string[] whitelist) + { + Uri url = new Uri(rawUrl); + + foreach (string origWlUrl in whitelist) + { + string wlUrl = origWlUrl; + + // Deal with a line-ending wildcard + if (wlUrl.EndsWith("*")) + wlUrl = wlUrl.Remove(wlUrl.Length - 1); + +// m_log.DebugFormat("[MOAP]: Checking whitelist URL pattern {0}", origWlUrl); + + // Handle a line starting wildcard slightly differently since this can only match the domain, not the path + if (wlUrl.StartsWith("*")) + { + wlUrl = wlUrl.Substring(1); + + if (url.Host.Contains(wlUrl)) + { +// m_log.DebugFormat("[MOAP]: Whitelist URL {0} matches {1}", origWlUrl, rawUrl); + return true; + } + } + else + { + string urlToMatch = url.Authority + url.AbsolutePath; + + if (urlToMatch.StartsWith(wlUrl)) + { +// m_log.DebugFormat("[MOAP]: Whitelist URL {0} matches {1}", origWlUrl, rawUrl); + return true; + } + } + } + + return false; + } + } +} \ No newline at end of file diff --git a/OpenSim/Region/CoreModules/World/Objects/BuySell/BuySellModule.cs b/OpenSim/Region/CoreModules/World/Objects/BuySell/BuySellModule.cs new file mode 100644 index 0000000000..568ba198bd --- /dev/null +++ b/OpenSim/Region/CoreModules/World/Objects/BuySell/BuySellModule.cs @@ -0,0 +1,265 @@ +/* + * Copyright (c) Contributors, http://opensimulator.org/ + * See CONTRIBUTORS.TXT for a full list of copyright holders. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * * Neither the name of the OpenSimulator Project nor the + * names of its contributors may be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE DEVELOPERS ``AS IS'' AND ANY + * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED + * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + * DISCLAIMED. IN NO EVENT SHALL THE CONTRIBUTORS BE LIABLE FOR ANY + * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES + * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND + * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS + * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +using System; +using System.Collections.Generic; +using System.Reflection; +using log4net; +using Mono.Addins; +using Nini.Config; +using OpenMetaverse; +using OpenMetaverse.Packets; +using OpenSim.Framework; +using OpenSim.Region.Framework; +using OpenSim.Region.Framework.Interfaces; +using OpenSim.Region.Framework.Scenes; +using OpenSim.Region.Framework.Scenes.Serialization; + +namespace OpenSim.Region.CoreModules.World.Objects.BuySell +{ + [Extension(Path = "/OpenSim/RegionModules", NodeName = "RegionModule", Id = "BuySellModule")] + public class BuySellModule : IBuySellModule, INonSharedRegionModule + { +// private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); + + protected Scene m_scene = null; + protected IDialogModule m_dialogModule; + + public string Name { get { return "Object BuySell Module"; } } + public Type ReplaceableInterface { get { return null; } } + + public void Initialise(IConfigSource source) {} + + public void AddRegion(Scene scene) + { + m_scene = scene; + m_scene.RegisterModuleInterface(this); + m_scene.EventManager.OnNewClient += SubscribeToClientEvents; + } + + public void RemoveRegion(Scene scene) + { + m_scene.EventManager.OnNewClient -= SubscribeToClientEvents; + } + + public void RegionLoaded(Scene scene) + { + m_dialogModule = scene.RequestModuleInterface(); + } + + public void Close() + { + RemoveRegion(m_scene); + } + + public void SubscribeToClientEvents(IClientAPI client) + { + client.OnObjectSaleInfo += ObjectSaleInfo; + } + + protected void ObjectSaleInfo( + IClientAPI client, UUID agentID, UUID sessionID, uint localID, byte saleType, int salePrice) + { + SceneObjectPart part = m_scene.GetSceneObjectPart(localID); + if (part == null || part.ParentGroup == null) + return; + + if (part.ParentGroup.IsDeleted) + return; + + if (part.OwnerID != client.AgentId && (!m_scene.Permissions.IsGod(client.AgentId))) + return; + + part = part.ParentGroup.RootPart; + + part.ObjectSaleType = saleType; + part.SalePrice = salePrice; + + part.ParentGroup.HasGroupChanged = true; + + part.GetProperties(client); + } + + public bool BuyObject(IClientAPI remoteClient, UUID categoryID, uint localID, byte saleType, int salePrice) + { + SceneObjectPart part = m_scene.GetSceneObjectPart(localID); + + if (part == null) + return false; + + if (part.ParentGroup == null) + return false; + + SceneObjectGroup group = part.ParentGroup; + + switch (saleType) + { + case 1: // Sell as original (in-place sale) + uint effectivePerms = group.GetEffectivePermissions(); + + if ((effectivePerms & (uint)PermissionMask.Transfer) == 0) + { + if (m_dialogModule != null) + m_dialogModule.SendAlertToUser(remoteClient, "This item doesn't appear to be for sale"); + return false; + } + + group.SetOwnerId(remoteClient.AgentId); + group.SetRootPartOwner(part, remoteClient.AgentId, remoteClient.ActiveGroupId); + + if (m_scene.Permissions.PropagatePermissions()) + { + foreach (SceneObjectPart child in group.Parts) + { + child.Inventory.ChangeInventoryOwner(remoteClient.AgentId); + child.TriggerScriptChangedEvent(Changed.OWNER); + child.ApplyNextOwnerPermissions(); + } + } + + part.ObjectSaleType = 0; + part.SalePrice = 10; + + group.HasGroupChanged = true; + part.GetProperties(remoteClient); + part.TriggerScriptChangedEvent(Changed.OWNER); + group.ResumeScripts(); + part.ScheduleFullUpdate(); + + break; + + case 2: // Sell a copy + Vector3 inventoryStoredPosition = new Vector3 + (((group.AbsolutePosition.X > (int)Constants.RegionSize) + ? 250 + : group.AbsolutePosition.X) + , + (group.AbsolutePosition.X > (int)Constants.RegionSize) + ? 250 + : group.AbsolutePosition.X, + group.AbsolutePosition.Z); + + Vector3 originalPosition = group.AbsolutePosition; + + group.AbsolutePosition = inventoryStoredPosition; + + string sceneObjectXml = SceneObjectSerializer.ToOriginalXmlFormat(group); + group.AbsolutePosition = originalPosition; + + uint perms = group.GetEffectivePermissions(); + + if ((perms & (uint)PermissionMask.Transfer) == 0) + { + if (m_dialogModule != null) + m_dialogModule.SendAlertToUser(remoteClient, "This item doesn't appear to be for sale"); + return false; + } + + AssetBase asset = m_scene.CreateAsset( + group.GetPartName(localID), + group.GetPartDescription(localID), + (sbyte)AssetType.Object, + Utils.StringToBytes(sceneObjectXml), + group.OwnerID); + m_scene.AssetService.Store(asset); + + InventoryItemBase item = new InventoryItemBase(); + item.CreatorId = part.CreatorID.ToString(); + item.CreatorData = part.CreatorData; + + item.ID = UUID.Random(); + item.Owner = remoteClient.AgentId; + item.AssetID = asset.FullID; + item.Description = asset.Description; + item.Name = asset.Name; + item.AssetType = asset.Type; + item.InvType = (int)InventoryType.Object; + item.Folder = categoryID; + + uint nextPerms=(perms & 7) << 13; + if ((nextPerms & (uint)PermissionMask.Copy) == 0) + perms &= ~(uint)PermissionMask.Copy; + if ((nextPerms & (uint)PermissionMask.Transfer) == 0) + perms &= ~(uint)PermissionMask.Transfer; + if ((nextPerms & (uint)PermissionMask.Modify) == 0) + perms &= ~(uint)PermissionMask.Modify; + + item.BasePermissions = perms & part.NextOwnerMask; + item.CurrentPermissions = perms & part.NextOwnerMask; + item.NextPermissions = part.NextOwnerMask; + item.EveryOnePermissions = part.EveryoneMask & + part.NextOwnerMask; + item.GroupPermissions = part.GroupMask & + part.NextOwnerMask; + item.CurrentPermissions |= 16; // Slam! + item.CreationDate = Util.UnixTimeSinceEpoch(); + + if (m_scene.AddInventoryItem(item)) + { + remoteClient.SendInventoryItemCreateUpdate(item, 0); + } + else + { + if (m_dialogModule != null) + m_dialogModule.SendAlertToUser(remoteClient, "Cannot buy now. Your inventory is unavailable"); + return false; + } + break; + + case 3: // Sell contents + List invList = part.Inventory.GetInventoryList(); + + bool okToSell = true; + + foreach (UUID invID in invList) + { + TaskInventoryItem item1 = part.Inventory.GetInventoryItem(invID); + if ((item1.CurrentPermissions & + (uint)PermissionMask.Transfer) == 0) + { + okToSell = false; + break; + } + } + + if (!okToSell) + { + if (m_dialogModule != null) + m_dialogModule.SendAlertToUser( + remoteClient, "This item's inventory doesn't appear to be for sale"); + return false; + } + + if (invList.Count > 0) + m_scene.MoveTaskInventoryItems(remoteClient.AgentId, part.Name, part, invList); + break; + } + + return true; + } + } +} diff --git a/OpenSim/Region/CoreModules/World/Permissions/PermissionsModule.cs b/OpenSim/Region/CoreModules/World/Permissions/PermissionsModule.cs index 69b247c350..f5f383964e 100644 --- a/OpenSim/Region/CoreModules/World/Permissions/PermissionsModule.cs +++ b/OpenSim/Region/CoreModules/World/Permissions/PermissionsModule.cs @@ -164,6 +164,7 @@ namespace OpenSim.Region.CoreModules.World.Permissions private Dictionary GrantYP = new Dictionary(); private IFriendsModule m_friendsModule; private IGroupsModule m_groupsModule; + private IMoapModule m_moapModule; #endregion @@ -177,7 +178,7 @@ namespace OpenSim.Region.CoreModules.World.Permissions string permissionModules = myConfig.GetString("permissionmodules", "DefaultPermissionsModule"); - List modules=new List(permissionModules.Split(',')); + List modules = new List(permissionModules.Split(',')); if (!modules.Contains("DefaultPermissionsModule")) return; @@ -209,6 +210,7 @@ namespace OpenSim.Region.CoreModules.World.Permissions m_scene.Permissions.OnDeedParcel += CanDeedParcel; m_scene.Permissions.OnDeedObject += CanDeedObject; m_scene.Permissions.OnIsGod += IsGod; + m_scene.Permissions.OnIsAdministrator += IsAdministrator; m_scene.Permissions.OnDuplicateObject += CanDuplicateObject; m_scene.Permissions.OnDeleteObject += CanDeleteObject; //MAYBE FULLY IMPLEMENTED m_scene.Permissions.OnEditObject += CanEditObject; //MAYBE FULLY IMPLEMENTED @@ -236,7 +238,7 @@ namespace OpenSim.Region.CoreModules.World.Permissions m_scene.Permissions.OnEditNotecard += CanEditNotecard; //NOT YET IMPLEMENTED m_scene.Permissions.OnEditScript += CanEditScript; //NOT YET IMPLEMENTED - m_scene.Permissions.OnCreateObjectInventory += CanCreateObjectInventory; //NOT IMPLEMENTED HERE + m_scene.Permissions.OnCreateObjectInventory += CanCreateObjectInventory; m_scene.Permissions.OnEditObjectInventory += CanEditObjectInventory;//MAYBE FULLY IMPLEMENTED m_scene.Permissions.OnCopyObjectInventory += CanCopyObjectInventory; //NOT YET IMPLEMENTED m_scene.Permissions.OnDeleteObjectInventory += CanDeleteObjectInventory; //NOT YET IMPLEMENTED @@ -248,6 +250,9 @@ namespace OpenSim.Region.CoreModules.World.Permissions m_scene.Permissions.OnDeleteUserInventory += CanDeleteUserInventory; //NOT YET IMPLEMENTED m_scene.Permissions.OnTeleport += CanTeleport; //NOT YET IMPLEMENTED + + m_scene.Permissions.OnControlPrimMedia += CanControlPrimMedia; + m_scene.Permissions.OnInteractWithPrimMedia += CanInteractWithPrimMedia; m_scene.AddCommand(this, "bypass permissions", "bypass permissions ", @@ -392,7 +397,13 @@ namespace OpenSim.Region.CoreModules.World.Permissions m_groupsModule = m_scene.RequestModuleInterface(); if (m_groupsModule == null) - m_log.Warn("[PERMISSIONS]: Groups module not found, group permissions will not work"); + m_log.Warn("[PERMISSIONS]: Groups module not found, group permissions will not work"); + + m_moapModule = m_scene.RequestModuleInterface(); + + // This log line will be commented out when no longer required for debugging +// if (m_moapModule == null) +// m_log.Warn("[PERMISSIONS]: Media on a prim module not found, media on a prim permissions will not work"); } public void Close() @@ -1769,10 +1780,28 @@ namespace OpenSim.Region.CoreModules.World.Permissions DebugPermissionInformation(MethodInfo.GetCurrentMethod().Name); if (m_bypassPermissions) return m_bypassPermissionsValue; - if ((int)InventoryType.LSL == invType) - if (m_allowedScriptCreators == UserSet.Administrators && !IsAdministrator(userID)) - return false; - + SceneObjectPart part = m_scene.GetSceneObjectPart(objectID); + ScenePresence p = m_scene.GetScenePresence(userID); + + if (part == null || p == null) + return false; + + if (!IsAdministrator(userID)) + { + if (part.OwnerID != userID) + { + // Group permissions + if ((part.GroupID == UUID.Zero) || (p.ControllingClient.GetGroupPowers(part.GroupID) == 0) || ((part.GroupMask & (uint)PermissionMask.Modify) == 0)) + return false; + } else { + if ((part.OwnerMask & (uint)PermissionMask.Modify) == 0) + return false; + } + if ((int)InventoryType.LSL == invType) + if (m_allowedScriptCreators == UserSet.Administrators) + return false; + } + return true; } @@ -1893,5 +1922,80 @@ namespace OpenSim.Region.CoreModules.World.Permissions } return(false); } + + private bool CanControlPrimMedia(UUID agentID, UUID primID, int face) + { +// m_log.DebugFormat( +// "[PERMISSONS]: Performing CanControlPrimMedia check with agentID {0}, primID {1}, face {2}", +// agentID, primID, face); + + if (null == m_moapModule) + return false; + + SceneObjectPart part = m_scene.GetSceneObjectPart(primID); + if (null == part) + return false; + + MediaEntry me = m_moapModule.GetMediaEntry(part, face); + + // If there is no existing media entry then it can be controlled (in this context, created). + if (null == me) + return true; + +// m_log.DebugFormat( +// "[PERMISSIONS]: Checking CanControlPrimMedia for {0} on {1} face {2} with control permissions {3}", +// agentID, primID, face, me.ControlPermissions); + + return GenericPrimMediaPermission(part, agentID, me.ControlPermissions); + } + + private bool CanInteractWithPrimMedia(UUID agentID, UUID primID, int face) + { +// m_log.DebugFormat( +// "[PERMISSONS]: Performing CanInteractWithPrimMedia check with agentID {0}, primID {1}, face {2}", +// agentID, primID, face); + + if (null == m_moapModule) + return false; + + SceneObjectPart part = m_scene.GetSceneObjectPart(primID); + if (null == part) + return false; + + MediaEntry me = m_moapModule.GetMediaEntry(part, face); + + // If there is no existing media entry then it can be controlled (in this context, created). + if (null == me) + return true; + +// m_log.DebugFormat( +// "[PERMISSIONS]: Checking CanInteractWithPrimMedia for {0} on {1} face {2} with interact permissions {3}", +// agentID, primID, face, me.InteractPermissions); + + return GenericPrimMediaPermission(part, agentID, me.InteractPermissions); + } + + private bool GenericPrimMediaPermission(SceneObjectPart part, UUID agentID, MediaPermission perms) + { +// if (IsAdministrator(agentID)) +// return true; + + if ((perms & MediaPermission.Anyone) == MediaPermission.Anyone) + return true; + + if ((perms & MediaPermission.Owner) == MediaPermission.Owner) + { + if (agentID == part.OwnerID) + return true; + } + + if ((perms & MediaPermission.Group) == MediaPermission.Group) + { + if (IsGroupMember(part.GroupID, agentID, 0)) + return true; + } + + return false; + } } } diff --git a/OpenSim/Region/CoreModules/World/Serialiser/SerialiseObjects.cs b/OpenSim/Region/CoreModules/World/Serialiser/SerialiseObjects.cs index bef7fe4627..328fbf0275 100644 --- a/OpenSim/Region/CoreModules/World/Serialiser/SerialiseObjects.cs +++ b/OpenSim/Region/CoreModules/World/Serialiser/SerialiseObjects.cs @@ -41,7 +41,7 @@ namespace OpenSim.Region.CoreModules.World.Serialiser public string WriteToFile(Scene scene, string dir) { - string targetFileName = dir + "objects.xml"; + string targetFileName = Path.Combine(dir, "objects.xml"); SaveSerialisedToFile(targetFileName, scene); @@ -80,7 +80,7 @@ namespace OpenSim.Region.CoreModules.World.Serialiser { string xmlstream = ""; - List EntityList = scene.GetEntities(); + EntityBase[] EntityList = scene.GetEntities(); List EntityXml = new List(); foreach (EntityBase ent in EntityList) diff --git a/OpenSim/Region/CoreModules/World/Serialiser/SerialiseTerrain.cs b/OpenSim/Region/CoreModules/World/Serialiser/SerialiseTerrain.cs index 5cbe66bb53..c04753da73 100644 --- a/OpenSim/Region/CoreModules/World/Serialiser/SerialiseTerrain.cs +++ b/OpenSim/Region/CoreModules/World/Serialiser/SerialiseTerrain.cs @@ -28,6 +28,7 @@ using OpenSim.Region.CoreModules.World.Terrain; using OpenSim.Region.CoreModules.World.Terrain.FileLoaders; using OpenSim.Region.Framework.Scenes; +using System.IO; namespace OpenSim.Region.CoreModules.World.Serialiser { @@ -38,7 +39,7 @@ namespace OpenSim.Region.CoreModules.World.Serialiser public string WriteToFile(Scene scene, string dir) { ITerrainLoader fileSystemExporter = new RAW32(); - string targetFileName = dir + "heightmap.r32"; + string targetFileName = Path.Combine(dir, "heightmap.r32"); lock (scene.Heightmap) { @@ -50,4 +51,4 @@ namespace OpenSim.Region.CoreModules.World.Serialiser #endregion } -} \ No newline at end of file +} diff --git a/OpenSim/Region/CoreModules/World/Serialiser/SerialiserModule.cs b/OpenSim/Region/CoreModules/World/Serialiser/SerialiserModule.cs index 58e42619c7..ec97acd7a4 100644 --- a/OpenSim/Region/CoreModules/World/Serialiser/SerialiserModule.cs +++ b/OpenSim/Region/CoreModules/World/Serialiser/SerialiserModule.cs @@ -48,7 +48,7 @@ namespace OpenSim.Region.CoreModules.World.Serialiser private Commander m_commander = new Commander("export"); private List m_regions = new List(); - private string m_savedir = "exports" + "/"; + private string m_savedir = "exports"; private List m_serialisers = new List(); #region ISharedRegionModule Members @@ -160,17 +160,17 @@ namespace OpenSim.Region.CoreModules.World.Serialiser return SceneXmlLoader.DeserializeGroupFromXml2(xmlString); } - public string SerializeGroupToXml2(SceneObjectGroup grp) + public string SerializeGroupToXml2(SceneObjectGroup grp, Dictionary options) { - return SceneXmlLoader.SaveGroupToXml2(grp); + return SceneXmlLoader.SaveGroupToXml2(grp, options); } - public void SavePrimListToXml2(List entityList, string fileName) + public void SavePrimListToXml2(EntityBase[] entityList, string fileName) { SceneXmlLoader.SavePrimListToXml2(entityList, fileName); } - public void SavePrimListToXml2(List entityList, TextWriter stream, Vector3 min, Vector3 max) + public void SavePrimListToXml2(EntityBase[] entityList, TextWriter stream, Vector3 min, Vector3 max) { SceneXmlLoader.SavePrimListToXml2(entityList, stream, min, max); } @@ -192,14 +192,14 @@ namespace OpenSim.Region.CoreModules.World.Serialiser } } - TextWriter regionInfoWriter = new StreamWriter(saveDir + "README.TXT"); + TextWriter regionInfoWriter = new StreamWriter(Path.Combine(saveDir, "README.TXT")); regionInfoWriter.WriteLine("Region Name: " + scene.RegionInfo.RegionName); regionInfoWriter.WriteLine("Region ID: " + scene.RegionInfo.RegionID.ToString()); regionInfoWriter.WriteLine("Backup Time: UTC " + DateTime.UtcNow.ToString()); regionInfoWriter.WriteLine("Serialise Version: 0.1"); regionInfoWriter.Close(); - TextWriter manifestWriter = new StreamWriter(saveDir + "region.manifest"); + TextWriter manifestWriter = new StreamWriter(Path.Combine(saveDir, "region.manifest")); foreach (string line in results) { manifestWriter.WriteLine(line); @@ -231,7 +231,7 @@ namespace OpenSim.Region.CoreModules.World.Serialiser if (region.RegionInfo.RegionName == (string) args[0]) { // List results = SerialiseRegion(region, m_savedir + region.RegionInfo.RegionID.ToString() + "/"); - SerialiseRegion(region, m_savedir + region.RegionInfo.RegionID.ToString() + "/"); + SerialiseRegion(region, Path.Combine(m_savedir, region.RegionInfo.RegionID.ToString())); } } } @@ -241,7 +241,7 @@ namespace OpenSim.Region.CoreModules.World.Serialiser foreach (Scene region in m_regions) { // List results = SerialiseRegion(region, m_savedir + region.RegionInfo.RegionID.ToString() + "/"); - SerialiseRegion(region, m_savedir + region.RegionInfo.RegionID.ToString() + "/"); + SerialiseRegion(region, Path.Combine(m_savedir, region.RegionInfo.RegionID.ToString())); } } diff --git a/OpenSim/Region/CoreModules/World/Serialiser/Tests/SerialiserTests.cs b/OpenSim/Region/CoreModules/World/Serialiser/Tests/SerialiserTests.cs index 799a4481f8..f10e848f68 100644 --- a/OpenSim/Region/CoreModules/World/Serialiser/Tests/SerialiserTests.cs +++ b/OpenSim/Region/CoreModules/World/Serialiser/Tests/SerialiserTests.cs @@ -25,6 +25,9 @@ * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ +using System.Collections.Generic; +using System.IO; +using System.Xml; using log4net.Config; using NUnit.Framework; using NUnit.Framework.SyntaxHelpers; @@ -34,8 +37,6 @@ using OpenSim.Region.Framework.Scenes; using OpenSim.Region.Framework.Scenes.Serialization; using OpenSim.Tests.Common; using OpenSim.Tests.Common.Setup; -using System.IO; -using System.Xml; namespace OpenSim.Region.CoreModules.World.Serialiser.Tests { @@ -302,15 +303,19 @@ namespace OpenSim.Region.CoreModules.World.Serialiser.Tests { case "UUID": xtr.ReadStartElement("UUID"); - uuid = UUID.Parse(xtr.ReadElementString("Guid")); - xtr.ReadEndElement(); + try + { + uuid = UUID.Parse(xtr.ReadElementString("UUID")); + xtr.ReadEndElement(); + } + catch { } // ignore everything but ... break; case "Name": name = xtr.ReadElementContentAsString(); break; case "CreatorID": xtr.ReadStartElement("CreatorID"); - creatorId = UUID.Parse(xtr.ReadElementString("Guid")); + creatorId = UUID.Parse(xtr.ReadElementString("UUID")); xtr.ReadEndElement(); break; } @@ -369,7 +374,9 @@ namespace OpenSim.Region.CoreModules.World.Serialiser.Tests // Need to add the object to the scene so that the request to get script state succeeds m_scene.AddSceneObject(so); - string xml2 = m_serialiserModule.SerializeGroupToXml2(so); + Dictionary options = new Dictionary(); + options["old-guids"] = true; + string xml2 = m_serialiserModule.SerializeGroupToXml2(so, options); XmlTextReader xtr = new XmlTextReader(new StringReader(xml2)); xtr.ReadStartElement("SceneObjectGroup"); diff --git a/OpenSim/Region/CoreModules/World/Sound/SoundModule.cs b/OpenSim/Region/CoreModules/World/Sound/SoundModule.cs index a52fea46fc..8df44feb8c 100644 --- a/OpenSim/Region/CoreModules/World/Sound/SoundModule.cs +++ b/OpenSim/Region/CoreModules/World/Sound/SoundModule.cs @@ -31,12 +31,14 @@ using OpenMetaverse; using OpenSim.Framework; using OpenSim.Region.Framework.Interfaces; using OpenSim.Region.Framework.Scenes; +using System.Reflection; +using log4net; namespace OpenSim.Region.CoreModules.World.Sound { public class SoundModule : IRegionModule, ISoundModule { - //private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); + private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); protected Scene m_scene; @@ -62,6 +64,12 @@ namespace OpenSim.Region.CoreModules.World.Sound public virtual void PlayAttachedSound( UUID soundID, UUID ownerID, UUID objectID, double gain, Vector3 position, byte flags, float radius) { + SceneObjectPart part = m_scene.GetSceneObjectPart(objectID); + if (part == null) + return; + + SceneObjectGroup grp = part.ParentGroup; + m_scene.ForEachScenePresence(delegate(ScenePresence sp) { if (sp.IsChildAgent) @@ -71,6 +79,18 @@ namespace OpenSim.Region.CoreModules.World.Sound if (dis > 100.0) // Max audio distance return; + if (grp.IsAttachment) + { + if (grp.GetAttachmentPoint() > 30) // HUD + { + if (sp.ControllingClient.AgentId != grp.OwnerID) + return; + } + + if (sp.ControllingClient.AgentId == grp.OwnerID) + dis = 0; + } + // Scale by distance if (radius == 0) gain = (float)((double)gain * ((100.0 - dis) / 100.0)); @@ -84,6 +104,24 @@ namespace OpenSim.Region.CoreModules.World.Sound public virtual void TriggerSound( UUID soundId, UUID ownerID, UUID objectID, UUID parentID, double gain, Vector3 position, UInt64 handle, float radius) { + SceneObjectPart part = m_scene.GetSceneObjectPart(objectID); + if (part == null) + { + ScenePresence sp; + if (!m_scene.TryGetScenePresence(objectID, out sp)) + return; + } + else + { + SceneObjectGroup grp = part.ParentGroup; + + if (grp.IsAttachment && grp.GetAttachmentPoint() > 30) + { + objectID = ownerID; + parentID = ownerID; + } + } + m_scene.ForEachScenePresence(delegate(ScenePresence sp) { if (sp.IsChildAgent) diff --git a/OpenSim/Region/CoreModules/World/Sun/SunModule.cs b/OpenSim/Region/CoreModules/World/Sun/SunModule.cs index a6dc2ec79a..cea7c78ce8 100644 --- a/OpenSim/Region/CoreModules/World/Sun/SunModule.cs +++ b/OpenSim/Region/CoreModules/World/Sun/SunModule.cs @@ -44,10 +44,8 @@ namespace OpenSim.Region.CoreModules /// it is not based on ~06:00 == Sun Rise. Rather it is based on 00:00 being sun-rise. /// - private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); - // // Global Constants used to determine where in the sky the sun is // @@ -108,26 +106,25 @@ namespace OpenSim.Region.CoreModules private Scene m_scene = null; // Calculated Once in the lifetime of a region - private long TicksToEpoch; // Elapsed time for 1/1/1970 - private uint SecondsPerSunCycle; // Length of a virtual day in RW seconds - private uint SecondsPerYear; // Length of a virtual year in RW seconds - private double SunSpeed; // Rate of passage in radians/second - private double SeasonSpeed; // Rate of change for seasonal effects - // private double HoursToRadians; // Rate of change for seasonal effects - private long TicksUTCOffset = 0; // seconds offset from UTC + private long TicksToEpoch; // Elapsed time for 1/1/1970 + private uint SecondsPerSunCycle; // Length of a virtual day in RW seconds + private uint SecondsPerYear; // Length of a virtual year in RW seconds + private double SunSpeed; // Rate of passage in radians/second + private double SeasonSpeed; // Rate of change for seasonal effects + // private double HoursToRadians; // Rate of change for seasonal effects + private long TicksUTCOffset = 0; // seconds offset from UTC // Calculated every update - private float OrbitalPosition; // Orbital placement at a point in time - private double HorizonShift; // Axis offset to skew day and night - private double TotalDistanceTravelled; // Distance since beginning of time (in radians) - private double SeasonalOffset; // Seaonal variation of tilt - private float Magnitude; // Normal tilt - // private double VWTimeRatio; // VW time as a ratio of real time + private float OrbitalPosition; // Orbital placement at a point in time + private double HorizonShift; // Axis offset to skew day and night + private double TotalDistanceTravelled; // Distance since beginning of time (in radians) + private double SeasonalOffset; // Seaonal variation of tilt + private float Magnitude; // Normal tilt + // private double VWTimeRatio; // VW time as a ratio of real time // Working values private Vector3 Position = Vector3.Zero; private Vector3 Velocity = Vector3.Zero; - private Quaternion Tilt = new Quaternion(1.0f, 0.0f, 0.0f, 0.0f); - + private Quaternion Tilt = new Quaternion(1.0f, 0.0f, 0.0f, 0.0f); // Used to fix the sun in the sky so it doesn't move based on current time private bool m_SunFixed = false; @@ -135,8 +132,6 @@ namespace OpenSim.Region.CoreModules private const int TICKS_PER_SECOND = 10000000; - - // Current time in elapsed seconds since Jan 1st 1970 private ulong CurrentTime { @@ -149,8 +144,6 @@ namespace OpenSim.Region.CoreModules // Time in seconds since UTC to use to calculate sun position. ulong PosTime = 0; - - /// /// Calculate the sun's orbital position and its velocity. /// @@ -202,7 +195,6 @@ namespace OpenSim.Region.CoreModules PosTime += (ulong)(((CurDayPercentage - 0.5) / .5) * NightSeconds); } } - } TotalDistanceTravelled = SunSpeed * PosTime; // distance measured in radians @@ -251,7 +243,6 @@ namespace OpenSim.Region.CoreModules Velocity.X = 0; Velocity.Y = 0; Velocity.Z = 0; - } else { @@ -271,9 +262,7 @@ namespace OpenSim.Region.CoreModules private float GetCurrentTimeAsLindenSunHour() { if (m_SunFixed) - { return m_SunFixedHour + 6; - } return GetCurrentSunHour() + 6.0f; } @@ -297,8 +286,6 @@ namespace OpenSim.Region.CoreModules m_scene.AddCommand(this, String.Format("sun {0}", kvp.Key), String.Format("{0} - {1}", kvp.Key, kvp.Value), "", HandleSunConsoleCommand); } - - TimeZone local = TimeZone.CurrentTimeZone; TicksUTCOffset = local.GetUtcOffset(local.ToLocalTime(DateTime.Now)).Ticks; m_log.Debug("[SUN]: localtime offset is " + TicksUTCOffset); @@ -325,13 +312,11 @@ namespace OpenSim.Region.CoreModules // must hard code to ~.5 to match sun position in LL based viewers m_HorizonShift = config.Configs["Sun"].GetDouble("day_night_offset", d_day_night); - // Scales the sun hours 0...12 vs 12...24, essentially makes daylight hours longer/shorter vs nighttime hours m_DayTimeSunHourScale = config.Configs["Sun"].GetDouble("day_time_sun_hour_scale", d_DayTimeSunHourScale); // Update frequency in frames m_UpdateInterval = config.Configs["Sun"].GetInt("update_interval", d_frame_mod); - } catch (Exception e) { @@ -391,10 +376,8 @@ namespace OpenSim.Region.CoreModules } scene.RegisterModuleInterface(this); - } - public void PostInitialise() { } @@ -402,7 +385,7 @@ namespace OpenSim.Region.CoreModules public void Close() { ready = false; - + // Remove our hooks m_scene.EventManager.OnFrame -= SunUpdate; m_scene.EventManager.OnAvatarEnteringNewParcel -= AvatarEnteringParcel; @@ -419,6 +402,7 @@ namespace OpenSim.Region.CoreModules { get { return false; } } + #endregion #region EventManager Events @@ -446,9 +430,7 @@ namespace OpenSim.Region.CoreModules public void SunUpdate() { if (((m_frame++ % m_UpdateInterval) != 0) || !ready || m_SunFixed || !receivedEstateToolsSunUpdate) - { return; - } GenSunPos(); // Generate shared values once @@ -467,7 +449,7 @@ namespace OpenSim.Region.CoreModules } /// - /// + /// /// /// /// Is the sun's position fixed? @@ -484,7 +466,6 @@ namespace OpenSim.Region.CoreModules while (FixedSunHour < 0) FixedSunHour += 24; - m_SunFixedHour = FixedSunHour; m_SunFixed = FixedSun; @@ -499,14 +480,12 @@ namespace OpenSim.Region.CoreModules // When sun settings are updated, we should update all clients with new settings. SunUpdateToAllClients(); - m_log.DebugFormat("[SUN]: PosTime : {0}", PosTime.ToString()); } } #endregion - private void SunUpdateToAllClients() { m_scene.ForEachScenePresence(delegate(ScenePresence sp) @@ -553,7 +532,6 @@ namespace OpenSim.Region.CoreModules { float ticksleftover = CurrentTime % SecondsPerSunCycle; - return (24.0f * (ticksleftover / SecondsPerSunCycle)); } @@ -666,7 +644,6 @@ namespace OpenSim.Region.CoreModules // When sun settings are updated, we should update all clients with new settings. SunUpdateToAllClients(); - } return Output; diff --git a/OpenSim/Region/CoreModules/World/Terrain/DefaultEffects/ChannelDigger.cs b/OpenSim/Region/CoreModules/World/Terrain/Effects/ChannelDigger.cs similarity index 98% rename from OpenSim/Region/CoreModules/World/Terrain/DefaultEffects/ChannelDigger.cs rename to OpenSim/Region/CoreModules/World/Terrain/Effects/ChannelDigger.cs index e23be595f9..36917e9e38 100644 --- a/OpenSim/Region/CoreModules/World/Terrain/DefaultEffects/ChannelDigger.cs +++ b/OpenSim/Region/CoreModules/World/Terrain/Effects/ChannelDigger.cs @@ -30,7 +30,7 @@ using OpenSim.Region.CoreModules.World.Terrain; using OpenSim.Region.CoreModules.World.Terrain.FloodBrushes; using OpenSim.Region.Framework.Interfaces; -namespace OpenSim.Region.Modules.Terrain.Extensions.DefaultEffects.Effects +namespace OpenSim.Region.CoreModules.World.Terrain.Effects { public class ChannelDigger : ITerrainEffect { diff --git a/OpenSim/Region/CoreModules/World/Terrain/TerrainModule.cs b/OpenSim/Region/CoreModules/World/Terrain/TerrainModule.cs index 1e7ea7bce6..25d73c2c0f 100644 --- a/OpenSim/Region/CoreModules/World/Terrain/TerrainModule.cs +++ b/OpenSim/Region/CoreModules/World/Terrain/TerrainModule.cs @@ -68,7 +68,7 @@ namespace OpenSim.Region.CoreModules.World.Terrain #endregion private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); - + private readonly Commander m_commander = new Commander("terrain"); private readonly Dictionary m_floodeffects = @@ -381,8 +381,13 @@ namespace OpenSim.Region.CoreModules.World.Terrain private void LoadPlugins() { m_plugineffects = new Dictionary(); + string plugineffectsPath = "Terrain"; + // Load the files in the Terrain/ dir - string[] files = Directory.GetFiles("Terrain"); + if (!Directory.Exists(plugineffectsPath)) + return; + + string[] files = Directory.GetFiles(plugineffectsPath); foreach (string file in files) { m_log.Info("Loading effects in " + file); @@ -581,8 +586,9 @@ namespace OpenSim.Region.CoreModules.World.Terrain client.OnModifyTerrain += client_OnModifyTerrain; client.OnBakeTerrain += client_OnBakeTerrain; client.OnLandUndo += client_OnLandUndo; + client.OnUnackedTerrain += client_OnUnackedTerrain; } - + /// /// Checks to see if the terrain has been modified since last check /// but won't attempt to limit those changes to the limits specified in the estate settings @@ -803,6 +809,12 @@ namespace OpenSim.Region.CoreModules.World.Terrain InterfaceBakeTerrain(null); //bake terrain does not use the passed in parameter } } + + protected void client_OnUnackedTerrain(IClientAPI client, int patchX, int patchY) + { + //m_log.Debug("Terrain packet unacked, resending patch: " + patchX + " , " + patchY); + client.SendLayerData(patchX, patchY, m_scene.Heightmap.GetFloatsSerialised()); + } private void StoreUndoState() { diff --git a/OpenSim/Region/CoreModules/World/Warp3DMap/MapImageModule.cs b/OpenSim/Region/CoreModules/World/Warp3DMap/MapImageModule.cs new file mode 100644 index 0000000000..6eb57eb424 --- /dev/null +++ b/OpenSim/Region/CoreModules/World/Warp3DMap/MapImageModule.cs @@ -0,0 +1,656 @@ +/* + * Copyright (c) Contributors, http://opensimulator.org/ + * See CONTRIBUTORS.TXT for a full list of copyright holders. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * * Neither the name of the OpenSimulator Project nor the + * names of its contributors may be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE DEVELOPERS ``AS IS'' AND ANY + * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED + * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + * DISCLAIMED. IN NO EVENT SHALL THE CONTRIBUTORS BE LIABLE FOR ANY + * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES + * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND + * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS + * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +using System; +using System.Collections.Generic; +using System.Drawing; +using System.Drawing.Imaging; +using System.IO; +using System.Reflection; +using CSJ2K; +using Nini.Config; +using log4net; +using Rednettle.Warp3D; +using OpenMetaverse; +using OpenMetaverse.Imaging; +using OpenMetaverse.Rendering; +using OpenMetaverse.StructuredData; +using OpenSim.Framework; +using OpenSim.Region.Framework.Interfaces; +using OpenSim.Region.Framework.Scenes; +using OpenSim.Region.Physics.Manager; +using OpenSim.Services.Interfaces; + +using WarpRenderer = global::Warp3D.Warp3D; + +namespace OpenSim.Region.CoreModules.World.Warp3DMap +{ + public class Warp3DImageModule : IMapImageGenerator, INonSharedRegionModule + { + private static readonly UUID TEXTURE_METADATA_MAGIC = new UUID("802dc0e0-f080-4931-8b57-d1be8611c4f3"); + private static readonly Color4 WATER_COLOR = new Color4(29, 71, 95, 216); + + private static readonly ILog m_log = + LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); + + private Scene m_scene; + private IRendering m_primMesher; + private IConfigSource m_config; + private Dictionary m_colors = new Dictionary(); + private bool m_useAntiAliasing = true; // TODO: Make this a config option + private bool m_Enabled = false; + + #region IRegionModule Members + + public void Initialise(IConfigSource source) + { + m_config = source; + + IConfig startupConfig = m_config.Configs["Startup"]; + if (startupConfig.GetString("MapImageModule", "MapImageModule") != "Warp3DImageModule") + return; + + m_Enabled = true; + } + + public void AddRegion(Scene scene) + { + if (!m_Enabled) + return; + + m_scene = scene; + + List renderers = RenderingLoader.ListRenderers(Util.ExecutingDirectory()); + if (renderers.Count > 0) + { + m_primMesher = RenderingLoader.LoadRenderer(renderers[0]); + m_log.Info("[MAPTILE]: Loaded prim mesher " + m_primMesher.ToString()); + } + else + { + m_log.Info("[MAPTILE]: No prim mesher loaded, prim rendering will be disabled"); + } + + m_scene.RegisterModuleInterface(this); + } + + public void RegionLoaded(Scene scene) + { + } + + public void RemoveRegion(Scene scene) + { + } + + public void Close() + { + } + + public string Name + { + get { return "Warp3DImageModule"; } + } + + public Type ReplaceableInterface + { + get { return null; } + } + + #endregion + + #region IMapImageGenerator Members + + public Bitmap CreateMapTile() + { + Vector3 camPos = new Vector3(127.5f, 127.5f, 221.7025033688163f); + Viewport viewport = new Viewport(camPos, -Vector3.UnitZ, 1024f, 0.1f, (int)Constants.RegionSize, (int)Constants.RegionSize, (float)Constants.RegionSize, (float)Constants.RegionSize); + return CreateMapTile(viewport, false); + } + + public Bitmap CreateViewImage(Vector3 camPos, Vector3 camDir, float fov, int width, int height, bool useTextures) + { + Viewport viewport = new Viewport(camPos, camDir, fov, (float)Constants.RegionSize, 0.1f, width, height); + return CreateMapTile(viewport, useTextures); + } + + public Bitmap CreateMapTile(Viewport viewport, bool useTextures) + { + bool drawPrimVolume = true; + bool textureTerrain = true; + + try + { + IConfig startupConfig = m_config.Configs["Startup"]; + drawPrimVolume = startupConfig.GetBoolean("DrawPrimOnMapTile", drawPrimVolume); + textureTerrain = startupConfig.GetBoolean("TextureOnMapTile", textureTerrain); + } + catch + { + m_log.Warn("[MAPTILE]: Failed to load StartupConfig"); + } + + m_colors.Clear(); + + int width = viewport.Width; + int height = viewport.Height; + + if (m_useAntiAliasing) + { + width *= 2; + height *= 2; + } + + WarpRenderer renderer = new WarpRenderer(); + renderer.CreateScene(width, height); + renderer.Scene.autoCalcNormals = false; + + #region Camera + + warp_Vector pos = ConvertVector(viewport.Position); + pos.z -= 0.001f; // Works around an issue with the Warp3D camera + warp_Vector lookat = warp_Vector.add(ConvertVector(viewport.Position), ConvertVector(viewport.LookDirection)); + + renderer.Scene.defaultCamera.setPos(pos); + renderer.Scene.defaultCamera.lookAt(lookat); + + if (viewport.Orthographic) + { + renderer.Scene.defaultCamera.isOrthographic = true; + renderer.Scene.defaultCamera.orthoViewWidth = viewport.OrthoWindowWidth; + renderer.Scene.defaultCamera.orthoViewHeight = viewport.OrthoWindowHeight; + } + else + { + float fov = viewport.FieldOfView; + fov *= 1.75f; // FIXME: ??? + renderer.Scene.defaultCamera.setFov(fov); + } + + #endregion Camera + + renderer.Scene.addLight("Light1", new warp_Light(new warp_Vector(0.2f, 0.2f, 1f), 0xffffff, 320, 80)); + renderer.Scene.addLight("Light2", new warp_Light(new warp_Vector(-1f, -1f, 1f), 0xffffff, 100, 40)); + + CreateWater(renderer); + CreateTerrain(renderer, textureTerrain); + if (drawPrimVolume) + CreateAllPrims(renderer, useTextures); + + renderer.Render(); + Bitmap bitmap = renderer.Scene.getImage(); + + if (m_useAntiAliasing) + bitmap = ImageUtils.ResizeImage(bitmap, viewport.Width, viewport.Height); + + return bitmap; + } + + public byte[] WriteJpeg2000Image() + { + try + { + using (Bitmap mapbmp = CreateMapTile()) + return OpenJPEG.EncodeFromImage(mapbmp, true); + } + catch (Exception e) + { + // JPEG2000 encoder failed + m_log.Error("[MAPTILE]: Failed generating terrain map: " + e); + } + + return null; + } + + #endregion + + #region Rendering Methods + + private void CreateWater(WarpRenderer renderer) + { + float waterHeight = (float)m_scene.RegionInfo.RegionSettings.WaterHeight; + + renderer.AddPlane("Water", 256f * 0.5f); + renderer.Scene.sceneobject("Water").setPos(127.5f, waterHeight, 127.5f); + + renderer.AddMaterial("WaterColor", ConvertColor(WATER_COLOR)); + renderer.Scene.material("WaterColor").setTransparency((byte)((1f - WATER_COLOR.A) * 255f)); + renderer.SetObjectMaterial("Water", "WaterColor"); + } + + private void CreateTerrain(WarpRenderer renderer, bool textureTerrain) + { + ITerrainChannel terrain = m_scene.Heightmap; + float[] heightmap = terrain.GetFloatsSerialised(); + + warp_Object obj = new warp_Object(256 * 256, 255 * 255 * 2); + + for (int y = 0; y < 256; y++) + { + for (int x = 0; x < 256; x++) + { + int v = y * 256 + x; + float height = heightmap[v]; + + warp_Vector pos = ConvertVector(new Vector3(x, y, height)); + obj.addVertex(new warp_Vertex(pos, (float)x / 255f, (float)(255 - y) / 255f)); + } + } + + for (int y = 0; y < 256; y++) + { + for (int x = 0; x < 256; x++) + { + if (x < 255 && y < 255) + { + int v = y * 256 + x; + + // Normal + Vector3 v1 = new Vector3(x, y, heightmap[y * 256 + x]); + Vector3 v2 = new Vector3(x + 1, y, heightmap[y * 256 + x + 1]); + Vector3 v3 = new Vector3(x, y + 1, heightmap[(y + 1) * 256 + x]); + warp_Vector norm = ConvertVector(SurfaceNormal(v1, v2, v3)); + norm = norm.reverse(); + obj.vertex(v).n = norm; + + // Triangle 1 + obj.addTriangle( + v, + v + 1, + v + 256); + + // Triangle 2 + obj.addTriangle( + v + 256 + 1, + v + 256, + v + 1); + } + } + } + + renderer.Scene.addObject("Terrain", obj); + + UUID[] textureIDs = new UUID[4]; + float[] startHeights = new float[4]; + float[] heightRanges = new float[4]; + + RegionSettings regionInfo = m_scene.RegionInfo.RegionSettings; + + textureIDs[0] = regionInfo.TerrainTexture1; + textureIDs[1] = regionInfo.TerrainTexture2; + textureIDs[2] = regionInfo.TerrainTexture3; + textureIDs[3] = regionInfo.TerrainTexture4; + + startHeights[0] = (float)regionInfo.Elevation1SW; + startHeights[1] = (float)regionInfo.Elevation1NW; + startHeights[2] = (float)regionInfo.Elevation1SE; + startHeights[3] = (float)regionInfo.Elevation1NE; + + heightRanges[0] = (float)regionInfo.Elevation2SW; + heightRanges[1] = (float)regionInfo.Elevation2NW; + heightRanges[2] = (float)regionInfo.Elevation2SE; + heightRanges[3] = (float)regionInfo.Elevation2NE; + + uint globalX, globalY; + Utils.LongToUInts(m_scene.RegionInfo.RegionHandle, out globalX, out globalY); + + Bitmap image = TerrainSplat.Splat(heightmap, textureIDs, startHeights, heightRanges, new Vector3d(globalX, globalY, 0.0), m_scene.AssetService, textureTerrain); + warp_Texture texture = new warp_Texture(image); + warp_Material material = new warp_Material(texture); + material.setReflectivity(50); + renderer.Scene.addMaterial("TerrainColor", material); + renderer.SetObjectMaterial("Terrain", "TerrainColor"); + } + + private void CreateAllPrims(WarpRenderer renderer, bool useTextures) + { + if (m_primMesher == null) + return; + + m_scene.ForEachSOG( + delegate(SceneObjectGroup group) + { + CreatePrim(renderer, group.RootPart, useTextures); + foreach (SceneObjectPart child in group.Parts) + CreatePrim(renderer, child, useTextures); + } + ); + } + + private void CreatePrim(WarpRenderer renderer, SceneObjectPart prim, + bool useTextures) + { + const float MIN_SIZE = 2f; + + if ((PCode)prim.Shape.PCode != PCode.Prim) + return; + if (prim.Scale.LengthSquared() < MIN_SIZE * MIN_SIZE) + return; + + Primitive omvPrim = prim.Shape.ToOmvPrimitive(prim.OffsetPosition, prim.RotationOffset); + FacetedMesh renderMesh = m_primMesher.GenerateFacetedMesh(omvPrim, DetailLevel.Medium); + if (renderMesh == null) + return; + + warp_Vector primPos = ConvertVector(prim.GetWorldPosition()); + warp_Quaternion primRot = ConvertQuaternion(prim.RotationOffset); + + warp_Matrix m = warp_Matrix.quaternionMatrix(primRot); + + if (prim.ParentID != 0) + { + SceneObjectGroup group = m_scene.SceneGraph.GetGroupByPrim(prim.LocalId); + if (group != null) + m.transform(warp_Matrix.quaternionMatrix(ConvertQuaternion(group.RootPart.RotationOffset))); + } + + warp_Vector primScale = ConvertVector(prim.Scale); + + string primID = prim.UUID.ToString(); + + // Create the prim faces + // TODO: Implement the useTextures flag behavior + for (int i = 0; i < renderMesh.Faces.Count; i++) + { + Face face = renderMesh.Faces[i]; + string meshName = primID + "-Face-" + i.ToString(); + + // Avoid adding duplicate meshes to the scene + if (renderer.Scene.objectData.ContainsKey(meshName)) + { + continue; + } + + warp_Object faceObj = new warp_Object(face.Vertices.Count, face.Indices.Count / 3); + + for (int j = 0; j < face.Vertices.Count; j++) + { + Vertex v = face.Vertices[j]; + + warp_Vector pos = ConvertVector(v.Position); + warp_Vector norm = ConvertVector(v.Normal); + + if (prim.Shape.SculptTexture == UUID.Zero) + norm = norm.reverse(); + warp_Vertex vert = new warp_Vertex(pos, norm, v.TexCoord.X, v.TexCoord.Y); + + faceObj.addVertex(vert); + } + + for (int j = 0; j < face.Indices.Count; j += 3) + { + faceObj.addTriangle( + face.Indices[j + 0], + face.Indices[j + 1], + face.Indices[j + 2]); + } + + Primitive.TextureEntryFace teFace = prim.Shape.Textures.GetFace((uint)i); + Color4 faceColor = GetFaceColor(teFace); + string materialName = GetOrCreateMaterial(renderer, faceColor); + + faceObj.transform(m); + faceObj.setPos(primPos); + faceObj.scaleSelf(primScale.x, primScale.y, primScale.z); + + renderer.Scene.addObject(meshName, faceObj); + + renderer.SetObjectMaterial(meshName, materialName); + } + } + + private Color4 GetFaceColor(Primitive.TextureEntryFace face) + { + Color4 color; + + if (face.TextureID == UUID.Zero) + return face.RGBA; + + if (!m_colors.TryGetValue(face.TextureID, out color)) + { + bool fetched = false; + + // Attempt to fetch the texture metadata + UUID metadataID = UUID.Combine(face.TextureID, TEXTURE_METADATA_MAGIC); + AssetBase metadata = m_scene.AssetService.GetCached(metadataID.ToString()); + if (metadata != null) + { + OSDMap map = null; + try { map = OSDParser.Deserialize(metadata.Data) as OSDMap; } catch { } + + if (map != null) + { + color = map["X-JPEG2000-RGBA"].AsColor4(); + fetched = true; + } + } + + if (!fetched) + { + // Fetch the texture, decode and get the average color, + // then save it to a temporary metadata asset + AssetBase textureAsset = m_scene.AssetService.Get(face.TextureID.ToString()); + if (textureAsset != null) + { + int width, height; + color = GetAverageColor(textureAsset.FullID, textureAsset.Data, out width, out height); + + OSDMap data = new OSDMap { { "X-JPEG2000-RGBA", OSD.FromColor4(color) } }; + metadata = new AssetBase + { + Data = System.Text.Encoding.UTF8.GetBytes(OSDParser.SerializeJsonString(data)), + Description = "Metadata for JPEG2000 texture " + face.TextureID.ToString(), + Flags = AssetFlags.Collectable, + FullID = metadataID, + ID = metadataID.ToString(), + Local = true, + Temporary = true, + Name = String.Empty, + Type = (sbyte)AssetType.Unknown + }; + m_scene.AssetService.Store(metadata); + } + else + { + color = new Color4(0.5f, 0.5f, 0.5f, 1.0f); + } + } + + m_colors[face.TextureID] = color; + } + + return color * face.RGBA; + } + + private string GetOrCreateMaterial(WarpRenderer renderer, Color4 color) + { + string name = color.ToString(); + + warp_Material material = renderer.Scene.material(name); + if (material != null) + return name; + + renderer.AddMaterial(name, ConvertColor(color)); + if (color.A < 1f) + renderer.Scene.material(name).setTransparency((byte)((1f - color.A) * 255f)); + return name; + } + + #endregion Rendering Methods + + #region Static Helpers + + private static warp_Vector ConvertVector(Vector3 vector) + { + return new warp_Vector(vector.X, vector.Z, vector.Y); + } + + private static warp_Quaternion ConvertQuaternion(Quaternion quat) + { + return new warp_Quaternion(quat.X, quat.Z, quat.Y, -quat.W); + } + + private static int ConvertColor(Color4 color) + { + int c = warp_Color.getColor((byte)(color.R * 255f), (byte)(color.G * 255f), (byte)(color.B * 255f)); + if (color.A < 1f) + c |= (byte)(color.A * 255f) << 24; + + return c; + } + + private static Vector3 SurfaceNormal(Vector3 c1, Vector3 c2, Vector3 c3) + { + Vector3 edge1 = new Vector3(c2.X - c1.X, c2.Y - c1.Y, c2.Z - c1.Z); + Vector3 edge2 = new Vector3(c3.X - c1.X, c3.Y - c1.Y, c3.Z - c1.Z); + + Vector3 normal = Vector3.Cross(edge1, edge2); + normal.Normalize(); + + return normal; + } + + public static Color4 GetAverageColor(UUID textureID, byte[] j2kData, out int width, out int height) + { + ulong r = 0; + ulong g = 0; + ulong b = 0; + ulong a = 0; + + using (MemoryStream stream = new MemoryStream(j2kData)) + { + try + { + Bitmap bitmap = (Bitmap)J2kImage.FromStream(stream); + width = bitmap.Width; + height = bitmap.Height; + + BitmapData bitmapData = bitmap.LockBits(new Rectangle(0, 0, width, height), ImageLockMode.ReadOnly, bitmap.PixelFormat); + int pixelBytes = (bitmap.PixelFormat == PixelFormat.Format24bppRgb) ? 3 : 4; + + // Sum up the individual channels + unsafe + { + if (pixelBytes == 4) + { + for (int y = 0; y < height; y++) + { + byte* row = (byte*)bitmapData.Scan0 + (y * bitmapData.Stride); + + for (int x = 0; x < width; x++) + { + b += row[x * pixelBytes + 0]; + g += row[x * pixelBytes + 1]; + r += row[x * pixelBytes + 2]; + a += row[x * pixelBytes + 3]; + } + } + } + else + { + for (int y = 0; y < height; y++) + { + byte* row = (byte*)bitmapData.Scan0 + (y * bitmapData.Stride); + + for (int x = 0; x < width; x++) + { + b += row[x * pixelBytes + 0]; + g += row[x * pixelBytes + 1]; + r += row[x * pixelBytes + 2]; + } + } + } + } + + // Get the averages for each channel + const decimal OO_255 = 1m / 255m; + decimal totalPixels = (decimal)(width * height); + + decimal rm = ((decimal)r / totalPixels) * OO_255; + decimal gm = ((decimal)g / totalPixels) * OO_255; + decimal bm = ((decimal)b / totalPixels) * OO_255; + decimal am = ((decimal)a / totalPixels) * OO_255; + + if (pixelBytes == 3) + am = 1m; + + return new Color4((float)rm, (float)gm, (float)bm, (float)am); + } + catch (Exception ex) + { + m_log.WarnFormat("[MAPTILE]: Error decoding JPEG2000 texture {0} ({1} bytes): {2}", textureID, j2kData.Length, ex.Message); + width = 0; + height = 0; + return new Color4(0.5f, 0.5f, 0.5f, 1.0f); + } + } + } + + #endregion Static Helpers + } + + public static class ImageUtils + { + /// + /// Performs bilinear interpolation between four values + /// + /// First, or top left value + /// Second, or top right value + /// Third, or bottom left value + /// Fourth, or bottom right value + /// Interpolation value on the X axis, between 0.0 and 1.0 + /// Interpolation value on fht Y axis, between 0.0 and 1.0 + /// The bilinearly interpolated result + public static float Bilinear(float v00, float v01, float v10, float v11, float xPercent, float yPercent) + { + return Utils.Lerp(Utils.Lerp(v00, v01, xPercent), Utils.Lerp(v10, v11, xPercent), yPercent); + } + + /// + /// Performs a high quality image resize + /// + /// Image to resize + /// New width + /// New height + /// Resized image + public static Bitmap ResizeImage(Image image, int width, int height) + { + Bitmap result = new Bitmap(width, height); + + using (Graphics graphics = Graphics.FromImage(result)) + { + graphics.CompositingQuality = System.Drawing.Drawing2D.CompositingQuality.HighQuality; + graphics.InterpolationMode = System.Drawing.Drawing2D.InterpolationMode.HighQualityBicubic; + graphics.SmoothingMode = System.Drawing.Drawing2D.SmoothingMode.HighQuality; + graphics.PixelOffsetMode = System.Drawing.Drawing2D.PixelOffsetMode.HighQuality; + + graphics.DrawImage(image, 0, 0, result.Width, result.Height); + } + + return result; + } + } +} diff --git a/OpenSim/Region/CoreModules/World/Warp3DMap/Perlin.cs b/OpenSim/Region/CoreModules/World/Warp3DMap/Perlin.cs new file mode 100644 index 0000000000..af59d7a1ba --- /dev/null +++ b/OpenSim/Region/CoreModules/World/Warp3DMap/Perlin.cs @@ -0,0 +1,273 @@ +/* + * Copyright (c) Contributors, http://opensimulator.org/ + * See CONTRIBUTORS.TXT for a full list of copyright holders. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * * Neither the name of the OpenSimulator Project nor the + * names of its contributors may be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE DEVELOPERS ``AS IS'' AND ANY + * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED + * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + * DISCLAIMED. IN NO EVENT SHALL THE CONTRIBUTORS BE LIABLE FOR ANY + * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES + * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND + * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS + * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +using System; +using OpenMetaverse; + +namespace OpenSim.Region.CoreModules.World.Warp3DMap +{ + public static class Perlin + { + // We use a hardcoded seed to keep the noise generation consistent between runs + private const int SEED = 42; + + private const int SAMPLE_SIZE = 1024; + private const int B = SAMPLE_SIZE; + private const int BM = SAMPLE_SIZE - 1; + private const int N = 0x1000; + + private static readonly int[] p = new int[SAMPLE_SIZE + SAMPLE_SIZE + 2]; + private static readonly float[,] g3 = new float[SAMPLE_SIZE + SAMPLE_SIZE + 2, 3]; + private static readonly float[,] g2 = new float[SAMPLE_SIZE + SAMPLE_SIZE + 2, 2]; + private static readonly float[] g1 = new float[SAMPLE_SIZE + SAMPLE_SIZE + 2]; + + static Perlin() + { + Random rng = new Random(SEED); + int i, j, k; + + for (i = 0; i < B; i++) + { + p[i] = i; + g1[i] = (float)((rng.Next() % (B + B)) - B) / B; + + for (j = 0; j < 2; j++) + g2[i, j] = (float)((rng.Next() % (B + B)) - B) / B; + normalize2(g2, i); + + for (j = 0; j < 3; j++) + g3[i, j] = (float)((rng.Next() % (B + B)) - B) / B; + normalize3(g3, i); + } + + while (--i > 0) + { + k = p[i]; + p[i] = p[j = rng.Next() % B]; + p[j] = k; + } + + for (i = 0; i < B + 2; i++) + { + p[B + i] = p[i]; + g1[B + i] = g1[i]; + for (j = 0; j < 2; j++) + g2[B + i, j] = g2[i, j]; + for (j = 0; j < 3; j++) + g3[B + i, j] = g3[i, j]; + } + } + + public static float noise1(float arg) + { + int bx0, bx1; + float rx0, rx1, sx, t, u, v, a; + + a = arg; + + t = arg + N; + bx0 = ((int)t) & BM; + bx1 = (bx0 + 1) & BM; + rx0 = t - (int)t; + rx1 = rx0 - 1f; + + sx = s_curve(rx0); + + u = rx0 * g1[p[bx0]]; + v = rx1 * g1[p[bx1]]; + + return Utils.Lerp(u, v, sx); + } + + public static float noise2(float x, float y) + { + int bx0, bx1, by0, by1, b00, b10, b01, b11; + float rx0, rx1, ry0, ry1, sx, sy, a, b, t, u, v; + int i, j; + + t = x + N; + bx0 = ((int)t) & BM; + bx1 = (bx0 + 1) & BM; + rx0 = t - (int)t; + rx1 = rx0 - 1f; + + t = y + N; + by0 = ((int)t) & BM; + by1 = (by0 + 1) & BM; + ry0 = t - (int)t; + ry1 = ry0 - 1f; + + i = p[bx0]; + j = p[bx1]; + + b00 = p[i + by0]; + b10 = p[j + by0]; + b01 = p[i + by1]; + b11 = p[j + by1]; + + sx = s_curve(rx0); + sy = s_curve(ry0); + + u = rx0 * g2[b00, 0] + ry0 * g2[b00, 1]; + v = rx1 * g2[b10, 0] + ry0 * g2[b10, 1]; + a = Utils.Lerp(u, v, sx); + + u = rx0 * g2[b01, 0] + ry1 * g2[b01, 1]; + v = rx1 * g2[b11, 0] + ry1 * g2[b11, 1]; + b = Utils.Lerp(u, v, sx); + + return Utils.Lerp(a, b, sy); + } + + public static float noise3(float x, float y, float z) + { + int bx0, bx1, by0, by1, bz0, bz1, b00, b10, b01, b11; + float rx0, rx1, ry0, ry1, rz0, rz1, sy, sz, a, b, c, d, t, u, v; + int i, j; + + t = x + N; + bx0 = ((int)t) & BM; + bx1 = (bx0 + 1) & BM; + rx0 = t - (int)t; + rx1 = rx0 - 1f; + + t = y + N; + by0 = ((int)t) & BM; + by1 = (by0 + 1) & BM; + ry0 = t - (int)t; + ry1 = ry0 - 1f; + + t = z + N; + bz0 = ((int)t) & BM; + bz1 = (bz0 + 1) & BM; + rz0 = t - (int)t; + rz1 = rz0 - 1f; + + i = p[bx0]; + j = p[bx1]; + + b00 = p[i + by0]; + b10 = p[j + by0]; + b01 = p[i + by1]; + b11 = p[j + by1]; + + t = s_curve(rx0); + sy = s_curve(ry0); + sz = s_curve(rz0); + + u = rx0 * g3[b00 + bz0, 0] + ry0 * g3[b00 + bz0, 1] + rz0 * g3[b00 + bz0, 2]; + v = rx1 * g3[b10 + bz0, 0] + ry0 * g3[b10 + bz0, 1] + rz0 * g3[b10 + bz0, 2]; + a = Utils.Lerp(u, v, t); + + u = rx0 * g3[b01 + bz0, 0] + ry1 * g3[b01 + bz0, 1] + rz0 * g3[b01 + bz0, 2]; + v = rx1 * g3[b11 + bz0, 0] + ry1 * g3[b11 + bz0, 1] + rz0 * g3[b11 + bz0, 2]; + b = Utils.Lerp(u, v, t); + + c = Utils.Lerp(a, b, sy); + + u = rx0 * g3[b00 + bz1, 0] + ry0 * g3[b00 + bz1, 1] + rz1 * g3[b00 + bz1, 2]; + v = rx1 * g3[b10 + bz1, 0] + ry0 * g3[b10 + bz1, 1] + rz1 * g3[b10 + bz1, 2]; + a = Utils.Lerp(u, v, t); + + u = rx0 * g3[b01 + bz1, 0] + ry1 * g3[b01 + bz1, 1] + rz1 * g3[b01 + bz1, 2]; + v = rx1 * g3[b11 + bz1, 0] + ry1 * g3[b11 + bz1, 1] + rz1 * g3[b11 + bz1, 2]; + b = Utils.Lerp(u, v, t); + + d = Utils.Lerp(a, b, sy); + return Utils.Lerp(c, d, sz); + } + + public static float turbulence1(float x, float freq) + { + float t; + float v; + + for (t = 0f; freq >= 1f; freq *= 0.5f) + { + v = freq * x; + t += noise1(v) / freq; + } + return t; + } + + public static float turbulence2(float x, float y, float freq) + { + float t; + Vector2 vec; + + for (t = 0f; freq >= 1f; freq *= 0.5f) + { + vec.X = freq * x; + vec.Y = freq * y; + t += noise2(vec.X, vec.Y) / freq; + } + return t; + } + + public static float turbulence3(float x, float y, float z, float freq) + { + float t; + Vector3 vec; + + for (t = 0f; freq >= 1f; freq *= 0.5f) + { + vec.X = freq * x; + vec.Y = freq * y; + vec.Z = freq * z; + t += noise3(vec.X, vec.Y, vec.Z) / freq; + } + return t; + } + + private static void normalize2(float[,] v, int i) + { + float s; + + s = (float)Math.Sqrt(v[i, 0] * v[i, 0] + v[i, 1] * v[i, 1]); + s = 1.0f / s; + v[i, 0] = v[i, 0] * s; + v[i, 1] = v[i, 1] * s; + } + + private static void normalize3(float[,] v, int i) + { + float s; + + s = (float)Math.Sqrt(v[i, 0] * v[i, 0] + v[i, 1] * v[i, 1] + v[i, 2] * v[i, 2]); + s = 1.0f / s; + + v[i, 0] = v[i, 0] * s; + v[i, 1] = v[i, 1] * s; + v[i, 2] = v[i, 2] * s; + } + + private static float s_curve(float t) + { + return t * t * (3f - 2f * t); + } + } +} diff --git a/OpenSim/Region/CoreModules/World/Warp3DMap/TerrainSplat.cs b/OpenSim/Region/CoreModules/World/Warp3DMap/TerrainSplat.cs new file mode 100644 index 0000000000..7bf675daff --- /dev/null +++ b/OpenSim/Region/CoreModules/World/Warp3DMap/TerrainSplat.cs @@ -0,0 +1,343 @@ +/* + * Copyright (c) Contributors, http://opensimulator.org/ + * See CONTRIBUTORS.TXT for a full list of copyright holders. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * * Neither the name of the OpenSimulator Project nor the + * names of its contributors may be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE DEVELOPERS ``AS IS'' AND ANY + * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED + * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + * DISCLAIMED. IN NO EVENT SHALL THE CONTRIBUTORS BE LIABLE FOR ANY + * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES + * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND + * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS + * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +using System; +using System.Diagnostics; +using System.Drawing; +using System.Drawing.Imaging; +using log4net; +using OpenMetaverse; +using OpenSim.Framework; +using OpenSim.Services.Interfaces; + +namespace OpenSim.Region.CoreModules.World.Warp3DMap +{ + public static class TerrainSplat + { + #region Constants + + private static readonly UUID DIRT_DETAIL = new UUID("0bc58228-74a0-7e83-89bc-5c23464bcec5"); + private static readonly UUID GRASS_DETAIL = new UUID("63338ede-0037-c4fd-855b-015d77112fc8"); + private static readonly UUID MOUNTAIN_DETAIL = new UUID("303cd381-8560-7579-23f1-f0a880799740"); + private static readonly UUID ROCK_DETAIL = new UUID("53a2f406-4895-1d13-d541-d2e3b86bc19c"); + + private static readonly UUID[] DEFAULT_TERRAIN_DETAIL = new UUID[] + { + DIRT_DETAIL, + GRASS_DETAIL, + MOUNTAIN_DETAIL, + ROCK_DETAIL + }; + + private static readonly Color[] DEFAULT_TERRAIN_COLOR = new Color[] + { + Color.FromArgb(255, 164, 136, 117), + Color.FromArgb(255, 65, 87, 47), + Color.FromArgb(255, 157, 145, 131), + Color.FromArgb(255, 125, 128, 130) + }; + + private static readonly UUID TERRAIN_CACHE_MAGIC = new UUID("2c0c7ef2-56be-4eb8-aacb-76712c535b4b"); + + #endregion Constants + + private static readonly ILog m_log = log4net.LogManager.GetLogger(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType.Name); + + /// + /// Builds a composited terrain texture given the region texture + /// and heightmap settings + /// + /// Terrain heightmap + /// Region information including terrain texture parameters + /// A composited 256x256 RGB texture ready for rendering + /// Based on the algorithm described at http://opensimulator.org/wiki/Terrain_Splatting + /// + public static Bitmap Splat(float[] heightmap, UUID[] textureIDs, float[] startHeights, float[] heightRanges, Vector3d regionPosition, IAssetService assetService, bool textureTerrain) + { + Debug.Assert(heightmap.Length == 256 * 256); + Debug.Assert(textureIDs.Length == 4); + Debug.Assert(startHeights.Length == 4); + Debug.Assert(heightRanges.Length == 4); + + Bitmap[] detailTexture = new Bitmap[4]; + + if (textureTerrain) + { + // Swap empty terrain textureIDs with default IDs + for (int i = 0; i < textureIDs.Length; i++) + { + if (textureIDs[i] == UUID.Zero) + textureIDs[i] = DEFAULT_TERRAIN_DETAIL[i]; + } + + #region Texture Fetching + + if (assetService != null) + { + for (int i = 0; i < 4; i++) + { + AssetBase asset; + UUID cacheID = UUID.Combine(TERRAIN_CACHE_MAGIC, textureIDs[i]); + + // Try to fetch a cached copy of the decoded/resized version of this texture + asset = assetService.GetCached(cacheID.ToString()); + if (asset != null) + { + try + { + using (System.IO.MemoryStream stream = new System.IO.MemoryStream(asset.Data)) + detailTexture[i] = (Bitmap)Image.FromStream(stream); + } + catch (Exception ex) + { + m_log.Warn("Failed to decode cached terrain texture " + cacheID + + " (textureID: " + textureIDs[i] + "): " + ex.Message); + } + } + + if (detailTexture[i] == null) + { + // Try to fetch the original JPEG2000 texture, resize if needed, and cache as PNG + asset = assetService.Get(textureIDs[i].ToString()); + if (asset != null) + { + try { detailTexture[i] = (Bitmap)CSJ2K.J2kImage.FromBytes(asset.Data); } + catch (Exception ex) + { + m_log.Warn("Failed to decode terrain texture " + asset.ID + ": " + ex.Message); + } + } + + if (detailTexture[i] != null) + { + Bitmap bitmap = detailTexture[i]; + + // Make sure this texture is the correct size, otherwise resize + if (bitmap.Width != 256 || bitmap.Height != 256) + bitmap = ImageUtils.ResizeImage(bitmap, 256, 256); + + // Save the decoded and resized texture to the cache + byte[] data; + using (System.IO.MemoryStream stream = new System.IO.MemoryStream()) + { + bitmap.Save(stream, ImageFormat.Png); + data = stream.ToArray(); + } + + // Cache a PNG copy of this terrain texture + AssetBase newAsset = new AssetBase + { + Data = data, + Description = "PNG", + Flags = AssetFlags.Collectable, + FullID = cacheID, + ID = cacheID.ToString(), + Local = true, + Name = String.Empty, + Temporary = true, + Type = (sbyte)AssetType.Unknown + }; + newAsset.Metadata.ContentType = "image/png"; + assetService.Store(newAsset); + } + } + } + } + + #endregion Texture Fetching + } + + // Fill in any missing textures with a solid color + for (int i = 0; i < 4; i++) + { + if (detailTexture[i] == null) + { + // Create a solid color texture for this layer + detailTexture[i] = new Bitmap(256, 256, PixelFormat.Format24bppRgb); + using (Graphics gfx = Graphics.FromImage(detailTexture[i])) + { + using (SolidBrush brush = new SolidBrush(DEFAULT_TERRAIN_COLOR[i])) + gfx.FillRectangle(brush, 0, 0, 256, 256); + } + } + } + + #region Layer Map + + float[] layermap = new float[256 * 256]; + + for (int y = 0; y < 256; y++) + { + for (int x = 0; x < 256; x++) + { + float height = heightmap[y * 256 + x]; + + float pctX = (float)x / 255f; + float pctY = (float)y / 255f; + + // Use bilinear interpolation between the four corners of start height and + // height range to select the current values at this position + float startHeight = ImageUtils.Bilinear( + startHeights[0], + startHeights[2], + startHeights[1], + startHeights[3], + pctX, pctY); + startHeight = Utils.Clamp(startHeight, 0f, 255f); + + float heightRange = ImageUtils.Bilinear( + heightRanges[0], + heightRanges[2], + heightRanges[1], + heightRanges[3], + pctX, pctY); + heightRange = Utils.Clamp(heightRange, 0f, 255f); + + // Generate two frequencies of perlin noise based on our global position + // The magic values were taken from http://opensimulator.org/wiki/Terrain_Splatting + Vector3 vec = new Vector3 + ( + ((float)regionPosition.X + x) * 0.20319f, + ((float)regionPosition.Y + y) * 0.20319f, + height * 0.25f + ); + + float lowFreq = Perlin.noise2(vec.X * 0.222222f, vec.Y * 0.222222f) * 6.5f; + float highFreq = Perlin.turbulence2(vec.X, vec.Y, 2f) * 2.25f; + float noise = (lowFreq + highFreq) * 2f; + + // Combine the current height, generated noise, start height, and height range parameters, then scale all of it + float layer = ((height + noise - startHeight) / heightRange) * 4f; + if (Single.IsNaN(layer)) layer = 0f; + layermap[y * 256 + x] = Utils.Clamp(layer, 0f, 3f); + } + } + + #endregion Layer Map + + #region Texture Compositing + + Bitmap output = new Bitmap(256, 256, PixelFormat.Format24bppRgb); + BitmapData outputData = output.LockBits(new Rectangle(0, 0, 256, 256), ImageLockMode.WriteOnly, PixelFormat.Format24bppRgb); + + unsafe + { + // Get handles to all of the texture data arrays + BitmapData[] datas = new BitmapData[] + { + detailTexture[0].LockBits(new Rectangle(0, 0, 256, 256), ImageLockMode.ReadOnly, detailTexture[0].PixelFormat), + detailTexture[1].LockBits(new Rectangle(0, 0, 256, 256), ImageLockMode.ReadOnly, detailTexture[1].PixelFormat), + detailTexture[2].LockBits(new Rectangle(0, 0, 256, 256), ImageLockMode.ReadOnly, detailTexture[2].PixelFormat), + detailTexture[3].LockBits(new Rectangle(0, 0, 256, 256), ImageLockMode.ReadOnly, detailTexture[3].PixelFormat) + }; + + int[] comps = new int[] + { + (datas[0].PixelFormat == PixelFormat.Format32bppArgb) ? 4 : 3, + (datas[1].PixelFormat == PixelFormat.Format32bppArgb) ? 4 : 3, + (datas[2].PixelFormat == PixelFormat.Format32bppArgb) ? 4 : 3, + (datas[3].PixelFormat == PixelFormat.Format32bppArgb) ? 4 : 3 + }; + + for (int y = 0; y < 256; y++) + { + for (int x = 0; x < 256; x++) + { + float layer = layermap[y * 256 + x]; + + // Select two textures + int l0 = (int)Math.Floor(layer); + int l1 = Math.Min(l0 + 1, 3); + + byte* ptrA = (byte*)datas[l0].Scan0 + y * datas[l0].Stride + x * comps[l0]; + byte* ptrB = (byte*)datas[l1].Scan0 + y * datas[l1].Stride + x * comps[l1]; + byte* ptrO = (byte*)outputData.Scan0 + y * outputData.Stride + x * 3; + + float aB = *(ptrA + 0); + float aG = *(ptrA + 1); + float aR = *(ptrA + 2); + + float bB = *(ptrB + 0); + float bG = *(ptrB + 1); + float bR = *(ptrB + 2); + + float layerDiff = layer - l0; + + // Interpolate between the two selected textures + *(ptrO + 0) = (byte)Math.Floor(aB + layerDiff * (bB - aB)); + *(ptrO + 1) = (byte)Math.Floor(aG + layerDiff * (bG - aG)); + *(ptrO + 2) = (byte)Math.Floor(aR + layerDiff * (bR - aR)); + } + } + + for (int i = 0; i < 4; i++) + detailTexture[i].UnlockBits(datas[i]); + } + + output.UnlockBits(outputData); + + // We generated the texture upside down, so flip it + output.RotateFlip(RotateFlipType.RotateNoneFlipY); + + #endregion Texture Compositing + + return output; + } + + public static Bitmap SplatSimple(float[] heightmap) + { + const float BASE_HSV_H = 93f / 360f; + const float BASE_HSV_S = 44f / 100f; + const float BASE_HSV_V = 34f / 100f; + + Bitmap img = new Bitmap(256, 256); + BitmapData bitmapData = img.LockBits(new Rectangle(0, 0, 256, 256), ImageLockMode.WriteOnly, PixelFormat.Format24bppRgb); + + unsafe + { + for (int y = 255; y >= 0; y--) + { + for (int x = 0; x < 256; x++) + { + float normHeight = heightmap[y * 256 + x] / 255f; + normHeight = Utils.Clamp(normHeight, BASE_HSV_V, 1.0f); + + Color4 color = Color4.FromHSV(BASE_HSV_H, BASE_HSV_S, normHeight); + + byte* ptr = (byte*)bitmapData.Scan0 + y * bitmapData.Stride + x * 3; + *(ptr + 0) = (byte)(color.B * 255f); + *(ptr + 1) = (byte)(color.G * 255f); + *(ptr + 2) = (byte)(color.R * 255f); + } + } + } + + img.UnlockBits(bitmapData); + return img; + } + } +} diff --git a/OpenSim/Region/CoreModules/World/Warp3DMap/Viewport.cs b/OpenSim/Region/CoreModules/World/Warp3DMap/Viewport.cs new file mode 100644 index 0000000000..472f86e5fa --- /dev/null +++ b/OpenSim/Region/CoreModules/World/Warp3DMap/Viewport.cs @@ -0,0 +1,165 @@ +/* + * Copyright (c) Contributors, http://opensimulator.org/ + * See CONTRIBUTORS.TXT for a full list of copyright holders. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * * Neither the name of the OpenSimulator Project nor the + * names of its contributors may be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE DEVELOPERS ``AS IS'' AND ANY + * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED + * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + * DISCLAIMED. IN NO EVENT SHALL THE CONTRIBUTORS BE LIABLE FOR ANY + * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES + * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND + * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS + * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +using System; +using System.Drawing; +using OpenMetaverse; + +namespace OpenSim.Region.CoreModules.World.Warp3DMap +{ + public class Viewport + { + private const float DEG_TO_RAD = (float)Math.PI / 180f; + private static readonly Vector3 UP_DIRECTION = Vector3.UnitZ; + + public Vector3 Position; + public Vector3 LookDirection; + public float FieldOfView; + public float NearPlaneDistance; + public float FarPlaneDistance; + public int Width; + public int Height; + public bool Orthographic; + public float OrthoWindowWidth; + public float OrthoWindowHeight; + + public Viewport(Vector3 position, Vector3 lookDirection, float fieldOfView, float farPlaneDist, float nearPlaneDist, int width, int height) + { + // Perspective projection mode + Position = position; + LookDirection = lookDirection; + FieldOfView = fieldOfView; + FarPlaneDistance = farPlaneDist; + NearPlaneDistance = nearPlaneDist; + Width = width; + Height = height; + } + + public Viewport(Vector3 position, Vector3 lookDirection, float farPlaneDist, float nearPlaneDist, int width, int height, float orthoWindowWidth, float orthoWindowHeight) + { + // Orthographic projection mode + Position = position; + LookDirection = lookDirection; + FarPlaneDistance = farPlaneDist; + NearPlaneDistance = nearPlaneDist; + Width = width; + Height = height; + OrthoWindowWidth = orthoWindowWidth; + OrthoWindowHeight = orthoWindowHeight; + Orthographic = true; + } + + public Point VectorToScreen(Vector3 v) + { + Matrix4 m = GetWorldToViewportMatrix(); + Vector3 screenPoint = v * m; + return new Point((int)screenPoint.X, (int)screenPoint.Y); + } + + public Matrix4 GetWorldToViewportMatrix() + { + Matrix4 result = GetViewMatrix(); + result *= GetPerspectiveProjectionMatrix(); + result *= GetViewportMatrix(); + + return result; + } + + public Matrix4 GetViewMatrix() + { + Vector3 zAxis = -LookDirection; + zAxis.Normalize(); + + Vector3 xAxis = Vector3.Cross(UP_DIRECTION, zAxis); + xAxis.Normalize(); + + Vector3 yAxis = Vector3.Cross(zAxis, xAxis); + + Vector3 position = Position; + float offsetX = -Vector3.Dot(xAxis, position); + float offsetY = -Vector3.Dot(yAxis, position); + float offsetZ = -Vector3.Dot(zAxis, position); + + return new Matrix4( + xAxis.X, yAxis.X, zAxis.X, 0f, + xAxis.Y, yAxis.Y, zAxis.Y, 0f, + xAxis.Z, yAxis.Z, zAxis.Z, 0f, + offsetX, offsetY, offsetZ, 1f); + } + + public Matrix4 GetPerspectiveProjectionMatrix() + { + float aspectRatio = (float)Width / (float)Height; + + float hFoV = FieldOfView * DEG_TO_RAD; + float zn = NearPlaneDistance; + float zf = FarPlaneDistance; + + float xScale = 1f / (float)Math.Tan(hFoV / 2f); + float yScale = aspectRatio * xScale; + float m33 = (zf == double.PositiveInfinity) ? -1 : (zf / (zn - zf)); + float m43 = zn * m33; + + return new Matrix4( + xScale, 0f, 0f, 0f, + 0f, yScale, 0f, 0f, + 0f, 0f, m33, -1f, + 0f, 0f, m43, 0f); + } + + public Matrix4 GetOrthographicProjectionMatrix(float aspectRatio) + { + float w = Width; + float h = Height; + float zn = NearPlaneDistance; + float zf = FarPlaneDistance; + + float m33 = 1 / (zn - zf); + float m43 = zn * m33; + + return new Matrix4( + 2f / w, 0f, 0f, 0f, + 0f, 2f / h, 0f, 0f, + 0f, 0f, m33, 0f, + 0f, 0f, m43, 1f); + } + + public Matrix4 GetViewportMatrix() + { + float scaleX = (float)Width * 0.5f; + float scaleY = (float)Height * 0.5f; + float offsetX = 0f + scaleX; + float offsetY = 0f + scaleY; + + return new Matrix4( + scaleX, 0f, 0f, 0f, + 0f, -scaleY, 0f, 0f, + 0f, 0f, 1f, 0f, + offsetX, offsetY, 0f, 1f); + } + } +} diff --git a/OpenSim/Region/CoreModules/World/Wind/WindModule.cs b/OpenSim/Region/CoreModules/World/Wind/WindModule.cs index 9736b73adf..6bac5559e9 100644 --- a/OpenSim/Region/CoreModules/World/Wind/WindModule.cs +++ b/OpenSim/Region/CoreModules/World/Wind/WindModule.cs @@ -425,7 +425,7 @@ namespace OpenSim.Region.CoreModules { if (m_ready) { - if(m_scene.GetRootAgentCount() > 0) + if (m_scene.GetRootAgentCount() > 0) { // Ask wind plugin to generate a LL wind array to be cached locally // Try not to update this too often, as it may involve array copies diff --git a/OpenSim/Region/CoreModules/World/WorldMap/MapSearchModule.cs b/OpenSim/Region/CoreModules/World/WorldMap/MapSearchModule.cs index a1a4f9e125..9f8851708c 100644 --- a/OpenSim/Region/CoreModules/World/WorldMap/MapSearchModule.cs +++ b/OpenSim/Region/CoreModules/World/WorldMap/MapSearchModule.cs @@ -138,14 +138,14 @@ namespace OpenSim.Region.CoreModules.World.WorldMap remoteClient.SendMapBlock(blocks, 2); } - private Scene GetClientScene(IClientAPI client) - { - foreach (Scene s in m_scenes) - { - if (client.Scene.RegionInfo.RegionHandle == s.RegionInfo.RegionHandle) - return s; - } - return m_scene; - } +// private Scene GetClientScene(IClientAPI client) +// { +// foreach (Scene s in m_scenes) +// { +// if (client.Scene.RegionInfo.RegionHandle == s.RegionInfo.RegionHandle) +// return s; +// } +// return m_scene; +// } } } diff --git a/OpenSim/Region/CoreModules/World/WorldMap/WorldMapModule.cs b/OpenSim/Region/CoreModules/World/WorldMap/WorldMapModule.cs index 9d9967a22b..3e478b06c9 100644 --- a/OpenSim/Region/CoreModules/World/WorldMap/WorldMapModule.cs +++ b/OpenSim/Region/CoreModules/World/WorldMap/WorldMapModule.cs @@ -307,7 +307,7 @@ namespace OpenSim.Region.CoreModules.World.WorldMap lock (m_rootAgents) { m_rootAgents.Remove(AgentId); - if(m_rootAgents.Count == 0) + if (m_rootAgents.Count == 0) StopThread(); } } @@ -324,7 +324,7 @@ namespace OpenSim.Region.CoreModules.World.WorldMap if (threadrunning) return; threadrunning = true; - m_log.Debug("[WORLD MAP]: Starting remote MapItem request thread"); +// m_log.Debug("[WORLD MAP]: Starting remote MapItem request thread"); Watchdog.StartThread(process, "MapItemRequestThread", ThreadPriority.BelowNormal, true); } @@ -1000,11 +1000,24 @@ namespace OpenSim.Region.CoreModules.World.WorldMap return responsemap; } - public void RegenerateMaptile(byte[] data) + public void GenerateMaptile() { + // Cannot create a map for a nonexistant heightmap + if (m_scene.Heightmap == null) + return; + + //create a texture asset of the terrain + IMapImageGenerator terrain = m_scene.RequestModuleInterface(); + if (terrain == null) + return; + + byte[] data = terrain.WriteJpeg2000Image(); + if (data == null) + return; + UUID lastMapRegionUUID = m_scene.RegionInfo.RegionSettings.TerrainImageID; - m_log.Debug("[MAPTILE]: STORING MAPTILE IMAGE"); + m_log.Debug("[WORLDMAP]: STORING MAPTILE IMAGE"); m_scene.RegionInfo.RegionSettings.TerrainImageID = UUID.Random(); diff --git a/OpenSim/Region/DataSnapshot/LandSnapshot.cs b/OpenSim/Region/DataSnapshot/LandSnapshot.cs index 64d29f2655..b8c90cd5a1 100644 --- a/OpenSim/Region/DataSnapshot/LandSnapshot.cs +++ b/OpenSim/Region/DataSnapshot/LandSnapshot.cs @@ -123,6 +123,8 @@ namespace OpenSim.Region.DataSnapshot.Providers ILandChannel landChannel = m_scene.LandChannel; List parcels = landChannel.AllParcels(); + IDwellModule dwellModule = m_scene.RequestModuleInterface(); + XmlNode parent = nodeFactory.CreateNode(XmlNodeType.Element, "parceldata", ""); if (parcels != null) { @@ -208,7 +210,10 @@ namespace OpenSim.Region.DataSnapshot.Providers xmlparcel.AppendChild(infouuid); XmlNode dwell = nodeFactory.CreateNode(XmlNodeType.Element, "dwell", ""); - dwell.InnerText = parcel.Dwell.ToString(); + if (dwellModule != null) + dwell.InnerText = dwellModule.GetDwell(parcel.GlobalID).ToString(); + else + dwell.InnerText = "0"; xmlparcel.AppendChild(dwell); //TODO: figure how to figure out teleport system landData.landingType diff --git a/OpenSim/Region/DataSnapshot/ObjectSnapshot.cs b/OpenSim/Region/DataSnapshot/ObjectSnapshot.cs index 00f6918600..5e75cae838 100644 --- a/OpenSim/Region/DataSnapshot/ObjectSnapshot.cs +++ b/OpenSim/Region/DataSnapshot/ObjectSnapshot.cs @@ -101,7 +101,8 @@ namespace OpenSim.Region.DataSnapshot.Providers XmlNode parent = nodeFactory.CreateNode(XmlNodeType.Element, "objectdata", ""); XmlNode node; - foreach (EntityBase entity in m_scene.Entities) + EntityBase[] entities = m_scene.Entities.GetEntities(); + foreach (EntityBase entity in entities) { // only objects, not avatars if (entity is SceneObjectGroup) @@ -135,16 +136,25 @@ namespace OpenSim.Region.DataSnapshot.Providers xmlobject.AppendChild(node); node = nodeFactory.CreateNode(XmlNodeType.Element, "flags", ""); - node.InnerText = String.Format("{0:x}", m_rootPart.ObjectFlags); + node.InnerText = String.Format("{0:x}", (uint)m_rootPart.Flags); xmlobject.AppendChild(node); node = nodeFactory.CreateNode(XmlNodeType.Element, "regionuuid", ""); node.InnerText = m_scene.RegionInfo.RegionSettings.RegionUUID.ToString(); xmlobject.AppendChild(node); - node = nodeFactory.CreateNode(XmlNodeType.Element, "parceluuid", ""); - node.InnerText = land.LandData.GlobalID.ToString(); - xmlobject.AppendChild(node); + if (land != null && land.LandData != null) + { + node = nodeFactory.CreateNode(XmlNodeType.Element, "parceluuid", ""); + node.InnerText = land.LandData.GlobalID.ToString(); + xmlobject.AppendChild(node); + } + else + { + // Something is wrong with this object. Let's not list it. + m_log.WarnFormat("[DATASNAPSHOT]: Bad data for object {0} ({1}) in region {2}", obj.Name, obj.UUID, m_scene.RegionInfo.RegionName); + continue; + } node = nodeFactory.CreateNode(XmlNodeType.Element, "location", ""); Vector3 loc = obj.AbsolutePosition; diff --git a/OpenSim/Region/DataSnapshot/SnapshotStore.cs b/OpenSim/Region/DataSnapshot/SnapshotStore.cs index 70cb2053c9..aa3d2ff34c 100644 --- a/OpenSim/Region/DataSnapshot/SnapshotStore.cs +++ b/OpenSim/Region/DataSnapshot/SnapshotStore.cs @@ -30,6 +30,7 @@ using System.Collections.Generic; using System.IO; using System.Reflection; using System.Text; +using System.Text.RegularExpressions; using System.Xml; using log4net; using OpenSim.Region.DataSnapshot.Interfaces; @@ -98,13 +99,21 @@ namespace OpenSim.Region.DataSnapshot { String path = DataFileNameFragment(provider.GetParentScene, provider.Name); - using (XmlTextWriter snapXWriter = new XmlTextWriter(path, Encoding.Default)) + try { - snapXWriter.Formatting = Formatting.Indented; - snapXWriter.WriteStartDocument(); - data.WriteTo(snapXWriter); - snapXWriter.WriteEndDocument(); + using (XmlTextWriter snapXWriter = new XmlTextWriter(path, Encoding.Default)) + { + snapXWriter.Formatting = Formatting.Indented; + snapXWriter.WriteStartDocument(); + data.WriteTo(snapXWriter); + snapXWriter.WriteEndDocument(); + } } + catch (Exception e) + { + m_log.WarnFormat("[DATASNAPSHOT]: Exception on writing to file {0}: {1}", path, e.Message); + } + } //mark provider as not stale, parent scene as stale @@ -185,12 +194,19 @@ namespace OpenSim.Region.DataSnapshot //save snapshot String path = DataFileNameScene(scene); - using (XmlTextWriter snapXWriter = new XmlTextWriter(path, Encoding.Default)) + try { - snapXWriter.Formatting = Formatting.Indented; - snapXWriter.WriteStartDocument(); - regionElement.WriteTo(snapXWriter); - snapXWriter.WriteEndDocument(); + using (XmlTextWriter snapXWriter = new XmlTextWriter(path, Encoding.Default)) + { + snapXWriter.Formatting = Formatting.Indented; + snapXWriter.WriteStartDocument(); + regionElement.WriteTo(snapXWriter); + snapXWriter.WriteEndDocument(); + } + } + catch (Exception e) + { + m_log.WarnFormat("[DATASNAPSHOT]: Exception on writing to file {0}: {1}", path, e.Message); } m_scenes[scene] = false; @@ -206,15 +222,23 @@ namespace OpenSim.Region.DataSnapshot #region Helpers private string DataFileNameFragment(Scene scene, String fragmentName) { - return Path.Combine(m_directory, Path.ChangeExtension(scene.RegionInfo.RegionName + "_" + fragmentName, "xml")); + return Path.Combine(m_directory, Path.ChangeExtension(Sanitize(scene.RegionInfo.RegionName + "_" + fragmentName), "xml")); } private string DataFileNameScene(Scene scene) { - return Path.Combine(m_directory, Path.ChangeExtension(scene.RegionInfo.RegionName, "xml")); + return Path.Combine(m_directory, Path.ChangeExtension(Sanitize(scene.RegionInfo.RegionName), "xml")); //return (m_snapsDir + Path.DirectorySeparatorChar + scene.RegionInfo.RegionName + ".xml"); } + private static string Sanitize(string name) + { + string invalidChars = Regex.Escape(new string(Path.GetInvalidFileNameChars())); + string invalidReStr = string.Format(@"[{0}]", invalidChars); + string newname = Regex.Replace(name, invalidReStr, "_"); + return newname.Replace('.', '_'); + } + private XmlNode MakeRegionNode(Scene scene, XmlDocument basedoc) { XmlNode docElement = basedoc.CreateNode(XmlNodeType.Element, "region", ""); diff --git a/OpenSim/Region/Examples/SimpleModule/MyNpcCharacter.cs b/OpenSim/Region/Examples/SimpleModule/MyNpcCharacter.cs index 375e25f90d..3241b57f96 100644 --- a/OpenSim/Region/Examples/SimpleModule/MyNpcCharacter.cs +++ b/OpenSim/Region/Examples/SimpleModule/MyNpcCharacter.cs @@ -84,7 +84,7 @@ namespace OpenSim.Region.Examples.SimpleModule public event DeRezObject OnDeRezObject; public event Action OnRegionHandShakeReply; - public event GenericCall2 OnRequestWearables; + public event GenericCall1 OnRequestWearables; public event GenericCall1 OnCompleteMovementToRegion; public event UpdateAgent OnPreAgentUpdate; public event UpdateAgent OnAgentUpdate; @@ -528,7 +528,11 @@ namespace OpenSim.Region.Examples.SimpleModule { } - public virtual void SendTeleportLocationStart() + public virtual void SendTeleportStart(uint flags) + { + } + + public virtual void SendTeleportProgress(uint flags, string message) { } diff --git a/OpenSim/Region/Framework/Interfaces/IAttachmentsModule.cs b/OpenSim/Region/Framework/Interfaces/IAttachmentsModule.cs index 2af25481e4..b3576c5c73 100644 --- a/OpenSim/Region/Framework/Interfaces/IAttachmentsModule.cs +++ b/OpenSim/Region/Framework/Interfaces/IAttachmentsModule.cs @@ -55,7 +55,7 @@ namespace OpenSim.Region.Framework.Interfaces /// /// /// - /// true if the object was successfully attached, false otherwise + /// true if the object was successfully attached, false otherwise bool AttachObject( IClientAPI remoteClient, SceneObjectGroup grp, uint AttachmentPt, bool silent); @@ -109,17 +109,6 @@ namespace OpenSim.Region.Framework.Interfaces /// /// void DetachSingleAttachmentToGround(UUID itemID, IClientAPI remoteClient); - - /// - /// Update the user inventory to the attachment of an item - /// - /// - /// - /// - /// - /// - UUID SetAttachmentInventoryStatus( - SceneObjectGroup att, IClientAPI remoteClient, UUID itemID, uint AttachmentPt); /// /// Update the user inventory to show a detach. @@ -131,5 +120,22 @@ namespace OpenSim.Region.Framework.Interfaces /// A /// void ShowDetachInUserInventory(UUID itemID, IClientAPI remoteClient); + + /// + /// Update the user inventory with a changed attachment + /// + /// + /// A + /// + /// + /// A + /// + /// + /// A + /// + /// + /// A + /// + void UpdateKnownItem(IClientAPI remoteClient, SceneObjectGroup grp, UUID itemID, UUID agentID); } -} \ No newline at end of file +} diff --git a/OpenSim/Region/Framework/Interfaces/IAvatarFactory.cs b/OpenSim/Region/Framework/Interfaces/IAvatarFactory.cs index c967f30d9d..5d414a4463 100644 --- a/OpenSim/Region/Framework/Interfaces/IAvatarFactory.cs +++ b/OpenSim/Region/Framework/Interfaces/IAvatarFactory.cs @@ -32,7 +32,9 @@ namespace OpenSim.Region.Framework.Interfaces { public interface IAvatarFactory { - bool TryGetAvatarAppearance(UUID avatarId, out AvatarAppearance appearance); - void UpdateDatabase(UUID userID, AvatarAppearance avatAppearance); + bool ValidateBakedTextureCache(IClientAPI client); + void QueueAppearanceSend(UUID agentid); + void QueueAppearanceSave(UUID agentid); + void SetAppearance(IClientAPI client, Primitive.TextureEntry textureEntry, byte[] visualParams); } } diff --git a/OpenSim/Framework/IClientFileTransfer.cs b/OpenSim/Region/Framework/Interfaces/IBuySellModule.cs similarity index 73% rename from OpenSim/Framework/IClientFileTransfer.cs rename to OpenSim/Region/Framework/Interfaces/IBuySellModule.cs index f947b17de3..d1ce4c0167 100644 --- a/OpenSim/Framework/IClientFileTransfer.cs +++ b/OpenSim/Region/Framework/Interfaces/IBuySellModule.cs @@ -26,15 +26,22 @@ */ using OpenMetaverse; +using OpenSim.Framework; -namespace OpenSim.Framework +namespace OpenSim.Region.Framework.Interfaces { - public delegate void UploadComplete(string filename, UUID fileID, ulong transferID, byte[] fileData, IClientAPI remoteClient); - public delegate void UploadAborted(string filename, UUID fileID, ulong transferID, IClientAPI remoteClient); - - public interface IClientFileTransfer - { - bool RequestUpload(string clientFileName, UploadComplete uploadCompleteCallback, UploadAborted abortCallback); - bool RequestUpload(UUID fileID, UploadComplete uploadCompleteCallback, UploadAborted abortCallback); + public interface IBuySellModule + { + /// + /// Try to buy an object + /// + /// + /// + /// + /// + /// + /// True on a successful purchase, false on failure + /// + bool BuyObject(IClientAPI remoteClient, UUID categoryID, uint localID, byte saleType, int salePrice); } } diff --git a/OpenSim/Region/Framework/Interfaces/ICloudModule.cs b/OpenSim/Region/Framework/Interfaces/ICloudModule.cs index f8a5bad347..7296ac3ef5 100644 --- a/OpenSim/Region/Framework/Interfaces/ICloudModule.cs +++ b/OpenSim/Region/Framework/Interfaces/ICloudModule.cs @@ -25,7 +25,6 @@ * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ - namespace OpenSim.Region.Framework.Interfaces { public interface ICloudModule : IRegionModule @@ -35,4 +34,4 @@ namespace OpenSim.Region.Framework.Interfaces /// float CloudCover(int x, int y, int z); } -} +} \ No newline at end of file diff --git a/OpenSim/Framework/FriendRegionInfo.cs b/OpenSim/Region/Framework/Interfaces/IDwellModule.cs similarity index 91% rename from OpenSim/Framework/FriendRegionInfo.cs rename to OpenSim/Region/Framework/Interfaces/IDwellModule.cs index 68b5f3da1c..db504393a2 100644 --- a/OpenSim/Framework/FriendRegionInfo.cs +++ b/OpenSim/Region/Framework/Interfaces/IDwellModule.cs @@ -26,13 +26,12 @@ */ using OpenMetaverse; +using OpenSim.Framework; -namespace OpenSim.Framework +namespace OpenSim.Region.Framework.Interfaces { - public class FriendRegionInfo + public interface IDwellModule { - public bool isOnline; - public ulong regionHandle; - public UUID regionID; + int GetDwell(UUID parcelID); } } diff --git a/OpenSim/Region/Framework/Interfaces/IEntityInventory.cs b/OpenSim/Region/Framework/Interfaces/IEntityInventory.cs index 27cb80a855..470e916210 100644 --- a/OpenSim/Region/Framework/Interfaces/IEntityInventory.cs +++ b/OpenSim/Region/Framework/Interfaces/IEntityInventory.cs @@ -29,6 +29,7 @@ using System.Collections.Generic; using System.Collections; using OpenMetaverse; using OpenSim.Framework; +using OpenSim.Region.Framework.Scenes; namespace OpenSim.Region.Framework.Interfaces { @@ -56,6 +57,15 @@ namespace OpenSim.Region.Framework.Interfaces /// Link number for the part void ResetInventoryIDs(); + /// + /// Reset parent object UUID for all the items in the prim's inventory. + /// + /// + /// If this method is called and there are inventory items, then we regard the inventory as having changed. + /// + /// Link number for the part + void ResetObjectID(); + /// /// Change every item in this inventory to a new owner. /// @@ -157,6 +167,17 @@ namespace OpenSim.Region.Framework.Interfaces /// If no inventory item has that name then an empty list is returned. /// IList GetInventoryItems(string name); + + /// + /// Get the scene object referenced by an inventory item. + /// + /// + /// This is returned in a 'rez ready' state. That is, name, description, permissions and other details have + /// been adjusted to reflect the part and item from which it originates. + /// + /// + /// The scene object. Null if the scene object asset couldn't be found + SceneObjectGroup GetRezReadySceneObject(TaskInventoryItem item); /// /// Update an existing inventory item. @@ -166,6 +187,7 @@ namespace OpenSim.Region.Framework.Interfaces /// false if the item did not exist, true if the update occurred successfully bool UpdateInventoryItem(TaskInventoryItem item); bool UpdateInventoryItem(TaskInventoryItem item, bool fireScriptEvents); + bool UpdateInventoryItem(TaskInventoryItem item, bool fireScriptEvents, bool considerChanged); /// /// Remove an item from this entity's inventory @@ -192,7 +214,7 @@ namespace OpenSim.Region.Framework.Interfaces /// Backup the inventory to the given data store /// /// - void ProcessInventoryBackup(IRegionDataStore datastore); + void ProcessInventoryBackup(ISimulationDataService datastore); uint MaskEffectivePermissions(); diff --git a/OpenSim/Framework/ConfigBase.cs b/OpenSim/Region/Framework/Interfaces/IEstateDataService.cs similarity index 76% rename from OpenSim/Framework/ConfigBase.cs rename to OpenSim/Region/Framework/Interfaces/IEstateDataService.cs index 40ec32f2f2..95c9659bc1 100644 --- a/OpenSim/Framework/ConfigBase.cs +++ b/OpenSim/Region/Framework/Interfaces/IEstateDataService.cs @@ -1,4 +1,4 @@ -/* +/* * Copyright (c) Contributors, http://opensimulator.org/ * See CONTRIBUTORS.TXT for a full list of copyright holders. * @@ -27,12 +27,19 @@ using System; using System.Collections.Generic; -using System.Text; +using OpenSim.Framework; +using OpenMetaverse; -namespace OpenSim.Framework +namespace OpenSim.Region.Framework.Interfaces { - public abstract class ConfigBase + public interface IEstateDataService { - protected ConfigurationMember m_configMember; + EstateSettings LoadEstateSettings(UUID regionID, bool create); + EstateSettings LoadEstateSettings(int estateID); + void StoreEstateSettings(EstateSettings es); + List GetEstates(string search); + bool LinkRegion(UUID regionID, int estateID); + List GetRegions(int estateID); + bool DeleteEstate(int estateID); } } diff --git a/OpenSim/Region/Framework/Interfaces/IEventQueue.cs b/OpenSim/Region/Framework/Interfaces/IEventQueue.cs index e093f0aa40..81e4952afe 100644 --- a/OpenSim/Region/Framework/Interfaces/IEventQueue.cs +++ b/OpenSim/Region/Framework/Interfaces/IEventQueue.cs @@ -28,6 +28,7 @@ using System.Net; using OpenMetaverse; using OpenMetaverse.Packets; +using OpenMetaverse.Messages.Linden; using OpenMetaverse.StructuredData; namespace OpenSim.Region.Framework.Interfaces @@ -54,7 +55,7 @@ namespace OpenSim.Region.Framework.Interfaces uint ttl, UUID transactionID, bool fromGroup, byte[] binaryBucket); void ChatterBoxSessionAgentListUpdates(UUID sessionID, UUID fromAgent, UUID toAgent, bool canVoiceChat, bool isModerator, bool textMute); - void ParcelProperties(ParcelPropertiesPacket parcelPropertiesPacket, UUID avatarID); + void ParcelProperties(ParcelPropertiesMessage parcelPropertiesMessage, UUID avatarID); void GroupMembership(AgentGroupDataUpdatePacket groupUpdate, UUID avatarID); } } diff --git a/OpenSim/Region/Framework/Interfaces/IGroupsModule.cs b/OpenSim/Region/Framework/Interfaces/IGroupsModule.cs index 2c091e753f..4c501f669b 100644 --- a/OpenSim/Region/Framework/Interfaces/IGroupsModule.cs +++ b/OpenSim/Region/Framework/Interfaces/IGroupsModule.cs @@ -65,7 +65,7 @@ namespace OpenSim.Region.Framework.Interfaces /// Get a group /// /// ID of the group - /// The group's data. Null if there is no such group. + /// The group's data. Null if there is no such group. GroupRecord GetGroupRecord(UUID GroupID); void ActivateGroup(IClientAPI remoteClient, UUID groupID); @@ -74,14 +74,14 @@ namespace OpenSim.Region.Framework.Interfaces List GroupRoleDataRequest(IClientAPI remoteClient, UUID groupID); List GroupRoleMembersRequest(IClientAPI remoteClient, UUID groupID); GroupProfileData GroupProfileRequest(IClientAPI remoteClient, UUID groupID); - GroupMembershipData[] GetMembershipData(UUID UserID); + GroupMembershipData[] GetMembershipData(UUID UserID); GroupMembershipData GetMembershipData(UUID GroupID, UUID UserID); void UpdateGroupInfo(IClientAPI remoteClient, UUID groupID, string charter, bool showInList, UUID insigniaID, int membershipFee, bool openEnrollment, bool allowPublish, bool maturePublish); void SetGroupAcceptNotices(IClientAPI remoteClient, UUID groupID, bool acceptNotices, bool listInProfile); - void GroupTitleUpdate(IClientAPI remoteClient, UUID GroupID, UUID TitleRoleID); + void GroupTitleUpdate(IClientAPI remoteClient, UUID GroupID, UUID TitleRoleID); GroupNoticeData[] GroupNoticesListRequest(IClientAPI remoteClient, UUID GroupID); string GetGroupTitle(UUID avatarID); diff --git a/OpenSim/Region/Framework/Interfaces/IInventoryArchiverModule.cs b/OpenSim/Region/Framework/Interfaces/IInventoryArchiverModule.cs index 01066e6ab1..ddf7565945 100644 --- a/OpenSim/Region/Framework/Interfaces/IInventoryArchiverModule.cs +++ b/OpenSim/Region/Framework/Interfaces/IInventoryArchiverModule.cs @@ -43,14 +43,14 @@ namespace OpenSim.Region.Framework.Interfaces /// Contains the exception generated if the save did not succeed public delegate void InventoryArchiveSaved( Guid id, bool succeeded, UserAccount userInfo, string invPath, Stream saveStream, Exception reportedException); - + public interface IInventoryArchiverModule { /// /// Fired when an archive inventory save has been completed. /// event InventoryArchiveSaved OnInventoryArchiveSaved; - + /// /// Dearchive a user's inventory folder from the given stream /// @@ -60,7 +60,7 @@ namespace OpenSim.Region.Framework.Interfaces /// The stream from which the inventory archive will be loaded /// true if the first stage of the operation succeeded, false otherwise bool DearchiveInventory(string firstName, string lastName, string invPath, string pass, Stream loadStream); - + /// /// Dearchive a user's inventory folder from the given stream /// @@ -72,8 +72,8 @@ namespace OpenSim.Region.Framework.Interfaces /// the loaded IAR with existing folders where possible. /// true if the first stage of the operation succeeded, false otherwise bool DearchiveInventory( - string firstName, string lastName, string invPath, string pass, Stream loadStream, - Dictionary options); + string firstName, string lastName, string invPath, string pass, Stream loadStream, + Dictionary options); /// /// Archive a user's inventory folder to the given stream @@ -85,7 +85,7 @@ namespace OpenSim.Region.Framework.Interfaces /// The stream to which the inventory archive will be saved /// true if the first stage of the operation succeeded, false otherwise bool ArchiveInventory(Guid id, string firstName, string lastName, string invPath, string pass, Stream saveStream); - + /// /// Archive a user's inventory folder to the given stream /// @@ -97,7 +97,7 @@ namespace OpenSim.Region.Framework.Interfaces /// Archiving options. Currently, there are none. /// true if the first stage of the operation succeeded, false otherwise bool ArchiveInventory( - Guid id, string firstName, string lastName, string invPath, string pass, Stream saveStream, - Dictionary options); + Guid id, string firstName, string lastName, string invPath, string pass, Stream saveStream, + Dictionary options); } } diff --git a/OpenSim/Region/Framework/Interfaces/IInventoryTransferModule.cs b/OpenSim/Region/Framework/Interfaces/IInventoryTransferModule.cs index 2390ff428e..1e92fde00b 100644 --- a/OpenSim/Region/Framework/Interfaces/IInventoryTransferModule.cs +++ b/OpenSim/Region/Framework/Interfaces/IInventoryTransferModule.cs @@ -35,7 +35,6 @@ namespace OpenSim.Region.Framework.Interfaces /// public interface IInventoryTransferModule { - void SetRootAgentScene(UUID agentID, Scene scene); bool NeedSceneCacheClear(UUID agentID, Scene scene); } -} +} \ No newline at end of file diff --git a/OpenSim/Framework/ILoginServiceToRegionsConnector.cs b/OpenSim/Region/Framework/Interfaces/IMoapModule.cs similarity index 55% rename from OpenSim/Framework/ILoginServiceToRegionsConnector.cs rename to OpenSim/Region/Framework/Interfaces/IMoapModule.cs index 5a155c1127..1d3d240b04 100644 --- a/OpenSim/Framework/ILoginServiceToRegionsConnector.cs +++ b/OpenSim/Region/Framework/Interfaces/IMoapModule.cs @@ -1,4 +1,4 @@ -/* +/* * Copyright (c) Contributors, http://opensimulator.org/ * See CONTRIBUTORS.TXT for a full list of copyright holders. * @@ -27,15 +27,41 @@ using System; using OpenMetaverse; +using OpenSim.Region.Framework.Scenes; -namespace OpenSim.Framework +namespace OpenSim.Region.Framework.Interfaces { - public interface ILoginServiceToRegionsConnector + /// + /// Provides methods from manipulating media-on-a-prim + /// + public interface IMoapModule { - void LogOffUserFromGrid(ulong regionHandle, UUID AvatarID, UUID RegionSecret, string message); - bool NewUserConnection(ulong regionHandle, AgentCircuitData agent, out string reason); - RegionInfo RequestClosestRegion(string region); - RegionInfo RequestNeighbourInfo(UUID regionID); - RegionInfo RequestNeighbourInfo(ulong regionhandle); + /// + /// Get the media entry for a given prim face. + /// + /// A copy of the media entry is returned rather than the original, so this can be altered at will without + /// affecting the original settings. + /// + /// + /// + MediaEntry GetMediaEntry(SceneObjectPart part, int face); + + /// + /// Set the media entry for a given prim face. + /// + /// + /// + /// + void SetMediaEntry(SceneObjectPart part, int face, MediaEntry me); + + /// + /// Clear the media entry for a given prim face. + /// + /// + /// This is the equivalent of setting a media entry of null + /// + /// + /// /param> + void ClearMediaEntry(SceneObjectPart part, int face); } -} +} \ No newline at end of file diff --git a/OpenSim/Region/Framework/Interfaces/IRegionArchiverModule.cs b/OpenSim/Region/Framework/Interfaces/IRegionArchiverModule.cs index 89e59d0f17..d8229de5a5 100644 --- a/OpenSim/Region/Framework/Interfaces/IRegionArchiverModule.cs +++ b/OpenSim/Region/Framework/Interfaces/IRegionArchiverModule.cs @@ -26,6 +26,7 @@ */ using System; +using System.Collections.Generic; using System.IO; namespace OpenSim.Region.Framework.Interfaces @@ -46,7 +47,7 @@ namespace OpenSim.Region.Framework.Interfaces /// the EventManager.OnOarFileSaved event. /// /// - void ArchiveRegion(string savePath); + void ArchiveRegion(string savePath, Dictionary options); /// /// Archive the region to the given path @@ -57,7 +58,7 @@ namespace OpenSim.Region.Framework.Interfaces /// /// /// If supplied, this request Id is later returned in the saved event - void ArchiveRegion(string savePath, Guid requestId); + void ArchiveRegion(string savePath, Guid requestId, Dictionary options); /// /// Archive the region to a stream. diff --git a/OpenSim/Region/Framework/Interfaces/IRegionSerialiserModule.cs b/OpenSim/Region/Framework/Interfaces/IRegionSerialiserModule.cs index e7562a55c9..c5b21a8f31 100644 --- a/OpenSim/Region/Framework/Interfaces/IRegionSerialiserModule.cs +++ b/OpenSim/Region/Framework/Interfaces/IRegionSerialiserModule.cs @@ -90,7 +90,7 @@ namespace OpenSim.Region.Framework.Interfaces /// /// /// - void SavePrimListToXml2(List entityList, string fileName); + void SavePrimListToXml2(EntityBase[] entityList, string fileName); /// /// Save a set of prims in the xml2 format, optionally specifying a bounding box for which @@ -101,7 +101,7 @@ namespace OpenSim.Region.Framework.Interfaces /// /// /// - void SavePrimListToXml2(List entityList, TextWriter stream, Vector3 min, Vector3 max); + void SavePrimListToXml2(EntityBase[] entityList, TextWriter stream, Vector3 min, Vector3 max); void SaveNamedPrimsToXml2(Scene scene, string primName, string fileName); @@ -117,6 +117,6 @@ namespace OpenSim.Region.Framework.Interfaces /// /// /// - string SerializeGroupToXml2(SceneObjectGroup grp); + string SerializeGroupToXml2(SceneObjectGroup grp, Dictionary options); } } diff --git a/OpenSim/Region/Framework/Interfaces/ISimulationDataService.cs b/OpenSim/Region/Framework/Interfaces/ISimulationDataService.cs new file mode 100644 index 0000000000..cc55b57f3c --- /dev/null +++ b/OpenSim/Region/Framework/Interfaces/ISimulationDataService.cs @@ -0,0 +1,102 @@ +/* + * Copyright (c) Contributors, http://opensimulator.org/ + * See CONTRIBUTORS.TXT for a full list of copyright holders. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * * Neither the name of the OpenSimulator Project nor the + * names of its contributors may be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE DEVELOPERS ``AS IS'' AND ANY + * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED + * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + * DISCLAIMED. IN NO EVENT SHALL THE CONTRIBUTORS BE LIABLE FOR ANY + * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES + * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND + * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS + * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +using System; +using System.Collections.Generic; +using OpenMetaverse; +using OpenSim.Framework; +using OpenSim.Region.Framework.Scenes; + +namespace OpenSim.Region.Framework.Interfaces +{ + public interface ISimulationDataService + { + /// + /// Stores all object's details apart from inventory + /// + /// + /// + void StoreObject(SceneObjectGroup obj, UUID regionUUID); + + /// + /// Entirely removes the object, including inventory + /// + /// + /// + /// + void RemoveObject(UUID uuid, UUID regionUUID); + + /// + /// Store a prim's inventory + /// + /// + void StorePrimInventory(UUID primID, ICollection items); + + /// + /// Load persisted objects from region storage. + /// + /// the Region UUID + /// List of loaded groups + List LoadObjects(UUID regionUUID); + #region REGION SYNC + List LoadObjectsInGivenSpace(UUID regionID, float lowerX, float lowerY, float upperX, float upperY); + #endregion REGION SYNC + + /// + /// Store a terrain revision in region storage + /// + /// HeightField data + /// region UUID + void StoreTerrain(double[,] terrain, UUID regionID); + + /// + /// Load the latest terrain revision from region storage + /// + /// the region UUID + /// Heightfield data + double[,] LoadTerrain(UUID regionID); + + void StoreLandObject(ILandObject Parcel); + + /// + /// + /// delete from land where UUID=globalID + /// delete from landaccesslist where LandUUID=globalID + /// + /// + /// + void RemoveLandObject(UUID globalID); + + List LoadLandObjects(UUID regionUUID); + + void StoreRegionSettings(RegionSettings rs); + RegionSettings LoadRegionSettings(UUID regionUUID); + RegionLightShareData LoadRegionWindlightSettings(UUID regionUUID); + void StoreRegionWindlightSettings(RegionLightShareData wl); + void RemoveRegionWindlightSettings(UUID regionID); + } +} diff --git a/OpenSim/Region/Framework/Interfaces/IRegionDataStore.cs b/OpenSim/Region/Framework/Interfaces/ISimulationDataStore.cs similarity index 97% rename from OpenSim/Region/Framework/Interfaces/IRegionDataStore.cs rename to OpenSim/Region/Framework/Interfaces/ISimulationDataStore.cs index 71db5c0ee5..fd4a3243ee 100644 --- a/OpenSim/Region/Framework/Interfaces/IRegionDataStore.cs +++ b/OpenSim/Region/Framework/Interfaces/ISimulationDataStore.cs @@ -32,7 +32,7 @@ using OpenSim.Region.Framework.Scenes; namespace OpenSim.Region.Framework.Interfaces { - public interface IRegionDataStore + public interface ISimulationDataStore { /// /// Initialises the data storage engine @@ -73,6 +73,9 @@ namespace OpenSim.Region.Framework.Interfaces /// the Region UUID /// List of loaded groups List LoadObjects(UUID regionUUID); + #region REGION SYNC + List LoadObjectsInGivenSpace(UUID regionID, float lowerX, float lowerY, float upperX, float upperY); + #endregion REGION SYNC /// /// Store a terrain revision in region storage @@ -105,11 +108,8 @@ namespace OpenSim.Region.Framework.Interfaces RegionSettings LoadRegionSettings(UUID regionUUID); RegionLightShareData LoadRegionWindlightSettings(UUID regionUUID); void StoreRegionWindlightSettings(RegionLightShareData wl); + void RemoveRegionWindlightSettings(UUID regionID); void Shutdown(); - - #region REGION SYNC - List LoadObjectsInGivenSpace(UUID regionID, float lowerX, float lowerY, float upperX, float upperY); - #endregion REGION SYNC } } diff --git a/OpenSim/Region/Framework/Interfaces/ITerrain.cs b/OpenSim/Region/Framework/Interfaces/ITerrain.cs index b42e872e6f..815a2d87a1 100644 --- a/OpenSim/Region/Framework/Interfaces/ITerrain.cs +++ b/OpenSim/Region/Framework/Interfaces/ITerrain.cs @@ -26,6 +26,7 @@ */ using OpenSim.Framework; +using OpenMetaverse; namespace OpenSim.Region.Framework.Interfaces { @@ -73,7 +74,8 @@ namespace OpenSim.Region.Framework.Interfaces public interface IMapImageGenerator { - System.Drawing.Bitmap CreateMapTile(string gradientmap); - byte[] WriteJpeg2000Image(string gradientmap); + System.Drawing.Bitmap CreateMapTile(); + System.Drawing.Bitmap CreateViewImage(Vector3 camPos, Vector3 camDir, float fov, int width, int height, bool useTextures); + byte[] WriteJpeg2000Image(); } } diff --git a/OpenSim/Region/Framework/Interfaces/IUserManagement.cs b/OpenSim/Region/Framework/Interfaces/IUserManagement.cs new file mode 100644 index 0000000000..1a5cb7ecd1 --- /dev/null +++ b/OpenSim/Region/Framework/Interfaces/IUserManagement.cs @@ -0,0 +1,13 @@ +using System; +using System.Collections.Generic; + +using OpenMetaverse; + +namespace OpenSim.Region.Framework.Interfaces +{ + public interface IUserManagement + { + string GetUserName(UUID uuid); + void AddUser(UUID uuid, string userData); + } +} diff --git a/OpenSim/Region/Framework/Interfaces/IWorldMapModule.cs b/OpenSim/Region/Framework/Interfaces/IWorldMapModule.cs index ac6afed9ce..65c57a6eb8 100644 --- a/OpenSim/Region/Framework/Interfaces/IWorldMapModule.cs +++ b/OpenSim/Region/Framework/Interfaces/IWorldMapModule.cs @@ -29,6 +29,9 @@ namespace OpenSim.Region.Framework.Interfaces { public interface IWorldMapModule { - void RegenerateMaptile(byte[] data); + /// + /// Generate a map tile for the scene. a terrain texture for this scene + /// + void GenerateMaptile(); } } diff --git a/OpenSim/Region/Framework/Scenes/Animation/ScenePresenceAnimator.cs b/OpenSim/Region/Framework/Scenes/Animation/ScenePresenceAnimator.cs index 061595b26c..ed47e559db 100644 --- a/OpenSim/Region/Framework/Scenes/Animation/ScenePresenceAnimator.cs +++ b/OpenSim/Region/Framework/Scenes/Animation/ScenePresenceAnimator.cs @@ -132,7 +132,7 @@ namespace OpenSim.Region.Framework.Scenes.Animation anim, m_scenePresence.ControllingClient.NextAnimationSequenceNumber, m_scenePresence.UUID)) { // 16384 is CHANGED_ANIMATION - m_scenePresence.SendScriptEventToAttachments("changed", new Object[] { 16384 }); + m_scenePresence.SendScriptEventToAttachments("changed", new Object[] { (int)Changed.ANIMATION}); SendAnimPack(); } } diff --git a/OpenSim/Region/Framework/Scenes/AsyncSceneObjectGroupDeleter.cs b/OpenSim/Region/Framework/Scenes/AsyncSceneObjectGroupDeleter.cs index 241cac0f11..64567db9d8 100644 --- a/OpenSim/Region/Framework/Scenes/AsyncSceneObjectGroupDeleter.cs +++ b/OpenSim/Region/Framework/Scenes/AsyncSceneObjectGroupDeleter.cs @@ -105,17 +105,17 @@ namespace OpenSim.Region.Framework.Scenes if (permissionToDelete) { foreach (SceneObjectGroup g in objectGroups) - g.DeleteGroup(false); + g.DeleteGroupFromScene(false); } } private void InventoryRunDeleteTimer(object sender, ElapsedEventArgs e) { - m_log.Debug("[SCENE]: Starting send to inventory loop"); + m_log.Debug("[ASYNC DELETER]: Starting send to inventory loop"); while (InventoryDeQueueAndDelete()) { - //m_log.Debug("[SCENE]: Sent item successfully to inventory, continuing..."); + //m_log.Debug("[ASYNC DELETER]: Sent item successfully to inventory, continuing..."); } } @@ -137,7 +137,7 @@ namespace OpenSim.Region.Framework.Scenes x = m_inventoryDeletes.Dequeue(); m_log.DebugFormat( - "[SCENE]: Sending object to user's inventory, {0} item(s) remaining.", left); + "[ASYNC DELETER]: Sending object to user's inventory, {0} item(s) remaining.", left); try { @@ -152,7 +152,8 @@ namespace OpenSim.Region.Framework.Scenes } catch (Exception e) { - m_log.DebugFormat("Exception background sending object: " + e); + m_log.ErrorFormat( + "[ASYNC DELETER]: Exception background sending object: {0}{1}", e.Message, e.StackTrace); } return true; @@ -164,12 +165,16 @@ namespace OpenSim.Region.Framework.Scenes // We can't put the object group details in here since the root part may have disappeared (which is where these sit). // FIXME: This needs to be fixed. m_log.ErrorFormat( - "[SCENE]: Queued sending of scene object to agent {0} {1} failed: {2}", - (x != null ? x.remoteClient.Name : "unavailable"), (x != null ? x.remoteClient.AgentId.ToString() : "unavailable"), e.ToString()); + "[ASYNC DELETER]: Queued sending of scene object to agent {0} {1} failed: {2} {3}", + (x != null ? x.remoteClient.Name : "unavailable"), + (x != null ? x.remoteClient.AgentId.ToString() : "unavailable"), + e.Message, + e.StackTrace); } - m_log.Debug("[SCENE]: No objects left in inventory send queue."); + m_log.Debug("[ASYNC DELETER]: No objects left in inventory send queue."); + return false; } } -} +} \ No newline at end of file diff --git a/OpenSim/Region/Framework/Scenes/EntityBase.cs b/OpenSim/Region/Framework/Scenes/EntityBase.cs index 4e25c468c0..6fd38e56b1 100644 --- a/OpenSim/Region/Framework/Scenes/EntityBase.cs +++ b/OpenSim/Region/Framework/Scenes/EntityBase.cs @@ -69,6 +69,7 @@ namespace OpenSim.Region.Framework.Scenes public bool IsDeleted { get { return m_isDeleted; } + set { m_isDeleted = value; } } protected bool m_isDeleted; @@ -130,8 +131,6 @@ namespace OpenSim.Region.Framework.Scenes { return (EntityBase) MemberwiseClone(); } - - public abstract void SetText(string text, Vector3 color, double alpha); } //Nested Classes diff --git a/OpenSim/Region/Framework/Scenes/EntityManager.cs b/OpenSim/Region/Framework/Scenes/EntityManager.cs index 099fcce559..0defa93c6a 100644 --- a/OpenSim/Region/Framework/Scenes/EntityManager.cs +++ b/OpenSim/Region/Framework/Scenes/EntityManager.cs @@ -34,187 +34,89 @@ using OpenMetaverse; namespace OpenSim.Region.Framework.Scenes { - public class EntityManager : IEnumerable + public class EntityManager { private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); - private readonly Dictionary m_eb_uuid = new Dictionary(); - private readonly Dictionary m_eb_localID = new Dictionary(); - //private readonly Dictionary m_pres_uuid = new Dictionary(); - private readonly Object m_lock = new Object(); + private readonly DoubleDictionary m_entities = new DoubleDictionary(); - [Obsolete("Use Add() instead.")] - public void Add(UUID id, EntityBase eb) + public int Count { - Add(eb); + get { return m_entities.Count; } } public void Add(EntityBase entity) { - lock (m_lock) - { - try - { - m_eb_uuid.Add(entity.UUID, entity); - m_eb_localID.Add(entity.LocalId, entity); - } - catch(Exception e) - { - m_log.ErrorFormat("Add Entity failed: {0}", e.Message); - } - } - } - - public void InsertOrReplace(EntityBase entity) - { - lock (m_lock) - { - try - { - m_eb_uuid[entity.UUID] = entity; - m_eb_localID[entity.LocalId] = entity; - } - catch(Exception e) - { - m_log.ErrorFormat("Insert or Replace Entity failed: {0}", e.Message); - } - } + m_entities.Add(entity.UUID, entity.LocalId, entity); } public void Clear() { - lock (m_lock) - { - m_eb_uuid.Clear(); - m_eb_localID.Clear(); - } - } - - public int Count - { - get - { - return m_eb_uuid.Count; - } + m_entities.Clear(); } public bool ContainsKey(UUID id) { - try - { - return m_eb_uuid.ContainsKey(id); - } - catch - { - return false; - } + return m_entities.ContainsKey(id); } public bool ContainsKey(uint localID) { - try - { - return m_eb_localID.ContainsKey(localID); - } - catch - { - return false; - } + return m_entities.ContainsKey(localID); } public bool Remove(uint localID) { - lock (m_lock) - { - try - { - bool a = false; - EntityBase entity; - if (m_eb_localID.TryGetValue(localID, out entity)) - a = m_eb_uuid.Remove(entity.UUID); - - bool b = m_eb_localID.Remove(localID); - return a && b; - } - catch (Exception e) - { - m_log.ErrorFormat("Remove Entity failed for {0}", localID, e); - return false; - } - } + return m_entities.Remove(localID); } public bool Remove(UUID id) { - lock (m_lock) - { - try - { - bool a = false; - EntityBase entity; - if (m_eb_uuid.TryGetValue(id, out entity)) - a = m_eb_localID.Remove(entity.LocalId); - - bool b = m_eb_uuid.Remove(id); - return a && b; - } - catch (Exception e) - { - m_log.ErrorFormat("Remove Entity failed for {0}", id, e); - return false; - } - } + return m_entities.Remove(id); } - public List GetAllByType() + public EntityBase[] GetAllByType() { List tmp = new List(); - lock (m_lock) - { - try + m_entities.ForEach( + delegate(EntityBase entity) { - foreach (KeyValuePair pair in m_eb_uuid) - { - if (pair.Value is T) - { - tmp.Add(pair.Value); - } - } + if (entity is T) + tmp.Add(entity); } - catch (Exception e) - { - m_log.ErrorFormat("GetAllByType failed for {0}", e); - tmp = null; - } - } + ); - return tmp; + return tmp.ToArray(); } - public List GetEntities() + public EntityBase[] GetEntities() { - lock (m_lock) - { - return new List(m_eb_uuid.Values); - } + List tmp = new List(m_entities.Count); + m_entities.ForEach(delegate(EntityBase entity) { tmp.Add(entity); }); + return tmp.ToArray(); + } + + public void ForEach(Action action) + { + m_entities.ForEach(action); + } + + public EntityBase Find(Predicate predicate) + { + return m_entities.FindValue(predicate); } public EntityBase this[UUID id] { get { - lock (m_lock) - { - EntityBase entity; - if (m_eb_uuid.TryGetValue(id, out entity)) - return entity; - else - return null; - } + EntityBase entity; + m_entities.TryGetValue(id, out entity); + return entity; } set { - InsertOrReplace(value); + Add(value); } } @@ -222,50 +124,24 @@ namespace OpenSim.Region.Framework.Scenes { get { - lock (m_lock) - { - EntityBase entity; - if (m_eb_localID.TryGetValue(localID, out entity)) - return entity; - else - return null; - } + EntityBase entity; + m_entities.TryGetValue(localID, out entity); + return entity; } set { - InsertOrReplace(value); + Add(value); } } public bool TryGetValue(UUID key, out EntityBase obj) { - lock (m_lock) - { - return m_eb_uuid.TryGetValue(key, out obj); - } + return m_entities.TryGetValue(key, out obj); } public bool TryGetValue(uint key, out EntityBase obj) { - lock (m_lock) - { - return m_eb_localID.TryGetValue(key, out obj); - } + return m_entities.TryGetValue(key, out obj); } - - /// - /// This could be optimised to work on the list 'live' rather than making a safe copy and iterating that. - /// - /// - public IEnumerator GetEnumerator() - { - return GetEntities().GetEnumerator(); - } - - IEnumerator IEnumerable.GetEnumerator() - { - return GetEnumerator(); - } - } } diff --git a/OpenSim/Region/Framework/Scenes/EventManager.cs b/OpenSim/Region/Framework/Scenes/EventManager.cs index 8d1ef77f68..a6ae574781 100644 --- a/OpenSim/Region/Framework/Scenes/EventManager.cs +++ b/OpenSim/Region/Framework/Scenes/EventManager.cs @@ -57,7 +57,7 @@ namespace OpenSim.Region.Framework.Scenes public event OnTerrainTickDelegate OnTerrainTick; - public delegate void OnBackupDelegate(IRegionDataStore datastore, bool forceBackup); + public delegate void OnBackupDelegate(ISimulationDataService datastore, bool forceBackup); public event OnBackupDelegate OnBackup; @@ -109,6 +109,8 @@ namespace OpenSim.Region.Framework.Scenes public event OnSetRootAgentSceneDelegate OnSetRootAgentScene; + public event ParcelPropertiesUpdateRequest OnParcelPropertiesUpdateRequest; + /// /// Fired when an object is touched/grabbed. /// @@ -290,6 +292,17 @@ namespace OpenSim.Region.Framework.Scenes public delegate void ChatFromClientEvent(Object sender, OSChatMessage chat); public event ChatFromClientEvent OnChatFromClient; + /// + /// ChatToClientsEvent is triggered via ChatModule (or + /// substitutes thereof) when a chat message is actually sent to clients. Clients will only be sent a + /// received chat message if they satisfy various conditions (within audible range, etc.) + /// + public delegate void ChatToClientsEvent( + UUID senderID, HashSet receiverIDs, + string message, ChatTypeEnum type, Vector3 fromPos, string fromName, + ChatSourceType src, ChatAudibleLevel level); + public event ChatToClientsEvent OnChatToClients; + /// /// ChatBroadcastEvent is called via Scene when a broadcast chat message /// from world comes in @@ -331,6 +344,34 @@ namespace OpenSim.Region.Framework.Scenes /// the avatarID is UUID.Zero (I know, this doesn't make much sense but now it's historical). public delegate void Attach(uint localID, UUID itemID, UUID avatarID); public event Attach OnAttach; + + /// + /// Called immediately after an object is loaded from storage. + /// + public event SceneObjectDelegate OnSceneObjectLoaded; + public delegate void SceneObjectDelegate(SceneObjectGroup so); + + /// + /// Called immediately before an object is saved to storage. + /// + /// + /// The scene object being persisted. + /// This is actually a copy of the original scene object so changes made here will be saved to storage but will not be kept in memory. + /// + /// + /// The original scene object being persisted. Changes here will stay in memory but will not be saved to storage on this save. + /// + public event SceneObjectPreSaveDelegate OnSceneObjectPreSave; + public delegate void SceneObjectPreSaveDelegate(SceneObjectGroup persistingSo, SceneObjectGroup originalSo); + + /// + /// Called when a scene object part is cloned within the region. + /// + /// + /// + /// True if the duplicate will immediately be in the scene, false otherwise + public event SceneObjectPartCopyDelegate OnSceneObjectPartCopy; + public delegate void SceneObjectPartCopyDelegate(SceneObjectPart copy, SceneObjectPart original, bool userExposed); public delegate void RegionUp(GridRegion region); public event RegionUp OnRegionUp; @@ -655,7 +696,7 @@ namespace OpenSim.Region.Framework.Scenes } } - public void TriggerOnBackup(IRegionDataStore dstore) + public void TriggerOnBackup(ISimulationDataService dstore, bool forced) { OnBackupDelegate handlerOnAttach = OnBackup; if (handlerOnAttach != null) @@ -664,7 +705,7 @@ namespace OpenSim.Region.Framework.Scenes { try { - d(dstore, false); + d(dstore, forced); } catch (Exception e) { @@ -1574,6 +1615,30 @@ namespace OpenSim.Region.Framework.Scenes } } } + + public void TriggerOnChatToClients( + UUID senderID, HashSet receiverIDs, + string message, ChatTypeEnum type, Vector3 fromPos, string fromName, + ChatSourceType src, ChatAudibleLevel level) + { + ChatToClientsEvent handler = OnChatToClients; + if (handler != null) + { + foreach (ChatToClientsEvent d in handler.GetInvocationList()) + { + try + { + d(senderID, receiverIDs, message, type, fromPos, fromName, src, level); + } + catch (Exception e) + { + m_log.ErrorFormat( + "[EVENT MANAGER]: Delegate for TriggerOnChatToClients failed - continuing. {0} {1}", + e.Message, e.StackTrace); + } + } + } + } public void TriggerOnChatBroadcast(Object sender, OSChatMessage chat) { @@ -2015,9 +2080,93 @@ namespace OpenSim.Region.Framework.Scenes } } + public void TriggerOnSceneObjectLoaded(SceneObjectGroup so) + { + SceneObjectDelegate handler = OnSceneObjectLoaded; + if (handler != null) + { + foreach (SceneObjectDelegate d in handler.GetInvocationList()) + { + try + { + d(so); + } + catch (Exception e) + { + m_log.ErrorFormat( + "[EVENT MANAGER]: Delegate for TriggerOnSceneObjectLoaded failed - continuing. {0} {1}", + e.Message, e.StackTrace); + } + } + } + } + + public void TriggerOnSceneObjectPreSave(SceneObjectGroup persistingSo, SceneObjectGroup originalSo) + { + SceneObjectPreSaveDelegate handler = OnSceneObjectPreSave; + if (handler != null) + { + foreach (SceneObjectPreSaveDelegate d in handler.GetInvocationList()) + { + try + { + d(persistingSo, originalSo); + } + catch (Exception e) + { + m_log.ErrorFormat( + "[EVENT MANAGER]: Delegate for TriggerOnSceneObjectPreSave failed - continuing. {0} {1}", + e.Message, e.StackTrace); + } + } + } + } + + public void TriggerOnSceneObjectPartCopy(SceneObjectPart copy, SceneObjectPart original, bool userExposed) + { + SceneObjectPartCopyDelegate handler = OnSceneObjectPartCopy; + if (handler != null) + { + foreach (SceneObjectPartCopyDelegate d in handler.GetInvocationList()) + { + try + { + d(copy, original, userExposed); + } + catch (Exception e) + { + m_log.ErrorFormat( + "[EVENT MANAGER]: Delegate for TriggerOnSceneObjectPartCopy failed - continuing. {0} {1}", + e.Message, e.StackTrace); + } + } + } + } + + public void TriggerOnParcelPropertiesUpdateRequest(LandUpdateArgs args, + int local_id, IClientAPI remote_client) + { + ParcelPropertiesUpdateRequest handler = OnParcelPropertiesUpdateRequest; + if (handler != null) + { + foreach (ParcelPropertiesUpdateRequest d in handler.GetInvocationList()) + { + try + { + d(args, local_id, remote_client); + } + catch (Exception e) + { + m_log.ErrorFormat( + "[EVENT MANAGER]: Delegate for TriggerOnSceneObjectPartCopy failed - continuing. {0} {1}", + e.Message, e.StackTrace); + } + } + } + } + //REGION SYNC #region REGION SYNC RELATED EVENTS - //OnScriptEngineSyncStop: triggered when user types "sync stop" on the script engine's console public delegate void ScriptEngineSyncStop(); public event ScriptEngineSyncStop OnScriptEngineSyncStop; @@ -2035,13 +2184,13 @@ namespace OpenSim.Region.Framework.Scenes catch (Exception e) { m_log.ErrorFormat( - "[EVENT MANAGER]: Delegate for TriggerScriptEngineSyncStop failed - continuing. {0} {1}", + "[EVENT MANAGER]: Delegate for TriggerOnSceneObjectLoaded failed - continuing. {0} {1}", e.Message, e.StackTrace); } } } } - + //OnUpdateTaskInventoryScriptAsset: triggered after Scene receives client's upload of updated script and stores it as asset public delegate void UpdateScript(UUID clientID, UUID itemId, UUID primId, bool isScriptRunning, UUID newAssetID); public event UpdateScript OnUpdateScript; @@ -2064,8 +2213,8 @@ namespace OpenSim.Region.Framework.Scenes } } } - } - + } + //OnPopulateLocalSceneList: Triggered by OpenSim to the valid local scene, should only happen in script engine public delegate void PopulateLocalSceneList(List localScenes); public event PopulateLocalSceneList OnPopulateLocalSceneList; @@ -2094,6 +2243,5 @@ namespace OpenSim.Region.Framework.Scenes } } #endregion - } } diff --git a/OpenSim/Region/Framework/Scenes/Prioritizer.cs b/OpenSim/Region/Framework/Scenes/Prioritizer.cs index de3c360a42..19f8180780 100644 --- a/OpenSim/Region/Framework/Scenes/Prioritizer.cs +++ b/OpenSim/Region/Framework/Scenes/Prioritizer.cs @@ -1,3 +1,30 @@ +/* + * Copyright (c) Contributors, http://opensimulator.org/ + * See CONTRIBUTORS.TXT for a full list of copyright holders. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * * Neither the name of the OpenSimulator Project nor the + * names of its contributors may be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE DEVELOPERS ``AS IS'' AND ANY + * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED + * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + * DISCLAIMED. IN NO EVENT SHALL THE CONTRIBUTORS BE LIABLE FOR ANY + * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES + * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND + * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS + * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + using System; using System.Collections.Generic; using log4net; @@ -31,11 +58,11 @@ namespace OpenSim.Region.Framework.Scenes public class Prioritizer { - private static readonly ILog m_log = LogManager.GetLogger(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType); +// private static readonly ILog m_log = LogManager.GetLogger(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType); /// /// This is added to the priority of all child prims, to make sure that the root prim update is sent to the - /// viewer before child prim updates. + /// viewer before child prim updates. /// The adjustment is added to child prims and subtracted from root prims, so the gap ends up /// being double. We do it both ways so that there is a still a priority delta even if the priority is already /// double.MinValue or double.MaxValue. @@ -75,7 +102,6 @@ namespace OpenSim.Region.Framework.Scenes break; default: throw new InvalidOperationException("UpdatePrioritizationScheme not defined."); - break; } // Adjust priority so that root prims are sent to the viewer first. This is especially important for @@ -122,9 +148,16 @@ namespace OpenSim.Region.Framework.Scenes // Use group position for child prims Vector3 entityPos; if (entity is SceneObjectPart) - entityPos = m_scene.GetGroupByPrim(entity.LocalId).AbsolutePosition; + { + // Can't use Scene.GetGroupByPrim() here, since the entity may have been delete from the scene + // before its scheduled update was triggered + //entityPos = m_scene.GetGroupByPrim(entity.LocalId).AbsolutePosition; + entityPos = ((SceneObjectPart)entity).ParentGroup.AbsolutePosition; + } else + { entityPos = entity.AbsolutePosition; + } return Vector3.DistanceSquared(presencePos, entityPos); } @@ -144,9 +177,16 @@ namespace OpenSim.Region.Framework.Scenes // Use group position for child prims Vector3 entityPos = entity.AbsolutePosition; if (entity is SceneObjectPart) - entityPos = m_scene.GetGroupByPrim(entity.LocalId).AbsolutePosition; + { + // Can't use Scene.GetGroupByPrim() here, since the entity may have been delete from the scene + // before its scheduled update was triggered + //entityPos = m_scene.GetGroupByPrim(entity.LocalId).AbsolutePosition; + entityPos = ((SceneObjectPart)entity).ParentGroup.AbsolutePosition; + } else + { entityPos = entity.AbsolutePosition; + } if (!presence.IsChildAgent) { diff --git a/OpenSim/Region/Framework/Scenes/Scene.Inventory.cs b/OpenSim/Region/Framework/Scenes/Scene.Inventory.cs index c8af7c6a8d..e6a4053192 100644 --- a/OpenSim/Region/Framework/Scenes/Scene.Inventory.cs +++ b/OpenSim/Region/Framework/Scenes/Scene.Inventory.cs @@ -58,7 +58,8 @@ namespace OpenSim.Region.Framework.Scenes { m_log.Info("[PRIM INVENTORY]: Starting scripts in scene"); - foreach (EntityBase group in Entities) + EntityBase[] entities = Entities.GetEntities(); + foreach (EntityBase group in entities) { if (group is SceneObjectGroup) { @@ -70,18 +71,18 @@ namespace OpenSim.Region.Framework.Scenes public void AddUploadedInventoryItem(UUID agentID, InventoryItemBase item) { - IMoneyModule money=RequestModuleInterface(); + IMoneyModule money = RequestModuleInterface(); if (money != null) { money.ApplyUploadCharge(agentID, money.UploadCharge, "Asset upload"); } - AddInventoryItem(agentID, item); + AddInventoryItem(item); } public bool AddInventoryItemReturned(UUID AgentId, InventoryItemBase item) { - if (InventoryService.AddItem(item)) + if (AddInventoryItem(item)) return true; else { @@ -92,26 +93,75 @@ namespace OpenSim.Region.Framework.Scenes } } - public void AddInventoryItem(UUID AgentID, InventoryItemBase item) + /// + /// Add the given inventory item to a user's inventory. + /// + /// + public bool AddInventoryItem(InventoryItemBase item) { + if (UUID.Zero == item.Folder) + { + InventoryFolderBase f = InventoryService.GetFolderForType(item.Owner, (AssetType)item.AssetType); + if (f != null) + { +// m_log.DebugFormat( +// "[LOCAL INVENTORY SERVICES CONNECTOR]: Found folder {0} type {1} for item {2}", +// f.Name, (AssetType)f.Type, item.Name); + + item.Folder = f.ID; + } + else + { + f = InventoryService.GetRootFolder(item.Owner); + if (f != null) + { + item.Folder = f.ID; + } + else + { + m_log.WarnFormat( + "[AGENT INVENTORY]: Could not find root folder for {0} when trying to add item {1} with no parent folder specified", + item.Owner, item.Name); + return false; + } + } + } + if (InventoryService.AddItem(item)) { int userlevel = 0; - if (Permissions.IsGod(AgentID)) + if (Permissions.IsGod(item.Owner)) { userlevel = 1; } - EventManager.TriggerOnNewInventoryItemUploadComplete(AgentID, item.AssetID, item.Name, userlevel); + EventManager.TriggerOnNewInventoryItemUploadComplete(item.Owner, item.AssetID, item.Name, userlevel); + + return true; } else { m_log.WarnFormat( - "[AGENT INVENTORY]: Agent {1} could not add item {2} {3}", - AgentID, item.Name, item.ID); + "[AGENT INVENTORY]: Agent {0} could not add item {1} {2}", + item.Owner, item.Name, item.ID); - return; + return false; } } + + /// + /// Add the given inventory item to a user's inventory. + /// + /// + /// A + /// + /// + /// A + /// + [Obsolete("Use AddInventoryItem(InventoryItemBase item) instead. This was deprecated in OpenSim 0.7.1")] + public void AddInventoryItem(UUID AgentID, InventoryItemBase item) + { + AddInventoryItem(item); + } /// /// Add an inventory item to an avatar's inventory. @@ -121,7 +171,7 @@ namespace OpenSim.Region.Framework.Scenes /// in which the item is to be placed. public void AddInventoryItem(IClientAPI remoteClient, InventoryItemBase item) { - AddInventoryItem(remoteClient.AgentId, item); + AddInventoryItem(item); remoteClient.SendInventoryItemCreateUpdate(item, 0); } @@ -212,7 +262,7 @@ namespace OpenSim.Region.Framework.Scenes // Update item with new asset item.AssetID = asset.FullID; if (group.UpdateInventoryItem(item)) - remoteClient.SendAgentAlertMessage("Script saved", false); + remoteClient.SendAgentAlertMessage("Script saved", false); part.GetProperties(remoteClient); @@ -453,6 +503,7 @@ namespace OpenSim.Region.Framework.Scenes InventoryItemBase itemCopy = new InventoryItemBase(); itemCopy.Owner = recipient; itemCopy.CreatorId = item.CreatorId; + itemCopy.CreatorData = item.CreatorData; itemCopy.ID = UUID.Random(); itemCopy.AssetID = item.AssetID; itemCopy.Description = item.Description; @@ -596,7 +647,7 @@ namespace OpenSim.Region.Framework.Scenes itemCopy.SalePrice = item.SalePrice; itemCopy.SaleType = item.SaleType; - if (InventoryService.AddItem(itemCopy)) + if (AddInventoryItem(itemCopy)) { IInventoryAccessModule invAccess = RequestModuleInterface(); if (invAccess != null) @@ -726,13 +777,13 @@ namespace OpenSim.Region.Framework.Scenes if (remoteClient.AgentId == oldAgentID) { CreateNewInventoryItem( - remoteClient, item.CreatorId, newFolderID, newName, item.Flags, callbackID, asset, (sbyte)item.InvType, + remoteClient, item.CreatorId, item.CreatorData, newFolderID, newName, item.Flags, callbackID, asset, (sbyte)item.InvType, item.BasePermissions, item.CurrentPermissions, item.EveryOnePermissions, item.NextPermissions, item.GroupPermissions, Util.UnixTimeSinceEpoch()); } else { CreateNewInventoryItem( - remoteClient, item.CreatorId, newFolderID, newName, item.Flags, callbackID, asset, (sbyte)item.InvType, + remoteClient, item.CreatorId, item.CreatorData, newFolderID, newName, item.Flags, callbackID, asset, (sbyte)item.InvType, item.NextPermissions, item.NextPermissions, item.EveryOnePermissions & item.NextPermissions, item.NextPermissions, item.GroupPermissions, Util.UnixTimeSinceEpoch()); } } @@ -747,7 +798,7 @@ namespace OpenSim.Region.Framework.Scenes /// /// Create a new asset data structure. /// - private AssetBase CreateAsset(string name, string description, sbyte assetType, byte[] data, UUID creatorID) + public AssetBase CreateAsset(string name, string description, sbyte assetType, byte[] data, UUID creatorID) { AssetBase asset = new AssetBase(UUID.Random(), name, assetType, creatorID.ToString()); asset.Description = description; @@ -782,11 +833,11 @@ namespace OpenSim.Region.Framework.Scenes /// /// /// - private void CreateNewInventoryItem(IClientAPI remoteClient, string creatorID, UUID folderID, string name, uint flags, uint callbackID, + private void CreateNewInventoryItem(IClientAPI remoteClient, string creatorID, string creatorData, UUID folderID, string name, uint flags, uint callbackID, AssetBase asset, sbyte invType, uint nextOwnerMask, int creationDate) { CreateNewInventoryItem( - remoteClient, creatorID, folderID, name, flags, callbackID, asset, invType, + remoteClient, creatorID, creatorData, folderID, name, flags, callbackID, asset, invType, (uint)PermissionMask.All, (uint)PermissionMask.All, 0, nextOwnerMask, 0, creationDate); } @@ -801,12 +852,13 @@ namespace OpenSim.Region.Framework.Scenes /// /// private void CreateNewInventoryItem( - IClientAPI remoteClient, string creatorID, UUID folderID, string name, uint flags, uint callbackID, AssetBase asset, sbyte invType, + IClientAPI remoteClient, string creatorID, string creatorData, UUID folderID, string name, uint flags, uint callbackID, AssetBase asset, sbyte invType, uint baseMask, uint currentMask, uint everyoneMask, uint nextOwnerMask, uint groupMask, int creationDate) { InventoryItemBase item = new InventoryItemBase(); item.Owner = remoteClient.AgentId; item.CreatorId = creatorID; + item.CreatorData = creatorData; item.ID = UUID.Random(); item.AssetID = asset.FullID; item.Description = asset.Description; @@ -822,8 +874,10 @@ namespace OpenSim.Region.Framework.Scenes item.BasePermissions = baseMask; item.CreationDate = creationDate; - if (InventoryService.AddItem(item)) + if (AddInventoryItem(item)) + { remoteClient.SendInventoryItemCreateUpdate(item, callbackID); + } else { m_dialogModule.SendAlertToUser(remoteClient, "Failed to create item"); @@ -857,6 +911,12 @@ namespace OpenSim.Region.Framework.Scenes if (!Permissions.CanCreateUserInventory(invType, remoteClient.AgentId)) return; + InventoryFolderBase f = new InventoryFolderBase(folderID, remoteClient.AgentId); + InventoryFolderBase folder = InventoryService.GetFolder(f); + + if (folder == null || folder.Owner != remoteClient.AgentId) + return; + if (transactionID == UUID.Zero) { ScenePresence presence; @@ -878,7 +938,7 @@ namespace OpenSim.Region.Framework.Scenes AssetBase asset = CreateAsset(name, description, assetType, data, remoteClient.AgentId); AssetService.Store(asset); - CreateNewInventoryItem(remoteClient, remoteClient.AgentId.ToString(), folderID, asset.Name, 0, callbackID, asset, invType, nextOwnerMask, creationDate); + CreateNewInventoryItem(remoteClient, remoteClient.AgentId.ToString(), string.Empty, folderID, asset.Name, 0, callbackID, asset, invType, nextOwnerMask, creationDate); } else { @@ -911,7 +971,7 @@ namespace OpenSim.Region.Framework.Scenes ScenePresence presence; if (TryGetScenePresence(remoteClient.AgentId, out presence)) { - byte[] data = null; +// byte[] data = null; AssetBase asset = new AssetBase(); asset.FullID = olditemID; @@ -919,8 +979,10 @@ namespace OpenSim.Region.Framework.Scenes asset.Name = name; asset.Description = description; - CreateNewInventoryItem(remoteClient, remoteClient.AgentId.ToString(), folderID, name, 0, callbackID, asset, invType, (uint)PermissionMask.All, (uint)PermissionMask.All, (uint)PermissionMask.All, (uint)PermissionMask.All, (uint)PermissionMask.All, Util.UnixTimeSinceEpoch()); - + CreateNewInventoryItem( + remoteClient, remoteClient.AgentId.ToString(), string.Empty, folderID, name, 0, callbackID, asset, invType, + (uint)PermissionMask.All, (uint)PermissionMask.All, (uint)PermissionMask.All, + (uint)PermissionMask.All, (uint)PermissionMask.All, Util.UnixTimeSinceEpoch()); } else { @@ -953,7 +1015,6 @@ namespace OpenSim.Region.Framework.Scenes InventoryService.DeleteFolders(remoteClient.AgentId, folderIDs); } - /// /// Send the details of a prim's inventory to the client. /// @@ -993,6 +1054,9 @@ namespace OpenSim.Region.Framework.Scenes SceneObjectGroup group = part.ParentGroup; if (group != null) { + if (!Permissions.CanEditObjectInventory(part.UUID, remoteClient.AgentId)) + return; + TaskInventoryItem item = group.GetInventoryItem(localID, itemID); if (item == null) return; @@ -1018,7 +1082,6 @@ namespace OpenSim.Region.Framework.Scenes private InventoryItemBase CreateAgentInventoryItemFromTask(UUID destAgent, SceneObjectPart part, UUID itemId) { - Console.WriteLine("CreateAgentInventoryItemFromTask"); TaskInventoryItem taskItem = part.Inventory.GetInventoryItem(itemId); if (null == taskItem) @@ -1041,6 +1104,7 @@ namespace OpenSim.Region.Framework.Scenes agentItem.ID = UUID.Random(); agentItem.CreatorId = taskItem.CreatorID.ToString(); + agentItem.CreatorData = taskItem.CreatorData; agentItem.Owner = destAgent; agentItem.AssetID = taskItem.AssetID; agentItem.Description = taskItem.Description; @@ -1089,7 +1153,10 @@ namespace OpenSim.Region.Framework.Scenes /// public InventoryItemBase MoveTaskInventoryItem(IClientAPI remoteClient, UUID folderId, SceneObjectPart part, UUID itemId) { - m_log.Info("Adding task inventory"); + m_log.DebugFormat( + "[PRIM INVENTORY]: Adding item {0} from {1} to folder {2} for {3}", + itemId, part.Name, folderId, remoteClient.Name); + InventoryItemBase agentItem = CreateAgentInventoryItemFromTask(remoteClient.AgentId, part, itemId); if (agentItem == null) @@ -1132,9 +1199,21 @@ namespace OpenSim.Region.Framework.Scenes return; } - // Only owner can copy - if (remoteClient.AgentId != taskItem.OwnerID) - return; + TaskInventoryItem item = part.Inventory.GetInventoryItem(itemId); + if ((item.CurrentPermissions & (uint)PermissionMask.Copy) == 0) + { + // If the item to be moved is no copy, we need to be able to + // edit the prim. + if (!Permissions.CanEditObjectInventory(part.UUID, remoteClient.AgentId)) + return; + } + else + { + // If the item is copiable, then we just need to have perms + // on it. The delete check is a pure rights check + if (!Permissions.CanDeleteObject(part.UUID, remoteClient.AgentId)) + return; + } MoveTaskInventoryItem(remoteClient, folderId, part, itemId); } @@ -1143,7 +1222,11 @@ namespace OpenSim.Region.Framework.Scenes /// MoveTaskInventoryItem /// /// - /// + /// + /// The user inventory folder to move (or copy) the item to. If null, then the most + /// suitable system folder is used (e.g. the Objects folder for objects). If there is no suitable folder, then + /// the item is placed in the user's root inventory folder + /// /// /// public InventoryItemBase MoveTaskInventoryItem(UUID avatarId, UUID folderId, SceneObjectPart part, UUID itemId) @@ -1163,7 +1246,7 @@ namespace OpenSim.Region.Framework.Scenes agentItem.Folder = folderId; - AddInventoryItem(avatarId, agentItem); + AddInventoryItem(agentItem); return agentItem; } @@ -1223,6 +1306,7 @@ namespace OpenSim.Region.Framework.Scenes destTaskItem.ItemID = UUID.Random(); destTaskItem.CreatorID = srcTaskItem.CreatorID; + destTaskItem.CreatorData = srcTaskItem.CreatorData; destTaskItem.AssetID = srcTaskItem.AssetID; destTaskItem.GroupID = destPart.GroupID; destTaskItem.OwnerID = destPart.OwnerID; @@ -1287,7 +1371,7 @@ namespace OpenSim.Region.Framework.Scenes { agentItem.Folder = newFolderID; - AddInventoryItem(destID, agentItem); + AddInventoryItem(agentItem); } } @@ -1417,16 +1501,48 @@ namespace OpenSim.Region.Framework.Scenes { agentTransactions.HandleTaskItemUpdateFromTransaction( remoteClient, part, transactionID, currentItem); - } - if (part.Inventory.UpdateInventoryItem(itemInfo)) - { + if ((InventoryType)itemInfo.InvType == InventoryType.Notecard) remoteClient.SendAgentAlertMessage("Notecard saved", false); else if ((InventoryType)itemInfo.InvType == InventoryType.LSL) remoteClient.SendAgentAlertMessage("Script saved", false); else remoteClient.SendAgentAlertMessage("Item saved", false); + } + // Base ALWAYS has move + currentItem.BasePermissions |= (uint)PermissionMask.Move; + + // Check if we're allowed to mess with permissions + if (!Permissions.IsGod(remoteClient.AgentId)) // Not a god + { + if (remoteClient.AgentId != part.OwnerID) // Not owner + { + // Friends and group members can't change any perms + itemInfo.BasePermissions = currentItem.BasePermissions; + itemInfo.EveryonePermissions = currentItem.EveryonePermissions; + itemInfo.GroupPermissions = currentItem.GroupPermissions; + itemInfo.NextPermissions = currentItem.NextPermissions; + itemInfo.CurrentPermissions = currentItem.CurrentPermissions; + } + else + { + // Owner can't change base, and can change other + // only up to base + itemInfo.BasePermissions = currentItem.BasePermissions; + itemInfo.EveryonePermissions &= currentItem.BasePermissions; + itemInfo.GroupPermissions &= currentItem.BasePermissions; + itemInfo.CurrentPermissions &= currentItem.BasePermissions; + itemInfo.NextPermissions &= currentItem.BasePermissions; + } + + } + + // Next ALWAYS has move + itemInfo.NextPermissions |= (uint)PermissionMask.Move; + + if (part.Inventory.UpdateInventoryItem(itemInfo)) + { part.GetProperties(remoteClient); } } @@ -1504,16 +1620,6 @@ namespace OpenSim.Region.Framework.Scenes if (part == null) return; - if (part.OwnerID != remoteClient.AgentId) - { - // Group permissions - if ((part.GroupID == UUID.Zero) || (remoteClient.GetGroupPowers(part.GroupID) == 0) || ((part.GroupMask & (uint)PermissionMask.Modify) == 0)) - return; - } else { - if ((part.OwnerMask & (uint)PermissionMask.Modify) == 0) - return; - } - if (!Permissions.CanCreateObjectInventory( itemBase.InvType, part.UUID, remoteClient.AgentId)) return; @@ -1613,6 +1719,7 @@ namespace OpenSim.Region.Framework.Scenes destTaskItem.ItemID = UUID.Random(); destTaskItem.CreatorID = srcTaskItem.CreatorID; + destTaskItem.CreatorData = srcTaskItem.CreatorData; destTaskItem.AssetID = srcTaskItem.AssetID; destTaskItem.GroupID = destPart.GroupID; destTaskItem.OwnerID = destPart.OwnerID; @@ -1664,37 +1771,6 @@ namespace OpenSim.Region.Framework.Scenes } } - /// - /// Called when one or more objects are removed from the environment into inventory. - /// - /// - /// - /// - /// - /// - public virtual void DeRezObject(IClientAPI remoteClient, List localIDs, - UUID groupID, DeRezAction action, UUID destinationID) - { - foreach (uint localID in localIDs) - { - DeRezObject(remoteClient, localID, groupID, action, destinationID); - } - } - - /// - /// Called when an object is removed from the environment into inventory. - /// - /// - /// - /// - /// - /// - public virtual void DeRezObject(IClientAPI remoteClient, uint localID, - UUID groupID, DeRezAction action, UUID destinationID) - { - DeRezObjects(remoteClient, new List() { localID} , groupID, action, destinationID); - } - public virtual void DeRezObjects(IClientAPI remoteClient, List localIDs, UUID groupID, DeRezAction action, UUID destinationID) { @@ -1729,17 +1805,17 @@ namespace OpenSim.Region.Framework.Scenes deleteIDs.Add(localID); deleteGroups.Add(grp); - // Force a database backup/update on this SceneObjectGroup - // So that we know the database is upto date, - // for when deleting the object from it - ForceSceneObjectBackup(grp); - if (remoteClient == null) { // Autoreturn has a null client. Nothing else does. So // allow only returns if (action != DeRezAction.Return) + { + m_log.WarnFormat( + "[AGENT INVENTORY]: Ignoring attempt to {0} {1} {2} without a client", + action, grp.Name, grp.UUID); return; + } permissionToTakeCopy = false; } @@ -1747,13 +1823,13 @@ namespace OpenSim.Region.Framework.Scenes { if (!Permissions.CanTakeCopyObject(grp.UUID, remoteClient.AgentId)) permissionToTakeCopy = false; + if (!Permissions.CanTakeObject(grp.UUID, remoteClient.AgentId)) permissionToTake = false; - + if (!Permissions.CanDeleteObject(grp.UUID, remoteClient.AgentId)) permissionToDelete = false; } - } // Handle god perms @@ -1822,53 +1898,6 @@ namespace OpenSim.Region.Framework.Scenes } } - public void UpdateKnownItem(IClientAPI remoteClient, SceneObjectGroup grp, UUID itemID, UUID agentID) - { - SceneObjectGroup objectGroup = grp; - if (objectGroup != null) - { - if (!grp.HasGroupChanged) - { - m_log.InfoFormat("[ATTACHMENT]: Save request for {0} which is unchanged", grp.UUID); - return; - } - - m_log.InfoFormat( - "[ATTACHMENT]: Updating asset for attachment {0}, attachpoint {1}", - grp.UUID, grp.GetAttachmentPoint()); - - string sceneObjectXml = SceneObjectSerializer.ToOriginalXmlFormat(objectGroup); - - InventoryItemBase item = new InventoryItemBase(itemID, remoteClient.AgentId); - item = InventoryService.GetItem(item); - - if (item != null) - { - AssetBase asset = CreateAsset( - objectGroup.GetPartName(objectGroup.LocalId), - objectGroup.GetPartDescription(objectGroup.LocalId), - (sbyte)AssetType.Object, - Utils.StringToBytes(sceneObjectXml), - remoteClient.AgentId); - AssetService.Store(asset); - - item.AssetID = asset.FullID; - item.Description = asset.Description; - item.Name = asset.Name; - item.AssetType = asset.Type; - item.InvType = (int)InventoryType.Object; - - InventoryService.UpdateItem(item); - - // this gets called when the agent loggs off! - if (remoteClient != null) - { - remoteClient.SendInventoryItemCreateUpdate(item, 0); - } - } - } - } - public UUID attachObjectAssetStore(IClientAPI remoteClient, SceneObjectGroup grp, UUID AgentId, out UUID itemID) { itemID = UUID.Zero; @@ -1902,6 +1931,7 @@ namespace OpenSim.Region.Framework.Scenes InventoryItemBase item = new InventoryItemBase(); item.CreatorId = grp.RootPart.CreatorID.ToString(); + item.CreatorData = grp.RootPart.CreatorData; item.Owner = remoteClient.AgentId; item.ID = UUID.Random(); item.AssetID = asset.FullID; @@ -1937,7 +1967,7 @@ namespace OpenSim.Region.Framework.Scenes // sets itemID so client can show item as 'attached' in inventory grp.SetFromItemID(item.ID); - if (InventoryService.AddItem(item)) + if (AddInventoryItem(item)) remoteClient.SendInventoryItemCreateUpdate(item, 0); else m_dialogModule.SendAlertToUser(remoteClient, "Operation failed"); @@ -1974,7 +2004,7 @@ namespace OpenSim.Region.Framework.Scenes remoteClient, itemID, RayEnd, RayStart, RayTargetID, BypassRayCast, RayEndIsIntersection, RezSelected, RemoveItem, fromTaskID, false); } - + /// /// Rez an object into the scene from a prim's inventory. /// @@ -1989,105 +2019,47 @@ namespace OpenSim.Region.Framework.Scenes SceneObjectPart sourcePart, TaskInventoryItem item, Vector3 pos, Quaternion rot, Vector3 vel, int param) { - // Rez object - if (item != null) + if (null == item) + return null; + + SceneObjectGroup group = sourcePart.Inventory.GetRezReadySceneObject(item); + + if (null == group) + return null; + + if (!Permissions.CanRezObject(group.PrimCount, item.OwnerID, pos)) + return null; + + if (!Permissions.BypassPermissions()) { - UUID ownerID = item.OwnerID; - - AssetBase rezAsset = AssetService.Get(item.AssetID.ToString()); - - if (rezAsset != null) - { - string xmlData = Utils.BytesToString(rezAsset.Data); - SceneObjectGroup group = SceneObjectSerializer.FromOriginalXmlFormat(xmlData); - - if (!Permissions.CanRezObject(group.Children.Count, ownerID, pos)) - { - return null; - } - group.ResetIDs(); - - AddNewSceneObject(group, true); - - // we set it's position in world. - group.AbsolutePosition = pos; - - SceneObjectPart rootPart = group.GetChildPart(group.UUID); - - // Since renaming the item in the inventory does not affect the name stored - // in the serialization, transfer the correct name from the inventory to the - // object itself before we rez. - rootPart.Name = item.Name; - rootPart.Description = item.Description; - - List partList = new List(group.Children.Values); - - group.SetGroup(sourcePart.GroupID, null); - - if ((rootPart.OwnerID != item.OwnerID) || (item.CurrentPermissions & 16) != 0) - { - if (Permissions.PropagatePermissions()) - { - foreach (SceneObjectPart part in partList) - { - part.EveryoneMask = item.EveryonePermissions; - part.NextOwnerMask = item.NextPermissions; - } - group.ApplyNextOwnerPermissions(); - } - } - - foreach (SceneObjectPart part in partList) - { - if ((part.OwnerID != item.OwnerID) || (item.CurrentPermissions & 16) != 0) - { - part.LastOwnerID = part.OwnerID; - part.OwnerID = item.OwnerID; - part.Inventory.ChangeInventoryOwner(item.OwnerID); - } - part.EveryoneMask = item.EveryonePermissions; - part.NextOwnerMask = item.NextPermissions; - } - - rootPart.TrimPermissions(); - - if (group.RootPart.Shape.PCode == (byte)PCode.Prim) - { - group.ClearPartAttachmentData(); - } - - group.UpdateGroupRotationR(rot); - - //group.ApplyPhysics(m_physicalPrim); - if (group.RootPart.PhysActor != null && group.RootPart.PhysActor.IsPhysical && vel != Vector3.Zero) - { - group.RootPart.ApplyImpulse((vel * group.GetMass()), false); - group.Velocity = vel; - rootPart.ScheduleFullUpdate(); - } - group.CreateScriptInstances(param, true, DefaultScriptEngine, 2); - rootPart.ScheduleFullUpdate(); - - if (!Permissions.BypassPermissions()) - { - if ((item.CurrentPermissions & (uint)PermissionMask.Copy) == 0) - sourcePart.Inventory.RemoveInventoryItem(item.ItemID); - } - return rootPart.ParentGroup; - } + if ((item.CurrentPermissions & (uint)PermissionMask.Copy) == 0) + sourcePart.Inventory.RemoveInventoryItem(item.ItemID); } - - return null; + + AddNewSceneObject(group, true, pos, rot, vel); + + // We can only call this after adding the scene object, since the scene object references the scene + // to find out if scripts should be activated at all. + group.CreateScriptInstances(param, true, DefaultScriptEngine, 3); + + group.ScheduleGroupForFullUpdate(); + + return group; } - public virtual bool returnObjects(SceneObjectGroup[] returnobjects, UUID AgentId) + public virtual bool returnObjects(SceneObjectGroup[] returnobjects, + UUID AgentId) { + List localIDs = new List(); + foreach (SceneObjectGroup grp in returnobjects) { - AddReturn(grp.OwnerID, grp.Name, grp.AbsolutePosition, "parcel owner return"); - DeRezObject(null, grp.RootPart.LocalId, - grp.RootPart.GroupID, DeRezAction.Return, UUID.Zero); + AddReturn(grp.OwnerID, grp.Name, grp.AbsolutePosition, + "parcel owner return"); + localIDs.Add(grp.RootPart.LocalId); } + DeRezObjects(null, localIDs, UUID.Zero, DeRezAction.Return, + UUID.Zero); return true; } @@ -2137,7 +2109,9 @@ namespace OpenSim.Region.Framework.Scenes sog.SetGroup(groupID, remoteClient); sog.ScheduleGroupForFullUpdate(); - foreach (SceneObjectPart child in sog.Children.Values) + SceneObjectPart[] partList = sog.Parts; + + foreach (SceneObjectPart child in partList) child.Inventory.ChangeInventoryOwner(ownerID); } else @@ -2147,8 +2121,10 @@ namespace OpenSim.Region.Framework.Scenes if (sog.GroupID != groupID) continue; + + SceneObjectPart[] partList = sog.Parts; - foreach (SceneObjectPart child in sog.Children.Values) + foreach (SceneObjectPart child in partList) { child.LastOwnerID = child.OwnerID; child.Inventory.ChangeInventoryOwner(groupID); @@ -2157,7 +2133,6 @@ namespace OpenSim.Region.Framework.Scenes sog.SetOwnerId(groupID); sog.ApplyNextOwnerPermissions(); } - } foreach (uint localID in localIDs) @@ -2194,7 +2169,7 @@ namespace OpenSim.Region.Framework.Scenes if (root == null) { - m_log.DebugFormat("[LINK]: Can't find linkset root prim {0{", parentPrimId); + m_log.DebugFormat("[LINK]: Can't find linkset root prim {0}", parentPrimId); return; } diff --git a/OpenSim/Region/Framework/Scenes/Scene.PacketHandlers.cs b/OpenSim/Region/Framework/Scenes/Scene.PacketHandlers.cs index e25b1f1503..ab567fbcb0 100644 --- a/OpenSim/Region/Framework/Scenes/Scene.PacketHandlers.cs +++ b/OpenSim/Region/Framework/Scenes/Scene.PacketHandlers.cs @@ -116,9 +116,8 @@ namespace OpenSim.Region.Framework.Scenes /// public void RequestPrim(uint primLocalID, IClientAPI remoteClient) { - List EntityList = GetEntities(); - - foreach (EntityBase ent in EntityList) + EntityBase[] entityList = GetEntities(); + foreach (EntityBase ent in entityList) { if (ent is SceneObjectGroup) { @@ -138,9 +137,8 @@ namespace OpenSim.Region.Framework.Scenes /// public void SelectPrim(uint primLocalID, IClientAPI remoteClient) { - List EntityList = GetEntities(); - - foreach (EntityBase ent in EntityList) + EntityBase[] entityList = GetEntities(); + foreach (EntityBase ent in entityList) { if (ent is SceneObjectGroup) { @@ -156,21 +154,27 @@ namespace OpenSim.Region.Framework.Scenes } break; } - else - { - // We also need to check the children of this prim as they - // can be selected as well and send property information - bool foundPrim = false; - foreach (KeyValuePair child in ((SceneObjectGroup) ent).Children) - { - if (child.Value.LocalId == primLocalID) - { - child.Value.GetProperties(remoteClient); - foundPrim = true; - break; - } - } - if (foundPrim) break; + else + { + // We also need to check the children of this prim as they + // can be selected as well and send property information + bool foundPrim = false; + + SceneObjectGroup sog = ent as SceneObjectGroup; + + SceneObjectPart[] partList = sog.Parts; + foreach (SceneObjectPart part in partList) + { + if (part.LocalId == primLocalID) + { + part.GetProperties(remoteClient); + foundPrim = true; + break; + } + } + + if (foundPrim) + break; } } } @@ -250,7 +254,7 @@ namespace OpenSim.Region.Framework.Scenes public virtual void ProcessObjectGrab(uint localID, Vector3 offsetPos, IClientAPI remoteClient, List surfaceArgs) { - List EntityList = GetEntities(); + EntityBase[] EntityList = GetEntities(); SurfaceTouchEventArgs surfaceArg = null; if (surfaceArgs != null && surfaceArgs.Count > 0) @@ -294,7 +298,7 @@ namespace OpenSim.Region.Framework.Scenes public virtual void ProcessObjectGrabUpdate(UUID objectID, Vector3 offset, Vector3 pos, IClientAPI remoteClient, List surfaceArgs) { - List EntityList = GetEntities(); + EntityBase[] EntityList = GetEntities(); SurfaceTouchEventArgs surfaceArg = null; if (surfaceArgs != null && surfaceArgs.Count > 0) @@ -334,7 +338,7 @@ namespace OpenSim.Region.Framework.Scenes public virtual void ProcessObjectDeGrab(uint localID, IClientAPI remoteClient, List surfaceArgs) { - List EntityList = GetEntities(); + EntityBase[] EntityList = GetEntities(); SurfaceTouchEventArgs surfaceArg = null; if (surfaceArgs != null && surfaceArgs.Count > 0) @@ -458,22 +462,6 @@ namespace OpenSim.Region.Framework.Scenes ); } - public void HandleUUIDNameRequest(UUID uuid, IClientAPI remote_client) - { - if (LibraryService != null && (LibraryService.LibraryRootFolder.Owner == uuid)) - { - remote_client.SendNameReply(uuid, "Mr", "OpenSim"); - } - else - { - string[] names = GetUserNames(uuid); - if (names.Length == 2) - { - remote_client.SendNameReply(uuid, names[0], names[1]); - } - - } - } /// /// Handle a fetch inventory request from the client @@ -511,6 +499,9 @@ namespace OpenSim.Region.Framework.Scenes public void HandleFetchInventoryDescendents(IClientAPI remoteClient, UUID folderID, UUID ownerID, bool fetchFolders, bool fetchItems, int sortOrder) { + if (folderID == UUID.Zero) + return; + // FIXME MAYBE: We're not handling sortOrder! // TODO: This code for looking in the folder for the library should be folded somewhere else diff --git a/OpenSim/Region/Framework/Scenes/Scene.Permissions.cs b/OpenSim/Region/Framework/Scenes/Scene.Permissions.cs index 7dab04fbd2..d67638ad1f 100644 --- a/OpenSim/Region/Framework/Scenes/Scene.Permissions.cs +++ b/OpenSim/Region/Framework/Scenes/Scene.Permissions.cs @@ -1,4 +1,4 @@ -/* +/* * Copyright (c) Contributors, http://opensimulator.org/ * See CONTRIBUTORS.TXT for a full list of copyright holders. * @@ -27,13 +27,15 @@ using System; using System.Collections.Generic; +using System.Reflection; using System.Text; +using log4net; using OpenMetaverse; using OpenSim.Framework; using OpenSim.Region.Framework.Interfaces; namespace OpenSim.Region.Framework.Scenes -{ +{ #region Delegates public delegate uint GenerateClientFlagsHandler(UUID userID, UUID objectID); public delegate void SetBypassPermissionsHandler(bool value); @@ -64,6 +66,7 @@ namespace OpenSim.Region.Framework.Scenes public delegate bool RunConsoleCommandHandler(UUID user, Scene requestFromScene); public delegate bool IssueEstateCommandHandler(UUID user, Scene requestFromScene, bool ownerCommand); public delegate bool IsGodHandler(UUID user, Scene requestFromScene); + public delegate bool IsAdministratorHandler(UUID user); public delegate bool EditParcelHandler(UUID user, ILandObject parcel, Scene scene); public delegate bool SellParcelHandler(UUID user, ILandObject parcel, Scene scene); public delegate bool AbandonParcelHandler(UUID user, ILandObject parcel, Scene scene); @@ -81,10 +84,14 @@ namespace OpenSim.Region.Framework.Scenes public delegate bool CopyUserInventoryHandler(UUID itemID, UUID userID); public delegate bool DeleteUserInventoryHandler(UUID itemID, UUID userID); public delegate bool TeleportHandler(UUID userID, Scene scene); + public delegate bool ControlPrimMediaHandler(UUID userID, UUID primID, int face); + public delegate bool InteractWithPrimMediaHandler(UUID userID, UUID primID, int face); #endregion public class ScenePermissions { + private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); + private Scene m_scene; public ScenePermissions(Scene scene) @@ -122,6 +129,7 @@ namespace OpenSim.Region.Framework.Scenes public event RunConsoleCommandHandler OnRunConsoleCommand; public event IssueEstateCommandHandler OnIssueEstateCommand; public event IsGodHandler OnIsGod; + public event IsAdministratorHandler OnIsAdministrator; public event EditParcelHandler OnEditParcel; public event SellParcelHandler OnSellParcel; public event AbandonParcelHandler OnAbandonParcel; @@ -139,6 +147,8 @@ namespace OpenSim.Region.Framework.Scenes public event CopyUserInventoryHandler OnCopyUserInventory; public event DeleteUserInventoryHandler OnDeleteUserInventory; public event TeleportHandler OnTeleport; + public event ControlPrimMediaHandler OnControlPrimMedia; + public event InteractWithPrimMediaHandler OnInteractWithPrimMedia; #endregion #region Object Permission Checks @@ -236,6 +246,8 @@ namespace OpenSim.Region.Framework.Scenes #region DELETE OBJECT public bool CanDeleteObject(UUID objectID, UUID deleter) { + bool result = true; + DeleteObjectHandler handler = OnDeleteObject; if (handler != null) { @@ -243,10 +255,18 @@ namespace OpenSim.Region.Framework.Scenes foreach (DeleteObjectHandler h in list) { if (h(objectID, deleter, m_scene) == false) - return false; + { + result = false; + break; + } } } - return true; + +// m_log.DebugFormat( +// "[SCENE PERMISSIONS]: CanDeleteObject() fired for object {0}, deleter {1}, result {2}", +// objectID, deleter, result); + + return result; } #endregion @@ -254,6 +274,8 @@ namespace OpenSim.Region.Framework.Scenes #region TAKE OBJECT public bool CanTakeObject(UUID objectID, UUID AvatarTakingUUID) { + bool result = true; + TakeObjectHandler handler = OnTakeObject; if (handler != null) { @@ -261,10 +283,18 @@ namespace OpenSim.Region.Framework.Scenes foreach (TakeObjectHandler h in list) { if (h(objectID, AvatarTakingUUID, m_scene) == false) - return false; + { + result = false; + break; + } } } - return true; + +// m_log.DebugFormat( +// "[SCENE PERMISSIONS]: CanTakeObject() fired for object {0}, taker {1}, result {2}", +// objectID, AvatarTakingUUID, result); + + return result; } #endregion @@ -272,6 +302,8 @@ namespace OpenSim.Region.Framework.Scenes #region TAKE COPY OBJECT public bool CanTakeCopyObject(UUID objectID, UUID userID) { + bool result = true; + TakeCopyObjectHandler handler = OnTakeCopyObject; if (handler != null) { @@ -279,10 +311,18 @@ namespace OpenSim.Region.Framework.Scenes foreach (TakeCopyObjectHandler h in list) { if (h(objectID, userID, m_scene) == false) - return false; + { + result = false; + break; + } } } - return true; + +// m_log.DebugFormat( +// "[SCENE PERMISSIONS]: CanTakeCopyObject() fired for object {0}, user {1}, result {2}", +// objectID, userID, result); + + return result; } #endregion @@ -377,6 +417,8 @@ namespace OpenSim.Region.Framework.Scenes #region RETURN OBJECT public bool CanReturnObjects(ILandObject land, UUID user, List objects) { + bool result = true; + ReturnObjectsHandler handler = OnReturnObjects; if (handler != null) { @@ -384,10 +426,18 @@ namespace OpenSim.Region.Framework.Scenes foreach (ReturnObjectsHandler h in list) { if (h(land, user, objects, m_scene) == false) - return false; + { + result = false; + break; + } } } - return true; + +// m_log.DebugFormat( +// "[SCENE PERMISSIONS]: CanReturnObjects() fired for user {0} for {1} objects on {2}, result {3}", +// user, objects.Count, land.LandData.Name, result); + + return result; } #endregion @@ -652,6 +702,21 @@ namespace OpenSim.Region.Framework.Scenes } return true; } + + public bool IsAdministrator(UUID user) + { + IsAdministratorHandler handler = OnIsAdministrator; + if (handler != null) + { + Delegate[] list = handler.GetInvocationList(); + foreach (IsAdministratorHandler h in list) + { + if (h(user) == false) + return false; + } + } + return true; + } #endregion #region EDIT PARCEL @@ -947,5 +1012,35 @@ namespace OpenSim.Region.Framework.Scenes } return true; } + + public bool CanControlPrimMedia(UUID userID, UUID primID, int face) + { + ControlPrimMediaHandler handler = OnControlPrimMedia; + if (handler != null) + { + Delegate[] list = handler.GetInvocationList(); + foreach (ControlPrimMediaHandler h in list) + { + if (h(userID, primID, face) == false) + return false; + } + } + return true; + } + + public bool CanInteractWithPrimMedia(UUID userID, UUID primID, int face) + { + InteractWithPrimMediaHandler handler = OnInteractWithPrimMedia; + if (handler != null) + { + Delegate[] list = handler.GetInvocationList(); + foreach (InteractWithPrimMediaHandler h in list) + { + if (h(userID, primID, face) == false) + return false; + } + } + return true; + } } -} +} \ No newline at end of file diff --git a/OpenSim/Region/Framework/Scenes/Scene.cs b/OpenSim/Region/Framework/Scenes/Scene.cs index 2783269ca5..029549d7d4 100644 --- a/OpenSim/Region/Framework/Scenes/Scene.cs +++ b/OpenSim/Region/Framework/Scenes/Scene.cs @@ -42,7 +42,6 @@ using OpenMetaverse.Imaging; using OpenSim.Framework; using OpenSim.Services.Interfaces; using OpenSim.Framework.Communications; - using OpenSim.Framework.Console; using OpenSim.Region.Framework.Interfaces; using OpenSim.Region.Framework.Scenes.Scripting; @@ -58,55 +57,21 @@ namespace OpenSim.Region.Framework.Scenes public partial class Scene : SceneBase { - public delegate void SynchronizeSceneHandler(Scene scene); - public SynchronizeSceneHandler SynchronizeScene = null; - - /* Used by the loadbalancer plugin on GForge */ - protected int m_splitRegionID = 0; - public int SplitRegionID - { - get { return m_splitRegionID; } - set { m_splitRegionID = value; } - } - private const long DEFAULT_MIN_TIME_FOR_PERSISTENCE = 60L; private const long DEFAULT_MAX_TIME_FOR_PERSISTENCE = 600L; + public delegate void SynchronizeSceneHandler(Scene scene); + #region Fields - protected Timer m_restartWaitTimer = new Timer(); - + public SynchronizeSceneHandler SynchronizeScene; public SimStatsReporter StatsReporter; - - protected List m_regionRestartNotifyList = new List(); - protected List m_neighbours = new List(); - - private volatile int m_bordersLocked = 0; - public bool BordersLocked - { - get { return m_bordersLocked == 1; } - set - { - if (value == true) - m_bordersLocked = 1; - else - m_bordersLocked = 0; - } - } public List NorthBorders = new List(); public List EastBorders = new List(); public List SouthBorders = new List(); public List WestBorders = new List(); - /// - /// The scene graph for this scene - /// - /// TODO: Possibly stop other classes being able to manipulate this directly. - private SceneGraph m_sceneGraph; - - /// - /// Are we applying physics to any of the prims in this scene? - /// + /// Are we applying physics to any of the prims in this scene? public bool m_physicalPrim; public float m_maxNonphys = 256; public float m_maxPhys = 10; @@ -120,23 +85,131 @@ namespace OpenSim.Region.Framework.Scenes // root agents when ACL denies access to root agent public bool m_strictAccessControl = true; public int MaxUndoCount = 5; + public bool LoginsDisabled = true; + public bool LoadingPrims; + public IXfer XferManager; + + // the minimum time that must elapse before a changed object will be considered for persisted + public long m_dontPersistBefore = DEFAULT_MIN_TIME_FOR_PERSISTENCE * 10000000L; + // the maximum time that must elapse before a changed object will be considered for persisted + public long m_persistAfter = DEFAULT_MAX_TIME_FOR_PERSISTENCE * 10000000L; + + protected int m_splitRegionID; + protected Timer m_restartWaitTimer = new Timer(); + protected List m_regionRestartNotifyList = new List(); + protected List m_neighbours = new List(); + protected string m_simulatorVersion = "OpenSimulator Server"; + protected ModuleLoader m_moduleLoader; + protected AgentCircuitManager m_authenticateHandler; + protected SceneCommunicationService m_sceneGridService; + + protected ISimulationDataService m_SimulationDataService; + protected IEstateDataService m_EstateDataService; + protected IAssetService m_AssetService; + protected IAuthorizationService m_AuthorizationService; + protected IInventoryService m_InventoryService; + protected IGridService m_GridService; + protected ILibraryService m_LibraryService; + protected ISimulationService m_simulationService; + protected IAuthenticationService m_AuthenticationService; + protected IPresenceService m_PresenceService; + protected IUserAccountService m_UserAccountService; + protected IAvatarService m_AvatarService; + protected IGridUserService m_GridUserService; + + protected IXMLRPC m_xmlrpcModule; + protected IWorldComm m_worldCommModule; + protected IAvatarFactory m_AvatarFactory; + protected IConfigSource m_config; + protected IRegionSerialiserModule m_serialiser; + protected IDialogModule m_dialogModule; + protected IEntityTransferModule m_teleportModule; + protected ICapabilitiesModule m_capsModule; + // Central Update Loop + protected int m_fps = 10; + protected uint m_frame; + protected float m_timespan = 0.089f; + protected DateTime m_lastupdate = DateTime.UtcNow; + + // TODO: Possibly stop other classes being able to manipulate this directly. + private SceneGraph m_sceneGraph; + private volatile int m_bordersLocked; private int m_RestartTimerCounter; private readonly Timer m_restartTimer = new Timer(15000); // Wait before firing private int m_incrementsof15seconds; private volatile bool m_backingup; - private Dictionary m_returns = new Dictionary(); private Dictionary m_groupsWithTargets = new Dictionary(); + private Object m_heartbeatLock = new Object(); - protected string m_simulatorVersion = "OpenSimulator Server"; + private int m_update_physics = 1; + private int m_update_entitymovement = 1; + private int m_update_objects = 1; // Update objects which have scheduled themselves for updates + private int m_update_presences = 1; // Update scene presence movements + private int m_update_events = 1; + private int m_update_backup = 200; + private int m_update_terrain = 50; + private int m_update_land = 1; + private int m_update_coarse_locations = 50; - protected ModuleLoader m_moduleLoader; - protected StorageManager m_storageManager; - protected AgentCircuitManager m_authenticateHandler; + private int frameMS; + private int physicsMS2; + private int physicsMS; + private int otherMS; + private int tempOnRezMS; + private int eventMS; + private int backupMS; + private int terrainMS; + private int landMS; + private int lastCompletedFrame; - protected SceneCommunicationService m_sceneGridService; - public bool LoginsDisabled = true; + private bool m_physics_enabled = true; + private bool m_scripts_enabled = true; + private string m_defaultScriptEngine; + private int m_LastLogin; + private Thread HeartbeatThread; + private volatile bool shuttingdown; + private int m_lastUpdate; + private bool m_firstHeartbeat = true; + + private object m_deleting_scene_object = new object(); + private object m_cleaningAttachments = new object(); + + private UpdatePrioritizationSchemes m_priorityScheme = UpdatePrioritizationSchemes.Time; + private bool m_reprioritizationEnabled = true; + private double m_reprioritizationInterval = 5000.0; + private double m_rootReprioritizationDistance = 10.0; + private double m_childReprioritizationDistance = 20.0; + + private Timer m_mapGenerationTimer = new Timer(); + private bool m_generateMaptiles; + + private Dictionary m_UserNamesCache = new Dictionary(); + + #endregion Fields + + #region Properties + + /* Used by the loadbalancer plugin on GForge */ + public int SplitRegionID + { + get { return m_splitRegionID; } + set { m_splitRegionID = value; } + } + + public bool BordersLocked + { + get { return m_bordersLocked == 1; } + set + { + if (value == true) + m_bordersLocked = 1; + else + m_bordersLocked = 0; + } + } + public new float TimeDilation { get { return m_sceneGraph.PhysicsScene.TimeDilation; } @@ -147,12 +220,41 @@ namespace OpenSim.Region.Framework.Scenes get { return m_sceneGridService; } } - public IXfer XferManager; + public ISimulationDataService SimulationDataService + { + get + { + if (m_SimulationDataService == null) + { + m_SimulationDataService = RequestModuleInterface(); - protected IAssetService m_AssetService; - protected IAuthorizationService m_AuthorizationService; + if (m_SimulationDataService == null) + { + throw new Exception("No ISimulationDataService available."); + } + } - private Object m_heartbeatLock = new Object(); + return m_SimulationDataService; + } + } + + public IEstateDataService EstateDataService + { + get + { + if (m_EstateDataService == null) + { + m_EstateDataService = RequestModuleInterface(); + + if (m_EstateDataService == null) + { + throw new Exception("No IEstateDataService available."); + } + } + + return m_EstateDataService; + } + } public IAssetService AssetService { @@ -191,8 +293,6 @@ namespace OpenSim.Region.Framework.Scenes } } - protected IInventoryService m_InventoryService; - public IInventoryService InventoryService { get @@ -211,8 +311,6 @@ namespace OpenSim.Region.Framework.Scenes } } - protected IGridService m_GridService; - public IGridService GridService { get @@ -231,8 +329,6 @@ namespace OpenSim.Region.Framework.Scenes } } - protected ILibraryService m_LibraryService; - public ILibraryService LibraryService { get @@ -244,7 +340,6 @@ namespace OpenSim.Region.Framework.Scenes } } - protected ISimulationService m_simulationService; public ISimulationService SimulationService { get @@ -255,7 +350,6 @@ namespace OpenSim.Region.Framework.Scenes } } - protected IAuthenticationService m_AuthenticationService; public IAuthenticationService AuthenticationService { get @@ -266,7 +360,6 @@ namespace OpenSim.Region.Framework.Scenes } } - protected IPresenceService m_PresenceService; public IPresenceService PresenceService { get @@ -276,7 +369,7 @@ namespace OpenSim.Region.Framework.Scenes return m_PresenceService; } } - protected IUserAccountService m_UserAccountService; + public IUserAccountService UserAccountService { get @@ -287,8 +380,7 @@ namespace OpenSim.Region.Framework.Scenes } } - protected OpenSim.Services.Interfaces.IAvatarService m_AvatarService; - public OpenSim.Services.Interfaces.IAvatarService AvatarService + public IAvatarService AvatarService { get { @@ -298,7 +390,6 @@ namespace OpenSim.Region.Framework.Scenes } } - protected IGridUserService m_GridUserService; public IGridUserService GridUserService { get @@ -309,19 +400,12 @@ namespace OpenSim.Region.Framework.Scenes } } - protected IXMLRPC m_xmlrpcModule; - protected IWorldComm m_worldCommModule; public IAttachmentsModule AttachmentsModule { get; set; } - protected IAvatarFactory m_AvatarFactory; + public IAvatarFactory AvatarFactory { get { return m_AvatarFactory; } } - protected IConfigSource m_config; - protected IRegionSerialiserModule m_serialiser; - protected IDialogModule m_dialogModule; - protected IEntityTransferModule m_teleportModule; - #region REGION SYNC protected IRegionSyncServerModule m_regionSyncServerModule; protected IRegionSyncClientModule m_regionSyncClientModule; @@ -462,7 +546,7 @@ namespace OpenSim.Region.Framework.Scenes GridRegion regionInfo = GridService.GetRegionByName(UUID.Zero, regionName); //TODO: need to load objects from the specified space - List PrimsFromDB = m_storageManager.DataStore.LoadObjectsInGivenSpace(regionInfo.RegionID, minX, minY, maxX, maxY); + List PrimsFromDB = m_SimulationDataService.LoadObjectsInGivenSpace(regionInfo.RegionID, minX, minY, maxX, maxY); m_log.Info("[SCENE]: Loaded " + PrimsFromDB.Count + " objects from the datastore"); @@ -471,7 +555,7 @@ namespace OpenSim.Region.Framework.Scenes if (group.RootPart == null) { m_log.ErrorFormat("[SCENE] Found a SceneObjectGroup with m_rootPart == null and {0} children", - group.Children == null ? 0 : group.Children.Count); + group.Parts == null ? 0 : group.Parts.Length); } AddRestoredSceneObject(group, true, true); @@ -490,46 +574,11 @@ namespace OpenSim.Region.Framework.Scenes // } #endregion - - protected ICapabilitiesModule m_capsModule; public ICapabilitiesModule CapsModule { get { return m_capsModule; } } - protected override IConfigSource GetConfig() - { - return m_config; - } - - // Central Update Loop - - protected int m_fps = 10; - protected uint m_frame; - protected float m_timespan = 0.089f; - protected DateTime m_lastupdate = DateTime.UtcNow; - - private int m_update_physics = 1; - private int m_update_entitymovement = 1; - private int m_update_objects = 1; // Update objects which have scheduled themselves for updates - private int m_update_presences = 1; // Update scene presence movements - private int m_update_events = 1; - private int m_update_backup = 200; - private int m_update_terrain = 50; - private int m_update_land = 1; - private int m_update_coarse_locations = 50; - - private int frameMS; - private int physicsMS2; - private int physicsMS; - private int otherMS; - private int tempOnRezMS; - private int eventMS; - private int backupMS; - private int terrainMS; - private int landMS; - private int lastCompletedFrame; - public int MonitorFrameTime { get { return frameMS; } } public int MonitorPhysicsUpdateTime { get { return physicsMS; } } public int MonitorPhysicsSyncTime { get { return physicsMS2; } } @@ -541,33 +590,6 @@ namespace OpenSim.Region.Framework.Scenes public int MonitorLandTime { get { return landMS; } } public int MonitorLastFrameTick { get { return lastCompletedFrame; } } - private bool m_physics_enabled = true; - private bool m_scripts_enabled = true; - private string m_defaultScriptEngine; - private int m_LastLogin; - private Thread HeartbeatThread; - private volatile bool shuttingdown; - - private int m_lastUpdate; - private bool m_firstHeartbeat = true; - - private object m_deleting_scene_object = new object(); - - // the minimum time that must elapse before a changed object will be considered for persisted - public long m_dontPersistBefore = DEFAULT_MIN_TIME_FOR_PERSISTENCE * 10000000L; - // the maximum time that must elapse before a changed object will be considered for persisted - public long m_persistAfter = DEFAULT_MAX_TIME_FOR_PERSISTENCE * 10000000L; - - private UpdatePrioritizationSchemes m_priorityScheme = UpdatePrioritizationSchemes.Time; - private bool m_reprioritizationEnabled = true; - private double m_reprioritizationInterval = 5000.0; - private double m_rootReprioritizationDistance = 10.0; - private double m_childReprioritizationDistance = 20.0; - - #endregion - - #region Properties - public UpdatePrioritizationSchemes UpdatePrioritizationScheme { get { return m_priorityScheme; } } public bool IsReprioritizationEnabled { get { return m_reprioritizationEnabled; } } public double ReprioritizationInterval { get { return m_reprioritizationInterval; } } @@ -647,80 +669,13 @@ namespace OpenSim.Region.Framework.Scenes set { m_sceneGraph.RestorePresences = value; } } - #endregion - - #region BinaryStats - - public class StatLogger - { - public DateTime StartTime; - public string Path; - public System.IO.BinaryWriter Log; - } - static StatLogger m_statLog = null; - static TimeSpan m_statLogPeriod = TimeSpan.FromSeconds(300); - static string m_statsDir = String.Empty; - static Object m_statLockObject = new Object(); - private void LogSimStats(SimStats stats) - { - SimStatsPacket pack = new SimStatsPacket(); - pack.Region = new SimStatsPacket.RegionBlock(); - pack.Region.RegionX = stats.RegionX; - pack.Region.RegionY = stats.RegionY; - pack.Region.RegionFlags = stats.RegionFlags; - pack.Region.ObjectCapacity = stats.ObjectCapacity; - //pack.Region = //stats.RegionBlock; - pack.Stat = stats.StatsBlock; - pack.Header.Reliable = false; - - // note that we are inside the reporter lock when called - DateTime now = DateTime.Now; - - // hide some time information into the packet - pack.Header.Sequence = (uint)now.Ticks; - - lock (m_statLockObject) // m_statLog is shared so make sure there is only executer here - { - try - { - if (m_statLog == null || now > m_statLog.StartTime + m_statLogPeriod) - { - // First log file or time has expired, start writing to a new log file - if (m_statLog != null && m_statLog.Log != null) - { - m_statLog.Log.Close(); - } - m_statLog = new StatLogger(); - m_statLog.StartTime = now; - m_statLog.Path = (m_statsDir.Length > 0 ? m_statsDir + System.IO.Path.DirectorySeparatorChar.ToString() : "") - + String.Format("stats-{0}.log", now.ToString("yyyyMMddHHmmss")); - m_statLog.Log = new BinaryWriter(File.Open(m_statLog.Path, FileMode.Append, FileAccess.Write)); - } - - // Write the serialized data to disk - if (m_statLog != null && m_statLog.Log != null) - m_statLog.Log.Write(pack.ToBytes()); - } - catch (Exception ex) - { - m_log.Error("statistics gathering failed: " + ex.Message, ex); - if (m_statLog != null && m_statLog.Log != null) - { - m_statLog.Log.Close(); - } - m_statLog = null; - } - } - return; - } - - #endregion + #endregion Properties #region Constructors public Scene(RegionInfo regInfo, AgentCircuitManager authen, SceneCommunicationService sceneGridService, - StorageManager storeManager, + ISimulationDataService simDataService, IEstateDataService estateDataService, ModuleLoader moduleLoader, bool dumpAssetsToFile, bool physicalPrim, bool SeeIntoRegionFromNeighbor, IConfigSource config, string simulatorVersion) { @@ -756,7 +711,8 @@ namespace OpenSim.Region.Framework.Scenes m_moduleLoader = moduleLoader; m_authenticateHandler = authen; m_sceneGridService = sceneGridService; - m_storageManager = storeManager; + m_SimulationDataService = simDataService; + m_EstateDataService = estateDataService; m_regInfo = regInfo; m_regionHandle = m_regInfo.RegionHandle; m_regionName = m_regInfo.RegionName; @@ -775,50 +731,9 @@ namespace OpenSim.Region.Framework.Scenes #region Region Settings // Load region settings - m_regInfo.RegionSettings = m_storageManager.DataStore.LoadRegionSettings(m_regInfo.RegionID); - if (m_storageManager.EstateDataStore != null) - { - m_regInfo.EstateSettings = m_storageManager.EstateDataStore.LoadEstateSettings(m_regInfo.RegionID, false); - if (m_regInfo.EstateSettings.EstateID == 0) // No record at all - { - MainConsole.Instance.Output("Your region is not part of an estate."); - while (true) - { - string response = MainConsole.Instance.CmdPrompt("Do you wish to join an existing estate?", "no", new List() {"yes", "no"}); - if (response == "no") - { - // Create a new estate - m_regInfo.EstateSettings = m_storageManager.EstateDataStore.LoadEstateSettings(m_regInfo.RegionID, true); - - m_regInfo.EstateSettings.EstateName = MainConsole.Instance.CmdPrompt("New estate name", m_regInfo.EstateSettings.EstateName); - m_regInfo.EstateSettings.Save(); - break; - } - else - { - response = MainConsole.Instance.CmdPrompt("Estate name to join", "None"); - if (response == "None") - continue; - - List estateIDs = m_storageManager.EstateDataStore.GetEstates(response); - if (estateIDs.Count < 1) - { - MainConsole.Instance.Output("The name you have entered matches no known estate. Please try again"); - continue; - } - - int estateID = estateIDs[0]; - - m_regInfo.EstateSettings = m_storageManager.EstateDataStore.LoadEstateSettings(estateID); - - if (m_storageManager.EstateDataStore.LinkRegion(m_regInfo.RegionID, estateID)) - break; - - MainConsole.Instance.Output("Joining the estate failed. Please try again."); - } - } - } - } + m_regInfo.RegionSettings = simDataService.LoadRegionSettings(m_regInfo.RegionID); + if (estateDataService != null) + m_regInfo.EstateSettings = estateDataService.LoadEstateSettings(m_regInfo.RegionID, false); #endregion Region Settings @@ -828,9 +743,9 @@ namespace OpenSim.Region.Framework.Scenes //Bind Storage Manager functions to some land manager functions for this scene EventManager.OnLandObjectAdded += - new EventManager.LandObjectAdded(m_storageManager.DataStore.StoreLandObject); + new EventManager.LandObjectAdded(simDataService.StoreLandObject); EventManager.OnLandObjectRemoved += - new EventManager.LandObjectRemoved(m_storageManager.DataStore.RemoveLandObject); + new EventManager.LandObjectRemoved(simDataService.RemoveLandObject); m_sceneGraph = new SceneGraph(this, m_regInfo); @@ -854,8 +769,6 @@ namespace OpenSim.Region.Framework.Scenes StatsReporter.OnSendStatsResult += SendSimStatsPackets; StatsReporter.OnStatsIncorrect += m_sceneGraph.RecalculateStats; - StatsReporter.SetObjectCapacity(RegionInfo.ObjectCapacity); - // Old /* m_simulatorVersion = simulatorVersion @@ -926,37 +839,28 @@ namespace OpenSim.Region.Framework.Scenes m_strictAccessControl = startupConfig.GetBoolean("StrictAccessControl", m_strictAccessControl); - #region BinaryStats - - try + m_generateMaptiles = startupConfig.GetBoolean("GenerateMaptiles", true); + if (m_generateMaptiles) { - IConfig statConfig = m_config.Configs["Statistics.Binary"]; - if (statConfig.Contains("enabled") && statConfig.GetBoolean("enabled")) + int maptileRefresh = startupConfig.GetInt("MaptileRefresh", 0); + if (maptileRefresh != 0) { - if (statConfig.Contains("collect_region_stats")) - { - if (statConfig.GetBoolean("collect_region_stats")) - { - // if enabled, add us to the event. If not enabled, I won't get called - StatsReporter.OnSendStatsResult += LogSimStats; - } - } - if (statConfig.Contains("region_stats_period_seconds")) - { - m_statLogPeriod = TimeSpan.FromSeconds(statConfig.GetInt("region_stats_period_seconds")); - } - if (statConfig.Contains("stats_dir")) - { - m_statsDir = statConfig.GetString("stats_dir"); - } + m_mapGenerationTimer.Interval = maptileRefresh * 1000; + m_mapGenerationTimer.Elapsed += RegenerateMaptile; + m_mapGenerationTimer.AutoReset = true; + m_mapGenerationTimer.Start(); } } - catch + else { - // if it doesn't work, we don't collect anything - } + string tile = startupConfig.GetString("MaptileStaticUUID", UUID.Zero.ToString()); + UUID tileID; - #endregion BinaryStats + if (UUID.TryParse(tile, out tileID)) + { + RegionInfo.RegionSettings.TerrainImageID = tileID; + } + } } catch { @@ -1062,36 +966,6 @@ namespace OpenSim.Region.Framework.Scenes return m_simulatorVersion; } - public string[] GetUserNames(UUID uuid) - { - string[] returnstring = new string[0]; - - UserAccount account = UserAccountService.GetUserAccount(RegionInfo.ScopeID, uuid); - - if (account != null) - { - returnstring = new string[2]; - returnstring[0] = account.FirstName; - returnstring[1] = account.LastName; - } - - return returnstring; - } - - public string GetUserName(UUID uuid) - { - string[] names = GetUserNames(uuid); - if (names.Length == 2) - { - string firstname = names[0]; - string lastname = names[1]; - - return firstname + " " + lastname; - - } - return "(hippos)"; - } - /// /// Another region is up. /// @@ -1315,29 +1189,30 @@ namespace OpenSim.Region.Framework.Scenes if (ScriptEngine) { m_log.Info("Stopping all Scripts in Scene"); - foreach (EntityBase ent in Entities) + + EntityBase[] entities = Entities.GetEntities(); + foreach (EntityBase ent in entities) { if (ent is SceneObjectGroup) - { - ((SceneObjectGroup) ent).RemoveScriptInstances(false); - } + ((SceneObjectGroup)ent).RemoveScriptInstances(false); } } else { m_log.Info("Starting all Scripts in Scene"); - lock (Entities) + + EntityBase[] entities = Entities.GetEntities(); + foreach (EntityBase ent in entities) { - foreach (EntityBase ent in Entities) + if (ent is SceneObjectGroup) { - if (ent is SceneObjectGroup) - { - ((SceneObjectGroup)ent).CreateScriptInstances(0, false, DefaultScriptEngine, 0); - ((SceneObjectGroup)ent).ResumeScripts(); - } + SceneObjectGroup sog = (SceneObjectGroup)ent; + sog.CreateScriptInstances(0, false, DefaultScriptEngine, 0); + sog.ResumeScripts(); } } } + m_scripts_enabled = !ScriptEngine; m_log.Info("[TOTEDD]: Here is the method to trigger disabling of the scripting engine"); } @@ -1384,12 +1259,12 @@ namespace OpenSim.Region.Framework.Scenes shuttingdown = true; m_log.Debug("[SCENE]: Persisting changed objects"); - List entities = GetEntities(); + EntityBase[] entities = GetEntities(); foreach (EntityBase entity in entities) { if (!entity.IsDeleted && entity is SceneObjectGroup && ((SceneObjectGroup)entity).HasGroupChanged) { - ((SceneObjectGroup)entity).ProcessBackup(m_storageManager.DataStore, false); + ((SceneObjectGroup)entity).ProcessBackup(SimulationDataService, false); } } @@ -1449,9 +1324,9 @@ namespace OpenSim.Region.Framework.Scenes while (m_regInfo.EstateSettings.EstateOwner == UUID.Zero && MainConsole.Instance != null) { MainConsole.Instance.Output("The current estate has no owner set."); - string first = "Test";// MainConsole.Instance.CmdPrompt("Estate owner first name", "Test"); - string last = "User";// MainConsole.Instance.CmdPrompt("Estate owner last name", "User"); - MainConsole.Instance.Output(String.Format("Setting estate owner to {0} {1}.", first, last)); + List excluded = new List(new char[1]{' '}); + string first = MainConsole.Instance.CmdPrompt("Estate owner first name", "Test", excluded); + string last = MainConsole.Instance.CmdPrompt("Estate owner last name", "User", excluded); UserAccount account = UserAccountService.GetUserAccount(m_regInfo.ScopeID, first, last); @@ -1513,7 +1388,7 @@ namespace OpenSim.Region.Framework.Scenes m_regInfo.EstateSettings.Save(); } else - m_log.ErrorFormat("[SCENE]: Unable to store account. If this simulator is connected to a grid,\n you must create the estate owner account first."); + m_log.ErrorFormat("[SCENE]: Unable to store account. If this simulator is connected to a grid, you must create the estate owner account first."); } else { @@ -1593,6 +1468,7 @@ namespace OpenSim.Region.Framework.Scenes // This will get fixed later to only send to locally logged in presences rather than all presences // but requires pulling apart the concept of a client from the concept of a presence/avatar if (IsSyncedClient()) + { ForEachScenePresence(delegate(ScenePresence sp) { sp.SendPrimUpdates(); }); if(m_frame % 20 == 0) @@ -1660,6 +1536,8 @@ namespace OpenSim.Region.Framework.Scenes m_sceneGraph.UpdateScenePresenceMovement(); } + // Perform the main physics update. This will do the actual work of moving objects and avatars according to their + // velocity int tmpPhysicsMS = Util.EnvironmentTickCount(); // Do not simulate physics locally if this is a synced client //if (!IsSyncedClient()) @@ -1913,18 +1791,22 @@ namespace OpenSim.Region.Framework.Scenes /// private void BackupWaitCallback(object o) { - Backup(); + Backup(false); } - + /// /// Backup the scene. This acts as the main method of the backup thread. /// + /// + /// If true, then any changes that have not yet been persisted are persisted. If false, + /// then the persistence decision is left to the backup code (in some situations, such as object persistence, + /// it's much more efficient to backup multiple changes at once rather than every single one). /// - public void Backup() + public void Backup(bool forced) { lock (m_returns) { - EventManager.TriggerOnBackup(m_storageManager.DataStore); + EventManager.TriggerOnBackup(SimulationDataService, forced); m_backingup = false; foreach (KeyValuePair ret in m_returns) @@ -1965,7 +1847,7 @@ namespace OpenSim.Region.Framework.Scenes { if (group != null) { - group.ProcessBackup(m_storageManager.DataStore, true); + group.ProcessBackup(SimulationDataService, true); } } @@ -2007,19 +1889,19 @@ namespace OpenSim.Region.Framework.Scenes /// public void SaveTerrain() { - m_storageManager.DataStore.StoreTerrain(Heightmap.GetDoubles(), RegionInfo.RegionID); + SimulationDataService.StoreTerrain(Heightmap.GetDoubles(), RegionInfo.RegionID); } public void StoreWindlightProfile(RegionLightShareData wl) { m_regInfo.WindlightSettings = wl; - m_storageManager.DataStore.StoreRegionWindlightSettings(wl); + SimulationDataService.StoreRegionWindlightSettings(wl); m_eventManager.TriggerOnSaveNewWindlightProfile(); } public void LoadWindlightProfile() { - m_regInfo.WindlightSettings = m_storageManager.DataStore.LoadRegionWindlightSettings(RegionInfo.RegionID); + m_regInfo.WindlightSettings = SimulationDataService.LoadRegionWindlightSettings(RegionInfo.RegionID); m_eventManager.TriggerOnSaveNewWindlightProfile(); } @@ -2030,13 +1912,13 @@ namespace OpenSim.Region.Framework.Scenes { try { - double[,] map = m_storageManager.DataStore.LoadTerrain(RegionInfo.RegionID); + double[,] map = SimulationDataService.LoadTerrain(RegionInfo.RegionID); if (map == null) { m_log.Info("[TERRAIN]: No default terrain. Generating a new terrain."); Heightmap = new TerrainChannel(); - m_storageManager.DataStore.StoreTerrain(Heightmap.GetDoubles(), RegionInfo.RegionID); + SimulationDataService.StoreTerrain(Heightmap.GetDoubles(), RegionInfo.RegionID); } else { @@ -2053,7 +1935,7 @@ namespace OpenSim.Region.Framework.Scenes { Heightmap = new TerrainChannel(); - m_storageManager.DataStore.StoreTerrain(Heightmap.GetDoubles(), RegionInfo.RegionID); + SimulationDataService.StoreTerrain(Heightmap.GetDoubles(), RegionInfo.RegionID); } } catch (Exception e) @@ -2077,42 +1959,20 @@ namespace OpenSim.Region.Framework.Scenes m_sceneGridService.SetScene(this); - // These two 'commands' *must be* next to each other or sim rebooting fails. - //m_sceneGridService.RegisterRegion(m_interregionCommsOut, RegionInfo); - - GridRegion region = new GridRegion(RegionInfo); - string error = GridService.RegisterRegion(RegionInfo.ScopeID, region); - if (error != String.Empty) + // If we generate maptiles internally at all, the maptile generator + // will register the region. If not, do it here + if (m_generateMaptiles) { - throw new Exception(error); + RegenerateMaptile(null, null); } - - } - - /// - /// Create a terrain texture for this scene - /// - public void CreateTerrainTexture() - { - //create a texture asset of the terrain - IMapImageGenerator terrain = RequestModuleInterface(); - - // Cannot create a map for a nonexistant heightmap yet. - if (Heightmap == null) - return; - - if (terrain == null) - return; - - byte[] data = terrain.WriteJpeg2000Image("defaultstripe.png"); - if (data != null) + else { - IWorldMapModule mapModule = RequestModuleInterface(); - - if (mapModule != null) - mapModule.RegenerateMaptile(data); - else - m_log.DebugFormat("[SCENE]: MapModule is null, can't save maptile"); + GridRegion region = new GridRegion(RegionInfo); + string error = GridService.RegisterRegion(RegionInfo.ScopeID, region); + if (error != String.Empty) + { + throw new Exception(error); + } } } @@ -2127,7 +1987,7 @@ namespace OpenSim.Region.Framework.Scenes public void loadAllLandObjectsFromStorage(UUID regionID) { m_log.Info("[SCENE]: Loading land objects from storage"); - List landData = m_storageManager.DataStore.LoadLandObjects(regionID); + List landData = SimulationDataService.LoadLandObjects(regionID); if (LandChannel != null) { @@ -2155,29 +2015,34 @@ namespace OpenSim.Region.Framework.Scenes /// public virtual void LoadPrimsFromStorage(UUID regionID) { + LoadingPrims = true; m_log.Info("[SCENE]: Loading objects from datastore"); - List PrimsFromDB = m_storageManager.DataStore.LoadObjects(regionID); + List PrimsFromDB = SimulationDataService.LoadObjects(regionID); m_log.Info("[SCENE]: Loaded " + PrimsFromDB.Count + " objects from the datastore"); foreach (SceneObjectGroup group in PrimsFromDB) { + EventManager.TriggerOnSceneObjectLoaded(group); + if (group.RootPart == null) { - m_log.ErrorFormat("[SCENE] Found a SceneObjectGroup with m_rootPart == null and {0} children", - group.Children == null ? 0 : group.Children.Count); + m_log.ErrorFormat( + "[SCENE]: Found a SceneObjectGroup with m_rootPart == null and {0} children", + group.Parts == null ? 0 : group.PrimCount); } AddRestoredSceneObject(group, true, true); SceneObjectPart rootPart = group.GetChildPart(group.UUID); - rootPart.ObjectFlags &= ~(uint)PrimFlags.Scripted; + rootPart.Flags &= ~PrimFlags.Scripted; rootPart.TrimPermissions(); group.CheckSculptAndLoad(); //rootPart.DoPhysicsPropertyUpdate(UsePhysics, true); } m_log.Info("[SCENE]: Loaded " + PrimsFromDB.Count.ToString() + " SceneObject(s)"); + LoadingPrims = false; } @@ -2336,7 +2201,7 @@ namespace OpenSim.Region.Framework.Scenes sceneObject.ScheduleGroupForFullUpdate(); return sceneObject; - } + } /// /// Add an object into the scene that has come from storage @@ -2415,6 +2280,23 @@ namespace OpenSim.Region.Framework.Scenes { return m_sceneGraph.AddNewSceneObject(sceneObject, attachToBackup, sendClientUpdates); } + + /// + /// Add a newly created object to the scene. + /// + /// + /// This method does not send updates to the client - callers need to handle this themselves. + /// + /// + /// Position of the object + /// Rotation of the object + /// Velocity of the object. This parameter only has an effect if the object is physical + /// + public bool AddNewSceneObject( + SceneObjectGroup sceneObject, bool attachToBackup, Vector3 pos, Quaternion rot, Vector3 vel) + { + return m_sceneGraph.AddNewSceneObject(sceneObject, attachToBackup, pos, rot, vel); + } /// /// Delete every object from the scene. This does not include attachments worn by avatars. @@ -2423,8 +2305,7 @@ namespace OpenSim.Region.Framework.Scenes { lock (Entities) { - ICollection entities = new List(Entities); - + EntityBase[] entities = Entities.GetEntities(); foreach (EntityBase e in entities) { if (e is SceneObjectGroup) @@ -2455,9 +2336,11 @@ namespace OpenSim.Region.Framework.Scenes group.RemoveScriptInstances(true); } - foreach (SceneObjectPart part in group.Children.Values) + SceneObjectPart[] partList = group.Parts; + + foreach (SceneObjectPart part in partList) { - if (part.IsJoint() && ((part.ObjectFlags&(uint)PrimFlags.Physics) != 0)) + if (part.IsJoint() && ((part.Flags & PrimFlags.Physics) != 0)) { PhysicsScene.RequestJointDeletion(part.Name); // FIXME: what if the name changed? } @@ -2467,19 +2350,20 @@ namespace OpenSim.Region.Framework.Scenes part.PhysActor = null; } } + // if (rootPart.PhysActor != null) // { // PhysicsScene.RemovePrim(rootPart.PhysActor); // rootPart.PhysActor = null; // } - if (UnlinkSceneObject(group.UUID, false)) + if (UnlinkSceneObject(group, false)) { EventManager.TriggerObjectBeingRemovedFromScene(group); EventManager.TriggerParcelPrimCountTainted(); } - group.DeleteGroup(silent); + group.DeleteGroupFromScene(silent); // m_log.DebugFormat("[SCENE]: Exit DeleteSceneObject() for {0} {1}", group.Name, group.UUID); } @@ -2488,18 +2372,25 @@ namespace OpenSim.Region.Framework.Scenes /// Unlink the given object from the scene. Unlike delete, this just removes the record of the object - the /// object itself is not destroyed. /// - /// Id of object. + /// The scene object. + /// If true, only deletes from scene, but keeps the object in the database. /// true if the object was in the scene, false if it was not - /// If true, only deletes from scene, but keeps object in database. - public bool UnlinkSceneObject(UUID uuid, bool softDelete) + public bool UnlinkSceneObject(SceneObjectGroup so, bool softDelete) { - if (m_sceneGraph.DeleteSceneObject(uuid, softDelete)) + if (m_sceneGraph.DeleteSceneObject(so.UUID, softDelete)) { if (!softDelete) { - m_storageManager.DataStore.RemoveObject(uuid, - m_regInfo.RegionID); + // Force a database update so that the scene object group ID is accurate. It's possible that the + // group has recently been delinked from another group but that this change has not been persisted + // to the DB. + ForceSceneObjectBackup(so); + so.DetachFromBackup(); + SimulationDataService.RemoveObject(so.UUID, m_regInfo.RegionID); } + + // We need to keep track of this state in case this group is still queued for further backup. + so.IsDeleted = true; return true; } @@ -2530,7 +2421,7 @@ namespace OpenSim.Region.Framework.Scenes } catch (Exception) { - m_log.Warn("[DATABASE]: exception when trying to remove the prim that crossed the border."); + m_log.Warn("[SCENE]: exception when trying to remove the prim that crossed the border."); } return; } @@ -2547,7 +2438,7 @@ namespace OpenSim.Region.Framework.Scenes } catch (Exception) { - m_log.Warn("[DATABASE]: exception when trying to return the prim that crossed the border."); + m_log.Warn("[SCENE]: exception when trying to return the prim that crossed the border."); } return; } @@ -2751,7 +2642,7 @@ namespace OpenSim.Region.Framework.Scenes } catch (Exception e) { - m_log.WarnFormat("[SCENE]: Problem casting object: {0}", e.Message); + m_log.WarnFormat("[SCENE]: Problem casting object: " + e.ToString()); return false; } @@ -2761,7 +2652,7 @@ namespace OpenSim.Region.Framework.Scenes return false; } - newObject.RootPart.ParentGroup.CreateScriptInstances(0, false, DefaultScriptEngine, 1); + newObject.RootPart.ParentGroup.CreateScriptInstances(0, false, DefaultScriptEngine, 2); newObject.ResumeScripts(); @@ -2786,7 +2677,7 @@ namespace OpenSim.Region.Framework.Scenes ScenePresence sp = GetScenePresence(userID); if (sp != null && AttachmentsModule != null) { - uint attPt = (uint)sp.Appearance.GetAttachpoint(itemID); + uint attPt = (uint)sp.Appearance.GetAttachpoint(itemID); AttachmentsModule.RezSingleAttachmentFromInventory(sp.ControllingClient, itemID, attPt); } @@ -2817,17 +2708,17 @@ namespace OpenSim.Region.Framework.Scenes // Force allocation of new LocalId // - foreach (SceneObjectPart p in sceneObject.Children.Values) - p.LocalId = 0; + SceneObjectPart[] parts = sceneObject.Parts; + for (int i = 0; i < parts.Length; i++) + parts[i].LocalId = 0; if (sceneObject.IsAttachmentCheckFull()) // Attachment { sceneObject.RootPart.AddFlag(PrimFlags.TemporaryOnRez); sceneObject.RootPart.AddFlag(PrimFlags.Phantom); - // Don't sent a full update here because this will cause full updates to be sent twice for - // attachments on region crossings, resulting in viewer glitches. + // attachments on region crossings, resulting in viewer glitches. AddRestoredSceneObject(sceneObject, false, false, false); // Handle attachment special case @@ -2838,7 +2729,6 @@ namespace OpenSim.Region.Framework.Scenes if (sp != null) { - SceneObjectGroup grp = sceneObject; m_log.DebugFormat( @@ -2850,7 +2740,6 @@ namespace OpenSim.Region.Framework.Scenes if (AttachmentsModule != null) AttachmentsModule.AttachObject(sp.ControllingClient, grp, 0, false); - } else { @@ -2914,19 +2803,25 @@ namespace OpenSim.Region.Framework.Scenes public void AddNewClient2(IClientAPI client, bool managed) { + AgentCircuitData aCircuit = m_authenticateHandler.GetAgentCircuitData(client.CircuitCode); bool vialogin = false; - if(managed) - m_clientManager.Add(client); + if (aCircuit == null) // no good, didn't pass NewUserConnection successfully + return; + + vialogin = (aCircuit.teleportFlags & (uint)Constants.TeleportFlags.ViaHGLogin) != 0 || + (aCircuit.teleportFlags & (uint)Constants.TeleportFlags.ViaLogin) != 0; CheckHeartbeat(); - SubscribeToClientEvents(client); ScenePresence presence; if (m_restorePresences.ContainsKey(client.AgentId)) { m_log.DebugFormat("[SCENE]: Restoring agent {0} {1} in {2}", client.Name, client.AgentId, RegionInfo.RegionName); + m_clientManager.Add(client); + SubscribeToClientEvents(client); + presence = m_restorePresences[client.AgentId]; m_restorePresences.Remove(client.AgentId); @@ -2940,7 +2835,8 @@ namespace OpenSim.Region.Framework.Scenes // REGION SYNC // The owner is not being set properly when there is no circuit. Hmmm - presence.Appearance.Owner = presence.UUID; + // Commenting this out for the merge from master. Might still need it since we have no circuit on scene + // presence.Appearance.Owner = presence.UUID; presence.initializeScenePresence(client, RegionInfo, this); @@ -2953,50 +2849,35 @@ namespace OpenSim.Region.Framework.Scenes } else { - AgentCircuitData aCircuit = m_authenticateHandler.GetAgentCircuitData(client.CircuitCode); - - // Do the verification here - System.Net.IPEndPoint ep = (System.Net.IPEndPoint)client.GetClientEP(); - if (aCircuit != null) + if (GetScenePresence(client.AgentId) == null) // ensure there is no SP here { - if (!VerifyClient(aCircuit, ep, out vialogin)) + m_log.Debug("[SCENE]: Adding new agent " + client.Name + " to scene " + RegionInfo.RegionName); + + m_clientManager.Add(client); + SubscribeToClientEvents(client); + + ScenePresence sp = CreateAndAddScenePresence(client); + if (aCircuit != null) + sp.Appearance = aCircuit.Appearance; + + // HERE!!! Do the initial attachments right here + // first agent upon login is a root agent by design. + // All other AddNewClient calls find aCircuit.child to be true + if (aCircuit == null || (aCircuit != null && aCircuit.child == false)) { - // uh-oh, this is fishy - m_log.WarnFormat("[Scene]: Agent {0} with session {1} connecting with unidentified end point {2}. Refusing service.", - client.AgentId, client.SessionId, ep.ToString()); - try - { - client.Close(); - } - catch (Exception e) - { - m_log.DebugFormat("[Scene]: Exception while closing aborted client: {0}", e.StackTrace); - } - return; + sp.IsChildAgent = false; + Util.FireAndForget(delegate(object o) { sp.RezAttachments(); }); } } - - m_log.Debug("[Scene] Adding new agent " + client.Name + " to scene " + RegionInfo.RegionName); - - ScenePresence sp = CreateAndAddScenePresence(client); - if (aCircuit != null) - sp.Appearance = aCircuit.Appearance; - - // HERE!!! Do the initial attachments right here - // first agent upon login is a root agent by design. - // All other AddNewClient calls find aCircuit.child to be true - if (aCircuit == null || (aCircuit != null && aCircuit.child == false)) - { - sp.IsChildAgent = false; - Util.FireAndForget(delegate(object o) { sp.RezAttachments(); }); - } } - m_LastLogin = Util.EnvironmentTickCount(); - EventManager.TriggerOnNewClient(client); - // m_log.Debug("[Scene] New agent " + client.Name + " vialogin=" + vialogin.ToString()); - if (vialogin) - EventManager.TriggerOnClientLogin(client); + if (GetScenePresence(client.AgentId) != null) + { + m_LastLogin = Util.EnvironmentTickCount(); + EventManager.TriggerOnNewClient(client); + if (vialogin) + EventManager.TriggerOnClientLogin(client); + } } private bool VerifyClient(AgentCircuitData aCircuit, System.Net.IPEndPoint ep, out bool vialogin) @@ -3004,9 +2885,9 @@ namespace OpenSim.Region.Framework.Scenes vialogin = false; // Do the verification here - if ((aCircuit.teleportFlags & (uint)Constants.TeleportFlags.ViaLogin) != 0) + if ((aCircuit.teleportFlags & (uint)Constants.TeleportFlags.ViaHGLogin) != 0) { - m_log.DebugFormat("[Scene]: Incoming client {0} {1} in region {2} via Login", aCircuit.firstname, aCircuit.lastname, RegionInfo.RegionName); + m_log.DebugFormat("[SCENE]: Incoming client {0} {1} in region {2} via HG login", aCircuit.firstname, aCircuit.lastname, RegionInfo.RegionName); vialogin = true; IUserAgentVerificationModule userVerification = RequestModuleInterface(); if (userVerification != null && ep != null) @@ -3014,14 +2895,21 @@ namespace OpenSim.Region.Framework.Scenes if (!userVerification.VerifyClient(aCircuit, ep.Address.ToString())) { // uh-oh, this is fishy - m_log.DebugFormat("[Scene]: User Client Verification for {0} {1} in {2} returned false", aCircuit.firstname, aCircuit.lastname, RegionInfo.RegionName); + m_log.DebugFormat("[SCENE]: User Client Verification for {0} {1} in {2} returned false", aCircuit.firstname, aCircuit.lastname, RegionInfo.RegionName); return false; } else - m_log.DebugFormat("[Scene]: User Client Verification for {0} {1} in {2} returned true", aCircuit.firstname, aCircuit.lastname, RegionInfo.RegionName); + m_log.DebugFormat("[SCENE]: User Client Verification for {0} {1} in {2} returned true", aCircuit.firstname, aCircuit.lastname, RegionInfo.RegionName); } } + else if ((aCircuit.teleportFlags & (uint)Constants.TeleportFlags.ViaLogin) != 0) + { + m_log.DebugFormat("[SCENE]: Incoming client {0} {1} in region {2} via regular login. Client IP verification not performed.", + aCircuit.firstname, aCircuit.lastname, RegionInfo.RegionName); + vialogin = true; + } + return true; } @@ -3039,6 +2927,8 @@ namespace OpenSim.Region.Framework.Scenes try { ScenePresence sp = GetScenePresence(agentID); + PresenceService.LogoutAgent(sp.ControllingClient.SessionId); + if (sp != null) sp.ControllingClient.Close(); @@ -3049,7 +2939,7 @@ namespace OpenSim.Region.Framework.Scenes } catch (Exception e) { - m_log.DebugFormat("[Scene]: Exception while closing aborted client: {0}", e.StackTrace); + m_log.DebugFormat("[SCENE]: Exception while closing aborted client: {0}", e.StackTrace); } } else @@ -3069,28 +2959,20 @@ namespace OpenSim.Region.Framework.Scenes SubscribeToClientPrimEvents(client); SubscribeToClientPrimRezEvents(client); SubscribeToClientInventoryEvents(client); - SubscribeToClientAttachmentEvents(client); SubscribeToClientTeleportEvents(client); SubscribeToClientScriptEvents(client); SubscribeToClientParcelEvents(client); SubscribeToClientGridEvents(client); - SubscribeToClientGodEvents(client); - SubscribeToClientNetworkEvents(client); - - - // EventManager.TriggerOnNewClient(client); } public virtual void SubscribeToClientTerrainEvents(IClientAPI client) { client.OnRegionHandShakeReply += SendLayerData; - client.OnUnackedTerrain += TerrainUnAcked; } public virtual void SubscribeToClientPrimEvents(IClientAPI client) { - client.OnUpdatePrimGroupPosition += m_sceneGraph.UpdatePrimPosition; client.OnUpdatePrimSinglePosition += m_sceneGraph.UpdatePrimSinglePosition; client.OnUpdatePrimGroupRotation += m_sceneGraph.UpdatePrimRotation; @@ -3108,7 +2990,7 @@ namespace OpenSim.Region.Framework.Scenes client.OnGrabUpdate += m_sceneGraph.MoveObject; client.OnSpinStart += m_sceneGraph.SpinStart; client.OnSpinUpdate += m_sceneGraph.SpinObject; - client.OnDeRezObject += DeRezObject; + client.OnDeRezObject += DeRezObjects; client.OnObjectName += m_sceneGraph.PrimName; client.OnObjectClickAction += m_sceneGraph.PrimClickAction; @@ -3130,7 +3012,6 @@ namespace OpenSim.Region.Framework.Scenes client.OnRedo += m_sceneGraph.HandleRedo; client.OnObjectDescription += m_sceneGraph.PrimDescription; client.OnObjectDrop += m_sceneGraph.DropObject; - client.OnObjectSaleInfo += ObjectSaleInfo; client.OnObjectIncludeInSearch += m_sceneGraph.MakeObjectSearchable; client.OnObjectOwner += ObjectOwner; } @@ -3163,18 +3044,6 @@ namespace OpenSim.Region.Framework.Scenes client.OnMoveTaskItem += ClientMoveTaskInventoryItem; } - public virtual void SubscribeToClientAttachmentEvents(IClientAPI client) - { - if (AttachmentsModule != null) - { - client.OnRezSingleAttachmentFromInv += AttachmentsModule.RezSingleAttachmentFromInventory; - client.OnRezMultipleAttachmentsFromInv += AttachmentsModule.RezMultipleAttachmentsFromInventory; - client.OnObjectAttach += AttachmentsModule.AttachObject; - client.OnObjectDetach += AttachmentsModule.DetachObject; - client.OnDetachAttachmentIntoInv += AttachmentsModule.ShowDetachInUserInventory; - } - } - public virtual void SubscribeToClientTeleportEvents(IClientAPI client) { client.OnTeleportLocationRequest += RequestTeleportLocation; @@ -3198,56 +3067,40 @@ namespace OpenSim.Region.Framework.Scenes public virtual void SubscribeToClientGridEvents(IClientAPI client) { - client.OnNameFromUUIDRequest += HandleUUIDNameRequest; + //client.OnNameFromUUIDRequest += HandleUUIDNameRequest; client.OnMoneyTransferRequest += ProcessMoneyTransferRequest; client.OnAvatarPickerRequest += ProcessAvatarPickerRequest; client.OnSetStartLocationRequest += SetHomeRezPoint; client.OnRegionHandleRequest += RegionHandleRequest; } - - public virtual void SubscribeToClientGodEvents(IClientAPI client) - { - IGodsModule godsModule = RequestModuleInterface(); - client.OnGodKickUser += godsModule.KickUser; - client.OnRequestGodlikePowers += godsModule.RequestGodlikePowers; - } - + public virtual void SubscribeToClientNetworkEvents(IClientAPI client) { client.OnNetworkStatsUpdate += StatsReporter.AddPacketsStats; client.OnViewerEffect += ProcessViewerEffect; } - protected virtual void UnsubscribeToClientEvents(IClientAPI client) - { - } - /// - /// Register for events from the client + /// Unsubscribe the client from events. /// - /// The IClientAPI of the connected client + /// FIXME: Not called anywhere! + /// The IClientAPI of the client public virtual void UnSubscribeToClientEvents(IClientAPI client) { UnSubscribeToClientTerrainEvents(client); UnSubscribeToClientPrimEvents(client); UnSubscribeToClientPrimRezEvents(client); UnSubscribeToClientInventoryEvents(client); - UnSubscribeToClientAttachmentEvents(client); UnSubscribeToClientTeleportEvents(client); UnSubscribeToClientScriptEvents(client); UnSubscribeToClientParcelEvents(client); UnSubscribeToClientGridEvents(client); - UnSubscribeToClientGodEvents(client); - UnSubscribeToClientNetworkEvents(client); - - // EventManager.TriggerOnNewClient(client); } public virtual void UnSubscribeToClientTerrainEvents(IClientAPI client) { client.OnRegionHandShakeReply -= SendLayerData; - client.OnUnackedTerrain -= TerrainUnAcked; } public virtual void UnSubscribeToClientPrimEvents(IClientAPI client) @@ -3269,7 +3122,7 @@ namespace OpenSim.Region.Framework.Scenes client.OnGrabUpdate -= m_sceneGraph.MoveObject; client.OnSpinStart -= m_sceneGraph.SpinStart; client.OnSpinUpdate -= m_sceneGraph.SpinObject; - client.OnDeRezObject -= DeRezObject; + client.OnDeRezObject -= DeRezObjects; client.OnObjectName -= m_sceneGraph.PrimName; client.OnObjectClickAction -= m_sceneGraph.PrimClickAction; client.OnObjectMaterial -= m_sceneGraph.PrimMaterial; @@ -3286,7 +3139,6 @@ namespace OpenSim.Region.Framework.Scenes client.OnRedo -= m_sceneGraph.HandleRedo; client.OnObjectDescription -= m_sceneGraph.PrimDescription; client.OnObjectDrop -= m_sceneGraph.DropObject; - client.OnObjectSaleInfo -= ObjectSaleInfo; client.OnObjectIncludeInSearch -= m_sceneGraph.MakeObjectSearchable; client.OnObjectOwner -= ObjectOwner; } @@ -3318,18 +3170,6 @@ namespace OpenSim.Region.Framework.Scenes client.OnMoveTaskItem -= ClientMoveTaskInventoryItem; } - public virtual void UnSubscribeToClientAttachmentEvents(IClientAPI client) - { - if (AttachmentsModule != null) - { - client.OnRezSingleAttachmentFromInv -= AttachmentsModule.RezSingleAttachmentFromInventory; - client.OnRezMultipleAttachmentsFromInv -= AttachmentsModule.RezMultipleAttachmentsFromInventory; - client.OnObjectAttach -= AttachmentsModule.AttachObject; - client.OnObjectDetach -= AttachmentsModule.DetachObject; - client.OnDetachAttachmentIntoInv -= AttachmentsModule.ShowDetachInUserInventory; - } - } - public virtual void UnSubscribeToClientTeleportEvents(IClientAPI client) { client.OnTeleportLocationRequest -= RequestTeleportLocation; @@ -3354,20 +3194,13 @@ namespace OpenSim.Region.Framework.Scenes public virtual void UnSubscribeToClientGridEvents(IClientAPI client) { - client.OnNameFromUUIDRequest -= HandleUUIDNameRequest; + //client.OnNameFromUUIDRequest -= HandleUUIDNameRequest; client.OnMoneyTransferRequest -= ProcessMoneyTransferRequest; client.OnAvatarPickerRequest -= ProcessAvatarPickerRequest; client.OnSetStartLocationRequest -= SetHomeRezPoint; client.OnRegionHandleRequest -= RegionHandleRequest; } - public virtual void UnSubscribeToClientGodEvents(IClientAPI client) - { - IGodsModule godsModule = RequestModuleInterface(); - client.OnGodKickUser -= godsModule.KickUser; - client.OnRequestGodlikePowers -= godsModule.RequestGodlikePowers; - } - public virtual void UnSubscribeToClientNetworkEvents(IClientAPI client) { client.OnNetworkStatsUpdate -= StatsReporter.AddPacketsStats; @@ -3582,7 +3415,6 @@ namespace OpenSim.Region.Framework.Scenes List regions = new List(avatar.KnownChildRegionHandles); regions.Remove(RegionInfo.RegionHandle); m_sceneGridService.SendCloseChildAgentConnections(agentID, regions); - } m_eventManager.TriggerClientClosed(agentID, this); } @@ -3594,6 +3426,17 @@ namespace OpenSim.Region.Framework.Scenes m_eventManager.TriggerOnRemovePresence(agentID); + if (avatar != null && (!avatar.IsChildAgent)) + avatar.SaveChangedAttachments(); + + ForEachClient( + delegate(IClientAPI client) + { + //We can safely ignore null reference exceptions. It means the avatar is dead and cleaned up anyway + try { client.SendKillObject(avatar.RegionHandle, avatar.LocalId); } + catch (NullReferenceException) { } + }); + // Don't try to send kills to clients if this is a synced server. // The client closed event will trigger the broadcast to client managers if(!IsSyncedServer()) @@ -3632,7 +3475,7 @@ namespace OpenSim.Region.Framework.Scenes } m_authenticateHandler.RemoveCircuit(avatar.ControllingClient.CircuitCode); - + CleanDroppedAttachments(); //m_log.InfoFormat("[SCENE] Memory pre GC {0}", System.GC.GetTotalMemory(false)); //m_log.InfoFormat("[SCENE] Memory post GC {0}", System.GC.GetTotalMemory(true)); } @@ -3722,7 +3565,6 @@ namespace OpenSim.Region.Framework.Scenes m_log.WarnFormat("[SCENE]: Deregister from grid failed for region {0}", m_regInfo.RegionName); } - /// /// Do the work necessary to initiate a new user connection for a particular scene. /// At the moment, this consists of setting up the caps infrastructure @@ -3735,7 +3577,25 @@ namespace OpenSim.Region.Framework.Scenes /// also return a reason. public bool NewUserConnection(AgentCircuitData agent, uint teleportFlags, out string reason) { - TeleportFlags tp = (TeleportFlags)teleportFlags; + return NewUserConnection(agent, teleportFlags, out reason, true); + } + + /// + /// Do the work necessary to initiate a new user connection for a particular scene. + /// At the moment, this consists of setting up the caps infrastructure + /// The return bool should allow for connections to be refused, but as not all calling paths + /// take proper notice of it let, we allowed banned users in still. + /// + /// CircuitData of the agent who is connecting + /// Outputs the reason for the false response on this string + /// True for normal presence. False for NPC + /// or other applications where a full grid/Hypergrid presence may not be required. + /// True if the region accepts this agent. False if it does not. False will + /// also return a reason. + public bool NewUserConnection(AgentCircuitData agent, uint teleportFlags, out string reason, bool requirePresenceLookup) + { + bool vialogin = ((teleportFlags & (uint)Constants.TeleportFlags.ViaLogin) != 0 || + (teleportFlags & (uint)Constants.TeleportFlags.ViaHGLogin) != 0); reason = String.Empty; //Teleport flags: @@ -3772,7 +3632,7 @@ namespace OpenSim.Region.Framework.Scenes ILandObject land = LandChannel.GetLandObject(agent.startpos.X, agent.startpos.Y); //On login test land permisions - if (tp == TeleportFlags.ViaLogin) + if (vialogin) { if (land != null && !TestLandRestrictions(agent, land, out reason)) { @@ -3782,16 +3642,18 @@ namespace OpenSim.Region.Framework.Scenes if (sp == null) // We don't have an [child] agent here already { - - try + if (requirePresenceLookup) { - if (!VerifyUserPresence(agent, out reason)) + try + { + if (!VerifyUserPresence(agent, out reason)) + return false; + } + catch (Exception e) + { + m_log.ErrorFormat("[CONNECTION BEGIN]: Exception verifying presence " + e.ToString()); return false; - } - catch (Exception e) - { - m_log.DebugFormat("[CONNECTION BEGIN]: Exception verifying presence {0}", e.Message); - return false; + } } try @@ -3801,7 +3663,7 @@ namespace OpenSim.Region.Framework.Scenes } catch (Exception e) { - m_log.DebugFormat("[CONNECTION BEGIN]: Exception authorizing user {0}", e.Message); + m_log.ErrorFormat("[CONNECTION BEGIN]: Exception authorizing user " + e.ToString()); return false; } @@ -3831,8 +3693,10 @@ namespace OpenSim.Region.Framework.Scenes agent.teleportFlags = teleportFlags; m_authenticateHandler.AddNewCircuit(agent.circuitcode, agent); - if (tp == TeleportFlags.ViaLogin) + if (vialogin) { + CleanDroppedAttachments(); + if (TestBorderCross(agent.startpos, Cardinals.E)) { Border crossedBorder = GetCrossedBorder(agent.startpos, Cardinals.E); @@ -3949,7 +3813,7 @@ namespace OpenSim.Region.Framework.Scenes IPresenceService presence = RequestModuleInterface(); if (presence == null) { - reason = String.Format("Failed to verify user {0} {1} in region {2}. Presence service does not exist.", agent.firstname, agent.lastname, RegionInfo.RegionName); + reason = String.Format("Failed to verify user presence in the grid for {0} {1} in region {2}. Presence service does not exist.", agent.firstname, agent.lastname, RegionInfo.RegionName); return false; } @@ -3957,7 +3821,7 @@ namespace OpenSim.Region.Framework.Scenes if (pinfo == null) { - reason = String.Format("Failed to verify user {0} {1}, access denied to region {2}.", agent.firstname, agent.lastname, RegionInfo.RegionName); + reason = String.Format("Failed to verify user presence in the grid for {0} {1}, access denied to region {2}.", agent.firstname, agent.lastname, RegionInfo.RegionName); return false; } @@ -4081,18 +3945,6 @@ namespace OpenSim.Region.Framework.Scenes return true; } - private ILandObject GetParcelAtPoint(float x, float y) - { - foreach (var parcel in AllParcels()) - { - if (parcel.ContainsPoint((int)x,(int)y)) - { - return parcel; - } - } - return null; - } - /// /// Update an AgentCircuitData object with new information /// @@ -4158,7 +4010,7 @@ namespace OpenSim.Region.Framework.Scenes public virtual void AgentCrossing(UUID agentID, Vector3 position, bool isFlying) { ScenePresence presence = GetScenePresence(agentID); - if(presence != null) + if (presence != null) { try { @@ -4193,6 +4045,13 @@ namespace OpenSim.Region.Framework.Scenes // We have to wait until the viewer contacts this region after receiving EAC. // That calls AddNewClient, which finally creates the ScenePresence + ILandObject nearestParcel = GetNearestAllowedParcel(cAgentData.AgentID, Constants.RegionSize / 2, Constants.RegionSize / 2); + if (nearestParcel == null) + { + m_log.DebugFormat("[SCENE]: Denying root agent entry to {0}: no allowed parcel", cAgentData.AgentID); + return false; + } + ScenePresence childAgentUpdate = WaitGetScenePresence(cAgentData.AgentID); if (childAgentUpdate != null) { @@ -4424,6 +4283,11 @@ namespace OpenSim.Region.Framework.Scenes #region Other Methods + protected override IConfigSource GetConfig() + { + return m_config; + } + #endregion public void HandleObjectPermissionsUpdate(IClientAPI controller, UUID agentID, UUID sessionID, byte field, uint localId, uint mask, byte set) @@ -4448,9 +4312,8 @@ namespace OpenSim.Region.Framework.Scenes /// public void ForceClientUpdate() { - List EntityList = GetEntities(); - - foreach (EntityBase ent in EntityList) + EntityBase[] entityList = GetEntities(); + foreach (EntityBase ent in entityList) { if (ent is SceneObjectGroup) { @@ -4468,9 +4331,8 @@ namespace OpenSim.Region.Framework.Scenes { m_log.Debug("Searching for Primitive: '" + cmdparams[2] + "'"); - List EntityList = GetEntities(); - - foreach (EntityBase ent in EntityList) + EntityBase[] entityList = GetEntities(); + foreach (EntityBase ent in entityList) { if (ent is SceneObjectGroup) { @@ -4845,7 +4707,7 @@ namespace OpenSim.Region.Framework.Scenes /// will not affect the original list of objects in the scene. /// /// - public List GetEntities() + public EntityBase[] GetEntities() { return m_sceneGraph.GetEntities(); } @@ -4868,23 +4730,6 @@ namespace OpenSim.Region.Framework.Scenes client.SendRegionHandle(regionID, handle); } - public void TerrainUnAcked(IClientAPI client, int patchX, int patchY) - { - //m_log.Debug("Terrain packet unacked, resending patch: " + patchX + " , " + patchY); - client.SendLayerData(patchX, patchY, Heightmap.GetFloatsSerialised()); - } - - public void SetRootAgentScene(UUID agentID) - { - IInventoryTransferModule inv = RequestModuleInterface(); - if (inv == null) - return; - - inv.SetRootAgentScene(agentID, this); - - EventManager.TriggerSetRootAgentScene(agentID, this); - } - public bool NeedSceneCacheClear(UUID agentID) { IInventoryTransferModule inv = RequestModuleInterface(); @@ -4894,189 +4739,10 @@ namespace OpenSim.Region.Framework.Scenes return inv.NeedSceneCacheClear(agentID, this); } - public void ObjectSaleInfo(IClientAPI client, UUID agentID, UUID sessionID, uint localID, byte saleType, int salePrice) - { - SceneObjectPart part = GetSceneObjectPart(localID); - if (part == null || part.ParentGroup == null) - return; - - if (part.ParentGroup.IsDeleted) - return; - - part = part.ParentGroup.RootPart; - - part.ObjectSaleType = saleType; - part.SalePrice = salePrice; - - part.ParentGroup.HasGroupChanged = true; - - part.GetProperties(client); - } - - public bool PerformObjectBuy(IClientAPI remoteClient, UUID categoryID, - uint localID, byte saleType) - { - SceneObjectPart part = GetSceneObjectPart(localID); - - if (part == null) - return false; - - if (part.ParentGroup == null) - return false; - - SceneObjectGroup group = part.ParentGroup; - - switch (saleType) - { - case 1: // Sell as original (in-place sale) - uint effectivePerms=group.GetEffectivePermissions(); - - if ((effectivePerms & (uint)PermissionMask.Transfer) == 0) - { - m_dialogModule.SendAlertToUser(remoteClient, "This item doesn't appear to be for sale"); - return false; - } - - group.SetOwnerId(remoteClient.AgentId); - group.SetRootPartOwner(part, remoteClient.AgentId, - remoteClient.ActiveGroupId); - - List partList = - new List(group.Children.Values); - - if (Permissions.PropagatePermissions()) - { - foreach (SceneObjectPart child in partList) - { - child.Inventory.ChangeInventoryOwner(remoteClient.AgentId); - child.TriggerScriptChangedEvent(Changed.OWNER); - child.ApplyNextOwnerPermissions(); - } - } - - part.ObjectSaleType = 0; - part.SalePrice = 10; - - group.HasGroupChanged = true; - part.GetProperties(remoteClient); - part.TriggerScriptChangedEvent(Changed.OWNER); - group.ResumeScripts(); - part.ScheduleFullUpdate(); - - break; - - case 2: // Sell a copy - - - Vector3 inventoryStoredPosition = new Vector3 - (((group.AbsolutePosition.X > (int)Constants.RegionSize) - ? 250 - : group.AbsolutePosition.X) - , - (group.AbsolutePosition.X > (int)Constants.RegionSize) - ? 250 - : group.AbsolutePosition.X, - group.AbsolutePosition.Z); - - Vector3 originalPosition = group.AbsolutePosition; - - group.AbsolutePosition = inventoryStoredPosition; - - string sceneObjectXml = SceneObjectSerializer.ToOriginalXmlFormat(group); - group.AbsolutePosition = originalPosition; - - uint perms=group.GetEffectivePermissions(); - - if ((perms & (uint)PermissionMask.Transfer) == 0) - { - m_dialogModule.SendAlertToUser(remoteClient, "This item doesn't appear to be for sale"); - return false; - } - - AssetBase asset = CreateAsset( - group.GetPartName(localID), - group.GetPartDescription(localID), - (sbyte)AssetType.Object, - Utils.StringToBytes(sceneObjectXml), - group.OwnerID); - AssetService.Store(asset); - - InventoryItemBase item = new InventoryItemBase(); - item.CreatorId = part.CreatorID.ToString(); - - item.ID = UUID.Random(); - item.Owner = remoteClient.AgentId; - item.AssetID = asset.FullID; - item.Description = asset.Description; - item.Name = asset.Name; - item.AssetType = asset.Type; - item.InvType = (int)InventoryType.Object; - item.Folder = categoryID; - - uint nextPerms=(perms & 7) << 13; - if ((nextPerms & (uint)PermissionMask.Copy) == 0) - perms &= ~(uint)PermissionMask.Copy; - if ((nextPerms & (uint)PermissionMask.Transfer) == 0) - perms &= ~(uint)PermissionMask.Transfer; - if ((nextPerms & (uint)PermissionMask.Modify) == 0) - perms &= ~(uint)PermissionMask.Modify; - - item.BasePermissions = perms & part.NextOwnerMask; - item.CurrentPermissions = perms & part.NextOwnerMask; - item.NextPermissions = part.NextOwnerMask; - item.EveryOnePermissions = part.EveryoneMask & - part.NextOwnerMask; - item.GroupPermissions = part.GroupMask & - part.NextOwnerMask; - item.CurrentPermissions |= 16; // Slam! - item.CreationDate = Util.UnixTimeSinceEpoch(); - - if (InventoryService.AddItem(item)) - remoteClient.SendInventoryItemCreateUpdate(item, 0); - else - { - m_dialogModule.SendAlertToUser(remoteClient, "Cannot buy now. Your inventory is unavailable"); - return false; - } - break; - - case 3: // Sell contents - List invList = part.Inventory.GetInventoryList(); - - bool okToSell = true; - - foreach (UUID invID in invList) - { - TaskInventoryItem item1 = part.Inventory.GetInventoryItem(invID); - if ((item1.CurrentPermissions & - (uint)PermissionMask.Transfer) == 0) - { - okToSell = false; - break; - } - } - - if (!okToSell) - { - m_dialogModule.SendAlertToUser( - remoteClient, "This item's inventory doesn't appear to be for sale"); - return false; - } - - if (invList.Count > 0) - MoveTaskInventoryItems(remoteClient.AgentId, part.Name, - part, invList); - break; - } - - return true; - } - public void CleanTempObjects() { - List objs = GetEntities(); - - foreach (EntityBase obj in objs) + EntityBase[] entities = GetEntities(); + foreach (EntityBase obj in entities) { if (obj is SceneObjectGroup) { @@ -5096,7 +4762,7 @@ namespace OpenSim.Region.Framework.Scenes public void DeleteFromStorage(UUID uuid) { - m_storageManager.DataStore.RemoveObject(uuid, m_regInfo.RegionID); + SimulationDataService.RemoveObject(uuid, m_regInfo.RegionID); } public int GetHealth() @@ -5212,7 +4878,7 @@ namespace OpenSim.Region.Framework.Scenes } // turn the proxy non-physical, which also stops its client-side interpolation - bool wasUsingPhysics = ((jointProxyObject.ObjectFlags & (uint)PrimFlags.Physics) != 0); + bool wasUsingPhysics = ((jointProxyObject.Flags & PrimFlags.Physics) != 0); if (wasUsingPhysics) { jointProxyObject.UpdatePrimFlags(false, false, true, false); // FIXME: possible deadlock here; check to make sure all the scene alterations set into motion here won't deadlock @@ -5371,7 +5037,6 @@ namespace OpenSim.Region.Framework.Scenes Vector3 nearestRegionEdgePoint = GetNearestRegionEdgePosition(avatar); //Debug.WriteLine("They are really in a place they don't belong, sending them to: " + nearestRegionEdgePoint.ToString()); return nearestRegionEdgePoint; - return null; } private Vector3 GetParcelCenterAtGround(ILandObject parcel) @@ -5505,17 +5170,21 @@ namespace OpenSim.Region.Framework.Scenes public List GetEstateRegions(int estateID) { - if (m_storageManager.EstateDataStore == null) - return new List(); + IEstateDataService estateDataService = EstateDataService; + if (estateDataService == null) + return new List(0); - return m_storageManager.EstateDataStore.GetRegions(estateID); + return estateDataService.GetRegions(estateID); } public void ReloadEstateData() { - m_regInfo.EstateSettings = m_storageManager.EstateDataStore.LoadEstateSettings(m_regInfo.RegionID, false); - - TriggerEstateSunUpdate(); + IEstateDataService estateDataService = EstateDataService; + if (estateDataService != null) + { + m_regInfo.EstateSettings = estateDataService.LoadEstateSettings(m_regInfo.RegionID, false); + TriggerEstateSunUpdate(); + } } public void TriggerEstateSunUpdate() @@ -5602,5 +5271,54 @@ namespace OpenSim.Region.Framework.Scenes return offsets.ToArray(); } + + public void RegenerateMaptile(object sender, ElapsedEventArgs e) + { + IWorldMapModule mapModule = RequestModuleInterface(); + if (mapModule != null) + { + mapModule.GenerateMaptile(); + + string error = GridService.RegisterRegion(RegionInfo.ScopeID, new GridRegion(RegionInfo)); + + if (error != String.Empty) + throw new Exception(error); + } + } + + public void CleanDroppedAttachments() + { + List objectsToDelete = + new List(); + + lock (m_cleaningAttachments) + { + ForEachSOG(delegate (SceneObjectGroup grp) + { + if (grp.RootPart.Shape.PCode == 0 && grp.RootPart.Shape.State != 0 && (!objectsToDelete.Contains(grp))) + { + UUID agentID = grp.OwnerID; + if (agentID == UUID.Zero) + { + objectsToDelete.Add(grp); + return; + } + + ScenePresence sp = GetScenePresence(agentID); + if (sp == null) + { + objectsToDelete.Add(grp); + return; + } + } + }); + } + + foreach (SceneObjectGroup grp in objectsToDelete) + { + m_log.InfoFormat("[SCENE]: Deleting dropped attachment {0} of user {1}", grp.UUID, grp.OwnerID); + DeleteSceneObject(grp, true); + } + } } } diff --git a/OpenSim/Region/Framework/Scenes/SceneBase.cs b/OpenSim/Region/Framework/Scenes/SceneBase.cs index f8591ba8ad..c71aefadee 100644 --- a/OpenSim/Region/Framework/Scenes/SceneBase.cs +++ b/OpenSim/Region/Framework/Scenes/SceneBase.cs @@ -521,7 +521,7 @@ namespace OpenSim.Region.Framework.Scenes /// /// /// - /// + /// public void AddCommand( object mod, string command, string shorthelp, string longhelp, string descriptivehelp, CommandDelegate callback) { diff --git a/OpenSim/Region/Framework/Scenes/SceneCommunicationService.cs b/OpenSim/Region/Framework/Scenes/SceneCommunicationService.cs index c675322185..88e084eecd 100644 --- a/OpenSim/Region/Framework/Scenes/SceneCommunicationService.cs +++ b/OpenSim/Region/Framework/Scenes/SceneCommunicationService.cs @@ -70,7 +70,7 @@ namespace OpenSim.Region.Framework.Scenes /// /// A user will arrive shortly, set up appropriate credentials so it can connect /// - public event ExpectUserDelegate OnExpectUser; +// public event ExpectUserDelegate OnExpectUser; /// /// A Prim will arrive shortly @@ -80,7 +80,7 @@ namespace OpenSim.Region.Framework.Scenes /// /// A new prim has arrived /// - public event PrimCrossing OnPrimCrossingIntoRegion; +// public event PrimCrossing OnPrimCrossingIntoRegion; ///// ///// A New Region is up and available @@ -90,7 +90,7 @@ namespace OpenSim.Region.Framework.Scenes /// /// We have a child agent for this avatar and we're getting a status update about it /// - public event ChildAgentUpdate OnChildAgentUpdate; +// public event ChildAgentUpdate OnChildAgentUpdate; //public event RemoveKnownRegionsFromAvatarList OnRemoveKnownRegionFromAvatar; /// diff --git a/OpenSim/Region/Framework/Scenes/SceneGraph.cs b/OpenSim/Region/Framework/Scenes/SceneGraph.cs index 2506e9c1ad..8a410600d5 100644 --- a/OpenSim/Region/Framework/Scenes/SceneGraph.cs +++ b/OpenSim/Region/Framework/Scenes/SceneGraph.cs @@ -72,14 +72,9 @@ namespace OpenSim.Region.Framework.Scenes protected Dictionary m_scenePresenceMap = new Dictionary(); protected List m_scenePresenceArray = new List(); - // SceneObjects is not currently populated or used. - //public Dictionary SceneObjects; protected internal EntityManager Entities = new EntityManager(); -// protected internal Dictionary Entities = new Dictionary(); protected internal Dictionary RestorePresences = new Dictionary(); - protected internal BasicQuadTreeNode QuadTree; - protected RegionInfo m_regInfo; protected Scene m_parentScene; protected Dictionary m_updateList = new Dictionary(); @@ -97,7 +92,6 @@ namespace OpenSim.Region.Framework.Scenes protected internal Dictionary SceneObjectGroupsByLocalID = new Dictionary(); protected internal Dictionary SceneObjectGroupsByFullID = new Dictionary(); - private readonly Object m_dictionary_lock = new Object(); private Object m_updateLock = new Object(); @@ -107,9 +101,6 @@ namespace OpenSim.Region.Framework.Scenes { m_parentScene = parent; m_regInfo = regInfo; - QuadTree = new BasicQuadTreeNode(null, "/0/", 0, 0, (short)Constants.RegionSize, (short)Constants.RegionSize); - QuadTree.Subdivide(); - QuadTree.Subdivide(); } public PhysicsScene PhysicsScene @@ -141,11 +132,10 @@ namespace OpenSim.Region.Framework.Scenes m_scenePresenceArray = newlist; } - lock (m_dictionary_lock) - { + lock (SceneObjectGroupsByFullID) SceneObjectGroupsByFullID.Clear(); + lock (SceneObjectGroupsByLocalID) SceneObjectGroupsByLocalID.Clear(); - } Entities.Clear(); } @@ -269,7 +259,7 @@ namespace OpenSim.Region.Framework.Scenes protected internal bool AddRestoredSceneObject( SceneObjectGroup sceneObject, bool attachToBackup, bool alreadyPersisted, bool sendClientUpdates) { - if (!alreadyPersisted) + if (attachToBackup && (!alreadyPersisted)) { sceneObject.ForceInventoryPersistence(); sceneObject.HasGroupChanged = true; @@ -292,11 +282,49 @@ namespace OpenSim.Region.Framework.Scenes /// protected internal bool AddNewSceneObject(SceneObjectGroup sceneObject, bool attachToBackup, bool sendClientUpdates) { - // Ensure that we persist this new scene object - sceneObject.HasGroupChanged = true; + // Ensure that we persist this new scene object if it's not an + // attachment + if (attachToBackup) + sceneObject.HasGroupChanged = true; return AddSceneObject(sceneObject, attachToBackup, sendClientUpdates); } + + /// + /// Add a newly created object to the scene. + /// + /// + /// This method does not send updates to the client - callers need to handle this themselves. + /// + /// + /// Position of the object + /// Rotation of the object + /// Velocity of the object. This parameter only has an effect if the object is physical + /// + public bool AddNewSceneObject( + SceneObjectGroup sceneObject, bool attachToBackup, Vector3 pos, Quaternion rot, Vector3 vel) + { + AddNewSceneObject(sceneObject, true, false); + + // we set it's position in world. + sceneObject.AbsolutePosition = pos; + + if (sceneObject.RootPart.Shape.PCode == (byte)PCode.Prim) + { + sceneObject.ClearPartAttachmentData(); + } + + sceneObject.UpdateGroupRotationR(rot); + + //group.ApplyPhysics(m_physicalPrim); + if (sceneObject.RootPart.PhysActor != null && sceneObject.RootPart.PhysActor.IsPhysical && vel != Vector3.Zero) + { + sceneObject.RootPart.ApplyImpulse((vel * sceneObject.GetMass()), false); + sceneObject.Velocity = vel; + } + + return true; + } /// /// Add an object to the scene. This will both update the scene, and send information about the @@ -319,72 +347,66 @@ namespace OpenSim.Region.Framework.Scenes if (sceneObject == null || sceneObject.RootPart == null || sceneObject.RootPart.UUID == UUID.Zero) return false; - lock (sceneObject) - { - if (Entities.ContainsKey(sceneObject.UUID)) - { -// m_log.WarnFormat( -// "[SCENE GRAPH]: Scene object {0} {1} was already in region {2} on add request", -// sceneObject.Name, sceneObject.UUID, m_parentScene.RegionInfo.RegionName); - return false; - } - -// m_log.DebugFormat( -// "[SCENE GRAPH]: Adding object {0} {1} to region {2}", -// sceneObject.Name, sceneObject.UUID, m_parentScene.RegionInfo.RegionName); - - if (m_parentScene.m_clampPrimSize) - { - foreach (SceneObjectPart part in sceneObject.Children.Values) - { - Vector3 scale = part.Shape.Scale; - - if (scale.X > m_parentScene.m_maxNonphys) - scale.X = m_parentScene.m_maxNonphys; - if (scale.Y > m_parentScene.m_maxNonphys) - scale.Y = m_parentScene.m_maxNonphys; - if (scale.Z > m_parentScene.m_maxNonphys) - scale.Z = m_parentScene.m_maxNonphys; - - part.Shape.Scale = scale; - } - } - - sceneObject.AttachToScene(m_parentScene); - - //KittyL: edited to support script engine actor - //if (sendClientUpdates) - // sceneObject.ScheduleGroupForFullUpdate(); - if (sendClientUpdates) - { - sceneObject.ScheduleGroupForFullUpdate(); - } - - Entities.Add(sceneObject); - m_numPrim += sceneObject.Children.Count; + if (Entities.ContainsKey(sceneObject.UUID)) + return false; - //KittyL: edited to support script engine actor - //if (attachToBackup) - // sceneObject.AttachToBackup(); - if (attachToBackup && m_parentScene.IsAuthoritativeScene()) - { - sceneObject.AttachToBackup(); - } + SceneObjectPart[] children = sceneObject.Parts; - if (OnObjectCreate != null) - OnObjectCreate(sceneObject); - - lock (m_dictionary_lock) + // Clamp child prim sizes and add child prims to the m_numPrim count + if (m_parentScene.m_clampPrimSize) + { + foreach (SceneObjectPart part in children) { - SceneObjectGroupsByFullID[sceneObject.UUID] = sceneObject; - SceneObjectGroupsByLocalID[sceneObject.LocalId] = sceneObject; - foreach (SceneObjectPart part in sceneObject.Children.Values) - { - SceneObjectGroupsByFullID[part.UUID] = sceneObject; - SceneObjectGroupsByLocalID[part.LocalId] = sceneObject; - } + Vector3 scale = part.Shape.Scale; + + if (scale.X > m_parentScene.m_maxNonphys) + scale.X = m_parentScene.m_maxNonphys; + if (scale.Y > m_parentScene.m_maxNonphys) + scale.Y = m_parentScene.m_maxNonphys; + if (scale.Z > m_parentScene.m_maxNonphys) + scale.Z = m_parentScene.m_maxNonphys; + + part.Shape.Scale = scale; } } + m_numPrim += children.Length; + + sceneObject.AttachToScene(m_parentScene); + + //KittyL: edited to support script engine actor + //if (sendClientUpdates) + // sceneObject.ScheduleGroupForFullUpdate(); + if (sendClientUpdates) + { + sceneObject.ScheduleGroupForFullUpdate(); + } + + Entities.Add(sceneObject); + + //KittyL: edited to support script engine actor + //if (attachToBackup) + // sceneObject.AttachToBackup(); + if (attachToBackup && m_parentScene.IsAuthoritativeScene()) + { + sceneObject.AttachToBackup(); + } + + if (OnObjectCreate != null) + OnObjectCreate(sceneObject); + + lock (SceneObjectGroupsByFullID) + { + SceneObjectGroupsByFullID[sceneObject.UUID] = sceneObject; + foreach (SceneObjectPart part in children) + SceneObjectGroupsByFullID[part.UUID] = sceneObject; + } + + lock (SceneObjectGroupsByLocalID) + { + SceneObjectGroupsByLocalID[sceneObject.LocalId] = sceneObject; + foreach (SceneObjectPart part in children) + SceneObjectGroupsByLocalID[part.LocalId] = sceneObject; + } return true; } @@ -395,34 +417,43 @@ namespace OpenSim.Region.Framework.Scenes /// true if the object was deleted, false if there was no object to delete public bool DeleteSceneObject(UUID uuid, bool resultOfObjectLinked) { - if (Entities.ContainsKey(uuid)) + EntityBase entity; + if (!Entities.TryGetValue(uuid, out entity) || (!(entity is SceneObjectGroup))) + return false; + + SceneObjectGroup grp = (SceneObjectGroup)entity; + + if (entity == null) + return false; + + if (!resultOfObjectLinked) { - if (!resultOfObjectLinked) - { - m_numPrim -= ((SceneObjectGroup) Entities[uuid]).Children.Count; + m_numPrim -= grp.PrimCount; - if ((((SceneObjectGroup)Entities[uuid]).RootPart.Flags & PrimFlags.Physics) == PrimFlags.Physics) - { - RemovePhysicalPrim(((SceneObjectGroup)Entities[uuid]).Children.Count); - } - } - - if (OnObjectRemove != null) - OnObjectRemove(Entities[uuid]); - - lock (m_dictionary_lock) - { - SceneObjectGroupsByFullID.Remove(uuid); - SceneObjectGroupsByLocalID.Remove(((SceneObjectGroup)Entities[uuid]).LocalId); - } - Entities.Remove(uuid); - //SceneObjectGroup part; - //((part.RootPart.Flags & PrimFlags.Physics) == PrimFlags.Physics) - - return true; + if ((grp.RootPart.Flags & PrimFlags.Physics) == PrimFlags.Physics) + RemovePhysicalPrim(grp.PrimCount); } - return false; + if (OnObjectRemove != null) + OnObjectRemove(Entities[uuid]); + + lock (SceneObjectGroupsByFullID) + { + SceneObjectPart[] parts = grp.Parts; + for (int i = 0; i < parts.Length; i++) + SceneObjectGroupsByFullID.Remove(parts[i].UUID); + SceneObjectGroupsByFullID.Remove(grp.RootPart.UUID); + } + + lock (SceneObjectGroupsByLocalID) + { + SceneObjectPart[] parts = grp.Parts; + for (int i = 0; i < parts.Length; i++) + SceneObjectGroupsByLocalID.Remove(parts[i].LocalId); + SceneObjectGroupsByLocalID.Remove(grp.RootPart.LocalId); + } + + return Entities.Remove(uuid); } /// @@ -434,9 +465,7 @@ namespace OpenSim.Region.Framework.Scenes protected internal void AddToUpdateList(SceneObjectGroup obj) { lock (m_updateList) - { m_updateList[obj.UUID] = obj; - } } /// @@ -446,34 +475,39 @@ namespace OpenSim.Region.Framework.Scenes { if (!Monitor.TryEnter(m_updateLock)) return; - - List updates; - - // Some updates add more updates to the updateList. - // Get the current list of updates and clear the list before iterating - lock (m_updateList) + try { - updates = new List(m_updateList.Values); - m_updateList.Clear(); - } + List updates; - // Go through all updates - for (int i = 0; i < updates.Count; i++) - { - SceneObjectGroup sog = updates[i]; - - // Don't abort the whole update if one entity happens to give us an exception. - try + // Some updates add more updates to the updateList. + // Get the current list of updates and clear the list before iterating + lock (m_updateList) { - sog.Update(); + updates = new List(m_updateList.Values); + m_updateList.Clear(); } - catch (Exception e) + + // Go through all updates + for (int i = 0; i < updates.Count; i++) { - m_log.ErrorFormat( - "[INNER SCENE]: Failed to update {0}, {1} - {2}", sog.Name, sog.UUID, e); + SceneObjectGroup sog = updates[i]; + + // Don't abort the whole update if one entity happens to give us an exception. + try + { + sog.Update(); + } + catch (Exception e) + { + m_log.ErrorFormat( + "[INNER SCENE]: Failed to update {0}, {1} - {2}", sog.Name, sog.UUID, e); + } } } - Monitor.Exit(m_updateLock); + finally + { + Monitor.Exit(m_updateLock); + } } protected internal void AddPhysicalPrim(int number) @@ -503,16 +537,6 @@ namespace OpenSim.Region.Framework.Scenes m_parentScene.AttachmentsModule.DetachSingleAttachmentToGround(group.UUID, remoteClient); } - protected internal void DetachObject(uint objectLocalID, IClientAPI remoteClient) - { - SceneObjectGroup group = GetGroupByPrim(objectLocalID); - if (group != null) - { - //group.DetachToGround(); - m_parentScene.AttachmentsModule.ShowDetachInUserInventory(group.GetFromItemID(), remoteClient); - } - } - protected internal void HandleUndo(IClientAPI remoteClient, UUID primId) { if (primId != UUID.Zero) @@ -535,6 +559,9 @@ namespace OpenSim.Region.Framework.Scenes protected internal void HandleObjectGroupUpdate( IClientAPI remoteClient, UUID GroupID, uint objectLocalID, UUID Garbage) { + if (!remoteClient.IsGroupMember(GroupID)) + return; + SceneObjectGroup group = GetGroupByPrim(objectLocalID); if (group != null) { @@ -830,36 +857,38 @@ namespace OpenSim.Region.Framework.Scenes /// null if no scene object group containing that prim is found public SceneObjectGroup GetGroupByPrim(uint localID) { - if (Entities.ContainsKey(localID)) - return Entities[localID] as SceneObjectGroup; + EntityBase entity; + if (Entities.TryGetValue(localID, out entity)) + return entity as SceneObjectGroup; //m_log.DebugFormat("Entered GetGroupByPrim with localID {0}", localID); SceneObjectGroup sog; lock (SceneObjectGroupsByLocalID) + SceneObjectGroupsByLocalID.TryGetValue(localID, out sog); + + if (sog != null) { - if (SceneObjectGroupsByLocalID.TryGetValue(localID, out sog)) - { + if (sog.HasChildPrim(localID)) return sog; - } + SceneObjectGroupsByLocalID.Remove(localID); } - List EntityList = GetEntities(); - foreach (EntityBase ent in EntityList) + EntityBase[] entityList = GetEntities(); + foreach (EntityBase ent in entityList) { //m_log.DebugFormat("Looking at entity {0}", ent.UUID); if (ent is SceneObjectGroup) { - if (((SceneObjectGroup)ent).HasChildPrim(localID)) + sog = (SceneObjectGroup)ent; + if (sog.HasChildPrim(localID)) { - sog = (SceneObjectGroup)ent; lock (SceneObjectGroupsByLocalID) - { SceneObjectGroupsByLocalID[localID] = sog; - } return sog; } } } + return null; } @@ -872,30 +901,32 @@ namespace OpenSim.Region.Framework.Scenes { SceneObjectGroup sog; lock (SceneObjectGroupsByFullID) + SceneObjectGroupsByFullID.TryGetValue(fullID, out sog); + + if (sog != null) { - if (SceneObjectGroupsByFullID.TryGetValue(fullID, out sog)) - { + if (sog.ContainsPart(fullID)) return sog; - } + + lock (SceneObjectGroupsByFullID) + SceneObjectGroupsByFullID.Remove(fullID); } - List EntityList = GetEntities(); - - foreach (EntityBase ent in EntityList) + EntityBase[] entityList = GetEntities(); + foreach (EntityBase ent in entityList) { if (ent is SceneObjectGroup) { - if (((SceneObjectGroup)ent).HasChildPrim(fullID)) + sog = (SceneObjectGroup)ent; + if (sog.HasChildPrim(fullID)) { - sog = (SceneObjectGroup)ent; lock (SceneObjectGroupsByFullID) - { SceneObjectGroupsByFullID[fullID] = sog; - } return sog; } } } + return null; } @@ -904,7 +935,7 @@ namespace OpenSim.Region.Framework.Scenes // Primitive Ray Tracing float closestDistance = 280f; EntityIntersection result = new EntityIntersection(); - List EntityList = GetEntities(); + EntityBase[] EntityList = GetEntities(); foreach (EntityBase ent in EntityList) { if (ent is SceneObjectGroup) @@ -942,23 +973,28 @@ namespace OpenSim.Region.Framework.Scenes /// null if the part was not found protected internal SceneObjectPart GetSceneObjectPart(string name) { - List EntityList = GetEntities(); + SceneObjectPart sop = null; - // FIXME: use a dictionary here - foreach (EntityBase ent in EntityList) - { - if (ent is SceneObjectGroup) + Entities.Find( + delegate(EntityBase entity) { - foreach (SceneObjectPart p in ((SceneObjectGroup) ent).GetParts()) + if (entity is SceneObjectGroup) { - if (p.Name == name) + foreach (SceneObjectPart p in ((SceneObjectGroup)entity).Parts) { - return p; + if (p.Name == name) + { + sop = p; + return true; + } } } + + return false; } - } - return null; + ); + + return sop; } /// @@ -979,7 +1015,7 @@ namespace OpenSim.Region.Framework.Scenes /// it /// /// - protected internal List GetEntities() + protected internal EntityBase[] GetEntities() { return Entities.GetEntities(); } @@ -988,7 +1024,7 @@ namespace OpenSim.Region.Framework.Scenes { Dictionary topScripts = new Dictionary(); - List EntityList = GetEntities(); + EntityBase[] EntityList = GetEntities(); int limit = 0; foreach (EntityBase ent in EntityList) { @@ -1052,7 +1088,7 @@ namespace OpenSim.Region.Framework.Scenes catch (Exception e) { // Catch it and move on. This includes situations where splist has inconsistent info - m_log.WarnFormat("[SCENE]: Problem processing action in ForEachSOG: ", e.Message); + m_log.WarnFormat("[SCENE]: Problem processing action in ForEachSOG: ", e.ToString()); } } } @@ -1093,7 +1129,6 @@ namespace OpenSim.Region.Framework.Scenes catch (Exception e) { m_log.Info("[BUG] in " + m_parentScene.RegionInfo.RegionName + ": " + e.ToString()); - m_log.Info("[BUG] Stack Trace: " + e.StackTrace); } } } @@ -1248,37 +1283,26 @@ namespace OpenSim.Region.Framework.Scenes /// /// /// - protected internal void UpdatePrimPosition(uint localID, Vector3 pos, IClientAPI remoteClient) + public void UpdatePrimPosition(uint localID, Vector3 pos, IClientAPI remoteClient) { SceneObjectGroup group = GetGroupByPrim(localID); + if (group != null) { - - // Vector3 oldPos = group.AbsolutePosition; if (group.IsAttachment || (group.RootPart.Shape.PCode == 9 && group.RootPart.Shape.State != 0)) { - - // If this is an attachment, then we need to save the modified - // object back into the avatar's inventory. First we save the - // attachment point information, then we update the relative - // positioning (which caused this method to get driven in the - // first place. Then we have to mark the object as NOT an - // attachment. This is necessary in order to correctly save - // and retrieve GroupPosition information for the attachment. - // Then we save the asset back into the appropriate inventory - // entry. Finally, we restore the object's attachment status. - + // Set the new attachment point data in the object byte attachmentPoint = group.GetAttachmentPoint(); group.UpdateGroupPosition(pos); group.RootPart.IsAttachment = false; group.AbsolutePosition = group.RootPart.AttachedPos; - m_parentScene.UpdateKnownItem(remoteClient, group, group.GetFromItemID(), group.OwnerID); group.SetAttachmentPoint(attachmentPoint); - + group.HasGroupChanged = true; } else { - if (m_parentScene.Permissions.CanMoveObject(group.UUID, remoteClient.AgentId) && m_parentScene.Permissions.CanObjectEntry(group.UUID, false, pos)) + if (m_parentScene.Permissions.CanMoveObject(group.UUID, remoteClient.AgentId) + && m_parentScene.Permissions.CanObjectEntry(group.UUID, false, pos)) { group.UpdateGroupPosition(pos); } @@ -1287,14 +1311,19 @@ namespace OpenSim.Region.Framework.Scenes } /// - /// + /// Update the texture entry of the given prim. /// + /// + /// A texture entry is an object that contains details of all the textures of the prim's face. In this case, + /// the texture is given in its byte serialized form. + /// /// /// /// protected internal void UpdatePrimTexture(uint localID, byte[] texture, IClientAPI remoteClient) { SceneObjectGroup group = GetGroupByPrim(localID); + if (group != null) { if (m_parentScene.Permissions.CanEditObject(group.UUID,remoteClient.AgentId)) @@ -1582,7 +1611,7 @@ namespace OpenSim.Region.Framework.Scenes { if (part != null) { - if (part.ParentGroup.Children.Count != 1) // Skip single + if (part.ParentGroup.PrimCount != 1) // Skip single { if (part.LinkNum < 2) // Root rootParts.Add(part); @@ -1601,6 +1630,11 @@ namespace OpenSim.Region.Framework.Scenes // Unlink all child parts from their groups // child.ParentGroup.DelinkFromGroup(child, true); + + // These are not in affected groups and will not be + // handled further. Do the honors here. + child.ParentGroup.HasGroupChanged = true; + child.ParentGroup.ScheduleGroupForFullUpdate(); } foreach (SceneObjectPart root in rootParts) @@ -1610,8 +1644,9 @@ namespace OpenSim.Region.Framework.Scenes // However, editing linked parts and unlinking may be different // SceneObjectGroup group = root.ParentGroup; - List newSet = new List(group.Children.Values); - int numChildren = group.Children.Count; + + List newSet = new List(group.Parts); + int numChildren = newSet.Count; // If there are prims left in a link set, but the root is // slated for unlink, we need to do this @@ -1652,8 +1687,6 @@ namespace OpenSim.Region.Framework.Scenes SceneObjectPart newRoot = newSet[0]; newSet.RemoveAt(0); - List linkIDs = new List(); - foreach (SceneObjectPart newChild in newSet) newChild.UpdateFlag = 0; @@ -1685,17 +1718,19 @@ namespace OpenSim.Region.Framework.Scenes UUID objid = UUID.Zero; SceneObjectPart obj = null; - List EntityList = GetEntities(); - foreach (EntityBase ent in EntityList) + EntityBase[] entityList = GetEntities(); + foreach (EntityBase ent in entityList) { if (ent is SceneObjectGroup) { - foreach (KeyValuePair subent in ((SceneObjectGroup)ent).Children) + SceneObjectGroup sog = ent as SceneObjectGroup; + + foreach (SceneObjectPart part in sog.Parts) { - if (subent.Value.LocalId == localID) + if (part.LocalId == localID) { - objid = subent.Key; - obj = subent.Value; + objid = part.UUID; + obj = part; } } } @@ -1735,6 +1770,8 @@ namespace OpenSim.Region.Framework.Scenes /// /// /// + /// + /// protected internal void DuplicateObject(uint originalPrim, Vector3 offset, uint flags, UUID AgentID, UUID GroupID) { //m_log.DebugFormat("[SCENE]: Duplication of object {0} at offset {1} requested by agent {2}", originalPrim, offset, AgentID); @@ -1749,13 +1786,17 @@ namespace OpenSim.Region.Framework.Scenes /// /// /// - protected internal SceneObjectGroup DuplicateObject(uint originalPrimID, Vector3 offset, uint flags, UUID AgentID, UUID GroupID, Quaternion rot) + /// + /// + /// + public SceneObjectGroup DuplicateObject(uint originalPrimID, Vector3 offset, uint flags, UUID AgentID, UUID GroupID, Quaternion rot) { //m_log.DebugFormat("[SCENE]: Duplication of object {0} at offset {1} requested by agent {2}", originalPrim, offset, AgentID); SceneObjectGroup original = GetGroupByPrim(originalPrimID); if (original != null) { - if (m_parentScene.Permissions.CanDuplicateObject(original.Children.Count, original.UUID, AgentID, original.AbsolutePosition)) + if (m_parentScene.Permissions.CanDuplicateObject( + original.PrimCount, original.UUID, AgentID, original.AbsolutePosition)) { SceneObjectGroup copy = original.Copy(true); copy.AbsolutePosition = copy.AbsolutePosition + offset; @@ -1765,8 +1806,7 @@ namespace OpenSim.Region.Framework.Scenes copy.SetOwnerId(AgentID); copy.SetRootPartOwner(copy.RootPart, AgentID, GroupID); - List partList = - new List(copy.Children.Values); + SceneObjectPart[] partList = copy.Parts; if (m_parentScene.Permissions.PropagatePermissions()) { @@ -1791,14 +1831,14 @@ namespace OpenSim.Region.Framework.Scenes // think it's selected, so it will never send a deselect... copy.IsSelected = false; - m_numPrim += copy.Children.Count; + m_numPrim += copy.Parts.Length; if (rot != Quaternion.Identity) { copy.UpdateGroupRotationR(rot); } - copy.CreateScriptInstances(0, false, m_parentScene.DefaultScriptEngine, 0); + copy.CreateScriptInstances(0, false, m_parentScene.DefaultScriptEngine, 1); copy.HasGroupChanged = true; copy.ScheduleGroupForFullUpdate(); copy.ResumeScripts(); diff --git a/OpenSim/Region/Framework/Scenes/SceneManager.cs b/OpenSim/Region/Framework/Scenes/SceneManager.cs index 3b8473469e..86ba2aa536 100644 --- a/OpenSim/Region/Framework/Scenes/SceneManager.cs +++ b/OpenSim/Region/Framework/Scenes/SceneManager.cs @@ -300,7 +300,7 @@ namespace OpenSim.Region.Framework.Scenes public void BackupCurrentScene() { - ForEachCurrentScene(delegate(Scene scene) { scene.Backup(); }); + ForEachCurrentScene(delegate(Scene scene) { scene.Backup(true); }); } public bool TrySetCurrentScene(string regionName) diff --git a/OpenSim/Region/Framework/Scenes/SceneObjectGroup.Inventory.cs b/OpenSim/Region/Framework/Scenes/SceneObjectGroup.Inventory.cs index 6c38d63fb9..9491dbf37c 100644 --- a/OpenSim/Region/Framework/Scenes/SceneObjectGroup.Inventory.cs +++ b/OpenSim/Region/Framework/Scenes/SceneObjectGroup.Inventory.cs @@ -46,13 +46,9 @@ namespace OpenSim.Region.Framework.Scenes /// public void ForceInventoryPersistence() { - lock (m_parts) - { - foreach (SceneObjectPart part in m_parts.Values) - { - part.Inventory.ForceInventoryPersistence(); - } - } + SceneObjectPart[] parts = m_parts.GetArray(); + for (int i = 0; i < parts.Length; i++) + parts[i].Inventory.ForceInventoryPersistence(); } /// @@ -64,10 +60,9 @@ namespace OpenSim.Region.Framework.Scenes // Don't start scripts if they're turned off in the region! if (!m_scene.RegionInfo.RegionSettings.DisableScripts) { - foreach (SceneObjectPart part in m_parts.Values) - { - part.Inventory.CreateScriptInstances(startParam, postOnRez, engine, stateSource); - } + SceneObjectPart[] parts = m_parts.GetArray(); + for (int i = 0; i < parts.Length; i++) + parts[i].Inventory.CreateScriptInstances(startParam, postOnRez, engine, stateSource); } } @@ -80,13 +75,9 @@ namespace OpenSim.Region.Framework.Scenes /// public void RemoveScriptInstances(bool sceneObjectBeingDeleted) { - lock (m_parts) - { - foreach (SceneObjectPart part in m_parts.Values) - { - part.Inventory.RemoveScriptInstances(sceneObjectBeingDeleted); - } - } + SceneObjectPart[] parts = m_parts.GetArray(); + for (int i = 0; i < parts.Length; i++) + parts[i].Inventory.RemoveScriptInstances(sceneObjectBeingDeleted); } /// @@ -283,8 +274,11 @@ namespace OpenSim.Region.Framework.Scenes PermissionMask.Transfer) | 7; uint ownerMask = 0x7fffffff; - foreach (SceneObjectPart part in m_parts.Values) + + SceneObjectPart[] parts = m_parts.GetArray(); + for (int i = 0; i < parts.Length; i++) { + SceneObjectPart part = parts[i]; ownerMask &= part.OwnerMask; perms &= part.Inventory.MaskEffectivePermissions(); } @@ -312,39 +306,40 @@ namespace OpenSim.Region.Framework.Scenes public void ApplyNextOwnerPermissions() { - foreach (SceneObjectPart part in m_parts.Values) - { - part.ApplyNextOwnerPermissions(); - } + SceneObjectPart[] parts = m_parts.GetArray(); + for (int i = 0; i < parts.Length; i++) + parts[i].ApplyNextOwnerPermissions(); } public string GetStateSnapshot() { Dictionary states = new Dictionary(); - foreach (SceneObjectPart part in m_parts.Values) + SceneObjectPart[] parts = m_parts.GetArray(); + for (int i = 0; i < parts.Length; i++) { + SceneObjectPart part = parts[i]; foreach (KeyValuePair s in part.Inventory.GetScriptStates()) states[s.Key] = s.Value; } if (states.Count < 1) - return ""; + return String.Empty; XmlDocument xmldoc = new XmlDocument(); XmlNode xmlnode = xmldoc.CreateNode(XmlNodeType.XmlDeclaration, - "", ""); + String.Empty, String.Empty); xmldoc.AppendChild(xmlnode); XmlElement rootElement = xmldoc.CreateElement("", "ScriptData", - ""); + String.Empty); xmldoc.AppendChild(rootElement); XmlElement wrapper = xmldoc.CreateElement("", "ScriptStates", - ""); + String.Empty); rootElement.AppendChild(wrapper); @@ -424,19 +419,17 @@ namespace OpenSim.Region.Framework.Scenes public void ResumeScripts() { - foreach (SceneObjectPart part in m_parts.Values) - { - part.Inventory.ResumeScripts(); - } + SceneObjectPart[] parts = m_parts.GetArray(); + for (int i = 0; i < parts.Length; i++) + parts[i].Inventory.ResumeScripts(); } #region REGION SYNC public void SuspendScripts() { - foreach (SceneObjectPart part in m_parts.Values) - { - part.Inventory.SuspendScripts(); - } + SceneObjectPart[] parts = m_parts.GetArray(); + for (int i = 0; i < parts.Length; i++) + parts[i].Inventory.SuspendScripts(); } #endregion REGION SYNC } diff --git a/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs b/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs index 1476e98678..24984aa386 100644 --- a/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs +++ b/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs @@ -29,6 +29,7 @@ using System; using System.Collections.Generic; using System.Drawing; using System.IO; +using System.Linq; using System.Threading; using System.Xml; using System.Xml.Serialization; @@ -157,17 +158,14 @@ namespace OpenSim.Region.Framework.Scenes } } - public float scriptScore = 0f; + public float scriptScore; private Vector3 lastPhysGroupPos; private Quaternion lastPhysGroupRot; - private bool m_isBackedUp = false; + private bool m_isBackedUp; - /// - /// The constituent parts of this group - /// - protected Dictionary m_parts = new Dictionary(); + protected MapAndArray m_parts = new MapAndArray(); protected ulong m_regionHandle; protected SceneObjectPart m_rootPart; @@ -176,13 +174,13 @@ namespace OpenSim.Region.Framework.Scenes private Dictionary m_targets = new Dictionary(); private Dictionary m_rotTargets = new Dictionary(); - private bool m_scriptListens_atTarget = false; - private bool m_scriptListens_notAtTarget = false; + private bool m_scriptListens_atTarget; + private bool m_scriptListens_notAtTarget; - private bool m_scriptListens_atRotTarget = false; - private bool m_scriptListens_notAtRotTarget = false; + private bool m_scriptListens_atRotTarget; + private bool m_scriptListens_notAtRotTarget; - internal Dictionary m_savedScriptState = null; + internal Dictionary m_savedScriptState; #region Properties @@ -193,7 +191,7 @@ namespace OpenSim.Region.Framework.Scenes { get { if (RootPart == null) - return ""; + return String.Empty; return RootPart.Name; } set { RootPart.Name = value; } @@ -235,13 +233,14 @@ namespace OpenSim.Region.Framework.Scenes set { m_rootPart.GroupID = value; } } - /// - /// The parts of this scene object group. You must lock this property before using it. - /// - public Dictionary Children + public SceneObjectPart[] Parts { - get { return m_parts; } - set { m_parts = value; } + get { return m_parts.GetArray(); } + } + + public bool ContainsPart(UUID partID) + { + return m_parts.ContainsKey(partID); } /// @@ -258,13 +257,9 @@ namespace OpenSim.Region.Framework.Scenes set { m_regionHandle = value; - lock (m_parts) - { - foreach (SceneObjectPart part in m_parts.Values) - { - part.RegionHandle = m_regionHandle; - } - } + SceneObjectPart[] parts = m_parts.GetArray(); + for (int i = 0; i < parts.Length; i++) + parts[i].RegionHandle = value; } } @@ -297,7 +292,7 @@ namespace OpenSim.Region.Framework.Scenes //if ((m_scene.TestBorderCross(val - Vector3.UnitX, Cardinals.E) || m_scene.TestBorderCross(val + Vector3.UnitX, Cardinals.W) // || m_scene.TestBorderCross(val - Vector3.UnitY, Cardinals.N) || m_scene.TestBorderCross(val + Vector3.UnitY, Cardinals.S)) // && !IsAttachmentCheckFull()) - if (m_scene.IsBorderCrossing(LocX, LocY, val) && !IsAttachmentCheckFull()) + if (m_scene.IsBorderCrossing(LocX, LocY, val) && !IsAttachmentCheckFull()&& (!m_scene.LoadingPrims)) { m_scene.CrossPrimGroupIntoNewRegion(val, this, true); } @@ -312,13 +307,10 @@ namespace OpenSim.Region.Framework.Scenes return; } } - lock (m_parts) - { - foreach (SceneObjectPart part in m_parts.Values) - { - part.GroupPosition = val; - } - } + + SceneObjectPart[] parts = m_parts.GetArray(); + for (int i = 0; i < parts.Length; i++) + parts[i].GroupPosition = val; //if (m_rootPart.PhysActor != null) //{ @@ -339,7 +331,15 @@ namespace OpenSim.Region.Framework.Scenes public override UUID UUID { get { return m_rootPart.UUID; } - set { m_rootPart.UUID = value; } + set + { + lock (m_parts.SyncRoot) + { + m_parts.Remove(m_rootPart.UUID); + m_rootPart.UUID = value; + m_parts.Add(value, m_rootPart); + } + } } public UUID OwnerID @@ -400,12 +400,12 @@ namespace OpenSim.Region.Framework.Scenes { m_rootPart.PhysActor.Selected = value; // Pass it on to the children. - foreach (SceneObjectPart child in Children.Values) + SceneObjectPart[] parts = m_parts.GetArray(); + for (int i = 0; i < parts.Length; i++) { + SceneObjectPart child = parts[i]; if (child.PhysActor != null) - { child.PhysActor.Selected = value; - } } } } @@ -494,13 +494,15 @@ namespace OpenSim.Region.Framework.Scenes XmlNodeList nodes = doc.GetElementsByTagName("SavedScriptState"); if (nodes.Count > 0) { - m_savedScriptState = new Dictionary(); + if (m_savedScriptState == null) + m_savedScriptState = new Dictionary(); foreach (XmlNode node in nodes) { if (node.Attributes["UUID"] != null) { UUID itemid = new UUID(node.Attributes["UUID"].Value); - m_savedScriptState.Add(itemid, node.InnerXml); + if (itemid != UUID.Zero) + m_savedScriptState[itemid] = node.InnerXml; } } } @@ -508,13 +510,9 @@ namespace OpenSim.Region.Framework.Scenes public void SetFromItemID(UUID AssetId) { - lock (m_parts) - { - foreach (SceneObjectPart part in m_parts.Values) - { - part.FromItemID = AssetId; - } - } + SceneObjectPart[] parts = m_parts.GetArray(); + for (int i = 0; i < parts.Length; i++) + parts[i].FromItemID = AssetId; } public UUID GetFromItemID() @@ -553,18 +551,15 @@ namespace OpenSim.Region.Framework.Scenes if (m_rootPart.LocalId == 0) m_rootPart.LocalId = m_scene.AllocateLocalId(); - // No need to lock here since the object isn't yet in a scene - foreach (SceneObjectPart part in m_parts.Values) + SceneObjectPart[] parts = m_parts.GetArray(); + for (int i = 0; i < parts.Length; i++) { + SceneObjectPart part = parts[i]; if (Object.ReferenceEquals(part, m_rootPart)) - { continue; - } if (part.LocalId == 0) - { part.LocalId = m_scene.AllocateLocalId(); - } part.ParentID = m_rootPart.LocalId; //m_log.DebugFormat("[SCENE]: Given local id {0} to part {1}, linknum {2}, parent {3} {4}", part.LocalId, part.UUID, part.LinkNum, part.ParentID, part.ParentUUID); @@ -583,22 +578,22 @@ namespace OpenSim.Region.Framework.Scenes Vector3 maxScale = Vector3.Zero; Vector3 finalScale = new Vector3(0.5f, 0.5f, 0.5f); - lock (m_parts) + SceneObjectPart[] parts = m_parts.GetArray(); + for (int i = 0; i < parts.Length; i++) { - foreach (SceneObjectPart part in m_parts.Values) - { - Vector3 partscale = part.Scale; - Vector3 partoffset = part.OffsetPosition; + SceneObjectPart part = parts[i]; + Vector3 partscale = part.Scale; + Vector3 partoffset = part.OffsetPosition; - minScale.X = (partscale.X + partoffset.X < minScale.X) ? partscale.X + partoffset.X : minScale.X; - minScale.Y = (partscale.Y + partoffset.Y < minScale.Y) ? partscale.Y + partoffset.Y : minScale.Y; - minScale.Z = (partscale.Z + partoffset.Z < minScale.Z) ? partscale.Z + partoffset.Z : minScale.Z; + minScale.X = (partscale.X + partoffset.X < minScale.X) ? partscale.X + partoffset.X : minScale.X; + minScale.Y = (partscale.Y + partoffset.Y < minScale.Y) ? partscale.Y + partoffset.Y : minScale.Y; + minScale.Z = (partscale.Z + partoffset.Z < minScale.Z) ? partscale.Z + partoffset.Z : minScale.Z; - maxScale.X = (partscale.X + partoffset.X > maxScale.X) ? partscale.X + partoffset.X : maxScale.X; - maxScale.Y = (partscale.Y + partoffset.Y > maxScale.Y) ? partscale.Y + partoffset.Y : maxScale.Y; - maxScale.Z = (partscale.Z + partoffset.Z > maxScale.Z) ? partscale.Z + partoffset.Z : maxScale.Z; - } + maxScale.X = (partscale.X + partoffset.X > maxScale.X) ? partscale.X + partoffset.X : maxScale.X; + maxScale.Y = (partscale.Y + partoffset.Y > maxScale.Y) ? partscale.Y + partoffset.Y : maxScale.Y; + maxScale.Z = (partscale.Z + partoffset.Z > maxScale.Z) ? partscale.Z + partoffset.Z : maxScale.Z; } + finalScale.X = (minScale.X > maxScale.X) ? minScale.X : maxScale.X; finalScale.Y = (minScale.Y > maxScale.Y) ? minScale.Y : maxScale.Y; finalScale.Z = (minScale.Z > maxScale.Z) ? minScale.Z : maxScale.Z; @@ -614,39 +609,40 @@ namespace OpenSim.Region.Framework.Scenes EntityIntersection result = new EntityIntersection(); - lock (m_parts) + SceneObjectPart[] parts = m_parts.GetArray(); + for (int i = 0; i < parts.Length; i++) { - foreach (SceneObjectPart part in m_parts.Values) + SceneObjectPart part = parts[i]; + + // Temporary commented to stop compiler warning + //Vector3 partPosition = + // new Vector3(part.AbsolutePosition.X, part.AbsolutePosition.Y, part.AbsolutePosition.Z); + Quaternion parentrotation = GroupRotation; + + // Telling the prim to raytrace. + //EntityIntersection inter = part.TestIntersection(hRay, parentrotation); + + EntityIntersection inter = part.TestIntersectionOBB(hRay, parentrotation, frontFacesOnly, faceCenters); + + // This may need to be updated to the maximum draw distance possible.. + // We might (and probably will) be checking for prim creation from other sims + // when the camera crosses the border. + float idist = Constants.RegionSize; + + if (inter.HitTF) { - // Temporary commented to stop compiler warning - //Vector3 partPosition = - // new Vector3(part.AbsolutePosition.X, part.AbsolutePosition.Y, part.AbsolutePosition.Z); - Quaternion parentrotation = GroupRotation; - - // Telling the prim to raytrace. - //EntityIntersection inter = part.TestIntersection(hRay, parentrotation); - - EntityIntersection inter = part.TestIntersectionOBB(hRay, parentrotation,frontFacesOnly, faceCenters); - - // This may need to be updated to the maximum draw distance possible.. - // We might (and probably will) be checking for prim creation from other sims - // when the camera crosses the border. - float idist = Constants.RegionSize; - - if (inter.HitTF) + // We need to find the closest prim to return to the testcaller along the ray + if (inter.distance < idist) { - // We need to find the closest prim to return to the testcaller along the ray - if (inter.distance < idist) - { - result.HitTF = true; - result.ipoint = inter.ipoint; - result.obj = part; - result.normal = inter.normal; - result.distance = inter.distance; - } + result.HitTF = true; + result.ipoint = inter.ipoint; + result.obj = part; + result.normal = inter.normal; + result.distance = inter.distance; } } } + return result; } @@ -665,238 +661,193 @@ namespace OpenSim.Region.Framework.Scenes minY = 256f; minZ = 8192f; - lock(m_parts); + SceneObjectPart[] parts = m_parts.GetArray(); + for (int i = 0; i < parts.Length; i++) { - foreach (SceneObjectPart part in m_parts.Values) - { - Vector3 worldPos = part.GetWorldPosition(); - Vector3 offset = worldPos - AbsolutePosition; - Quaternion worldRot; - if (part.ParentID == 0) - { - worldRot = part.RotationOffset; - } - else - { - worldRot = part.GetWorldRotation(); - } + SceneObjectPart part = parts[i]; - Vector3 frontTopLeft; - Vector3 frontTopRight; - Vector3 frontBottomLeft; - Vector3 frontBottomRight; + Vector3 worldPos = part.GetWorldPosition(); + Vector3 offset = worldPos - AbsolutePosition; + Quaternion worldRot; + if (part.ParentID == 0) + worldRot = part.RotationOffset; + else + worldRot = part.GetWorldRotation(); - Vector3 backTopLeft; - Vector3 backTopRight; - Vector3 backBottomLeft; - Vector3 backBottomRight; + Vector3 frontTopLeft; + Vector3 frontTopRight; + Vector3 frontBottomLeft; + Vector3 frontBottomRight; - // Vector3[] corners = new Vector3[8]; + Vector3 backTopLeft; + Vector3 backTopRight; + Vector3 backBottomLeft; + Vector3 backBottomRight; - Vector3 orig = Vector3.Zero; + Vector3 orig = Vector3.Zero; - frontTopLeft.X = orig.X - (part.Scale.X / 2); - frontTopLeft.Y = orig.Y - (part.Scale.Y / 2); - frontTopLeft.Z = orig.Z + (part.Scale.Z / 2); + frontTopLeft.X = orig.X - (part.Scale.X / 2); + frontTopLeft.Y = orig.Y - (part.Scale.Y / 2); + frontTopLeft.Z = orig.Z + (part.Scale.Z / 2); - frontTopRight.X = orig.X - (part.Scale.X / 2); - frontTopRight.Y = orig.Y + (part.Scale.Y / 2); - frontTopRight.Z = orig.Z + (part.Scale.Z / 2); + frontTopRight.X = orig.X - (part.Scale.X / 2); + frontTopRight.Y = orig.Y + (part.Scale.Y / 2); + frontTopRight.Z = orig.Z + (part.Scale.Z / 2); - frontBottomLeft.X = orig.X - (part.Scale.X / 2); - frontBottomLeft.Y = orig.Y - (part.Scale.Y / 2); - frontBottomLeft.Z = orig.Z - (part.Scale.Z / 2); + frontBottomLeft.X = orig.X - (part.Scale.X / 2); + frontBottomLeft.Y = orig.Y - (part.Scale.Y / 2); + frontBottomLeft.Z = orig.Z - (part.Scale.Z / 2); - frontBottomRight.X = orig.X - (part.Scale.X / 2); - frontBottomRight.Y = orig.Y + (part.Scale.Y / 2); - frontBottomRight.Z = orig.Z - (part.Scale.Z / 2); + frontBottomRight.X = orig.X - (part.Scale.X / 2); + frontBottomRight.Y = orig.Y + (part.Scale.Y / 2); + frontBottomRight.Z = orig.Z - (part.Scale.Z / 2); - backTopLeft.X = orig.X + (part.Scale.X / 2); - backTopLeft.Y = orig.Y - (part.Scale.Y / 2); - backTopLeft.Z = orig.Z + (part.Scale.Z / 2); + backTopLeft.X = orig.X + (part.Scale.X / 2); + backTopLeft.Y = orig.Y - (part.Scale.Y / 2); + backTopLeft.Z = orig.Z + (part.Scale.Z / 2); - backTopRight.X = orig.X + (part.Scale.X / 2); - backTopRight.Y = orig.Y + (part.Scale.Y / 2); - backTopRight.Z = orig.Z + (part.Scale.Z / 2); + backTopRight.X = orig.X + (part.Scale.X / 2); + backTopRight.Y = orig.Y + (part.Scale.Y / 2); + backTopRight.Z = orig.Z + (part.Scale.Z / 2); - backBottomLeft.X = orig.X + (part.Scale.X / 2); - backBottomLeft.Y = orig.Y - (part.Scale.Y / 2); - backBottomLeft.Z = orig.Z - (part.Scale.Z / 2); + backBottomLeft.X = orig.X + (part.Scale.X / 2); + backBottomLeft.Y = orig.Y - (part.Scale.Y / 2); + backBottomLeft.Z = orig.Z - (part.Scale.Z / 2); - backBottomRight.X = orig.X + (part.Scale.X / 2); - backBottomRight.Y = orig.Y + (part.Scale.Y / 2); - backBottomRight.Z = orig.Z - (part.Scale.Z / 2); + backBottomRight.X = orig.X + (part.Scale.X / 2); + backBottomRight.Y = orig.Y + (part.Scale.Y / 2); + backBottomRight.Z = orig.Z - (part.Scale.Z / 2); - //m_log.InfoFormat("pre corner 1 is {0} {1} {2}", frontTopLeft.X, frontTopLeft.Y, frontTopLeft.Z); - //m_log.InfoFormat("pre corner 2 is {0} {1} {2}", frontTopRight.X, frontTopRight.Y, frontTopRight.Z); - //m_log.InfoFormat("pre corner 3 is {0} {1} {2}", frontBottomRight.X, frontBottomRight.Y, frontBottomRight.Z); - //m_log.InfoFormat("pre corner 4 is {0} {1} {2}", frontBottomLeft.X, frontBottomLeft.Y, frontBottomLeft.Z); - //m_log.InfoFormat("pre corner 5 is {0} {1} {2}", backTopLeft.X, backTopLeft.Y, backTopLeft.Z); - //m_log.InfoFormat("pre corner 6 is {0} {1} {2}", backTopRight.X, backTopRight.Y, backTopRight.Z); - //m_log.InfoFormat("pre corner 7 is {0} {1} {2}", backBottomRight.X, backBottomRight.Y, backBottomRight.Z); - //m_log.InfoFormat("pre corner 8 is {0} {1} {2}", backBottomLeft.X, backBottomLeft.Y, backBottomLeft.Z); + frontTopLeft = frontTopLeft * worldRot; + frontTopRight = frontTopRight * worldRot; + frontBottomLeft = frontBottomLeft * worldRot; + frontBottomRight = frontBottomRight * worldRot; - //for (int i = 0; i < 8; i++) - //{ - // corners[i] = corners[i] * worldRot; - // corners[i] += offset; - - // if (corners[i].X > maxX) - // maxX = corners[i].X; - // if (corners[i].X < minX) - // minX = corners[i].X; - - // if (corners[i].Y > maxY) - // maxY = corners[i].Y; - // if (corners[i].Y < minY) - // minY = corners[i].Y; - - // if (corners[i].Z > maxZ) - // maxZ = corners[i].Y; - // if (corners[i].Z < minZ) - // minZ = corners[i].Z; - //} - - frontTopLeft = frontTopLeft * worldRot; - frontTopRight = frontTopRight * worldRot; - frontBottomLeft = frontBottomLeft * worldRot; - frontBottomRight = frontBottomRight * worldRot; - - backBottomLeft = backBottomLeft * worldRot; - backBottomRight = backBottomRight * worldRot; - backTopLeft = backTopLeft * worldRot; - backTopRight = backTopRight * worldRot; + backBottomLeft = backBottomLeft * worldRot; + backBottomRight = backBottomRight * worldRot; + backTopLeft = backTopLeft * worldRot; + backTopRight = backTopRight * worldRot; - frontTopLeft += offset; - frontTopRight += offset; - frontBottomLeft += offset; - frontBottomRight += offset; + frontTopLeft += offset; + frontTopRight += offset; + frontBottomLeft += offset; + frontBottomRight += offset; - backBottomLeft += offset; - backBottomRight += offset; - backTopLeft += offset; - backTopRight += offset; + backBottomLeft += offset; + backBottomRight += offset; + backTopLeft += offset; + backTopRight += offset; - //m_log.InfoFormat("corner 1 is {0} {1} {2}", frontTopLeft.X, frontTopLeft.Y, frontTopLeft.Z); - //m_log.InfoFormat("corner 2 is {0} {1} {2}", frontTopRight.X, frontTopRight.Y, frontTopRight.Z); - //m_log.InfoFormat("corner 3 is {0} {1} {2}", frontBottomRight.X, frontBottomRight.Y, frontBottomRight.Z); - //m_log.InfoFormat("corner 4 is {0} {1} {2}", frontBottomLeft.X, frontBottomLeft.Y, frontBottomLeft.Z); - //m_log.InfoFormat("corner 5 is {0} {1} {2}", backTopLeft.X, backTopLeft.Y, backTopLeft.Z); - //m_log.InfoFormat("corner 6 is {0} {1} {2}", backTopRight.X, backTopRight.Y, backTopRight.Z); - //m_log.InfoFormat("corner 7 is {0} {1} {2}", backBottomRight.X, backBottomRight.Y, backBottomRight.Z); - //m_log.InfoFormat("corner 8 is {0} {1} {2}", backBottomLeft.X, backBottomLeft.Y, backBottomLeft.Z); + if (frontTopRight.X > maxX) + maxX = frontTopRight.X; + if (frontTopLeft.X > maxX) + maxX = frontTopLeft.X; + if (frontBottomRight.X > maxX) + maxX = frontBottomRight.X; + if (frontBottomLeft.X > maxX) + maxX = frontBottomLeft.X; - if (frontTopRight.X > maxX) - maxX = frontTopRight.X; - if (frontTopLeft.X > maxX) - maxX = frontTopLeft.X; - if (frontBottomRight.X > maxX) - maxX = frontBottomRight.X; - if (frontBottomLeft.X > maxX) - maxX = frontBottomLeft.X; + if (backTopRight.X > maxX) + maxX = backTopRight.X; + if (backTopLeft.X > maxX) + maxX = backTopLeft.X; + if (backBottomRight.X > maxX) + maxX = backBottomRight.X; + if (backBottomLeft.X > maxX) + maxX = backBottomLeft.X; - if (backTopRight.X > maxX) - maxX = backTopRight.X; - if (backTopLeft.X > maxX) - maxX = backTopLeft.X; - if (backBottomRight.X > maxX) - maxX = backBottomRight.X; - if (backBottomLeft.X > maxX) - maxX = backBottomLeft.X; + if (frontTopRight.X < minX) + minX = frontTopRight.X; + if (frontTopLeft.X < minX) + minX = frontTopLeft.X; + if (frontBottomRight.X < minX) + minX = frontBottomRight.X; + if (frontBottomLeft.X < minX) + minX = frontBottomLeft.X; - if (frontTopRight.X < minX) - minX = frontTopRight.X; - if (frontTopLeft.X < minX) - minX = frontTopLeft.X; - if (frontBottomRight.X < minX) - minX = frontBottomRight.X; - if (frontBottomLeft.X < minX) - minX = frontBottomLeft.X; + if (backTopRight.X < minX) + minX = backTopRight.X; + if (backTopLeft.X < minX) + minX = backTopLeft.X; + if (backBottomRight.X < minX) + minX = backBottomRight.X; + if (backBottomLeft.X < minX) + minX = backBottomLeft.X; - if (backTopRight.X < minX) - minX = backTopRight.X; - if (backTopLeft.X < minX) - minX = backTopLeft.X; - if (backBottomRight.X < minX) - minX = backBottomRight.X; - if (backBottomLeft.X < minX) - minX = backBottomLeft.X; + // + if (frontTopRight.Y > maxY) + maxY = frontTopRight.Y; + if (frontTopLeft.Y > maxY) + maxY = frontTopLeft.Y; + if (frontBottomRight.Y > maxY) + maxY = frontBottomRight.Y; + if (frontBottomLeft.Y > maxY) + maxY = frontBottomLeft.Y; - // - if (frontTopRight.Y > maxY) - maxY = frontTopRight.Y; - if (frontTopLeft.Y > maxY) - maxY = frontTopLeft.Y; - if (frontBottomRight.Y > maxY) - maxY = frontBottomRight.Y; - if (frontBottomLeft.Y > maxY) - maxY = frontBottomLeft.Y; + if (backTopRight.Y > maxY) + maxY = backTopRight.Y; + if (backTopLeft.Y > maxY) + maxY = backTopLeft.Y; + if (backBottomRight.Y > maxY) + maxY = backBottomRight.Y; + if (backBottomLeft.Y > maxY) + maxY = backBottomLeft.Y; - if (backTopRight.Y > maxY) - maxY = backTopRight.Y; - if (backTopLeft.Y > maxY) - maxY = backTopLeft.Y; - if (backBottomRight.Y > maxY) - maxY = backBottomRight.Y; - if (backBottomLeft.Y > maxY) - maxY = backBottomLeft.Y; + if (frontTopRight.Y < minY) + minY = frontTopRight.Y; + if (frontTopLeft.Y < minY) + minY = frontTopLeft.Y; + if (frontBottomRight.Y < minY) + minY = frontBottomRight.Y; + if (frontBottomLeft.Y < minY) + minY = frontBottomLeft.Y; - if (frontTopRight.Y < minY) - minY = frontTopRight.Y; - if (frontTopLeft.Y < minY) - minY = frontTopLeft.Y; - if (frontBottomRight.Y < minY) - minY = frontBottomRight.Y; - if (frontBottomLeft.Y < minY) - minY = frontBottomLeft.Y; + if (backTopRight.Y < minY) + minY = backTopRight.Y; + if (backTopLeft.Y < minY) + minY = backTopLeft.Y; + if (backBottomRight.Y < minY) + minY = backBottomRight.Y; + if (backBottomLeft.Y < minY) + minY = backBottomLeft.Y; - if (backTopRight.Y < minY) - minY = backTopRight.Y; - if (backTopLeft.Y < minY) - minY = backTopLeft.Y; - if (backBottomRight.Y < minY) - minY = backBottomRight.Y; - if (backBottomLeft.Y < minY) - minY = backBottomLeft.Y; + // + if (frontTopRight.Z > maxZ) + maxZ = frontTopRight.Z; + if (frontTopLeft.Z > maxZ) + maxZ = frontTopLeft.Z; + if (frontBottomRight.Z > maxZ) + maxZ = frontBottomRight.Z; + if (frontBottomLeft.Z > maxZ) + maxZ = frontBottomLeft.Z; - // - if (frontTopRight.Z > maxZ) - maxZ = frontTopRight.Z; - if (frontTopLeft.Z > maxZ) - maxZ = frontTopLeft.Z; - if (frontBottomRight.Z > maxZ) - maxZ = frontBottomRight.Z; - if (frontBottomLeft.Z > maxZ) - maxZ = frontBottomLeft.Z; + if (backTopRight.Z > maxZ) + maxZ = backTopRight.Z; + if (backTopLeft.Z > maxZ) + maxZ = backTopLeft.Z; + if (backBottomRight.Z > maxZ) + maxZ = backBottomRight.Z; + if (backBottomLeft.Z > maxZ) + maxZ = backBottomLeft.Z; - if (backTopRight.Z > maxZ) - maxZ = backTopRight.Z; - if (backTopLeft.Z > maxZ) - maxZ = backTopLeft.Z; - if (backBottomRight.Z > maxZ) - maxZ = backBottomRight.Z; - if (backBottomLeft.Z > maxZ) - maxZ = backBottomLeft.Z; + if (frontTopRight.Z < minZ) + minZ = frontTopRight.Z; + if (frontTopLeft.Z < minZ) + minZ = frontTopLeft.Z; + if (frontBottomRight.Z < minZ) + minZ = frontBottomRight.Z; + if (frontBottomLeft.Z < minZ) + minZ = frontBottomLeft.Z; - if (frontTopRight.Z < minZ) - minZ = frontTopRight.Z; - if (frontTopLeft.Z < minZ) - minZ = frontTopLeft.Z; - if (frontBottomRight.Z < minZ) - minZ = frontBottomRight.Z; - if (frontBottomLeft.Z < minZ) - minZ = frontBottomLeft.Z; - - if (backTopRight.Z < minZ) - minZ = backTopRight.Z; - if (backTopLeft.Z < minZ) - minZ = backTopLeft.Z; - if (backBottomRight.Z < minZ) - minZ = backBottomRight.Z; - if (backBottomLeft.Z < minZ) - minZ = backBottomLeft.Z; - } + if (backTopRight.Z < minZ) + minZ = backTopRight.Z; + if (backTopLeft.Z < minZ) + minZ = backTopLeft.Z; + if (backBottomRight.Z < minZ) + minZ = backBottomRight.Z; + if (backBottomLeft.Z < minZ) + minZ = backBottomLeft.Z; } } @@ -936,17 +887,12 @@ namespace OpenSim.Region.Framework.Scenes XmlDocument doc = new XmlDocument(); Dictionary states = new Dictionary(); - // Capture script state while holding the lock - lock (m_parts) + SceneObjectPart[] parts = m_parts.GetArray(); + for (int i = 0; i < parts.Length; i++) { - foreach (SceneObjectPart part in m_parts.Values) - { - Dictionary pstates = part.Inventory.GetScriptStates(); - foreach (UUID itemid in pstates.Keys) - { - states.Add(itemid, pstates[itemid]); - } - } + Dictionary pstates = parts[i].Inventory.GetScriptStates(); + foreach (KeyValuePair kvp in pstates) + states.Add(kvp.Key, kvp.Value); } if (states.Count > 0) @@ -965,74 +911,6 @@ namespace OpenSim.Region.Framework.Scenes } } - /// - /// Attach this scene object to the given avatar. - /// - /// - /// - /// - public void AttachToAgent(UUID agentID, uint attachmentpoint, Vector3 AttachOffset, bool silent) - { - ScenePresence avatar = m_scene.GetScenePresence(agentID); - if (avatar != null) - { - // don't attach attachments to child agents - if (avatar.IsChildAgent) return; - -// m_log.DebugFormat("[SOG]: Adding attachment {0} to avatar {1}", Name, avatar.Name); - - DetachFromBackup(); - - // Remove from database and parcel prim count - m_scene.DeleteFromStorage(UUID); - m_scene.EventManager.TriggerParcelPrimCountTainted(); - - m_rootPart.AttachedAvatar = agentID; - - //Anakin Lohner bug #3839 - foreach (SceneObjectPart p in m_parts.Values) - { - p.AttachedAvatar = agentID; - } - - if (m_rootPart.PhysActor != null) - { - m_scene.PhysicsScene.RemovePrim(m_rootPart.PhysActor); - m_rootPart.PhysActor = null; - } - - AbsolutePosition = AttachOffset; - m_rootPart.AttachedPos = AttachOffset; - m_rootPart.IsAttachment = true; - - m_rootPart.SetParentLocalId(avatar.LocalId); - SetAttachmentPoint(Convert.ToByte(attachmentpoint)); - - avatar.AddAttachment(this); - - if (!silent) - { - // Killing it here will cause the client to deselect it - // It then reappears on the avatar, deselected - // through the full update below - // - if (IsSelected) - { - m_scene.SendKillObject(m_rootPart.LocalId); - } - - IsSelected = false; // fudge.... - ScheduleGroupForFullUpdate(); - } - } - else - { - m_log.WarnFormat( - "[SOG]: Tried to add attachment {0} to avatar with UUID {1} in region {2} but the avatar is not present", - UUID, agentID, Scene.RegionInfo.RegionName); - } - } - public byte GetAttachmentPoint() { return m_rootPart.Shape.State; @@ -1060,11 +938,10 @@ namespace OpenSim.Region.Framework.Scenes AbsolutePosition = detachedpos; m_rootPart.AttachedAvatar = UUID.Zero; - //Anakin Lohner bug #3839 - foreach (SceneObjectPart p in m_parts.Values) - { - p.AttachedAvatar = UUID.Zero; - } + + SceneObjectPart[] parts = m_parts.GetArray(); + for (int i = 0; i < parts.Length; i++) + parts[i].AttachedAvatar = UUID.Zero; m_rootPart.SetParentLocalId(0); SetAttachmentPoint((byte)0); @@ -1089,11 +966,10 @@ namespace OpenSim.Region.Framework.Scenes } m_rootPart.AttachedAvatar = UUID.Zero; - //Anakin Lohner bug #3839 - foreach (SceneObjectPart p in m_parts.Values) - { - p.AttachedAvatar = UUID.Zero; - } + + SceneObjectPart[] parts = m_parts.GetArray(); + for (int i = 0; i < parts.Length; i++) + parts[i].AttachedAvatar = UUID.Zero; m_rootPart.SetParentLocalId(0); //m_rootPart.SetAttachmentPoint((byte)0); @@ -1116,13 +992,9 @@ namespace OpenSim.Region.Framework.Scenes public override void UpdateMovement() { - lock (m_parts) - { - foreach (SceneObjectPart part in m_parts.Values) - { - part.UpdateMovement(); - } - } + SceneObjectPart[] parts = m_parts.GetArray(); + for (int i = 0; i < parts.Length; i++) + parts[i].UpdateMovement(); } public ushort GetTimeDilation() @@ -1155,8 +1027,6 @@ namespace OpenSim.Region.Framework.Scenes part.ParentID = 0; part.LinkNum = 0; - // No locking required since the SOG should not be in the scene yet - one can't change root parts after - // the scene object has been attached to the scene m_parts.Add(m_rootPart.UUID, m_rootPart); } @@ -1166,16 +1036,10 @@ namespace OpenSim.Region.Framework.Scenes /// public void AddPart(SceneObjectPart part) { - lock (m_parts) - { - part.SetParent(this); - m_parts.Add(part.UUID, part); - - part.LinkNum = m_parts.Count; - - if (part.LinkNum == 2 && RootPart != null) - RootPart.LinkNum = 1; - } + part.SetParent(this); + part.LinkNum = m_parts.Add(part.UUID, part); + if (part.LinkNum == 2 && RootPart != null) + RootPart.LinkNum = 1; } /// @@ -1183,28 +1047,20 @@ namespace OpenSim.Region.Framework.Scenes /// private void UpdateParentIDs() { - lock (m_parts) + SceneObjectPart[] parts = m_parts.GetArray(); + for (int i = 0; i < parts.Length; i++) { - foreach (SceneObjectPart part in m_parts.Values) - { - if (part.UUID != m_rootPart.UUID) - { - part.ParentID = m_rootPart.LocalId; - } - } + SceneObjectPart part = parts[i]; + if (part.UUID != m_rootPart.UUID) + part.ParentID = m_rootPart.LocalId; } } public void RegenerateFullIDs() { - lock (m_parts) - { - foreach (SceneObjectPart part in m_parts.Values) - { - part.UUID = UUID.Random(); - - } - } + SceneObjectPart[] parts = m_parts.GetArray(); + for (int i = 0; i < parts.Length; i++) + parts[i].UUID = UUID.Random(); } // helper provided for parts. @@ -1237,7 +1093,7 @@ namespace OpenSim.Region.Framework.Scenes // teravus: AbsolutePosition is NOT a normal property! // the code in the getter of AbsolutePosition is significantly different then the code in the setter! - + // jhurliman: Then why is it a property instead of two methods? } public UUID GetPartsFullID(uint localID) @@ -1275,42 +1131,40 @@ namespace OpenSim.Region.Framework.Scenes } /// - /// Delete this group from its scene and tell all the scene presences about that deletion. + /// Delete this group from its scene. /// - /// Broadcast deletions to all clients. - public void DeleteGroup(bool silent) + /// + /// This only handles the in-world consequences of deletion (e.g. any avatars sitting on it are forcibly stood + /// up and all avatars receive notification of its removal. Removal of the scene object from database backup + /// must be handled by the caller. + /// + /// If true then deletion is not broadcast to clients + public void DeleteGroupFromScene(bool silent) { - // We need to keep track of this state in case this group is still queued for backup. - m_isDeleted = true; - - DetachFromBackup(); - - lock (m_parts) + SceneObjectPart[] parts = m_parts.GetArray(); + for (int i = 0; i < parts.Length; i++) { - foreach (SceneObjectPart part in m_parts.Values) - { -// part.Inventory.RemoveScriptInstances(); - // REGION SYNC - if (Scene.IsSyncedServer()) - { - Scene.RegionSyncServerModule.DeleteObject(part.RegionHandle, part.LocalId, part); - //return; - } - Scene.ForEachScenePresence(delegate(ScenePresence avatar) - { - if (avatar.ParentID == LocalId) - { - avatar.StandUp(); - } + SceneObjectPart part = parts[i]; - if (!silent) - { - part.UpdateFlag = 0; - if (part == m_rootPart) - avatar.ControllingClient.SendKillObject(m_regionHandle, part.LocalId); - } - }); + // REGION SYNC + if (Scene.IsSyncedServer()) + { + Scene.RegionSyncServerModule.DeleteObject(part.RegionHandle, part.LocalId, part); + //return; } + + Scene.ForEachScenePresence(delegate(ScenePresence avatar) + { + if (avatar.ParentID == LocalId) + avatar.StandUp(); + + if (!silent) + { + part.UpdateFlag = 0; + if (part == m_rootPart) + avatar.ControllingClient.SendKillObject(m_regionHandle, part.LocalId); + } + }); } } @@ -1332,20 +1186,19 @@ namespace OpenSim.Region.Framework.Scenes public void aggregateScriptEvents() { - uint objectflagupdate=(uint)RootPart.GetEffectiveObjectFlags(); + PrimFlags objectflagupdate = (PrimFlags)RootPart.GetEffectiveObjectFlags(); - scriptEvents aggregateScriptEvents=0; + scriptEvents aggregateScriptEvents = 0; - lock (m_parts) + SceneObjectPart[] parts = m_parts.GetArray(); + for (int i = 0; i < parts.Length; i++) { - foreach (SceneObjectPart part in m_parts.Values) - { - if (part == null) - continue; - if (part != RootPart) - part.ObjectFlags = objectflagupdate; - aggregateScriptEvents |= part.AggregateScriptEvents; - } + SceneObjectPart part = parts[i]; + if (part == null) + continue; + if (part != RootPart) + part.Flags = objectflagupdate; + aggregateScriptEvents |= part.AggregateScriptEvents; } m_scriptListens_atTarget = ((aggregateScriptEvents & scriptEvents.at_target) != 0); @@ -1370,7 +1223,7 @@ namespace OpenSim.Region.Framework.Scenes ScheduleGroupForFullUpdate(); } - public override void SetText(string text, Vector3 color, double alpha) + public void SetText(string text, Vector3 color, double alpha) { Color = Color.FromArgb(0xff - (int) (alpha * 0xff), (int) (color.X * 0xff), @@ -1388,26 +1241,22 @@ namespace OpenSim.Region.Framework.Scenes /// public void ApplyPhysics(bool m_physicalPrim) { - lock (m_parts) + // Apply physics to the root prim + m_rootPart.ApplyPhysics(m_rootPart.GetEffectiveObjectFlags(), m_rootPart.VolumeDetectActive, m_physicalPrim); + + // Apply physics to child prims + SceneObjectPart[] parts = m_parts.GetArray(); + if (parts.Length > 1) { - if (m_parts.Count > 1) + for (int i = 0; i < parts.Length; i++) { - m_rootPart.ApplyPhysics(m_rootPart.GetEffectiveObjectFlags(), m_rootPart.VolumeDetectActive, m_physicalPrim); - foreach (SceneObjectPart part in m_parts.Values) - { - if (part.LocalId != m_rootPart.LocalId) - { - part.ApplyPhysics(m_rootPart.GetEffectiveObjectFlags(), part.VolumeDetectActive, m_physicalPrim); - } - } - - // Hack to get the physics scene geometries in the right spot - ResetChildPrimPhysicsPositions(); - } - else - { - m_rootPart.ApplyPhysics(m_rootPart.GetEffectiveObjectFlags(), m_rootPart.VolumeDetectActive, m_physicalPrim); + SceneObjectPart part = parts[i]; + if (part.LocalId != m_rootPart.LocalId) + part.ApplyPhysics(m_rootPart.GetEffectiveObjectFlags(), part.VolumeDetectActive, m_physicalPrim); } + + // Hack to get the physics scene geometries in the right spot + ResetChildPrimPhysicsPositions(); } } @@ -1418,13 +1267,9 @@ namespace OpenSim.Region.Framework.Scenes public void ForEachPart(Action whatToDo) { - lock (m_parts) - { - foreach (SceneObjectPart part in m_parts.Values) - { - whatToDo(part); - } - } + SceneObjectPart[] parts = m_parts.GetArray(); + for (int i = 0; i < parts.Length; i++) + whatToDo(parts[i]); } #region Events @@ -1433,17 +1278,24 @@ namespace OpenSim.Region.Framework.Scenes /// Processes backup. /// /// - public virtual void ProcessBackup(IRegionDataStore datastore, bool forcedBackup) + public virtual void ProcessBackup(ISimulationDataService datastore, bool forcedBackup) { if (!m_isBackedUp) + { +// m_log.DebugFormat( +// "[WATER WARS]: Ignoring backup of {0} {1} since object is not marked to be backed up", Name, UUID); return; + } + + if (IsDeleted || UUID == UUID.Zero) + { +// m_log.DebugFormat( +// "[WATER WARS]: Ignoring backup of {0} {1} since object is marked as already deleted", Name, UUID); + return; + } // Since this is the top of the section of call stack for backing up a particular scene object, don't let // any exception propogate upwards. - - if (IsDeleted || UUID == UUID.Zero) - return; - try { if (!m_scene.ShuttingDown) // if shutting down then there will be nothing to handle the return so leave till next restart @@ -1464,8 +1316,8 @@ namespace OpenSim.Region.Framework.Scenes DetachFromBackup(); m_log.InfoFormat("[SCENE]: Returning object {0} due to parcel auto return", RootPart.UUID.ToString()); m_scene.AddReturn(OwnerID, Name, AbsolutePosition, "parcel auto return"); - m_scene.DeRezObject(null, RootPart.LocalId, - RootPart.GroupID, DeRezAction.Return, UUID.Zero); + m_scene.DeRezObjects(null, new List() { RootPart.LocalId }, UUID.Zero, + DeRezAction.Return, UUID.Zero); return; } @@ -1476,11 +1328,11 @@ namespace OpenSim.Region.Framework.Scenes if (HasGroupChanged) { // don't backup while it's selected or you're asking for changes mid stream. - if ((isTimeToPersist()) || (forcedBackup)) + if (isTimeToPersist() || forcedBackup) { - m_log.DebugFormat( - "[SCENE]: Storing {0}, {1} in {2}", - Name, UUID, m_scene.RegionInfo.RegionName); +// m_log.DebugFormat( +// "[SCENE]: Storing {0}, {1} in {2}", +// Name, UUID, m_scene.RegionInfo.RegionName); SceneObjectGroup backup_group = Copy(false); backup_group.RootPart.Velocity = RootPart.Velocity; @@ -1489,6 +1341,7 @@ namespace OpenSim.Region.Framework.Scenes backup_group.RootPart.ParticleSystem = RootPart.ParticleSystem; HasGroupChanged = false; + m_scene.EventManager.TriggerOnSceneObjectPreSave(backup_group, this); datastore.StoreObject(backup_group, m_scene.RegionInfo.RegionID); backup_group.ForEachPart(delegate(SceneObjectPart part) @@ -1498,19 +1351,19 @@ namespace OpenSim.Region.Framework.Scenes backup_group = null; } - // else - // { - // m_log.DebugFormat( - // "[SCENE]: Did not update persistence of object {0} {1}, selected = {2}", - // Name, UUID, IsSelected); - // } +// else +// { +// m_log.DebugFormat( +// "[SCENE]: Did not update persistence of object {0} {1}, selected = {2}", +// Name, UUID, IsSelected); +// } } } catch (Exception e) { m_log.ErrorFormat( - "[SCENE]: Storing of {0}, {1} in {2} failed with exception {3}\n\t{4}", - Name, UUID, m_scene.RegionInfo.RegionName, e, e.StackTrace); + "[SCENE]: Storing of {0}, {1} in {2} failed with exception {3}{4}", + Name, UUID, m_scene.RegionInfo.RegionName, e.Message, e.StackTrace); } } @@ -1521,14 +1374,12 @@ namespace OpenSim.Region.Framework.Scenes RootPart.SendFullUpdate( remoteClient, m_scene.Permissions.GenerateClientFlags(remoteClient.AgentId, RootPart.UUID)); - lock (m_parts) + SceneObjectPart[] parts = m_parts.GetArray(); + for (int i = 0; i < parts.Length; i++) { - foreach (SceneObjectPart part in m_parts.Values) - { - if (part != RootPart) - part.SendFullUpdate( - remoteClient, m_scene.Permissions.GenerateClientFlags(remoteClient.AgentId, part.UUID)); - } + SceneObjectPart part = parts[i]; + if (part != RootPart) + part.SendFullUpdate(remoteClient, m_scene.Permissions.GenerateClientFlags(remoteClient.AgentId, part.UUID)); } } @@ -1537,12 +1388,13 @@ namespace OpenSim.Region.Framework.Scenes /// /// Duplicates this object, including operations such as physics set up and attaching to the backup event. /// + /// True if the duplicate will immediately be in the scene, false otherwise /// public SceneObjectGroup Copy(bool userExposed) { SceneObjectGroup dupe = (SceneObjectGroup)MemberwiseClone(); dupe.m_isBackedUp = false; - dupe.m_parts = new Dictionary(); + dupe.m_parts = new MapAndArray(); // Warning, The following code related to previousAttachmentStatus is needed so that clones of // attachments do not bordercross while they're being duplicated. This is hacktastic! @@ -1571,29 +1423,7 @@ namespace OpenSim.Region.Framework.Scenes if (userExposed) dupe.m_rootPart.TrimPermissions(); - /// may need to create a new Physics actor. - if (dupe.RootPart.PhysActor != null && userExposed) - { - PrimitiveBaseShape pbs = dupe.RootPart.Shape; - - dupe.RootPart.PhysActor = m_scene.PhysicsScene.AddPrimShape( - dupe.RootPart.Name, - pbs, - dupe.RootPart.AbsolutePosition, - dupe.RootPart.Scale, - dupe.RootPart.RotationOffset, - dupe.RootPart.PhysActor.IsPhysical); - - dupe.RootPart.PhysActor.LocalID = dupe.RootPart.LocalId; - dupe.RootPart.DoPhysicsPropertyUpdate(dupe.RootPart.PhysActor.IsPhysical, true); - } - - List partList; - - lock (m_parts) - { - partList = new List(m_parts.Values); - } + List partList = new List(m_parts.GetArray()); partList.Sort(delegate(SceneObjectPart p1, SceneObjectPart p2) { @@ -1606,11 +1436,28 @@ namespace OpenSim.Region.Framework.Scenes if (part.UUID != m_rootPart.UUID) { SceneObjectPart newPart = dupe.CopyPart(part, OwnerID, GroupID, userExposed); - newPart.LinkNum = part.LinkNum; } - } + // Need to duplicate the physics actor as well + if (part.PhysActor != null && userExposed) + { + PrimitiveBaseShape pbs = part.Shape; + + part.PhysActor + = m_scene.PhysicsScene.AddPrimShape( + string.Format("{0}/{1}", part.Name, part.UUID), + pbs, + part.AbsolutePosition, + part.Scale, + part.RotationOffset, + part.PhysActor.IsPhysical); + + part.PhysActor.LocalID = part.LocalId; + part.DoPhysicsPropertyUpdate(part.PhysActor.IsPhysical, true); + } + } + if (userExposed) { dupe.UpdateParentIDs(); @@ -1624,14 +1471,14 @@ namespace OpenSim.Region.Framework.Scenes } /// - /// + /// Copy the given part as the root part of this scene object. /// /// /// /// public void CopyRootPart(SceneObjectPart part, UUID cAgentID, UUID cGroupID, bool userExposed) { - SetRootPart(part.Copy(m_scene.AllocateLocalId(), OwnerID, GroupID, m_parts.Count, userExposed)); + SetRootPart(part.Copy(m_scene.AllocateLocalId(), OwnerID, GroupID, 0, userExposed)); } public void ScriptSetPhysicsStatus(bool UsePhysics) @@ -1882,15 +1729,9 @@ namespace OpenSim.Region.Framework.Scenes public SceneObjectPart CopyPart(SceneObjectPart part, UUID cAgentID, UUID cGroupID, bool userExposed) { SceneObjectPart newPart = part.Copy(m_scene.AllocateLocalId(), OwnerID, GroupID, m_parts.Count, userExposed); - newPart.SetParent(this); - - lock (m_parts) - { - m_parts.Add(newPart.UUID, newPart); - } + AddPart(newPart); SetPartAsNonRoot(newPart); - return newPart; } @@ -1902,14 +1743,15 @@ namespace OpenSim.Region.Framework.Scenes /// public void ResetIDs() { - // As this is only ever called for prims which are not currently part of the scene (and hence - // not accessible by clients), there should be no need to lock - List partsList = new List(m_parts.Values); - m_parts.Clear(); - foreach (SceneObjectPart part in partsList) + lock (m_parts.SyncRoot) { - part.ResetIDs(part.LinkNum); // Don't change link nums - m_parts.Add(part.UUID, part); + List partsList = new List(m_parts.GetArray()); + m_parts.Clear(); + foreach (SceneObjectPart part in partsList) + { + part.ResetIDs(part.LinkNum); // Don't change link nums + m_parts.Add(part.UUID, part); + } } } @@ -1919,7 +1761,6 @@ namespace OpenSim.Region.Framework.Scenes /// public void ServiceObjectPropertiesFamilyRequest(IClientAPI remoteClient, UUID AgentID, uint RequestFlags) { - remoteClient.SendObjectPropertiesFamilyData(RequestFlags, RootPart.UUID, RootPart.OwnerID, RootPart.GroupID, RootPart.BaseMask, RootPart.OwnerMask, RootPart.GroupMask, RootPart.EveryoneMask, RootPart.NextOwnerMask, RootPart.OwnershipCost, RootPart.ObjectSaleType, RootPart.SalePrice, RootPart.Category, @@ -1950,28 +1791,27 @@ namespace OpenSim.Region.Framework.Scenes //if ((RootPart.Flags & PrimFlags.TemporaryOnRez) != 0) // return; - lock (m_parts) + bool UsePhysics = ((RootPart.Flags & PrimFlags.Physics) != 0); + + if (UsePhysics && !AbsolutePosition.ApproxEquals(lastPhysGroupPos, 0.02f)) { - bool UsePhysics = ((RootPart.Flags & PrimFlags.Physics) != 0); + m_rootPart.UpdateFlag = 1; + lastPhysGroupPos = AbsolutePosition; + } - if (UsePhysics && !AbsolutePosition.ApproxEquals(lastPhysGroupPos, 0.02f)) - { - m_rootPart.UpdateFlag = 1; - lastPhysGroupPos = AbsolutePosition; - } + if (UsePhysics && !GroupRotation.ApproxEquals(lastPhysGroupRot, 0.1f)) + { + m_rootPart.UpdateFlag = 1; + lastPhysGroupRot = GroupRotation; + } - if (UsePhysics && !GroupRotation.ApproxEquals(lastPhysGroupRot, 0.1f)) - { - m_rootPart.UpdateFlag = 1; - lastPhysGroupRot = GroupRotation; - } - - foreach (SceneObjectPart part in m_parts.Values) - { - if (!IsSelected) - part.UpdateLookAt(); - part.SendScheduledUpdates(); - } + SceneObjectPart[] parts = m_parts.GetArray(); + for (int i = 0; i < parts.Length; i++) + { + SceneObjectPart part = parts[i]; + if (!IsSelected) + part.UpdateLookAt(); + part.SendScheduledUpdates(); } } @@ -1981,27 +1821,22 @@ namespace OpenSim.Region.Framework.Scenes RootPart.AddFullUpdateToAvatar(presence); - lock (m_parts) + SceneObjectPart[] parts = m_parts.GetArray(); + for (int i = 0; i < parts.Length; i++) { - foreach (SceneObjectPart part in m_parts.Values) - { - if (part != RootPart) - part.AddFullUpdateToAvatar(presence); - } + SceneObjectPart part = parts[i]; + if (part != RootPart) + part.AddFullUpdateToAvatar(presence); } } public void ScheduleTerseUpdateToAvatar(ScenePresence presence) { // m_log.DebugFormat("[SOG]: Scheduling terse update for {0} {1} just to avatar {2}", Name, UUID, presence.Name); - - lock (m_parts) - { - foreach (SceneObjectPart part in m_parts.Values) - { - part.AddTerseUpdateToAvatar(presence); - } - } + + SceneObjectPart[] parts = m_parts.GetArray(); + for (int i = 0; i < parts.Length; i++) + parts[i].AddTerseUpdateToAvatar(presence); } /// @@ -2009,19 +1844,18 @@ namespace OpenSim.Region.Framework.Scenes /// public void ScheduleGroupForFullUpdate() { - if (IsAttachment) - m_log.DebugFormat("[SOG]: Scheduling full update for {0} {1}", Name, LocalId); +// if (IsAttachment) +// m_log.DebugFormat("[SOG]: Scheduling full update for {0} {1}", Name, LocalId); checkAtTargets(); RootPart.ScheduleFullUpdate(); - lock (m_parts) + SceneObjectPart[] parts = m_parts.GetArray(); + for (int i = 0; i < parts.Length; i++) { - foreach (SceneObjectPart part in m_parts.Values) - { - if (part != RootPart) - part.ScheduleFullUpdate(); - } + SceneObjectPart part = parts[i]; + if (part != RootPart) + part.ScheduleFullUpdate(); } } @@ -2031,14 +1865,10 @@ namespace OpenSim.Region.Framework.Scenes public void ScheduleGroupForTerseUpdate() { // m_log.DebugFormat("[SOG]: Scheduling terse update for {0} {1}", Name, UUID); - - lock (m_parts) - { - foreach (SceneObjectPart part in m_parts.Values) - { - part.ScheduleTerseUpdate(); - } - } + + SceneObjectPart[] parts = m_parts.GetArray(); + for (int i = 0; i < parts.Length; i++) + parts[i].ScheduleTerseUpdate(); } /// @@ -2053,13 +1883,12 @@ namespace OpenSim.Region.Framework.Scenes RootPart.SendFullUpdateToAllClients(); - lock (m_parts) + SceneObjectPart[] parts = m_parts.GetArray(); + for (int i = 0; i < parts.Length; i++) { - foreach (SceneObjectPart part in m_parts.Values) - { - if (part != RootPart) - part.SendFullUpdateToAllClients(); - } + SceneObjectPart part = parts[i]; + if (part != RootPart) + part.SendFullUpdateToAllClients(); } } @@ -2092,14 +1921,10 @@ namespace OpenSim.Region.Framework.Scenes { if (IsDeleted) return; - - lock (m_parts) - { - foreach (SceneObjectPart part in m_parts.Values) - { - part.SendTerseUpdateToAllClients(); - } - } + + SceneObjectPart[] parts = m_parts.GetArray(); + for (int i = 0; i < parts.Length; i++) + parts[i].SendTerseUpdateToAllClients(); } #endregion @@ -2113,15 +1938,11 @@ namespace OpenSim.Region.Framework.Scenes /// null if no child part with that linknum or child part public SceneObjectPart GetLinkNumPart(int linknum) { - lock (m_parts) + SceneObjectPart[] parts = m_parts.GetArray(); + for (int i = 0; i < parts.Length; i++) { - foreach (SceneObjectPart part in m_parts.Values) - { - if (part.LinkNum == linknum) - { - return part; - } - } + if (parts[i].LinkNum == linknum) + return parts[i]; } return null; @@ -2134,11 +1955,8 @@ namespace OpenSim.Region.Framework.Scenes /// null if a child part with the primID was not found public SceneObjectPart GetChildPart(UUID primID) { - SceneObjectPart childPart = null; - if (m_parts.ContainsKey(primID)) - { - childPart = m_parts[primID]; - } + SceneObjectPart childPart; + m_parts.TryGetValue(primID, out childPart); return childPart; } @@ -2149,17 +1967,11 @@ namespace OpenSim.Region.Framework.Scenes /// null if a child part with the local ID was not found public SceneObjectPart GetChildPart(uint localID) { - //m_log.DebugFormat("Entered looking for {0}", localID); - lock (m_parts) + SceneObjectPart[] parts = m_parts.GetArray(); + for (int i = 0; i < parts.Length; i++) { - foreach (SceneObjectPart part in m_parts.Values) - { - //m_log.DebugFormat("Found {0}", part.LocalId); - if (part.LocalId == localID) - { - return part; - } - } + if (parts[i].LocalId == localID) + return parts[i]; } return null; @@ -2173,12 +1985,7 @@ namespace OpenSim.Region.Framework.Scenes /// public bool HasChildPrim(UUID primID) { - if (m_parts.ContainsKey(primID)) - { - return true; - } - - return false; + return m_parts.ContainsKey(primID); } /// @@ -2189,17 +1996,11 @@ namespace OpenSim.Region.Framework.Scenes /// public bool HasChildPrim(uint localID) { - //m_log.DebugFormat("Entered HasChildPrim looking for {0}", localID); - lock (m_parts) + SceneObjectPart[] parts = m_parts.GetArray(); + for (int i = 0; i < parts.Length; i++) { - foreach (SceneObjectPart part in m_parts.Values) - { - //m_log.DebugFormat("Found {0}", part.LocalId); - if (part.LocalId == localID) - { - return true; - } - } + if (parts[i].LocalId == localID) + return true; } return false; @@ -2250,19 +2051,21 @@ namespace OpenSim.Region.Framework.Scenes if (m_rootPart.LinkNum == 0) m_rootPart.LinkNum = 1; - lock (m_parts) + lock (m_parts.SyncRoot) { m_parts.Add(linkPart.UUID, linkPart); // Insert in terms of link numbers, the new links // before the current ones (with the exception of // the root prim. Shuffle the old ones up - foreach (KeyValuePair kvp in m_parts) + SceneObjectPart[] parts = m_parts.GetArray(); + for (int i = 0; i < parts.Length; i++) { - if (kvp.Value.LinkNum != 1) + SceneObjectPart part = parts[i]; + if (part.LinkNum != 1) { // Don't update root prim link number - kvp.Value.LinkNum += objectGroup.PrimCount; + part.LinkNum += objectGroup.PrimCount; } } @@ -2274,29 +2077,26 @@ namespace OpenSim.Region.Framework.Scenes //if (linkPart.PhysActor != null) //{ // m_scene.PhysicsScene.RemovePrim(linkPart.PhysActor); - + //linkPart.PhysActor = null; //} //TODO: rest of parts int linkNum = 3; - foreach (SceneObjectPart part in objectGroup.Children.Values) + SceneObjectPart[] ogParts = objectGroup.Parts; + for (int i = 0; i < ogParts.Length; i++) { + SceneObjectPart part = ogParts[i]; if (part.UUID != objectGroup.m_rootPart.UUID) - { LinkNonRootPart(part, oldGroupPosition, oldRootRotation, linkNum++); - } part.ClearUndoState(); } } - m_scene.UnlinkSceneObject(objectGroup.UUID, true); + m_scene.UnlinkSceneObject(objectGroup, true); objectGroup.m_isDeleted = true; - - lock (objectGroup.m_parts) - { - objectGroup.m_parts.Clear(); - } + + objectGroup.m_parts.Clear(); // Can't do this yet since backup still makes use of the root part without any synchronization // objectGroup.m_rootPart = null; @@ -2366,19 +2166,25 @@ namespace OpenSim.Region.Framework.Scenes Quaternion worldRot = linkPart.GetWorldRotation(); // Remove the part from this object - lock (m_parts) + lock (m_parts.SyncRoot) { m_parts.Remove(linkPart.UUID); - } - if (m_parts.Count == 1 && RootPart != null) //Single prim is left - RootPart.LinkNum = 0; - else - { - foreach (SceneObjectPart p in m_parts.Values) + SceneObjectPart[] parts = m_parts.GetArray(); + + if (parts.Length == 1 && RootPart != null) { - if (p.LinkNum > linkPart.LinkNum) - p.LinkNum--; + // Single prim left + RootPart.LinkNum = 0; + } + else + { + for (int i = 0; i < parts.Length; i++) + { + SceneObjectPart part = parts[i]; + if (part.LinkNum > linkPart.LinkNum) + part.LinkNum--; + } } } @@ -2449,7 +2255,6 @@ namespace OpenSim.Region.Framework.Scenes part.SetParent(this); part.ParentID = m_rootPart.LocalId; - // Caller locks m_parts for us m_parts.Add(part.UUID, part); part.LinkNum = linkNum; @@ -2702,24 +2507,21 @@ namespace OpenSim.Region.Framework.Scenes if (selectionPart != null) { - lock (m_parts) + SceneObjectPart[] parts = m_parts.GetArray(); + for (int i = 0; i < parts.Length; i++) { - foreach (SceneObjectPart part in m_parts.Values) + SceneObjectPart part = parts[i]; + if (part.Scale.X > m_scene.RegionInfo.PhysPrimMax || + part.Scale.Y > m_scene.RegionInfo.PhysPrimMax || + part.Scale.Z > m_scene.RegionInfo.PhysPrimMax) { - if (part.Scale.X > m_scene.RegionInfo.PhysPrimMax || - part.Scale.Y > m_scene.RegionInfo.PhysPrimMax || - part.Scale.Z > m_scene.RegionInfo.PhysPrimMax) - { - UsePhysics = false; // Reset physics - break; - } - } - - foreach (SceneObjectPart part in m_parts.Values) - { - part.UpdatePrimFlags(UsePhysics, IsTemporary, IsPhantom, IsVolumeDetect); + UsePhysics = false; // Reset physics + break; } } + + for (int i = 0; i < parts.Length; i++) + parts[i].UpdatePrimFlags(UsePhysics, IsTemporary, IsPhantom, IsVolumeDetect); } } @@ -2732,18 +2534,6 @@ namespace OpenSim.Region.Framework.Scenes } } - /// - /// Get the parts of this scene object - /// - /// - public SceneObjectPart[] GetParts() - { - int numParts = Children.Count; - SceneObjectPart[] partArray = new SceneObjectPart[numParts]; - Children.Values.CopyTo(partArray, 0); - return partArray; - } - /// /// Update the texture entry for this part /// @@ -2761,9 +2551,9 @@ namespace OpenSim.Region.Framework.Scenes public void UpdatePermissions(UUID AgentID, byte field, uint localID, uint mask, byte addRemTF) { - foreach (SceneObjectPart part in m_parts.Values) - part.UpdatePermissions(AgentID, field, localID, mask, - addRemTF); + SceneObjectPart[] parts = m_parts.GetArray(); + for (int i = 0; i < parts.Length; i++) + parts[i].UpdatePermissions(AgentID, field, localID, mask, addRemTF); HasGroupChanged = true; } @@ -2827,6 +2617,7 @@ namespace OpenSim.Region.Framework.Scenes //if (part.UUID != m_rootPart.UUID) HasGroupChanged = true; + part.TriggerScriptChangedEvent(Changed.SCALE); ScheduleGroupForFullUpdate(); //if (part.UUID == m_rootPart.UUID) @@ -2866,77 +2657,77 @@ namespace OpenSim.Region.Framework.Scenes float y = (scale.Y / part.Scale.Y); float z = (scale.Z / part.Scale.Z); - lock (m_parts) + SceneObjectPart[] parts; + if (x > 1.0f || y > 1.0f || z > 1.0f) { - if (x > 1.0f || y > 1.0f || z > 1.0f) + parts = m_parts.GetArray(); + for (int i = 0; i < parts.Length; i++) { - foreach (SceneObjectPart obPart in m_parts.Values) + SceneObjectPart obPart = parts[i]; + if (obPart.UUID != m_rootPart.UUID) { - if (obPart.UUID != m_rootPart.UUID) + obPart.IgnoreUndoUpdate = true; + Vector3 oldSize = new Vector3(obPart.Scale); + + float f = 1.0f; + float a = 1.0f; + + if (part.PhysActor != null && part.PhysActor.IsPhysical) { - obPart.IgnoreUndoUpdate = true; - Vector3 oldSize = new Vector3(obPart.Scale); - - float f = 1.0f; - float a = 1.0f; - - if (part.PhysActor != null && part.PhysActor.IsPhysical) + if (oldSize.X * x > m_scene.m_maxPhys) { - if (oldSize.X*x > m_scene.m_maxPhys) - { - f = m_scene.m_maxPhys / oldSize.X; - a = f / x; - x *= a; - y *= a; - z *= a; - } - if (oldSize.Y*y > m_scene.m_maxPhys) - { - f = m_scene.m_maxPhys / oldSize.Y; - a = f / y; - x *= a; - y *= a; - z *= a; - } - if (oldSize.Z*z > m_scene.m_maxPhys) - { - f = m_scene.m_maxPhys / oldSize.Z; - a = f / z; - x *= a; - y *= a; - z *= a; - } + f = m_scene.m_maxPhys / oldSize.X; + a = f / x; + x *= a; + y *= a; + z *= a; } - else + if (oldSize.Y * y > m_scene.m_maxPhys) { - if (oldSize.X*x > m_scene.m_maxNonphys) - { - f = m_scene.m_maxNonphys / oldSize.X; - a = f / x; - x *= a; - y *= a; - z *= a; - } - if (oldSize.Y*y > m_scene.m_maxNonphys) - { - f = m_scene.m_maxNonphys / oldSize.Y; - a = f / y; - x *= a; - y *= a; - z *= a; - } - if (oldSize.Z*z > m_scene.m_maxNonphys) - { - f = m_scene.m_maxNonphys / oldSize.Z; - a = f / z; - x *= a; - y *= a; - z *= a; - } + f = m_scene.m_maxPhys / oldSize.Y; + a = f / y; + x *= a; + y *= a; + z *= a; + } + if (oldSize.Z * z > m_scene.m_maxPhys) + { + f = m_scene.m_maxPhys / oldSize.Z; + a = f / z; + x *= a; + y *= a; + z *= a; } - obPart.IgnoreUndoUpdate = false; - obPart.StoreUndoState(); } + else + { + if (oldSize.X * x > m_scene.m_maxNonphys) + { + f = m_scene.m_maxNonphys / oldSize.X; + a = f / x; + x *= a; + y *= a; + z *= a; + } + if (oldSize.Y * y > m_scene.m_maxNonphys) + { + f = m_scene.m_maxNonphys / oldSize.Y; + a = f / y; + x *= a; + y *= a; + z *= a; + } + if (oldSize.Z * z > m_scene.m_maxNonphys) + { + f = m_scene.m_maxNonphys / oldSize.Z; + a = f / z; + x *= a; + y *= a; + z *= a; + } + } + obPart.IgnoreUndoUpdate = false; + obPart.StoreUndoState(); } } } @@ -2947,27 +2738,26 @@ namespace OpenSim.Region.Framework.Scenes prevScale.Z *= z; part.Resize(prevScale); - lock (m_parts) + parts = m_parts.GetArray(); + for (int i = 0; i < parts.Length; i++) { - foreach (SceneObjectPart obPart in m_parts.Values) + SceneObjectPart obPart = parts[i]; + obPart.IgnoreUndoUpdate = true; + if (obPart.UUID != m_rootPart.UUID) { - obPart.IgnoreUndoUpdate = true; - if (obPart.UUID != m_rootPart.UUID) - { - Vector3 currentpos = new Vector3(obPart.OffsetPosition); - currentpos.X *= x; - currentpos.Y *= y; - currentpos.Z *= z; - Vector3 newSize = new Vector3(obPart.Scale); - newSize.X *= x; - newSize.Y *= y; - newSize.Z *= z; - obPart.Resize(newSize); - obPart.UpdateOffSet(currentpos); - } - obPart.IgnoreUndoUpdate = false; - obPart.StoreUndoState(); + Vector3 currentpos = new Vector3(obPart.OffsetPosition); + currentpos.X *= x; + currentpos.Y *= y; + currentpos.Z *= z; + Vector3 newSize = new Vector3(obPart.Scale); + newSize.X *= x; + newSize.Y *= y; + newSize.Z *= z; + obPart.Resize(newSize); + obPart.UpdateOffSet(currentpos); } + obPart.IgnoreUndoUpdate = false; + obPart.StoreUndoState(); } if (part.PhysActor != null) @@ -2979,6 +2769,7 @@ namespace OpenSim.Region.Framework.Scenes part.IgnoreUndoUpdate = false; part.StoreUndoState(); HasGroupChanged = true; + m_rootPart.TriggerScriptChangedEvent(Changed.SCALE); ScheduleGroupForTerseUpdate(); } } @@ -2993,10 +2784,10 @@ namespace OpenSim.Region.Framework.Scenes /// public void UpdateGroupPosition(Vector3 pos) { - foreach (SceneObjectPart part in Children.Values) - { - part.StoreUndoState(); - } + SceneObjectPart[] parts = m_parts.GetArray(); + for (int i = 0; i < parts.Length; i++) + parts[i].StoreUndoState(); + if (m_scene.EventManager.TriggerGroupMove(UUID, pos)) { if (IsAttachment) @@ -3031,10 +2822,11 @@ namespace OpenSim.Region.Framework.Scenes public void UpdateSinglePosition(Vector3 pos, uint localID) { SceneObjectPart part = GetChildPart(localID); - foreach (SceneObjectPart parts in Children.Values) - { - parts.StoreUndoState(); - } + + SceneObjectPart[] parts = m_parts.GetArray(); + for (int i = 0; i < parts.Length; i++) + parts[i].StoreUndoState(); + if (part != null) { if (part.UUID == m_rootPart.UUID) @@ -3056,10 +2848,10 @@ namespace OpenSim.Region.Framework.Scenes /// private void UpdateRootPosition(Vector3 pos) { - foreach (SceneObjectPart part in Children.Values) - { - part.StoreUndoState(); - } + SceneObjectPart[] parts = m_parts.GetArray(); + for (int i = 0; i < parts.Length; i++) + parts[i].StoreUndoState(); + Vector3 newPos = new Vector3(pos.X, pos.Y, pos.Z); Vector3 oldPos = new Vector3(AbsolutePosition.X + m_rootPart.OffsetPosition.X, @@ -3071,15 +2863,12 @@ namespace OpenSim.Region.Framework.Scenes axDiff *= Quaternion.Inverse(partRotation); diff = axDiff; - lock (m_parts) + parts = m_parts.GetArray(); + for (int i = 0; i < parts.Length; i++) { - foreach (SceneObjectPart obPart in m_parts.Values) - { - if (obPart.UUID != m_rootPart.UUID) - { - obPart.OffsetPosition = obPart.OffsetPosition + diff; - } - } + SceneObjectPart obPart = parts[i]; + if (obPart.UUID != m_rootPart.UUID) + obPart.OffsetPosition = obPart.OffsetPosition + diff; } AbsolutePosition = newPos; @@ -3103,10 +2892,10 @@ namespace OpenSim.Region.Framework.Scenes /// public void UpdateGroupRotationR(Quaternion rot) { - foreach (SceneObjectPart parts in Children.Values) - { - parts.StoreUndoState(); - } + SceneObjectPart[] parts = m_parts.GetArray(); + for (int i = 0; i < parts.Length; i++) + parts[i].StoreUndoState(); + m_rootPart.UpdateRotation(rot); PhysicsActor actor = m_rootPart.PhysActor; @@ -3127,10 +2916,10 @@ namespace OpenSim.Region.Framework.Scenes /// public void UpdateGroupRotationPR(Vector3 pos, Quaternion rot) { - foreach (SceneObjectPart parts in Children.Values) - { - parts.StoreUndoState(); - } + SceneObjectPart[] parts = m_parts.GetArray(); + for (int i = 0; i < parts.Length; i++) + parts[i].StoreUndoState(); + m_rootPart.UpdateRotation(rot); PhysicsActor actor = m_rootPart.PhysActor; @@ -3154,10 +2943,11 @@ namespace OpenSim.Region.Framework.Scenes public void UpdateSingleRotation(Quaternion rot, uint localID) { SceneObjectPart part = GetChildPart(localID); - foreach (SceneObjectPart parts in Children.Values) - { - parts.StoreUndoState(); - } + + SceneObjectPart[] parts = m_parts.GetArray(); + for (int i = 0; i < parts.Length; i++) + parts[i].StoreUndoState(); + if (part != null) { if (part.UUID == m_rootPart.UUID) @@ -3214,33 +3004,35 @@ namespace OpenSim.Region.Framework.Scenes m_scene.PhysicsScene.AddPhysicsActorTaint(m_rootPart.PhysActor); } - lock (m_parts) + SceneObjectPart[] parts = m_parts.GetArray(); + for (int i = 0; i < parts.Length; i++) { - foreach (SceneObjectPart prim in m_parts.Values) + SceneObjectPart prim = parts[i]; + if (prim.UUID != m_rootPart.UUID) { - if (prim.UUID != m_rootPart.UUID) - { - prim.IgnoreUndoUpdate = true; - Vector3 axPos = prim.OffsetPosition; - axPos *= oldParentRot; - axPos *= Quaternion.Inverse(axRot); - prim.OffsetPosition = axPos; - Quaternion primsRot = prim.RotationOffset; - Quaternion newRot = primsRot * oldParentRot; - newRot *= Quaternion.Inverse(axRot); - prim.RotationOffset = newRot; - prim.ScheduleTerseUpdate(); - } + prim.IgnoreUndoUpdate = true; + Vector3 axPos = prim.OffsetPosition; + axPos *= oldParentRot; + axPos *= Quaternion.Inverse(axRot); + prim.OffsetPosition = axPos; + Quaternion primsRot = prim.RotationOffset; + Quaternion newRot = primsRot * oldParentRot; + newRot *= Quaternion.Inverse(axRot); + prim.RotationOffset = newRot; + prim.ScheduleTerseUpdate(); } } - foreach (SceneObjectPart childpart in Children.Values) + + for (int i = 0; i < parts.Length; i++) { + SceneObjectPart childpart = parts[i]; if (childpart != m_rootPart) { childpart.IgnoreUndoUpdate = false; childpart.StoreUndoState(); } } + m_rootPart.ScheduleTerseUpdate(); } @@ -3361,17 +3153,10 @@ namespace OpenSim.Region.Framework.Scenes if (atTargets.Count > 0) { - uint[] localids = new uint[0]; - lock (m_parts) - { - localids = new uint[m_parts.Count]; - int cntr = 0; - foreach (SceneObjectPart part in m_parts.Values) - { - localids[cntr] = part.LocalId; - cntr++; - } - } + SceneObjectPart[] parts = m_parts.GetArray(); + uint[] localids = new uint[parts.Length]; + for (int i = 0; i < parts.Length; i++) + localids[i] = parts[i].LocalId; for (int ctr = 0; ctr < localids.Length; ctr++) { @@ -3389,17 +3174,10 @@ namespace OpenSim.Region.Framework.Scenes if (m_scriptListens_notAtTarget && !at_target) { //trigger not_at_target - uint[] localids = new uint[0]; - lock (m_parts) - { - localids = new uint[m_parts.Count]; - int cntr = 0; - foreach (SceneObjectPart part in m_parts.Values) - { - localids[cntr] = part.LocalId; - cntr++; - } - } + SceneObjectPart[] parts = m_parts.GetArray(); + uint[] localids = new uint[parts.Length]; + for (int i = 0; i < parts.Length; i++) + localids[i] = parts[i].LocalId; for (int ctr = 0; ctr < localids.Length; ctr++) { @@ -3440,17 +3218,10 @@ namespace OpenSim.Region.Framework.Scenes if (atRotTargets.Count > 0) { - uint[] localids = new uint[0]; - lock (m_parts) - { - localids = new uint[m_parts.Count]; - int cntr = 0; - foreach (SceneObjectPart part in m_parts.Values) - { - localids[cntr] = part.LocalId; - cntr++; - } - } + SceneObjectPart[] parts = m_parts.GetArray(); + uint[] localids = new uint[parts.Length]; + for (int i = 0; i < parts.Length; i++) + localids[i] = parts[i].LocalId; for (int ctr = 0; ctr < localids.Length; ctr++) { @@ -3468,17 +3239,10 @@ namespace OpenSim.Region.Framework.Scenes if (m_scriptListens_notAtRotTarget && !at_Rottarget) { //trigger not_at_target - uint[] localids = new uint[0]; - lock (m_parts) - { - localids = new uint[m_parts.Count]; - int cntr = 0; - foreach (SceneObjectPart part in m_parts.Values) - { - localids[cntr] = part.LocalId; - cntr++; - } - } + SceneObjectPart[] parts = m_parts.GetArray(); + uint[] localids = new uint[parts.Length]; + for (int i = 0; i < parts.Length; i++) + localids[i] = parts[i].LocalId; for (int ctr = 0; ctr < localids.Length; ctr++) { @@ -3492,40 +3256,36 @@ namespace OpenSim.Region.Framework.Scenes public float GetMass() { float retmass = 0f; - lock (m_parts) - { - foreach (SceneObjectPart part in m_parts.Values) - { - retmass += part.GetMass(); - } - } + + SceneObjectPart[] parts = m_parts.GetArray(); + for (int i = 0; i < parts.Length; i++) + retmass += parts[i].GetMass(); + return retmass; } public void CheckSculptAndLoad() { - lock (m_parts) + if (IsDeleted) + return; + if ((RootPart.GetEffectiveObjectFlags() & (uint)PrimFlags.Phantom) != 0) + return; + + SceneObjectPart[] parts = m_parts.GetArray(); + for (int i = 0; i < parts.Length; i++) { - if (!IsDeleted) + SceneObjectPart part = parts[i]; + if (part.Shape.SculptEntry && part.Shape.SculptTexture != UUID.Zero) { - if ((RootPart.GetEffectiveObjectFlags() & (uint)PrimFlags.Phantom) == 0) + // check if a previously decoded sculpt map has been cached + if (File.Exists(System.IO.Path.Combine("j2kDecodeCache", "smap_" + part.Shape.SculptTexture.ToString()))) { - foreach (SceneObjectPart part in m_parts.Values) - { - if (part.Shape.SculptEntry && part.Shape.SculptTexture != UUID.Zero) - { - // check if a previously decoded sculpt map has been cached - if (File.Exists(System.IO.Path.Combine("j2kDecodeCache", "smap_" + part.Shape.SculptTexture.ToString()))) - { - part.SculptTextureCallback(part.Shape.SculptTexture, null); - } - else - { - m_scene.AssetService.Get( - part.Shape.SculptTexture.ToString(), part, AssetReceived); - } - } - } + part.SculptTextureCallback(part.Shape.SculptTexture, null); + } + else + { + m_scene.AssetService.Get( + part.Shape.SculptTexture.ToString(), part, AssetReceived); } } } @@ -3549,15 +3309,12 @@ namespace OpenSim.Region.Framework.Scenes /// public void SetGroup(UUID GroupID, IClientAPI client) { - lock (m_parts) + SceneObjectPart[] parts = m_parts.GetArray(); + for (int i = 0; i < parts.Length; i++) { - foreach (SceneObjectPart part in m_parts.Values) - { - part.SetGroup(GroupID, client); - part.Inventory.ChangeInventoryGroup(GroupID); - } - - HasGroupChanged = true; + SceneObjectPart part = parts[i]; + part.SetGroup(GroupID, client); + part.Inventory.ChangeInventoryGroup(GroupID); } // Don't trigger the update here - otherwise some client issues occur when multiple updates are scheduled @@ -3567,10 +3324,9 @@ namespace OpenSim.Region.Framework.Scenes public void TriggerScriptChangedEvent(Changed val) { - foreach (SceneObjectPart part in Children.Values) - { - part.TriggerScriptChangedEvent(val); - } + SceneObjectPart[] parts = m_parts.GetArray(); + for (int i = 0; i < parts.Length; i++) + parts[i].TriggerScriptChangedEvent(val); } public override string ToString() @@ -3580,11 +3336,9 @@ namespace OpenSim.Region.Framework.Scenes public void SetAttachmentPoint(byte point) { - lock (m_parts) - { - foreach (SceneObjectPart part in m_parts.Values) - part.SetAttachmentPoint(point); - } + SceneObjectPart[] parts = m_parts.GetArray(); + for (int i = 0; i < parts.Length; i++) + parts[i].SetAttachmentPoint(point); } #region ISceneObject @@ -3653,29 +3407,37 @@ namespace OpenSim.Region.Framework.Scenes //references if we call SceneObjectGroup.Copy(), which creates new SceneObjectPart for all //non root parts. (So is SceneObjectGroup.CopyPart().) //Plus, we do not need to trigger client updating, since Script engine does not have client connections. - Dictionary updatedParts = new Dictionary(); - lock (m_parts) + lock (m_parts.SyncRoot) { - foreach (KeyValuePair pair in updatedSog.Children){ - UUID partUUID = pair.Key; - SceneObjectPart updatedPart = pair.Value; - if(m_parts.ContainsKey(partUUID)){ - //update the existing part - SceneObjectPart oldPart = m_parts[partUUID]; + // Adds and updates parts in this SOG + Dictionary updatedParts = new Dictionary(); + foreach (SceneObjectPart updatedPart in updatedSog.Parts) + { + SceneObjectPart oldPart; + m_parts.TryGetValue(updatedPart.UUID, out oldPart); + if(oldPart != null) + { oldPart.UpdateObjectPartProperties(updatedPart); - updatedParts.Add(partUUID, updatedPart); - }else{ + updatedParts.Add(updatedPart.UUID, updatedPart); + } + else + { //a new part - m_parts.Add(partUUID,updatedPart); + m_parts.Add(updatedPart.UUID, updatedPart); } } - //delete the parts that are no longer in the object-group - foreach(KeyValuePair pair in m_parts){ - if(!updatedParts.ContainsKey(pair.Key)){ - m_parts.Remove(pair.Key); + // Deletes parts that are no longer in this SOG + List deletedParts = new List(); + foreach(SceneObjectPart part in m_parts.GetArray()) + { + if(!updatedParts.ContainsKey(part.UUID)) + { + deletedParts.Add(part.UUID); } } + foreach(UUID deletedPart in deletedParts) + m_parts.Remove(deletedPart); } //update the authoritative scene that this object is located, which is identified by (LocX, LocY) diff --git a/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs b/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs index a8de2da8e9..011101e014 100644 --- a/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs +++ b/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs @@ -39,6 +39,7 @@ using OpenMetaverse.Packets; using OpenSim.Framework; using OpenSim.Region.Framework.Interfaces; using OpenSim.Region.Framework.Scenes.Scripting; +using OpenSim.Region.Framework.Scenes.Serialization; using OpenSim.Region.Physics.Manager; namespace OpenSim.Region.Framework.Scenes @@ -56,9 +57,11 @@ namespace OpenSim.Region.Framework.Scenes LINK = 32, ALLOWED_DROP = 64, OWNER = 128, - REGION_RESTART = 256, - REGION = 512, - TELEPORT = 1024 + REGION = 256, + TELEPORT = 512, + REGION_RESTART = 1024, + MEDIA = 2048, + ANIMATION = 16384 } // I don't really know where to put this except here. @@ -116,82 +119,87 @@ namespace OpenSim.Region.Framework.Scenes /// /// Is this sop a root part? /// - [XmlIgnore] + public bool IsRoot { get { return ParentGroup.RootPart == this; } } - // use only one serializer to give the runtime a chance to optimize it (it won't do that if you - // use a new instance every time) - private static XmlSerializer serializer = new XmlSerializer(typeof (SceneObjectPart)); - #region Fields public bool AllowedDrop; - [XmlIgnore] + public bool DIE_AT_EDGE; - [XmlIgnore] + public bool RETURN_AT_EDGE; - [XmlIgnore] + public bool BlockGrab; - [XmlIgnore] + public bool StatusSandbox; - [XmlIgnore] + public Vector3 StatusSandboxPos; // TODO: This needs to be persisted in next XML version update! - [XmlIgnore] + public readonly int[] PayPrice = {-2,-2,-2,-2,-2}; - [XmlIgnore] - public PhysicsActor PhysActor; + + + public PhysicsActor PhysActor + { + get { return m_physActor; } + set + { +// m_log.DebugFormat("[SOP]: PhysActor set to {0} for {1} {2}", value, Name, UUID); + m_physActor = value; + } + } //Xantor 20080528 Sound stuff: // Note: This isn't persisted in the database right now, as the fields for that aren't just there yet. // Not a big problem as long as the script that sets it remains in the prim on startup. // for SL compatibility it should be persisted though (set sound / displaytext / particlesystem, kill script) - [XmlIgnore] + public UUID Sound; - [XmlIgnore] + public byte SoundFlags; - [XmlIgnore] + public double SoundGain; - [XmlIgnore] + public double SoundRadius; - [XmlIgnore] + public uint TimeStampFull; - [XmlIgnore] + public uint TimeStampLastActivity; // Will be used for AutoReturn - [XmlIgnore] + public uint TimeStampTerse; - [XmlIgnore] + public UUID FromItemID; - [XmlIgnore] + public UUID FromFolderID; - [XmlIgnore] + public int STATUS_ROTATE_X; - [XmlIgnore] + public int STATUS_ROTATE_Y; - [XmlIgnore] + public int STATUS_ROTATE_Z; - [XmlIgnore] + private Dictionary m_CollisionFilter = new Dictionary(); /// @@ -200,67 +208,66 @@ namespace OpenSim.Region.Framework.Scenes /// private UUID m_fromUserInventoryItemID; - [XmlIgnore] + public UUID FromUserInventoryItemID { get { return m_fromUserInventoryItemID; } } - [XmlIgnore] + public bool IsAttachment; - [XmlIgnore] + public scriptEvents AggregateScriptEvents; - [XmlIgnore] + public UUID AttachedAvatar; - [XmlIgnore] + public Vector3 AttachedPos; - [XmlIgnore] + public uint AttachmentPoint; - [XmlIgnore] + public Vector3 RotationAxis = Vector3.One; - [XmlIgnore] + public bool VolumeDetectActive; // XmlIgnore set to avoid problems with persistance until I come to care for this // Certainly this must be a persistant setting finally - [XmlIgnore] + public bool IsWaitingForFirstSpinUpdatePacket; - [XmlIgnore] + public Quaternion SpinOldOrientation = Quaternion.Identity; - [XmlIgnore] + public Quaternion m_APIDTarget = Quaternion.Identity; - [XmlIgnore] + public float m_APIDDamp = 0; - [XmlIgnore] + public float m_APIDStrength = 0; /// /// This part's inventory /// - [XmlIgnore] + public IEntityInventory Inventory { get { return m_inventory; } } protected SceneObjectPartInventory m_inventory; - [XmlIgnore] + public bool Undoing; - [XmlIgnore] + public bool IgnoreUndoUpdate = false; public PrimFlags LocalFlags; - [XmlIgnore] private float m_damage = -1.0f; private byte[] m_TextureAnimation; private byte m_clickAction; @@ -268,9 +275,9 @@ namespace OpenSim.Region.Framework.Scenes private string m_description = String.Empty; private readonly List m_lastColliders = new List(); private int m_linkNum; - [XmlIgnore] + private int m_scriptAccessPin; - [XmlIgnore] + private readonly Dictionary m_scriptEvents = new Dictionary(); private string m_sitName = String.Empty; private Quaternion m_sitTargetOrientation = Quaternion.Identity; @@ -294,6 +301,7 @@ namespace OpenSim.Region.Framework.Scenes /// private byte m_updateFlag; + private PhysicsActor m_physActor; protected Vector3 m_acceleration; protected Vector3 m_angularVelocity; @@ -319,6 +327,11 @@ namespace OpenSim.Region.Framework.Scenes protected Vector3 m_lastAcceleration; protected Vector3 m_lastAngularVelocity; protected int m_lastTerseSent; + + /// + /// Stores media texture data + /// + protected string m_mediaUrl; // TODO: Those have to be changed into persistent properties at some later point, // or sit-camera on vehicles will break on sim-crossing. @@ -388,7 +401,7 @@ namespace OpenSim.Region.Framework.Scenes // this appears to have the same UUID (!) as the prim. If this isn't the case, one can't drag items from // the prim into an agent inventory (Linden client reports that the "Object not found for drop" in its log - _flags = 0; + Flags = 0; CreateSelected = true; TrimPermissions(); @@ -416,10 +429,11 @@ namespace OpenSim.Region.Framework.Scenes private uint _groupMask = (uint)PermissionMask.None; private uint _everyoneMask = (uint)PermissionMask.None; private uint _nextOwnerMask = (uint)PermissionMask.All; - private PrimFlags _flags = 0; + private PrimFlags _flags = PrimFlags.None; private DateTime m_expires; private DateTime m_rezzed; private bool m_createSelected = false; + private string m_creatorData = string.Empty; public UUID CreatorID { @@ -433,6 +447,61 @@ namespace OpenSim.Region.Framework.Scenes } } + public string CreatorData // = ; + { + get { return m_creatorData; } + set { m_creatorData = value; } + } + + /// + /// Used by the DB layer to retrieve / store the entire user identification. + /// The identification can either be a simple UUID or a string of the form + /// uuid[;profile_url[;name]] + /// + public string CreatorIdentification + { + get + { + if (m_creatorData != null && m_creatorData != string.Empty) + return _creatorID.ToString() + ';' + m_creatorData; + else + return _creatorID.ToString(); + } + set + { + if ((value == null) || (value != null && value == string.Empty)) + { + m_creatorData = string.Empty; + return; + } + + if (!value.Contains(";")) // plain UUID + { + UUID uuid = UUID.Zero; + UUID.TryParse(value, out uuid); + _creatorID = uuid; + } + else // [;[;name]] + { + string name = "Unknown User"; + string[] parts = value.Split(';'); + if (parts.Length >= 1) + { + UUID uuid = UUID.Zero; + UUID.TryParse(parts[0], out uuid); + _creatorID = uuid; + } + if (parts.Length >= 2) + m_creatorData = parts[1]; + if (parts.Length >= 3) + name = parts[2]; + + m_creatorData += ';' + name; + + } + } + } + /// /// A relic from when we we thought that prims contained folder objects. In /// reality, prim == folder @@ -463,16 +532,27 @@ namespace OpenSim.Region.Framework.Scenes set { m_inventory.Items = value; } } + /// + /// This is idential to the Flags property, except that the returned value is uint rather than PrimFlags + /// + [Obsolete("Use Flags property instead")] public uint ObjectFlags { - get { return (uint)_flags; } - set { _flags = (PrimFlags)value; } + get { return (uint)Flags; } + set { Flags = (PrimFlags)value; } } public UUID UUID { get { return m_uuid; } - set { m_uuid = value; } + set + { + m_uuid = value; + + // This is necessary so that TaskInventoryItem parent ids correctly reference the new uuid of this part + if (Inventory != null) + Inventory.ResetObjectID(); + } } public uint LocalId @@ -519,7 +599,7 @@ namespace OpenSim.Region.Framework.Scenes } - [XmlIgnore] + public Dictionary CollisionFilter { get { return m_CollisionFilter; } @@ -529,21 +609,21 @@ namespace OpenSim.Region.Framework.Scenes } } - [XmlIgnore] + public Quaternion APIDTarget { get { return m_APIDTarget; } set { m_APIDTarget = value; } } - [XmlIgnore] + public float APIDDamp { get { return m_APIDDamp; } set { m_APIDDamp = value; } } - [XmlIgnore] + public float APIDStrength { get { return m_APIDStrength; } @@ -589,35 +669,35 @@ namespace OpenSim.Region.Framework.Scenes set { m_LoopSoundSlavePrims = value; } } - [XmlIgnore] + public Byte[] TextureAnimation { get { return m_TextureAnimation; } set { m_TextureAnimation = value; } } - [XmlIgnore] + public Byte[] ParticleSystem { get { return m_particleSystem; } set { m_particleSystem = value; } } - [XmlIgnore] + public DateTime Expires { get { return m_expires; } set { m_expires = value; } } - [XmlIgnore] + public DateTime Rezzed { get { return m_rezzed; } set { m_rezzed = value; } } - [XmlIgnore] + public float Damage { get { return m_damage; } @@ -864,7 +944,6 @@ namespace OpenSim.Region.Framework.Scenes set { m_color = value; - TriggerScriptChangedEvent(Changed.COLOR); /* ScheduleFullUpdate() need not be called b/c after * setting the color, the text will be set, so then @@ -921,21 +1000,7 @@ namespace OpenSim.Region.Framework.Scenes public PrimitiveBaseShape Shape { get { return m_shape; } - set - { - bool shape_changed = false; - // TODO: this should really be restricted to the right - // set of attributes on shape change. For instance, - // changing the lighting on a shape shouldn't cause - // this. - if (m_shape != null) - shape_changed = true; - - m_shape = value; - - if (shape_changed) - TriggerScriptChangedEvent(Changed.SHAPE); - } + set { m_shape = value; } } public Vector3 Scale @@ -964,17 +1029,42 @@ namespace OpenSim.Region.Framework.Scenes TriggerScriptChangedEvent(Changed.SCALE); } } + public byte UpdateFlag { get { return m_updateFlag; } set { m_updateFlag = value; } } + + /// + /// Used for media on a prim. + /// + /// Do not change this value directly - always do it through an IMoapModule. + public string MediaUrl + { + get + { + return m_mediaUrl; + } + + set + { + m_mediaUrl = value; + + if (ParentGroup != null) + ParentGroup.HasGroupChanged = true; + } + } - [XmlIgnore] + public bool CreateSelected { get { return m_createSelected; } - set { m_createSelected = value; } + set + { +// m_log.DebugFormat("[SOP]: Setting CreateSelected to {0} for {1} {2}", value, Name, UUID); + m_createSelected = value; + } } #endregion @@ -1134,20 +1224,28 @@ namespace OpenSim.Region.Framework.Scenes set { _nextOwnerMask = value; } } + /// + /// Property flags. See OpenMetaverse.PrimFlags + /// + /// Example properties are PrimFlags.Phantom and PrimFlags.DieAtEdge public PrimFlags Flags { get { return _flags; } - set { _flags = value; } + set + { +// m_log.DebugFormat("[SOP]: Setting flags for {0} {1} to {2}", UUID, Name, value); + _flags = value; + } } - [XmlIgnore] + public UUID SitTargetAvatar { get { return m_sitTargetAvatar; } set { m_sitTargetAvatar = value; } } - [XmlIgnore] + public virtual UUID RegionID { get @@ -1161,7 +1259,7 @@ namespace OpenSim.Region.Framework.Scenes } private UUID _parentUUID = UUID.Zero; - [XmlIgnore] + public UUID ParentUUID { get @@ -1175,7 +1273,7 @@ namespace OpenSim.Region.Framework.Scenes set { _parentUUID = value; } } - [XmlIgnore] + public string SitAnimation { get { return m_sitAnimation; } @@ -1270,10 +1368,10 @@ namespace OpenSim.Region.Framework.Scenes public void AddFlag(PrimFlags flag) { // PrimFlags prevflag = Flags; - if ((ObjectFlags & (uint) flag) == 0) + if ((Flags & flag) == 0) { //m_log.Debug("Adding flag: " + ((PrimFlags) flag).ToString()); - _flags |= flag; + Flags |= flag; if (flag == PrimFlags.TemporaryOnRez) ResetExpire(); @@ -1297,7 +1395,7 @@ namespace OpenSim.Region.Framework.Scenes /// /// Tell the scene presence that it should send updates for this part to its client - /// + /// public void AddFullUpdateToAvatar(ScenePresence presence) { presence.SceneViewer.QueuePartForUpdate(this); @@ -1359,7 +1457,7 @@ namespace OpenSim.Region.Framework.Scenes m_parentGroup.Scene.ForEachScenePresence(delegate(ScenePresence sp) { - if(!sp.IsChildAgent) + if (!sp.IsChildAgent) sp.ControllingClient.SendAttachedSoundGainChange(UUID, (float)volume); }); } @@ -1479,7 +1577,7 @@ namespace OpenSim.Region.Framework.Scenes if (!isPhantom && !IsAttachment && !(Shape.PathCurve == (byte) Extrusion.Flexible)) { PhysActor = m_parentGroup.Scene.PhysicsScene.AddPrimShape( - Name, + string.Format("{0}/{1}", Name, UUID), Shape, AbsolutePosition, Scale, @@ -1497,7 +1595,7 @@ namespace OpenSim.Region.Framework.Scenes } else { - m_log.DebugFormat("[SPEW]: physics actor is null for {0} with parent {1}", UUID, this.ParentGroup.UUID); + m_log.DebugFormat("[SOP]: physics actor is null for {0} with parent {1}", UUID, this.ParentGroup.UUID); } } } @@ -1532,6 +1630,11 @@ namespace OpenSim.Region.Framework.Scenes /// /// Duplicates this part. /// + /// + /// + /// + /// + /// True if the duplicate will immediately be in the scene, false otherwise /// public SceneObjectPart Copy(uint localID, UUID AgentID, UUID GroupID, int linkNum, bool userExposed) { @@ -1554,7 +1657,7 @@ namespace OpenSim.Region.Framework.Scenes dupe.Velocity = new Vector3(0, 0, 0); dupe.Acceleration = new Vector3(0, 0, 0); dupe.AngularVelocity = new Vector3(0, 0, 0); - dupe.ObjectFlags = ObjectFlags; + dupe.Flags = Flags; dupe._ownershipCost = _ownershipCost; dupe._objectSaleType = _objectSaleType; @@ -1591,10 +1694,14 @@ namespace OpenSim.Region.Framework.Scenes m_parentGroup.Scene.AssetService.Get(dupe.m_shape.SculptTexture.ToString(), dupe, AssetReceived); } - bool UsePhysics = ((dupe.ObjectFlags & (uint)PrimFlags.Physics) != 0); + bool UsePhysics = ((dupe.Flags & PrimFlags.Physics) != 0); dupe.DoPhysicsPropertyUpdate(UsePhysics, true); } + ParentGroup.Scene.EventManager.TriggerOnSceneObjectPartCopy(dupe, this, userExposed); + +// m_log.DebugFormat("[SCENE OBJECT PART]: Clone of {0} {1} finished", Name, UUID); + return dupe; } @@ -1758,7 +1865,7 @@ namespace OpenSim.Region.Framework.Scenes /// that's not wholesome. Had to make Scene public //PhysActor = null; - if ((ObjectFlags & (uint)PrimFlags.Phantom) == 0) + if ((Flags & PrimFlags.Phantom) == 0) { if (UsePhysics) { @@ -1786,7 +1893,7 @@ namespace OpenSim.Region.Framework.Scenes /// /// /// - public static SceneObjectPart FromXml(XmlReader xmlReader) + public static SceneObjectPart FromXml(XmlTextReader xmlReader) { return FromXml(UUID.Zero, xmlReader); } @@ -1797,9 +1904,9 @@ namespace OpenSim.Region.Framework.Scenes /// The inventory id from which this part came, if applicable /// /// - public static SceneObjectPart FromXml(UUID fromUserInventoryItemId, XmlReader xmlReader) + public static SceneObjectPart FromXml(UUID fromUserInventoryItemId, XmlTextReader xmlReader) { - SceneObjectPart part = (SceneObjectPart)serializer.Deserialize(xmlReader); + SceneObjectPart part = SceneObjectSerializer.Xml2ToSOP(xmlReader); part.m_fromUserInventoryItemID = fromUserInventoryItemId; // for tempOnRez objects, we have to fix the Expire date. @@ -1906,11 +2013,13 @@ namespace OpenSim.Region.Framework.Scenes public uint GetEffectiveObjectFlags() { - PrimFlags f = _flags; - if (m_parentGroup == null || m_parentGroup.RootPart == this) - f &= ~(PrimFlags.Touch | PrimFlags.Money); + // Commenting this section of code out since it doesn't actually do anything, as enums are handled by + // value rather than reference +// PrimFlags f = _flags; +// if (m_parentGroup == null || m_parentGroup.RootPart == this) +// f &= ~(PrimFlags.Touch | PrimFlags.Money); - return (uint)_flags | (uint)LocalFlags; + return (uint)Flags | (uint)LocalFlags; } public Vector3 GetGeometricCenter() @@ -2628,7 +2737,7 @@ namespace OpenSim.Region.Framework.Scenes public void PreloadSound(string sound) { // UUID ownerID = OwnerID; - UUID objectID = UUID; + UUID objectID = ParentGroup.RootPart.UUID; UUID soundID = UUID.Zero; if (!UUID.TryParse(sound, out soundID)) @@ -2661,10 +2770,10 @@ namespace OpenSim.Region.Framework.Scenes public void RemFlag(PrimFlags flag) { // PrimFlags prevflag = Flags; - if ((ObjectFlags & (uint) flag) != 0) + if ((Flags & flag) != 0) { //m_log.Debug("Removing flag: " + ((PrimFlags)flag).ToString()); - _flags &= ~flag; + Flags &= ~flag; } //m_log.Debug("prev: " + prevflag.ToString() + " curr: " + Flags.ToString()); //ScheduleFullUpdate(); @@ -2955,10 +3064,10 @@ namespace OpenSim.Region.Framework.Scenes if (remoteClient.AgentId == _ownerID) { - if ((uint) (_flags & PrimFlags.CreateSelected) != 0) + if ((Flags & PrimFlags.CreateSelected) != 0) { clientFlags |= (uint) PrimFlags.CreateSelected; - _flags &= ~PrimFlags.CreateSelected; + Flags &= ~PrimFlags.CreateSelected; } } //bool isattachment = IsAttachment; @@ -3035,8 +3144,9 @@ namespace OpenSim.Region.Framework.Scenes volume = 0; UUID ownerID = _ownerID; - UUID objectID = UUID; + UUID objectID = ParentGroup.RootPart.UUID; UUID parentID = GetRootPartUUID(); + UUID soundID = UUID.Zero; Vector3 position = AbsolutePosition; // region local ulong regionHandle = m_parentGroup.Scene.RegionInfo.RegionHandle; @@ -3072,11 +3182,11 @@ namespace OpenSim.Region.Framework.Scenes else soundModule.PlayAttachedSound(soundID, ownerID, objectID, volume, position, flags, radius); ParentGroup.PlaySoundMasterPrim = this; - ownerID = this._ownerID; - objectID = this.UUID; - parentID = this.GetRootPartUUID(); - position = this.AbsolutePosition; // region local - regionHandle = this.ParentGroup.Scene.RegionInfo.RegionHandle; + ownerID = _ownerID; + objectID = ParentGroup.RootPart.UUID; + parentID = GetRootPartUUID(); + position = AbsolutePosition; // region local + regionHandle = ParentGroup.Scene.RegionInfo.RegionHandle; if (triggered) soundModule.TriggerSound(soundID, ownerID, objectID, parentID, volume, position, regionHandle, radius); else @@ -3084,7 +3194,7 @@ namespace OpenSim.Region.Framework.Scenes foreach (SceneObjectPart prim in ParentGroup.PlaySoundSlavePrims) { ownerID = prim._ownerID; - objectID = prim.UUID; + objectID = prim.ParentGroup.RootPart.UUID; parentID = prim.GetRootPartUUID(); position = prim.AbsolutePosition; // region local regionHandle = prim.ParentGroup.Scene.RegionInfo.RegionHandle; @@ -3254,6 +3364,7 @@ namespace OpenSim.Region.Framework.Scenes texcolor.B = Util.Clip((float)color.Z, 0.0f, 1.0f); tex.FaceTextures[face].RGBA = texcolor; UpdateTexture(tex); + TriggerScriptChangedEvent(Changed.COLOR); return; } else if (face == ALL_SIDES) @@ -3275,6 +3386,7 @@ namespace OpenSim.Region.Framework.Scenes tex.DefaultTexture.RGBA = texcolor; } UpdateTexture(tex); + TriggerScriptChangedEvent(Changed.COLOR); return; } } @@ -3990,9 +4102,9 @@ namespace OpenSim.Region.Framework.Scenes /// Serialize this part to xml. /// /// - public void ToXml(XmlWriter xmlWriter) + public void ToXml(XmlTextWriter xmlWriter) { - serializer.Serialize(xmlWriter, this); + SceneObjectSerializer.SOPToXml2(xmlWriter, this, new Dictionary()); } public void TriggerScriptChangedEvent(Changed val) @@ -4149,6 +4261,9 @@ namespace OpenSim.Region.Framework.Scenes // objects if ((_nextOwnerMask & (uint)PermissionMask.Copy) == 0) _nextOwnerMask |= (uint)PermissionMask.Transfer; + + _nextOwnerMask |= (uint)PermissionMask.Move; + break; } SendFullUpdateToAllClients(); @@ -4207,9 +4322,9 @@ namespace OpenSim.Region.Framework.Scenes public void UpdatePrimFlags(bool UsePhysics, bool IsTemporary, bool IsPhantom, bool IsVD) { - bool wasUsingPhysics = ((ObjectFlags & (uint) PrimFlags.Physics) != 0); - bool wasTemporary = ((ObjectFlags & (uint)PrimFlags.TemporaryOnRez) != 0); - bool wasPhantom = ((ObjectFlags & (uint)PrimFlags.Phantom) != 0); + bool wasUsingPhysics = ((Flags & PrimFlags.Physics) != 0); + bool wasTemporary = ((Flags & PrimFlags.TemporaryOnRez) != 0); + bool wasPhantom = ((Flags & PrimFlags.Phantom) != 0); bool wasVD = VolumeDetectActive; if ((UsePhysics == wasUsingPhysics) && (wasTemporary == IsTemporary) && (wasPhantom == IsPhantom) && (IsVD==wasVD)) @@ -4297,7 +4412,7 @@ namespace OpenSim.Region.Framework.Scenes { // It's not phantom anymore. So make sure the physics engine get's knowledge of it PhysActor = m_parentGroup.Scene.PhysicsScene.AddPrimShape( - Name, + string.Format("{0}/{1}", Name, UUID), Shape, AbsolutePosition, Scale, @@ -4445,6 +4560,7 @@ namespace OpenSim.Region.Framework.Scenes ParentGroup.RootPart.Rezzed = DateTime.UtcNow; ParentGroup.HasGroupChanged = true; + TriggerScriptChangedEvent(Changed.SHAPE); ScheduleFullUpdate(); } @@ -4663,20 +4779,8 @@ namespace OpenSim.Region.Framework.Scenes if (ParentGroup == null || ParentGroup.IsDeleted) return; - Vector3 lPos = OffsetPosition; - - if (IsAttachment) - { - if (ParentGroup.RootPart != this) - return; - - lPos = ParentGroup.RootPart.AttachedPos; - } - else - { - if (ParentGroup.RootPart == this) - lPos = AbsolutePosition; - } + if (IsAttachment && ParentGroup.RootPart != this) + return; // Causes this thread to dig into the Client Thread Data. // Remember your locking here! diff --git a/OpenSim/Region/Framework/Scenes/SceneObjectPartInventory.cs b/OpenSim/Region/Framework/Scenes/SceneObjectPartInventory.cs index 187118ba52..54b00526d7 100644 --- a/OpenSim/Region/Framework/Scenes/SceneObjectPartInventory.cs +++ b/OpenSim/Region/Framework/Scenes/SceneObjectPartInventory.cs @@ -37,6 +37,7 @@ using log4net; using OpenSim.Framework; using OpenSim.Region.Framework.Interfaces; using OpenSim.Region.Framework.Scenes.Scripting; +using OpenSim.Region.Framework.Scenes.Serialization; namespace OpenSim.Region.Framework.Scenes { @@ -118,19 +119,36 @@ namespace OpenSim.Region.Framework.Scenes /// Link number for the part public void ResetInventoryIDs() { - lock (Items) + if (null == m_part || null == m_part.ParentGroup) + return; + + lock (m_items) { - if (0 == Items.Count) + if (0 == m_items.Count) return; - HasInventoryChanged = true; - m_part.ParentGroup.HasGroupChanged = true; - IList items = new List(Items.Values); - Items.Clear(); + IList items = GetInventoryItems(); + m_items.Clear(); foreach (TaskInventoryItem item in items) { item.ResetIDs(m_part.UUID); + m_items.Add(item.ItemID, item); + } + } + } + + public void ResetObjectID() + { + lock (Items) + { + IList items = new List(Items.Values); + Items.Clear(); + + foreach (TaskInventoryItem item in items) + { + item.ParentPartID = m_part.UUID; + item.ParentID = m_part.UUID; Items.Add(item.ItemID, item); } } @@ -148,17 +166,17 @@ namespace OpenSim.Region.Framework.Scenes { return; } + } - HasInventoryChanged = true; - m_part.ParentGroup.HasGroupChanged = true; - IList items = new List(Items.Values); - foreach (TaskInventoryItem item in items) + HasInventoryChanged = true; + m_part.ParentGroup.HasGroupChanged = true; + List items = GetInventoryItems(); + foreach (TaskInventoryItem item in items) + { + if (ownerId != item.OwnerID) { - if (ownerId != item.OwnerID) - { - item.LastOwnerID = item.OwnerID; - item.OwnerID = ownerId; - } + item.LastOwnerID = item.OwnerID; + item.OwnerID = ownerId; } } } @@ -175,17 +193,22 @@ namespace OpenSim.Region.Framework.Scenes { return; } + } + // Don't let this set the HasGroupChanged flag for attachments + // as this happens during rez and we don't want a new asset + // for each attachment each time + if (!m_part.ParentGroup.RootPart.IsAttachment) + { HasInventoryChanged = true; m_part.ParentGroup.HasGroupChanged = true; - IList items = new List(Items.Values); - foreach (TaskInventoryItem item in items) - { - if (groupID != item.GroupID) - { - item.GroupID = groupID; - } - } + } + + List items = GetInventoryItems(); + foreach (TaskInventoryItem item in items) + { + if (groupID != item.GroupID) + item.GroupID = groupID; } } @@ -194,16 +217,9 @@ namespace OpenSim.Region.Framework.Scenes /// public void CreateScriptInstances(int startParam, bool postOnRez, string engine, int stateSource) { - lock (m_items) - { - foreach (TaskInventoryItem item in Items.Values) - { - if ((int)InventoryType.LSL == item.InvType) - { - CreateScriptInstance(item, startParam, postOnRez, engine, stateSource); - } - } - } + List scripts = GetInventoryScripts(); + foreach (TaskInventoryItem item in scripts) + CreateScriptInstance(item, startParam, postOnRez, engine, stateSource); } public ArrayList GetScriptErrors(UUID itemID) @@ -236,16 +252,9 @@ namespace OpenSim.Region.Framework.Scenes /// public void RemoveScriptInstances(bool sceneObjectBeingDeleted) { - lock (Items) - { - foreach (TaskInventoryItem item in Items.Values) - { - if ((int)InventoryType.LSL == item.InvType) - { - RemoveScriptInstance(item.ItemID, sceneObjectBeingDeleted); - } - } - } + List scripts = GetInventoryScripts(); + foreach (TaskInventoryItem item in scripts) + RemoveScriptInstance(item.ItemID, sceneObjectBeingDeleted); } /// @@ -267,7 +276,7 @@ namespace OpenSim.Region.Framework.Scenes if (!m_part.ParentGroup.Scene.RegionInfo.RegionSettings.DisableScripts) { - if (stateSource == 1 && // Prim crossing + if (stateSource == 2 && // Prim crossing m_part.ParentGroup.Scene.m_trustBinaries) { lock (m_items) @@ -375,21 +384,15 @@ namespace OpenSim.Region.Framework.Scenes /// public void CreateScriptInstance(UUID itemId, int startParam, bool postOnRez, string engine, int stateSource) { - lock (m_items) - { - if (m_items.ContainsKey(itemId)) - { - CreateScriptInstance(m_items[itemId], startParam, postOnRez, engine, stateSource); - } - else - { - m_log.ErrorFormat( - "[PRIM INVENTORY]: " + - "Couldn't start script with ID {0} since it couldn't be found for prim {1}, {2} at {3} in {4}", - itemId, m_part.Name, m_part.UUID, - m_part.AbsolutePosition, m_part.ParentGroup.Scene.RegionInfo.RegionName); - } - } + TaskInventoryItem item = GetInventoryItem(itemId); + if (item != null) + CreateScriptInstance(item, startParam, postOnRez, engine, stateSource); + else + m_log.ErrorFormat( + "[PRIM INVENTORY]: " + + "Couldn't start script with ID {0} since it couldn't be found for prim {1}, {2} at {3} in {4}", + itemId, m_part.Name, m_part.UUID, + m_part.AbsolutePosition, m_part.ParentGroup.Scene.RegionInfo.RegionName); } /// @@ -430,16 +433,18 @@ namespace OpenSim.Region.Framework.Scenes /// /// Check if the inventory holds an item with a given name. - /// This method assumes that the task inventory is already locked. /// /// /// private bool InventoryContainsName(string name) { - foreach (TaskInventoryItem item in Items.Values) + lock (m_items) { - if (item.Name == name) - return true; + foreach (TaskInventoryItem item in m_items.Values) + { + if (item.Name == name) + return true; + } } return false; } @@ -482,12 +487,7 @@ namespace OpenSim.Region.Framework.Scenes /// public void AddInventoryItemExclusive(TaskInventoryItem item, bool allowedDrop) { - List il; - - lock (m_items) - { - il = new List(m_items.Values); - } + List il = GetInventoryItems(); foreach (TaskInventoryItem i in il) { @@ -527,14 +527,12 @@ namespace OpenSim.Region.Framework.Scenes item.GroupID = m_part.GroupID; lock (m_items) - { m_items.Add(item.ItemID, item); - if (allowedDrop) - m_part.TriggerScriptChangedEvent(Changed.ALLOWED_DROP); - else - m_part.TriggerScriptChangedEvent(Changed.INVENTORY); - } + if (allowedDrop) + m_part.TriggerScriptChangedEvent(Changed.ALLOWED_DROP); + else + m_part.TriggerScriptChangedEvent(Changed.INVENTORY); m_inventorySerial++; //m_inventorySerial += 2; @@ -558,9 +556,8 @@ namespace OpenSim.Region.Framework.Scenes m_items.Add(item.ItemID, item); // m_part.TriggerScriptChangedEvent(Changed.INVENTORY); } + m_inventorySerial++; } - - m_inventorySerial++; } /// @@ -602,6 +599,67 @@ namespace OpenSim.Region.Framework.Scenes return items; } + public SceneObjectGroup GetRezReadySceneObject(TaskInventoryItem item) + { + AssetBase rezAsset = m_part.ParentGroup.Scene.AssetService.Get(item.AssetID.ToString()); + + if (null == rezAsset) + { + m_log.WarnFormat( + "[PRIM INVENTORY]: Could not find asset {0} for inventory item {1} in {2}", + item.AssetID, item.Name, m_part.Name); + return null; + } + + string xmlData = Utils.BytesToString(rezAsset.Data); + SceneObjectGroup group = SceneObjectSerializer.FromOriginalXmlFormat(xmlData); + + group.ResetIDs(); + + SceneObjectPart rootPart = group.GetChildPart(group.UUID); + + // Since renaming the item in the inventory does not affect the name stored + // in the serialization, transfer the correct name from the inventory to the + // object itself before we rez. + rootPart.Name = item.Name; + rootPart.Description = item.Description; + + SceneObjectPart[] partList = group.Parts; + + group.SetGroup(m_part.GroupID, null); + + if ((rootPart.OwnerID != item.OwnerID) || (item.CurrentPermissions & 16) != 0) + { + if (m_part.ParentGroup.Scene.Permissions.PropagatePermissions()) + { + foreach (SceneObjectPart part in partList) + { + part.EveryoneMask = item.EveryonePermissions; + part.NextOwnerMask = item.NextPermissions; + } + + group.ApplyNextOwnerPermissions(); + } + } + + foreach (SceneObjectPart part in partList) + { + if ((part.OwnerID != item.OwnerID) || (item.CurrentPermissions & 16) != 0) + { + part.LastOwnerID = part.OwnerID; + part.OwnerID = item.OwnerID; + part.Inventory.ChangeInventoryOwner(item.OwnerID); + } + + part.EveryoneMask = item.EveryonePermissions; + part.NextOwnerMask = item.NextPermissions; + } + + rootPart.TrimPermissions(); + + return group; + } + /// /// Update an existing inventory item. /// @@ -610,50 +668,57 @@ namespace OpenSim.Region.Framework.Scenes /// false if the item did not exist, true if the update occurred successfully public bool UpdateInventoryItem(TaskInventoryItem item) { - return UpdateInventoryItem(item, true); + return UpdateInventoryItem(item, true, true); } public bool UpdateInventoryItem(TaskInventoryItem item, bool fireScriptEvents) { - lock(m_items) + return UpdateInventoryItem(item, fireScriptEvents, true); + } + + public bool UpdateInventoryItem(TaskInventoryItem item, bool fireScriptEvents, bool considerChanged) + { + TaskInventoryItem it = GetInventoryItem(item.ItemID); + if (it != null) + { - if (m_items.ContainsKey(item.ItemID)) + item.ParentID = m_part.UUID; + item.ParentPartID = m_part.UUID; + item.Flags = m_items[item.ItemID].Flags; + + // If group permissions have been set on, check that the groupID is up to date in case it has + // changed since permissions were last set. + if (item.GroupPermissions != (uint)PermissionMask.None) + item.GroupID = m_part.GroupID; + + if (item.AssetID == UUID.Zero) + item.AssetID = it.AssetID; + + lock (m_items) { - if (m_items.ContainsKey(item.ItemID)) - { - item.ParentID = m_part.UUID; - item.ParentPartID = m_part.UUID; - item.Flags = m_items[item.ItemID].Flags; - - // If group permissions have been set on, check that the groupID is up to date in case it has - // changed since permissions were last set. - if (item.GroupPermissions != (uint)PermissionMask.None) - item.GroupID = m_part.GroupID; - - if (item.AssetID == UUID.Zero) - { - item.AssetID = m_items[item.ItemID].AssetID; - } - m_items[item.ItemID] = item; - m_inventorySerial++; - if (fireScriptEvents) - m_part.TriggerScriptChangedEvent(Changed.INVENTORY); - HasInventoryChanged = true; - m_part.ParentGroup.HasGroupChanged = true; - return true; - } - else - { - m_log.ErrorFormat( - "[PRIM INVENTORY]: " + - "Tried to retrieve item ID {0} from prim {1}, {2} at {3} in {4} but the item does not exist in this inventory", - item.ItemID, m_part.Name, m_part.UUID, - m_part.AbsolutePosition, m_part.ParentGroup.Scene.RegionInfo.RegionName); - } - + m_items[item.ItemID] = item; + m_inventorySerial++; } - return false; + + if (fireScriptEvents) + m_part.TriggerScriptChangedEvent(Changed.INVENTORY); + if (considerChanged) + { + HasInventoryChanged = true; + m_part.ParentGroup.HasGroupChanged = true; + } + return true; } + else + { + m_log.ErrorFormat( + "[PRIM INVENTORY]: " + + "Tried to retrieve item ID {0} from prim {1}, {2} at {3} in {4} but the item does not exist in this inventory", + item.ItemID, m_part.Name, m_part.UUID, + m_part.AbsolutePosition, m_part.ParentGroup.Scene.RegionInfo.RegionName); + } + return false; + } /// @@ -664,52 +729,37 @@ namespace OpenSim.Region.Framework.Scenes /// in this prim's inventory. public int RemoveInventoryItem(UUID itemID) { - lock (m_items) + TaskInventoryItem item = GetInventoryItem(itemID); + if (item != null) { - if (m_items.ContainsKey(itemID)) + int type = m_items[itemID].InvType; + if (type == 10) // Script { - int type = m_items[itemID].InvType; - if (type == 10) // Script - { - m_part.RemoveScriptEvents(itemID); - m_part.ParentGroup.Scene.EventManager.TriggerRemoveScript(m_part.LocalId, itemID); - } - m_items.Remove(itemID); - m_inventorySerial++; - m_part.TriggerScriptChangedEvent(Changed.INVENTORY); - - HasInventoryChanged = true; - m_part.ParentGroup.HasGroupChanged = true; - - int scriptcount = 0; - lock (m_items) - { - foreach (TaskInventoryItem item in m_items.Values) - { - if (item.Type == 10) - { - scriptcount++; - } - } - } - - if (scriptcount <= 0) - { - m_part.RemFlag(PrimFlags.Scripted); - } - - m_part.ScheduleFullUpdate(); - - return type; - } - else - { - m_log.ErrorFormat( - "[PRIM INVENTORY]: " + - "Tried to remove item ID {0} from prim {1}, {2} at {3} in {4} but the item does not exist in this inventory", - itemID, m_part.Name, m_part.UUID, - m_part.AbsolutePosition, m_part.ParentGroup.Scene.RegionInfo.RegionName); + m_part.RemoveScriptEvents(itemID); + m_part.ParentGroup.Scene.EventManager.TriggerRemoveScript(m_part.LocalId, itemID); } + m_items.Remove(itemID); + m_inventorySerial++; + m_part.TriggerScriptChangedEvent(Changed.INVENTORY); + + HasInventoryChanged = true; + m_part.ParentGroup.HasGroupChanged = true; + + if (!ContainsScripts()) + m_part.RemFlag(PrimFlags.Scripted); + + m_part.ScheduleFullUpdate(); + + return type; + + } + else + { + m_log.ErrorFormat( + "[PRIM INVENTORY]: " + + "Tried to remove item ID {0} from prim {1}, {2} at {3} in {4} but the item does not exist in this inventory", + itemID, m_part.Name, m_part.UUID, + m_part.AbsolutePosition, m_part.ParentGroup.Scene.RegionInfo.RegionName); } return -1; @@ -763,6 +813,10 @@ namespace OpenSim.Region.Framework.Scenes // isn't available (such as drag from prim inventory to agent inventory) InventoryStringBuilder invString = new InventoryStringBuilder(m_part.UUID, UUID.Zero); + bool includeAssets = false; + if (m_part.ParentGroup.Scene.Permissions.CanEditObjectInventory(m_part.UUID, client.AgentId)) + includeAssets = true; + lock (m_items) { foreach (TaskInventoryItem item in m_items.Values) @@ -793,7 +847,10 @@ namespace OpenSim.Region.Framework.Scenes invString.AddNameValueLine("group_id", item.GroupID.ToString()); invString.AddSectionEnd(); - invString.AddNameValueLine("asset_id", item.AssetID.ToString()); + if (includeAssets) + invString.AddNameValueLine("asset_id", item.AssetID.ToString()); + else + invString.AddNameValueLine("asset_id", UUID.Zero.ToString()); invString.AddNameValueLine("type", TaskInventoryItem.Types[item.Type]); invString.AddNameValueLine("inv_type", TaskInventoryItem.InvTypes[item.InvType]); invString.AddNameValueLine("flags", Utils.UIntToHexString(item.Flags)); @@ -826,16 +883,14 @@ namespace OpenSim.Region.Framework.Scenes /// Process inventory backup /// /// - public void ProcessInventoryBackup(IRegionDataStore datastore) + public void ProcessInventoryBackup(ISimulationDataService datastore) { if (HasInventoryChanged) { - lock (Items) - { - datastore.StorePrimInventory(m_part.UUID, Items.Values); - } - HasInventoryChanged = false; + List items = GetInventoryItems(); + datastore.StorePrimInventory(m_part.UUID, items); + } } @@ -1000,6 +1055,30 @@ namespace OpenSim.Region.Framework.Scenes return ret; } + + public List GetInventoryItems() + { + List ret = new List(); + + lock (m_items) + ret = new List(m_items.Values); + + return ret; + } + + public List GetInventoryScripts() + { + List ret = new List(); + + lock (m_items) + { + foreach (TaskInventoryItem item in m_items.Values) + if (item.InvType == (int)InventoryType.LSL) + ret.Add(item); + } + + return ret; + } public Dictionary GetScriptStates() { @@ -1009,24 +1088,20 @@ namespace OpenSim.Region.Framework.Scenes if (engines == null) // No engine at all return ret; - lock (m_items) + List scripts = GetInventoryScripts(); + + foreach (TaskInventoryItem item in scripts) { - foreach (TaskInventoryItem item in m_items.Values) + foreach (IScriptModule e in engines) { - if (item.InvType == (int)InventoryType.LSL) + if (e != null) { - foreach (IScriptModule e in engines) + string n = e.GetXMLState(item.ItemID); + if (n != String.Empty) { - if (e != null) - { - string n = e.GetXMLState(item.ItemID); - if (n != String.Empty) - { - if (!ret.ContainsKey(item.ItemID)) - ret[item.ItemID] = n; - break; - } - } + if (!ret.ContainsKey(item.ItemID)) + ret[item.ItemID] = n; + break; } } } @@ -1041,22 +1116,18 @@ namespace OpenSim.Region.Framework.Scenes if (engines == null) return; - lock (m_items) + List scripts = GetInventoryScripts(); + + foreach (TaskInventoryItem item in scripts) { - foreach (TaskInventoryItem item in m_items.Values) + foreach (IScriptModule engine in engines) { - if (item.InvType == (int)InventoryType.LSL) + if (engine != null) { - foreach (IScriptModule engine in engines) - { - if (engine != null) - { - if (item.OwnerChanged) - engine.PostScriptEvent(item.ItemID, "changed", new Object[] { (int)Changed.OWNER }); - item.OwnerChanged = false; - engine.ResumeScript(item.ItemID); - } - } + if (item.OwnerChanged) + engine.PostScriptEvent(item.ItemID, "changed", new Object[] { (int)Changed.OWNER }); + item.OwnerChanged = false; + engine.ResumeScript(item.ItemID); } } } diff --git a/OpenSim/Region/Framework/Scenes/ScenePresence.cs b/OpenSim/Region/Framework/Scenes/ScenePresence.cs index 7a359f651a..f52bf41cdb 100644 --- a/OpenSim/Region/Framework/Scenes/ScenePresence.cs +++ b/OpenSim/Region/Framework/Scenes/ScenePresence.cs @@ -75,8 +75,7 @@ namespace OpenSim.Region.Framework.Scenes private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); - private static readonly byte[] BAKE_INDICES = new byte[] { 8, 9, 10, 11, 19, 20 }; - private static readonly byte[] DEFAULT_TEXTURE = AvatarAppearance.GetDefaultTexture().GetBytes(); +// private static readonly byte[] DEFAULT_TEXTURE = AvatarAppearance.GetDefaultTexture().GetBytes(); private static readonly Array DIR_CONTROL_FLAGS = Enum.GetValues(typeof(Dir_ControlFlags)); private static readonly Vector3 HEAD_ADJUSTMENT = new Vector3(0f, 0f, 0.3f); @@ -140,8 +139,6 @@ namespace OpenSim.Region.Framework.Scenes private SendCourseLocationsMethod m_sendCourseLocationsMethod; - private bool m_startAnimationSet; - //private Vector3 m_requestedSitOffset = new Vector3(); private Vector3 m_LastFinitePos; @@ -177,9 +174,6 @@ namespace OpenSim.Region.Framework.Scenes private float m_health = 100f; - // Default AV Height - private float m_avHeight = 127.0f; - protected RegionInfo m_regionInfo; protected ulong crossingFromRegion; @@ -697,13 +691,6 @@ namespace OpenSim.Region.Framework.Scenes m_sendCourseLocationsMethod = SendCoarseLocationsDefault; CreateSceneViewer(); m_animator = new ScenePresenceAnimator(this); - - /* - Primitive.TextureEntry te = AvatarAppearance.GetDefaultTexture(); - byte[] vp = AvatarAppearance.GetDefaultVisualParams(); - m_appearance = new AvatarAppearance(UUID); - m_appearance.SetAppearance(te, vp); - * */ } private ScenePresence(IClientAPI client, Scene world, RegionInfo reginfo) : this() @@ -739,24 +726,19 @@ namespace OpenSim.Region.Framework.Scenes AdjustKnownSeeds(); // TODO: I think, this won't send anything, as we are still a child here... - //Animator.TrySetMovementAnimation("STAND"); + Animator.TrySetMovementAnimation("STAND"); // we created a new ScenePresence (a new child agent) in a fresh region. // Request info about all the (root) agents in this region // Note: This won't send data *to* other clients in that region (children don't send) + +// MIC: This gets called again in CompleteMovement SendInitialFullUpdateToAllClients(); RegisterToEvents(); SetDirectionVectors(); } - public ScenePresence(IClientAPI client, Scene world, RegionInfo reginfo, byte[] visualParams, - AvatarWearable[] wearables) - : this(client, world, reginfo) - { - m_appearance = new AvatarAppearance(m_uuid, wearables, visualParams); - } - public ScenePresence(IClientAPI client, Scene world, RegionInfo reginfo, AvatarAppearance appearance) : this(client, world, reginfo) { @@ -777,7 +759,7 @@ namespace OpenSim.Region.Framework.Scenes // These client messages will not be handled by client managers but instead // they are caught by the RegionSyncClient module and passed up to the auth sim m_controllingClient.OnAgentUpdate += HandleAgentUpdate; - m_controllingClient.OnSetAppearance += SetAppearance; + //m_controllingClient.OnSetAppearance += SetAppearance; m_log.DebugFormat("[SCENE PRESENCE]: Setting local handler for HandleAgentRequestSit"); //RA m_controllingClient.OnAgentRequestSit += HandleAgentRequestSit; m_controllingClient.OnAgentSit += HandleAgentSit; @@ -785,7 +767,6 @@ namespace OpenSim.Region.Framework.Scenes m_controllingClient.OnStopAnim += HandleStopAnim; } - m_controllingClient.OnRequestWearables += SendWearables; m_controllingClient.OnCompleteMovementToRegion += CompleteMovement; //m_controllingClient.OnCompleteMovementToRegion += SendInitialData; @@ -868,7 +849,7 @@ namespace OpenSim.Region.Framework.Scenes m_rootRegionHandle = m_scene.RegionInfo.RegionHandle; - m_scene.SetRootAgentScene(m_uuid); + m_scene.EventManager.TriggerSetRootAgentScene(m_uuid, m_scene); // Moved this from SendInitialData to ensure that m_appearance is initialized // before the inventory is processed in MakeRootAgent. This fixes a race condition @@ -898,9 +879,10 @@ namespace OpenSim.Region.Framework.Scenes } float localAVHeight = 1.56f; - if (m_avHeight != 127.0f) + if (m_appearance != null) { - localAVHeight = m_avHeight; + if (m_appearance.AvatarHeight > 0) + localAVHeight = m_appearance.AvatarHeight; } float posZLimit = 0; @@ -915,17 +897,6 @@ namespace OpenSim.Region.Framework.Scenes } AbsolutePosition = pos; - AddToPhysicalScene(isFlying); - - if (m_forceFly) - { - m_physicsActor.Flying = true; - } - else if (m_flyDisabled) - { - m_physicsActor.Flying = false; - } - if (m_appearance != null) { if (m_appearance.AvatarHeight > 0) @@ -938,6 +909,23 @@ namespace OpenSim.Region.Framework.Scenes m_appearance = new AvatarAppearance(UUID); } + AddToPhysicalScene(isFlying); + + if (m_appearance != null) + { + if (m_appearance.AvatarHeight > 0) + SetHeight(m_appearance.AvatarHeight); + } + + if (m_forceFly) + { + m_physicsActor.Flying = true; + } + else if (m_flyDisabled) + { + m_physicsActor.Flying = false; + } + // Don't send an animation pack here, since on a region crossing this will sometimes cause a flying // avatar to return to the standing position in mid-air. On login it looks like this is being sent // elsewhere anyway @@ -976,7 +964,12 @@ namespace OpenSim.Region.Framework.Scenes /// public void MakeChildAgent() { - Animator.ResetAnimations(); + // It looks like m_animator is set to null somewhere, and MakeChild + // is called after that. Probably in aborted teleports. + if (m_animator == null) + m_animator = new ScenePresenceAnimator(this); + else + Animator.ResetAnimations(); // m_log.DebugFormat( // "[SCENEPRESENCE]: Downgrading root agent {0}, {1} to a child agent in {2}", @@ -1110,12 +1103,11 @@ namespace OpenSim.Region.Framework.Scenes /// /// Sets avatar height in the phyiscs plugin /// - internal void SetHeight(float height) + public void SetHeight(float height) { - m_avHeight = height; if (PhysicsActor != null && !IsChildAgent) { - Vector3 SetSize = new Vector3(0.45f, 0.6f, m_avHeight); + Vector3 SetSize = new Vector3(0.45f, 0.6f, height); PhysicsActor.Size = SetSize; } } @@ -1127,7 +1119,11 @@ namespace OpenSim.Region.Framework.Scenes /// public void CompleteMovement(IClientAPI client) { - m_log.Debug("[SCENE PRESENCE]: CompleteMovement"); + DateTime startTime = DateTime.Now; + + m_log.DebugFormat( + "[SCENE PRESENCE]: Completing movement of {0} into region {1}", + client.Name, Scene.RegionInfo.RegionName); Vector3 look = Velocity; if ((look.X == 0) && (look.Y == 0) && (look.Z == 0)) @@ -1178,6 +1174,9 @@ namespace OpenSim.Region.Framework.Scenes friendsModule.SendFriendsOnlineIfNeeded(ControllingClient); } + m_log.DebugFormat( + "[SCENE PRESENCE]: Completing movement of {0} into region {1} took {2}ms", + client.Name, Scene.RegionInfo.RegionName, (DateTime.Now - startTime).Milliseconds); } /// @@ -1364,7 +1363,7 @@ namespace OpenSim.Region.Framework.Scenes // Setting parent ID would fix this, if we knew what value // to use. Or we could add a m_isSitting variable. //Animator.TrySetMovementAnimation("SIT_GROUND_CONSTRAINED"); - SitGround = true; + SitGround = true; } // In the future, these values might need to go global. @@ -1599,6 +1598,8 @@ namespace OpenSim.Region.Framework.Scenes } } + // If the agent update does move the avatar, then calculate the force ready for the velocity update, + // which occurs later in the main scene loop if (update_movementflag || (update_rotation && DCFlagKeyPressed)) { // m_log.DebugFormat("{0} {1}", update_movementflag, (update_rotation && DCFlagKeyPressed)); @@ -1765,9 +1766,10 @@ namespace OpenSim.Region.Framework.Scenes m_parentID = 0; SendFullUpdateToAllClients(); m_requestedSitTargetID = 0; - if ((m_physicsActor != null) && (m_avHeight > 0)) + if (m_physicsActor != null && m_appearance != null) { - SetHeight(m_avHeight); + if (m_appearance.AvatarHeight > 0) + SetHeight(m_appearance.AvatarHeight); } } @@ -1784,7 +1786,7 @@ namespace OpenSim.Region.Framework.Scenes // If the primitive the player clicked on has no sit target, and one or more other linked objects have sit targets that are not full, the sit target of the object with the lowest link number will be used. // Get our own copy of the part array, and sort into the order we want to test - SceneObjectPart[] partArray = targetPart.ParentGroup.GetParts(); + SceneObjectPart[] partArray = targetPart.ParentGroup.Parts; Array.Sort(partArray, delegate(SceneObjectPart p1, SceneObjectPart p2) { // we want the originally selected part first, then the rest in link order -- so make the selected part link num (-1) @@ -2407,15 +2409,15 @@ namespace OpenSim.Region.Framework.Scenes { m_perfMonMS = Util.EnvironmentTickCount(); - PhysicsActor actor = m_physicsActor; - Vector3 velocity = (actor != null) ? actor.Velocity : Vector3.Zero; - Vector3 pos = m_pos; pos.Z += m_appearance.HipOffset; //m_log.DebugFormat("[SCENEPRESENCE]: TerseUpdate: Pos={0} Rot={1} Vel={2}", m_pos, m_bodyRot, m_velocity); - remoteClient.SendPrimUpdate(this, PrimUpdateFlags.Position | PrimUpdateFlags.Rotation | PrimUpdateFlags.Velocity | PrimUpdateFlags.Acceleration | PrimUpdateFlags.AngularVelocity); + remoteClient.SendPrimUpdate( + this, + PrimUpdateFlags.Position | PrimUpdateFlags.Rotation | PrimUpdateFlags.Velocity + | PrimUpdateFlags.Acceleration | PrimUpdateFlags.AngularVelocity); m_scene.StatsReporter.AddAgentTime(Util.EnvironmentTickCountSubtract(m_perfMonMS)); m_scene.StatsReporter.AddAgentUpdates(1); @@ -2469,19 +2471,30 @@ namespace OpenSim.Region.Framework.Scenes // 2 stage check is needed. if (remoteAvatar == null) return; - IClientAPI cl=remoteAvatar.ControllingClient; + + IClientAPI cl = remoteAvatar.ControllingClient; if (cl == null) return; + if (m_appearance.Texture == null) return; - Vector3 pos = m_pos; - pos.Z += m_appearance.HipOffset; +// MT: This is needed for sit. It's legal to send it to oneself, and the name +// of the method is a misnomer +// +// if (LocalId == remoteAvatar.LocalId) +// { +// m_log.WarnFormat("[SCENEPRESENCE]: An agent is attempting to send avatar data to itself; {0}", UUID); +// return; +// } + if (IsChildAgent) + { + m_log.WarnFormat("[SCENEPRESENCE]: A child agent is attempting to send out avatar data; {0}", UUID); + return; + } + remoteAvatar.m_controllingClient.SendAvatarDataImmediate(this); - // Next line added on recommondation of MB - m_controllingClient.SendAppearance(m_appearance.Owner, m_appearance.VisualParams, m_appearance.Texture.GetBytes()); - m_scene.StatsReporter.AddAgentUpdates(1); } @@ -2499,21 +2512,24 @@ namespace OpenSim.Region.Framework.Scenes m_scene.ForEachScenePresence(delegate(ScenePresence avatar) { ++avUpdates; - // only send if this is the root (children are only "listening posts" in a foreign region) + + // Don't update ourselves + if (avatar.LocalId == LocalId) + return; + + // If this is a root agent, then get info about the avatar if (!IsChildAgent) { m_log.DebugFormat("[SCENE PRESENCE]: SendInitialFullUpdateToAllClients.SendFullUpdateToOtherClient"); SendFullUpdateToOtherClient(avatar); } - if (avatar.LocalId != LocalId) + // If the other avatar is a root + if (!avatar.IsChildAgent) { - if (!avatar.IsChildAgent) - { - avatar.SendFullUpdateToOtherClient(this); - avatar.SendAppearanceToOtherAgent(this); - avatar.Animator.SendAnimPackToClient(ControllingClient); - } + avatar.SendFullUpdateToOtherClient(this); + avatar.SendAppearanceToOtherAgent(this); + avatar.Animator.SendAnimPackToClient(ControllingClient); } }); @@ -2535,6 +2551,12 @@ namespace OpenSim.Region.Framework.Scenes m_perfMonMS = Util.EnvironmentTickCount(); // only send update from root agents to other clients; children are only "listening posts" + if (IsChildAgent) + { + m_log.Warn("[SCENEPRESENCE] attempt to send update from a childagent"); + return; + } + int count = 0; m_scene.ForEachScenePresence(delegate(ScenePresence sp) { @@ -2558,26 +2580,21 @@ namespace OpenSim.Region.Framework.Scenes // the inventory arrives // m_scene.GetAvatarAppearance(m_controllingClient, out m_appearance); - Vector3 pos = m_pos; - pos.Z += m_appearance.HipOffset; - m_controllingClient.SendAvatarDataImmediate(this); - SendInitialFullUpdateToAllClients(); - // Next two lines added on recommondation of MB - if (m_appearance != null && m_appearance.VisualParams != null && m_appearance.Texture != null) - m_controllingClient.SendAppearance(m_appearance.Owner, m_appearance.VisualParams, m_appearance.Texture.GetBytes()); + if (m_scene.AvatarFactory != null) + { + if (m_scene.AvatarFactory.ValidateBakedTextureCache(m_controllingClient)) + { +// m_log.WarnFormat("[SCENEPRESENCE]: baked textures are in the cache for {0}", Name); + m_controllingClient.SendAppearance( + m_appearance.Owner,m_appearance.VisualParams,m_appearance.Texture.GetBytes()); + } + } + else + { + m_log.WarnFormat("[SCENEPRESENCE]: AvatarFactory not set for {0}", Name); + } - SendAppearanceToAllOtherAgents(); - } - - /// - /// Tell the client for this scene presence what items it should be wearing now - /// - public void SendWearables() - { - m_log.DebugFormat("[SCENE]: Received request for wearables of {0}", Name); - - ControllingClient.SendWearables(m_appearance.Wearables, m_appearance.Serial++); } /// @@ -2585,39 +2602,27 @@ namespace OpenSim.Region.Framework.Scenes /// public void SendAppearanceToAllOtherAgents() { +// DEBUG ON +// m_log.WarnFormat("[SCENEPRESENCE]: Send appearance from {0} to all other agents", m_uuid); +// DEBUG OFF // REGION SYNC // The server should not be doing anything via the ForEachScenePresence method if (m_scene.IsSyncedServer()) + { + m_scene.RegionSyncServerModule.SendAppearance(UUID, Appearance.Texture, Appearance.VisualParams); return; + } if (Appearance.Texture == null) return; m_perfMonMS = Util.EnvironmentTickCount(); - // REGION SYNC - //if(m_scene.IsSyncedServer()) - //m_scene.RegionSyncServerModule.SendAppearance(UUID, Appearance.VisualParams, Appearance.Texture); - m_appearance.Owner = UUID; // Why does this need to be here? - m_scene.ForEachClient(delegate(IClientAPI client) - { - if(client.AgentId != ControllingClient.AgentId) - { - m_log.DebugFormat("[SCENE PRESENCE] Sending {0} appearance to {1} (SendAppearanceToAllOtherAgents)", Name, client.Name); - client.SendAppearance(m_appearance.Owner, m_appearance.VisualParams, m_appearance.Texture.GetBytes()); - } - }); - /* - - - - m_scene.ForEachScenePresence(delegate(ScenePresence scenePresence) + m_scene.ForEachScenePresence(delegate(ScenePresence scenePresence) + { + if (scenePresence.UUID != UUID) { - if (scenePresence.UUID != UUID) - { - SendAppearanceToOtherAgent(scenePresence); - } - }); - } - * */ + SendAppearanceToOtherAgent(scenePresence); + } + }); m_scene.StatsReporter.AddAgentTime(Util.EnvironmentTickCountSubtract(m_perfMonMS)); } @@ -2627,105 +2632,20 @@ namespace OpenSim.Region.Framework.Scenes /// public void SendAppearanceToOtherAgent(ScenePresence avatar) { - if (Appearance.Texture == null) + if (LocalId == avatar.LocalId) { + m_log.WarnFormat("[SCENE PRESENCE]: An agent is attempting to send appearance data to itself; {0}", UUID); return; } - //m_log.WarnFormat("{0} sending appearance to {1}, owner={2}", UUID, avatar.UUID, m_appearance.Owner); - m_log.DebugFormat("[SCENE PRESENCE] Sending {0} appearance to {1} (SendAppearanceToOtherAgent)", Name, avatar.Name); - m_appearance.Owner = UUID; + +// DEBUG ON +// m_log.WarnFormat("[SP] Send appearance from {0} to {1}",m_uuid,avatar.ControllingClient.AgentId); +// DEBUG OFF + avatar.ControllingClient.SendAppearance( m_appearance.Owner, m_appearance.VisualParams, m_appearance.Texture.GetBytes()); } - /// - /// Set appearance data (textureentry and slider settings) received from the client - /// - /// - /// - public void SetAppearance(Primitive.TextureEntry textureEntry, byte[] visualParams) - { - //m_log.WarnFormat("[SCENE PRESENCE] SetAppearance called for {0} ({1})", Name, textureEntry == null ? " " : "te"); - if (m_physicsActor != null) - { - if (!IsChildAgent) - { - // This may seem like it's redundant, remove the avatar from the physics scene - // just to add it back again, but it saves us from having to update - // 3 variables 10 times a second. - bool flyingTemp = m_physicsActor.Flying; - RemoveFromPhysicalScene(); - //m_scene.PhysicsScene.RemoveAvatar(m_physicsActor); - - //PhysicsActor = null; - - AddToPhysicalScene(flyingTemp); - } - } - - #region Bake Cache Check - - if (textureEntry != null) - { - for (int i = 0; i < BAKE_INDICES.Length; i++) - { - int j = BAKE_INDICES[i]; - Primitive.TextureEntryFace face = textureEntry.FaceTextures[j]; - - if (face != null && face.TextureID != AppearanceManager.DEFAULT_AVATAR_TEXTURE) - { - if (m_scene.AssetService.Get(face.TextureID.ToString()) == null) - { - m_log.Warn("[APPEARANCE]: Missing baked texture " + face.TextureID + " (" + j + ") for avatar " + this.Name); - this.ControllingClient.SendRebakeAvatarTextures(face.TextureID); - } - } - } - - } - - - #endregion Bake Cache Check - - try - { - m_appearance.SetAppearance(textureEntry, visualParams); - if (m_appearance.AvatarHeight > 0) - SetHeight(m_appearance.AvatarHeight); - - // This is not needed, because only the transient data changed - //AvatarData adata = new AvatarData(m_appearance); - //m_scene.AvatarService.SetAvatar(m_controllingClient.AgentId, adata); - - SendAppearanceToAllOtherAgents(); - if (!m_startAnimationSet) - { - Animator.UpdateMovementAnimations(); - m_startAnimationSet = true; - } - - Vector3 pos = m_pos; - pos.Z += m_appearance.HipOffset; - - m_controllingClient.SendAvatarDataImmediate(this); - // Next line added on recommondation of MB - m_controllingClient.SendAppearance(m_appearance.Owner, m_appearance.VisualParams, m_appearance.Texture.GetBytes()); - } - catch (Exception e) - { - m_log.DebugFormat("[SCENE PRESENCE] EXCEPTION setting appearance: {0}", e); - } - } - - public void SetWearable(int wearableId, AvatarWearable wearable) - { - m_log.WarnFormat("[SCENE PRESENCE] SetWearable called for \"{0}\" (wearableID = {1})", Name, wearableId); - m_appearance.SetWearable(wearableId, wearable); - AvatarData adata = new AvatarData(m_appearance); - m_scene.AvatarService.SetAvatar(m_controllingClient.AgentId, adata); - m_controllingClient.SendWearables(m_appearance.Wearables, m_appearance.Serial++); - } - // Because appearance setting is in a module, we actually need // to give it access to our appearance directly, otherwise we // get a synchronization issue. @@ -2766,7 +2686,7 @@ namespace OpenSim.Region.Framework.Scenes cadu.ActiveGroupID = UUID.Zero.Guid; cadu.AgentID = UUID.Guid; cadu.alwaysrun = m_setAlwaysRun; - cadu.AVHeight = m_avHeight; + cadu.AVHeight = m_appearance.AvatarHeight; Vector3 tempCameraCenter = m_CameraCenter; cadu.cameraPosition = tempCameraCenter; cadu.drawdistance = m_DrawDistance; @@ -3102,7 +3022,6 @@ namespace OpenSim.Region.Framework.Scenes m_CameraCenter = cAgentData.Center + offset; - m_avHeight = cAgentData.Size.Z; //SetHeight(cAgentData.AVHeight); if ((cAgentData.Throttles != null) && cAgentData.Throttles.Length > 0) @@ -3119,14 +3038,14 @@ namespace OpenSim.Region.Framework.Scenes public void CopyTo(AgentData cAgent) { + cAgent.CallbackURI = m_callbackURI; + cAgent.AgentID = UUID; cAgent.RegionID = Scene.RegionInfo.RegionID; cAgent.Position = AbsolutePosition; cAgent.Velocity = m_velocity; cAgent.Center = m_CameraCenter; - // Don't copy the size; it is inferred from apearance parameters - //cAgent.Size = new Vector3(0, 0, m_avHeight); cAgent.AtAxis = m_CameraAtAxis; cAgent.LeftAxis = m_CameraLeftAxis; cAgent.UpAxis = m_CameraUpAxis; @@ -3158,6 +3077,9 @@ namespace OpenSim.Region.Framework.Scenes cAgent.AlwaysRun = m_setAlwaysRun; + cAgent.Appearance = new AvatarAppearance(m_appearance); + +/* try { // We might not pass the Wearables in all cases... @@ -3197,14 +3119,14 @@ namespace OpenSim.Region.Framework.Scenes { //m_log.DebugFormat("[SCENE PRESENCE]: attachments {0}", attPoints.Count); int i = 0; - AttachmentData[] attachs = new AttachmentData[attPoints.Count]; + AvatarAttachment[] attachs = new AvatarAttachment[attPoints.Count]; foreach (int point in attPoints) { - attachs[i++] = new AttachmentData(point, m_appearance.GetAttachedItem(point), m_appearance.GetAttachedAsset(point)); + attachs[i++] = new AvatarAttachment(point, m_appearance.GetAttachedItem(point), m_appearance.GetAttachedAsset(point)); } cAgent.Attachments = attachs; } - +*/ lock (scriptedcontrols) { ControllerData[] controls = new ControllerData[scriptedcontrols.Count]; @@ -3231,6 +3153,9 @@ namespace OpenSim.Region.Framework.Scenes public void CopyFrom(AgentData cAgent) { +// DEBUG ON + m_log.ErrorFormat("[SCENEPRESENCE] CALLING COPYFROM"); +// DEBUG OFF m_originRegionID = cAgent.RegionID; m_callbackURI = cAgent.CallbackURI; @@ -3238,7 +3163,6 @@ namespace OpenSim.Region.Framework.Scenes m_pos = cAgent.Position; m_velocity = cAgent.Velocity; m_CameraCenter = cAgent.Center; - //m_avHeight = cAgent.Size.Z; m_CameraAtAxis = cAgent.AtAxis; m_CameraLeftAxis = cAgent.LeftAxis; m_CameraUpAxis = cAgent.UpAxis; @@ -3256,6 +3180,15 @@ namespace OpenSim.Region.Framework.Scenes m_godLevel = cAgent.GodLevel; m_setAlwaysRun = cAgent.AlwaysRun; + m_appearance = new AvatarAppearance(cAgent.Appearance); + if (m_physicsActor != null) + { + bool isFlying = m_physicsActor.Flying; + RemoveFromPhysicalScene(); + AddToPhysicalScene(isFlying); + } + +/* uint i = 0; try { @@ -3268,15 +3201,17 @@ namespace OpenSim.Region.Framework.Scenes UUID assetId = cAgent.Wearables[n + 1]; wears[i++] = new AvatarWearable(itemId, assetId); } - m_appearance.Wearables = wears; - Primitive.TextureEntry te; + // m_appearance.Wearables = wears; + Primitive.TextureEntry textures = null; if (cAgent.AgentTextures != null && cAgent.AgentTextures.Length > 1) - te = new Primitive.TextureEntry(cAgent.AgentTextures, 0, cAgent.AgentTextures.Length); - else - te = AvatarAppearance.GetDefaultTexture(); - if ((cAgent.VisualParams == null) || (cAgent.VisualParams.Length < AvatarAppearance.VISUALPARAM_COUNT)) - cAgent.VisualParams = AvatarAppearance.GetDefaultVisualParams(); - m_appearance.SetAppearance(te, (byte[])cAgent.VisualParams.Clone()); + textures = new Primitive.TextureEntry(cAgent.AgentTextures, 0, cAgent.AgentTextures.Length); + + byte[] visuals = null; + + if ((cAgent.VisualParams != null) && (cAgent.VisualParams.Length < AvatarAppearance.VISUALPARAM_COUNT)) + visuals = (byte[])cAgent.VisualParams.Clone(); + + m_appearance = new AvatarAppearance(cAgent.AgentID,wears,textures,visuals); } catch (Exception e) { @@ -3289,14 +3224,14 @@ namespace OpenSim.Region.Framework.Scenes if (cAgent.Attachments != null) { m_appearance.ClearAttachments(); - foreach (AttachmentData att in cAgent.Attachments) + foreach (AvatarAttachment att in cAgent.Attachments) { m_appearance.SetAttachment(att.AttachPoint, att.ItemID, att.AssetID); } } } catch { } - +*/ try { lock (scriptedcontrols) @@ -3356,31 +3291,22 @@ namespace OpenSim.Region.Framework.Scenes } } - public override void SetText(string text, Vector3 color, double alpha) - { - throw new Exception("Can't set Text on avatar."); - } - /// /// Adds a physical representation of the avatar to the Physics plugin /// public void AddToPhysicalScene(bool isFlying) { + if (m_appearance.AvatarHeight == 0) + m_appearance.SetHeight(); + PhysicsScene scene = m_scene.PhysicsScene; Vector3 pVec = AbsolutePosition; // Old bug where the height was in centimeters instead of meters - if (m_avHeight == 127.0f) - { - m_physicsActor = scene.AddAvatar(Firstname + "." + Lastname, pVec, new Vector3(0f, 0f, 1.56f), - isFlying); - } - else - { - m_physicsActor = scene.AddAvatar(Firstname + "." + Lastname, pVec, - new Vector3(0f, 0f, m_avHeight), isFlying); - } + m_physicsActor = scene.AddAvatar(Firstname + "." + Lastname, pVec, + new Vector3(0f, 0f, m_appearance.AvatarHeight), isFlying); + scene.AddPhysicsActorTaint(m_physicsActor); //m_physicsActor.OnRequestTerseUpdate += SendTerseUpdateToAllClients; m_physicsActor.OnCollisionUpdate += PhysicsCollisionUpdate; @@ -3532,6 +3458,27 @@ namespace OpenSim.Region.Framework.Scenes m_attachments.Add(gobj); } } + + /// + /// Get the scene object attached to the given point. + /// + /// + /// Returns an empty list if there were no attachments at the point. + public List GetAttachments(uint attachmentPoint) + { + List attachments = new List(); + + lock (m_attachments) + { + foreach (SceneObjectGroup so in m_attachments) + { + if (attachmentPoint == so.RootPart.AttachmentPoint) + attachments.Add(so); + } + } + + return attachments; + } public bool HasAttachments() { @@ -3604,7 +3551,7 @@ namespace OpenSim.Region.Framework.Scenes if (m == null) // No script engine loaded continue; - m.PostObjectEvent(grp.RootPart.UUID, "changed", new Object[] { 16384 }); + m.PostObjectEvent(grp.RootPart.UUID, "changed", new Object[] { (int)Changed.ANIMATION }); } } } @@ -3849,15 +3796,16 @@ namespace OpenSim.Region.Framework.Scenes return; } - List attPoints = m_appearance.GetAttachedPoints(); - foreach (int p in attPoints) + List attachments = m_appearance.GetAttachments(); + foreach (AvatarAttachment attach in attachments) { if (m_isDeleted) return; - UUID itemID = m_appearance.GetAttachedItem(p); - UUID assetID = m_appearance.GetAttachedAsset(p); + int p = attach.AttachPoint; + UUID itemID = attach.ItemID; + //UUID assetID = attach.AssetID; // For some reason assetIDs are being written as Zero's in the DB -- need to track tat down // But they're not used anyway, the item is being looked up for now, so let's proceed. //if (UUID.Zero == assetID) @@ -3868,17 +3816,11 @@ namespace OpenSim.Region.Framework.Scenes try { - // Rez from inventory - UUID asset - = m_scene.AttachmentsModule.RezSingleAttachmentFromInventory(ControllingClient, itemID, (uint)p); - - m_log.InfoFormat( - "[ATTACHMENT]: Rezzed attachment in point {0} from item {1} and asset {2} ({3})", - p, itemID, assetID, asset); + m_scene.AttachmentsModule.RezSingleAttachmentFromInventory(ControllingClient, itemID, (uint)p); } catch (Exception e) { - m_log.ErrorFormat("[ATTACHMENT]: Unable to rez attachment: {0}", e.ToString()); + m_log.ErrorFormat("[ATTACHMENT]: Unable to rez attachment: {0}{1}", e.Message, e.StackTrace); } } } @@ -3907,5 +3849,28 @@ namespace OpenSim.Region.Framework.Scenes m_reprioritization_called = false; } } + + public void SaveChangedAttachments() + { + // Need to copy this list because DetachToInventoryPrep mods it + List attachments = new List(Attachments.ToArray()); + + IAttachmentsModule attachmentsModule = m_scene.AttachmentsModule; + if (attachmentsModule != null) + { + foreach (SceneObjectGroup grp in attachments) + { + if (grp.HasGroupChanged) // Resizer scripts? + { + grp.RootPart.IsAttachment = false; + grp.AbsolutePosition = grp.RootPart.AttachedPos; +// grp.DetachToInventoryPrep(); + attachmentsModule.UpdateKnownItem(ControllingClient, + grp, grp.GetFromItemID(), grp.OwnerID); + grp.RootPart.IsAttachment = true; + } + } + } + } } } diff --git a/OpenSim/Region/Framework/Scenes/SceneViewer.cs b/OpenSim/Region/Framework/Scenes/SceneViewer.cs index f478a4a770..b44a0100a4 100644 --- a/OpenSim/Region/Framework/Scenes/SceneViewer.cs +++ b/OpenSim/Region/Framework/Scenes/SceneViewer.cs @@ -73,9 +73,10 @@ namespace OpenSim.Region.Framework.Scenes { m_pendingObjects = new Queue(); - lock(m_pendingObjects) + lock (m_pendingObjects) { - foreach (EntityBase e in m_presence.Scene.Entities) + EntityBase[] entities = m_presence.Scene.Entities.GetEntities(); + foreach (EntityBase e in entities) { if (e != null && e is SceneObjectGroup) m_pendingObjects.Enqueue((SceneObjectGroup)e); @@ -84,7 +85,7 @@ namespace OpenSim.Region.Framework.Scenes } } - lock(m_pendingObjects) + lock (m_pendingObjects) { while (m_pendingObjects != null && m_pendingObjects.Count > 0) { @@ -178,11 +179,13 @@ namespace OpenSim.Region.Framework.Scenes public void Reset() { - if (m_pendingObjects != null) - { - lock (m_pendingObjects) - { + if (m_pendingObjects == null) + return; + lock (m_pendingObjects) + { + if (m_pendingObjects != null) + { m_pendingObjects.Clear(); m_pendingObjects = null; } diff --git a/OpenSim/Region/Framework/Scenes/Serialization/SceneObjectSerializer.cs b/OpenSim/Region/Framework/Scenes/Serialization/SceneObjectSerializer.cs index 09dd745bc6..9d9094fd1a 100644 --- a/OpenSim/Region/Framework/Scenes/Serialization/SceneObjectSerializer.cs +++ b/OpenSim/Region/Framework/Scenes/Serialization/SceneObjectSerializer.cs @@ -26,12 +26,15 @@ */ using System; +using System.Collections.Generic; +using System.Drawing; using System.IO; using System.Reflection; using System.Xml; using log4net; using OpenMetaverse; using OpenSim.Framework; +using OpenSim.Region.Framework.Interfaces; using OpenSim.Region.Framework.Scenes; namespace OpenSim.Region.Framework.Scenes.Serialization @@ -44,6 +47,8 @@ namespace OpenSim.Region.Framework.Scenes.Serialization public class SceneObjectSerializer { private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); + + private static IUserManagement m_UserManagement; /// /// Deserialize a scene object from the original xml format @@ -65,14 +70,6 @@ namespace OpenSim.Region.Framework.Scenes.Serialization //m_log.DebugFormat("[SOG]: Starting deserialization of SOG"); //int time = System.Environment.TickCount; - // libomv.types changes UUID to Guid - xmlData = xmlData.Replace("", ""); - xmlData = xmlData.Replace("", ""); - - // Handle Nested property - xmlData = xmlData.Replace("", ""); - xmlData = xmlData.Replace("", ""); - try { StringReader sr; @@ -124,6 +121,7 @@ namespace OpenSim.Region.Framework.Scenes.Serialization } } + /// /// Serialize a scene object to the original xml format /// @@ -154,20 +152,19 @@ namespace OpenSim.Region.Framework.Scenes.Serialization writer.WriteStartElement(String.Empty, "SceneObjectGroup", String.Empty); writer.WriteStartElement(String.Empty, "RootPart", String.Empty); - ToOriginalXmlFormat(sceneObject.RootPart, writer); + ToXmlFormat(sceneObject.RootPart, writer); writer.WriteEndElement(); writer.WriteStartElement(String.Empty, "OtherParts", String.Empty); - lock (sceneObject.Children) + SceneObjectPart[] parts = sceneObject.Parts; + for (int i = 0; i < parts.Length; i++) { - foreach (SceneObjectPart part in sceneObject.Children.Values) + SceneObjectPart part = parts[i]; + if (part.UUID != sceneObject.RootPart.UUID) { - if (part.UUID != sceneObject.RootPart.UUID) - { - writer.WriteStartElement(String.Empty, "Part", String.Empty); - ToOriginalXmlFormat(part, writer); - writer.WriteEndElement(); - } + writer.WriteStartElement(String.Empty, "Part", String.Empty); + ToXmlFormat(part, writer); + writer.WriteEndElement(); } } @@ -178,9 +175,9 @@ namespace OpenSim.Region.Framework.Scenes.Serialization //m_log.DebugFormat("[SERIALIZER]: Finished serialization of SOG {0}, {1}ms", Name, System.Environment.TickCount - time); } - protected static void ToOriginalXmlFormat(SceneObjectPart part, XmlTextWriter writer) + protected static void ToXmlFormat(SceneObjectPart part, XmlTextWriter writer) { - part.ToXml(writer); + SOPToXml2(writer, part, new Dictionary()); } public static SceneObjectGroup FromXml2Format(string xmlData) @@ -188,14 +185,6 @@ namespace OpenSim.Region.Framework.Scenes.Serialization //m_log.DebugFormat("[SOG]: Starting deserialization of SOG"); //int time = System.Environment.TickCount; - // libomv.types changes UUID to Guid - xmlData = xmlData.Replace("", ""); - xmlData = xmlData.Replace("", ""); - - // Handle Nested property - xmlData = xmlData.Replace("", ""); - xmlData = xmlData.Replace("", ""); - try { XmlDocument doc = new XmlDocument(); @@ -260,23 +249,828 @@ namespace OpenSim.Region.Framework.Scenes.Serialization { using (XmlTextWriter writer = new XmlTextWriter(sw)) { - ToXml2Format(sceneObject, writer); + SOGToXml2(writer, sceneObject, new Dictionary()); } return sw.ToString(); } } - /// - /// Serialize a scene object to the 'xml2' format. - /// - /// - /// - public static void ToXml2Format(SceneObjectGroup sceneObject, XmlTextWriter writer) - { - //m_log.DebugFormat("[SERIALIZER]: Starting serialization of SOG {0} to XML2", Name); - //int time = System.Environment.TickCount; + #region manual serialization + + private delegate void SOPXmlProcessor(SceneObjectPart sop, XmlTextReader reader); + private static Dictionary m_SOPXmlProcessors = new Dictionary(); + + private delegate void TaskInventoryXmlProcessor(TaskInventoryItem item, XmlTextReader reader); + private static Dictionary m_TaskInventoryXmlProcessors = new Dictionary(); + + private delegate void ShapeXmlProcessor(PrimitiveBaseShape shape, XmlTextReader reader); + private static Dictionary m_ShapeXmlProcessors = new Dictionary(); + + static SceneObjectSerializer() + { + #region SOPXmlProcessors initialization + m_SOPXmlProcessors.Add("AllowedDrop", ProcessAllowedDrop); + m_SOPXmlProcessors.Add("CreatorID", ProcessCreatorID); + m_SOPXmlProcessors.Add("CreatorData", ProcessCreatorData); + m_SOPXmlProcessors.Add("FolderID", ProcessFolderID); + m_SOPXmlProcessors.Add("InventorySerial", ProcessInventorySerial); + m_SOPXmlProcessors.Add("TaskInventory", ProcessTaskInventory); + m_SOPXmlProcessors.Add("UUID", ProcessUUID); + m_SOPXmlProcessors.Add("LocalId", ProcessLocalId); + m_SOPXmlProcessors.Add("Name", ProcessName); + m_SOPXmlProcessors.Add("Material", ProcessMaterial); + m_SOPXmlProcessors.Add("PassTouches", ProcessPassTouches); + m_SOPXmlProcessors.Add("RegionHandle", ProcessRegionHandle); + m_SOPXmlProcessors.Add("ScriptAccessPin", ProcessScriptAccessPin); + m_SOPXmlProcessors.Add("GroupPosition", ProcessGroupPosition); + m_SOPXmlProcessors.Add("OffsetPosition", ProcessOffsetPosition); + m_SOPXmlProcessors.Add("RotationOffset", ProcessRotationOffset); + m_SOPXmlProcessors.Add("Velocity", ProcessVelocity); + m_SOPXmlProcessors.Add("AngularVelocity", ProcessAngularVelocity); + m_SOPXmlProcessors.Add("Acceleration", ProcessAcceleration); + m_SOPXmlProcessors.Add("Description", ProcessDescription); + m_SOPXmlProcessors.Add("Color", ProcessColor); + m_SOPXmlProcessors.Add("Text", ProcessText); + m_SOPXmlProcessors.Add("SitName", ProcessSitName); + m_SOPXmlProcessors.Add("TouchName", ProcessTouchName); + m_SOPXmlProcessors.Add("LinkNum", ProcessLinkNum); + m_SOPXmlProcessors.Add("ClickAction", ProcessClickAction); + m_SOPXmlProcessors.Add("Shape", ProcessShape); + m_SOPXmlProcessors.Add("Scale", ProcessScale); + m_SOPXmlProcessors.Add("UpdateFlag", ProcessUpdateFlag); + m_SOPXmlProcessors.Add("SitTargetOrientation", ProcessSitTargetOrientation); + m_SOPXmlProcessors.Add("SitTargetPosition", ProcessSitTargetPosition); + m_SOPXmlProcessors.Add("SitTargetPositionLL", ProcessSitTargetPositionLL); + m_SOPXmlProcessors.Add("SitTargetOrientationLL", ProcessSitTargetOrientationLL); + m_SOPXmlProcessors.Add("ParentID", ProcessParentID); + m_SOPXmlProcessors.Add("CreationDate", ProcessCreationDate); + m_SOPXmlProcessors.Add("Category", ProcessCategory); + m_SOPXmlProcessors.Add("SalePrice", ProcessSalePrice); + m_SOPXmlProcessors.Add("ObjectSaleType", ProcessObjectSaleType); + m_SOPXmlProcessors.Add("OwnershipCost", ProcessOwnershipCost); + m_SOPXmlProcessors.Add("GroupID", ProcessGroupID); + m_SOPXmlProcessors.Add("OwnerID", ProcessOwnerID); + m_SOPXmlProcessors.Add("LastOwnerID", ProcessLastOwnerID); + m_SOPXmlProcessors.Add("BaseMask", ProcessBaseMask); + m_SOPXmlProcessors.Add("OwnerMask", ProcessOwnerMask); + m_SOPXmlProcessors.Add("GroupMask", ProcessGroupMask); + m_SOPXmlProcessors.Add("EveryoneMask", ProcessEveryoneMask); + m_SOPXmlProcessors.Add("NextOwnerMask", ProcessNextOwnerMask); + m_SOPXmlProcessors.Add("Flags", ProcessFlags); + m_SOPXmlProcessors.Add("CollisionSound", ProcessCollisionSound); + m_SOPXmlProcessors.Add("CollisionSoundVolume", ProcessCollisionSoundVolume); + m_SOPXmlProcessors.Add("MediaUrl", ProcessMediaUrl); + m_SOPXmlProcessors.Add("TextureAnimation", ProcessTextureAnimation); + m_SOPXmlProcessors.Add("ParticleSystem", ProcessParticleSystem); + #endregion + + #region TaskInventoryXmlProcessors initialization + m_TaskInventoryXmlProcessors.Add("AssetID", ProcessTIAssetID); + m_TaskInventoryXmlProcessors.Add("BasePermissions", ProcessTIBasePermissions); + m_TaskInventoryXmlProcessors.Add("CreationDate", ProcessTICreationDate); + m_TaskInventoryXmlProcessors.Add("CreatorID", ProcessTICreatorID); + m_TaskInventoryXmlProcessors.Add("CreatorData", ProcessTICreatorData); + m_TaskInventoryXmlProcessors.Add("Description", ProcessTIDescription); + m_TaskInventoryXmlProcessors.Add("EveryonePermissions", ProcessTIEveryonePermissions); + m_TaskInventoryXmlProcessors.Add("Flags", ProcessTIFlags); + m_TaskInventoryXmlProcessors.Add("GroupID", ProcessTIGroupID); + m_TaskInventoryXmlProcessors.Add("GroupPermissions", ProcessTIGroupPermissions); + m_TaskInventoryXmlProcessors.Add("InvType", ProcessTIInvType); + m_TaskInventoryXmlProcessors.Add("ItemID", ProcessTIItemID); + m_TaskInventoryXmlProcessors.Add("OldItemID", ProcessTIOldItemID); + m_TaskInventoryXmlProcessors.Add("LastOwnerID", ProcessTILastOwnerID); + m_TaskInventoryXmlProcessors.Add("Name", ProcessTIName); + m_TaskInventoryXmlProcessors.Add("NextPermissions", ProcessTINextPermissions); + m_TaskInventoryXmlProcessors.Add("OwnerID", ProcessTIOwnerID); + m_TaskInventoryXmlProcessors.Add("CurrentPermissions", ProcessTICurrentPermissions); + m_TaskInventoryXmlProcessors.Add("ParentID", ProcessTIParentID); + m_TaskInventoryXmlProcessors.Add("ParentPartID", ProcessTIParentPartID); + m_TaskInventoryXmlProcessors.Add("PermsGranter", ProcessTIPermsGranter); + m_TaskInventoryXmlProcessors.Add("PermsMask", ProcessTIPermsMask); + m_TaskInventoryXmlProcessors.Add("Type", ProcessTIType); + m_TaskInventoryXmlProcessors.Add("OwnerChanged", ProcessTIOwnerChanged); + + #endregion + + #region ShapeXmlProcessors initialization + m_ShapeXmlProcessors.Add("ProfileCurve", ProcessShpProfileCurve); + m_ShapeXmlProcessors.Add("TextureEntry", ProcessShpTextureEntry); + m_ShapeXmlProcessors.Add("ExtraParams", ProcessShpExtraParams); + m_ShapeXmlProcessors.Add("PathBegin", ProcessShpPathBegin); + m_ShapeXmlProcessors.Add("PathCurve", ProcessShpPathCurve); + m_ShapeXmlProcessors.Add("PathEnd", ProcessShpPathEnd); + m_ShapeXmlProcessors.Add("PathRadiusOffset", ProcessShpPathRadiusOffset); + m_ShapeXmlProcessors.Add("PathRevolutions", ProcessShpPathRevolutions); + m_ShapeXmlProcessors.Add("PathScaleX", ProcessShpPathScaleX); + m_ShapeXmlProcessors.Add("PathScaleY", ProcessShpPathScaleY); + m_ShapeXmlProcessors.Add("PathShearX", ProcessShpPathShearX); + m_ShapeXmlProcessors.Add("PathShearY", ProcessShpPathShearY); + m_ShapeXmlProcessors.Add("PathSkew", ProcessShpPathSkew); + m_ShapeXmlProcessors.Add("PathTaperX", ProcessShpPathTaperX); + m_ShapeXmlProcessors.Add("PathTaperY", ProcessShpPathTaperY); + m_ShapeXmlProcessors.Add("PathTwist", ProcessShpPathTwist); + m_ShapeXmlProcessors.Add("PathTwistBegin", ProcessShpPathTwistBegin); + m_ShapeXmlProcessors.Add("PCode", ProcessShpPCode); + m_ShapeXmlProcessors.Add("ProfileBegin", ProcessShpProfileBegin); + m_ShapeXmlProcessors.Add("ProfileEnd", ProcessShpProfileEnd); + m_ShapeXmlProcessors.Add("ProfileHollow", ProcessShpProfileHollow); + m_ShapeXmlProcessors.Add("Scale", ProcessShpScale); + m_ShapeXmlProcessors.Add("State", ProcessShpState); + m_ShapeXmlProcessors.Add("ProfileShape", ProcessShpProfileShape); + m_ShapeXmlProcessors.Add("HollowShape", ProcessShpHollowShape); + m_ShapeXmlProcessors.Add("SculptTexture", ProcessShpSculptTexture); + m_ShapeXmlProcessors.Add("SculptType", ProcessShpSculptType); + m_ShapeXmlProcessors.Add("SculptData", ProcessShpSculptData); + m_ShapeXmlProcessors.Add("FlexiSoftness", ProcessShpFlexiSoftness); + m_ShapeXmlProcessors.Add("FlexiTension", ProcessShpFlexiTension); + m_ShapeXmlProcessors.Add("FlexiDrag", ProcessShpFlexiDrag); + m_ShapeXmlProcessors.Add("FlexiGravity", ProcessShpFlexiGravity); + m_ShapeXmlProcessors.Add("FlexiWind", ProcessShpFlexiWind); + m_ShapeXmlProcessors.Add("FlexiForceX", ProcessShpFlexiForceX); + m_ShapeXmlProcessors.Add("FlexiForceY", ProcessShpFlexiForceY); + m_ShapeXmlProcessors.Add("FlexiForceZ", ProcessShpFlexiForceZ); + m_ShapeXmlProcessors.Add("LightColorR", ProcessShpLightColorR); + m_ShapeXmlProcessors.Add("LightColorG", ProcessShpLightColorG); + m_ShapeXmlProcessors.Add("LightColorB", ProcessShpLightColorB); + m_ShapeXmlProcessors.Add("LightColorA", ProcessShpLightColorA); + m_ShapeXmlProcessors.Add("LightRadius", ProcessShpLightRadius); + m_ShapeXmlProcessors.Add("LightCutoff", ProcessShpLightCutoff); + m_ShapeXmlProcessors.Add("LightFalloff", ProcessShpLightFalloff); + m_ShapeXmlProcessors.Add("LightIntensity", ProcessShpLightIntensity); + m_ShapeXmlProcessors.Add("FlexiEntry", ProcessShpFlexiEntry); + m_ShapeXmlProcessors.Add("LightEntry", ProcessShpLightEntry); + m_ShapeXmlProcessors.Add("SculptEntry", ProcessShpSculptEntry); + m_ShapeXmlProcessors.Add("Media", ProcessShpMedia); + #endregion + } + + #region SOPXmlProcessors + private static void ProcessAllowedDrop(SceneObjectPart obj, XmlTextReader reader) + { + obj.AllowedDrop = reader.ReadElementContentAsBoolean("AllowedDrop", String.Empty); + } + + private static void ProcessCreatorID(SceneObjectPart obj, XmlTextReader reader) + { + obj.CreatorID = ReadUUID(reader, "CreatorID"); + } + + private static void ProcessCreatorData(SceneObjectPart obj, XmlTextReader reader) + { + obj.CreatorData = reader.ReadElementContentAsString("CreatorData", String.Empty); + } + + private static void ProcessFolderID(SceneObjectPart obj, XmlTextReader reader) + { + obj.FolderID = ReadUUID(reader, "FolderID"); + } + + private static void ProcessInventorySerial(SceneObjectPart obj, XmlTextReader reader) + { + obj.InventorySerial = (uint)reader.ReadElementContentAsInt("InventorySerial", String.Empty); + } + + private static void ProcessTaskInventory(SceneObjectPart obj, XmlTextReader reader) + { + obj.TaskInventory = ReadTaskInventory(reader, "TaskInventory"); + } + + private static void ProcessUUID(SceneObjectPart obj, XmlTextReader reader) + { + obj.UUID = ReadUUID(reader, "UUID"); + } + + private static void ProcessLocalId(SceneObjectPart obj, XmlTextReader reader) + { + obj.LocalId = (uint)reader.ReadElementContentAsLong("LocalId", String.Empty); + } + + private static void ProcessName(SceneObjectPart obj, XmlTextReader reader) + { + obj.Name = reader.ReadElementString("Name"); + } + + private static void ProcessMaterial(SceneObjectPart obj, XmlTextReader reader) + { + obj.Material = (byte)reader.ReadElementContentAsInt("Material", String.Empty); + } + + private static void ProcessPassTouches(SceneObjectPart obj, XmlTextReader reader) + { + obj.PassTouches = reader.ReadElementContentAsBoolean("PassTouches", String.Empty); + } + + private static void ProcessRegionHandle(SceneObjectPart obj, XmlTextReader reader) + { + obj.RegionHandle = (ulong)reader.ReadElementContentAsLong("RegionHandle", String.Empty); + } + + private static void ProcessScriptAccessPin(SceneObjectPart obj, XmlTextReader reader) + { + obj.ScriptAccessPin = reader.ReadElementContentAsInt("ScriptAccessPin", String.Empty); + } + + private static void ProcessGroupPosition(SceneObjectPart obj, XmlTextReader reader) + { + obj.GroupPosition = ReadVector(reader, "GroupPosition"); + } + + private static void ProcessOffsetPosition(SceneObjectPart obj, XmlTextReader reader) + { + obj.OffsetPosition = ReadVector(reader, "OffsetPosition"); ; + } + + private static void ProcessRotationOffset(SceneObjectPart obj, XmlTextReader reader) + { + obj.RotationOffset = ReadQuaternion(reader, "RotationOffset"); + } + + private static void ProcessVelocity(SceneObjectPart obj, XmlTextReader reader) + { + obj.Velocity = ReadVector(reader, "Velocity"); + } + + private static void ProcessAngularVelocity(SceneObjectPart obj, XmlTextReader reader) + { + obj.AngularVelocity = ReadVector(reader, "AngularVelocity"); + } + + private static void ProcessAcceleration(SceneObjectPart obj, XmlTextReader reader) + { + obj.Acceleration = ReadVector(reader, "Acceleration"); + } + + private static void ProcessDescription(SceneObjectPart obj, XmlTextReader reader) + { + obj.Description = reader.ReadElementString("Description"); + } + + private static void ProcessColor(SceneObjectPart obj, XmlTextReader reader) + { + reader.ReadStartElement("Color"); + if (reader.Name == "R") + { + float r = reader.ReadElementContentAsFloat("R", String.Empty); + float g = reader.ReadElementContentAsFloat("G", String.Empty); + float b = reader.ReadElementContentAsFloat("B", String.Empty); + float a = reader.ReadElementContentAsFloat("A", String.Empty); + obj.Color = Color.FromArgb((int)a, (int)r, (int)g, (int)b); + reader.ReadEndElement(); + } + } + + private static void ProcessText(SceneObjectPart obj, XmlTextReader reader) + { + obj.Text = reader.ReadElementString("Text", String.Empty); + } + + private static void ProcessSitName(SceneObjectPart obj, XmlTextReader reader) + { + obj.SitName = reader.ReadElementString("SitName", String.Empty); + } + + private static void ProcessTouchName(SceneObjectPart obj, XmlTextReader reader) + { + obj.TouchName = reader.ReadElementString("TouchName", String.Empty); + } + + private static void ProcessLinkNum(SceneObjectPart obj, XmlTextReader reader) + { + obj.LinkNum = reader.ReadElementContentAsInt("LinkNum", String.Empty); + } + + private static void ProcessClickAction(SceneObjectPart obj, XmlTextReader reader) + { + obj.ClickAction = (byte)reader.ReadElementContentAsInt("ClickAction", String.Empty); + } + + private static void ProcessShape(SceneObjectPart obj, XmlTextReader reader) + { + obj.Shape = ReadShape(reader, "Shape"); + } + + private static void ProcessScale(SceneObjectPart obj, XmlTextReader reader) + { + obj.Scale = ReadVector(reader, "Scale"); + } + + private static void ProcessUpdateFlag(SceneObjectPart obj, XmlTextReader reader) + { + obj.UpdateFlag = (byte)reader.ReadElementContentAsInt("UpdateFlag", String.Empty); + } + + private static void ProcessSitTargetOrientation(SceneObjectPart obj, XmlTextReader reader) + { + obj.SitTargetOrientation = ReadQuaternion(reader, "SitTargetOrientation"); + } + + private static void ProcessSitTargetPosition(SceneObjectPart obj, XmlTextReader reader) + { + obj.SitTargetPosition = ReadVector(reader, "SitTargetPosition"); + } + + private static void ProcessSitTargetPositionLL(SceneObjectPart obj, XmlTextReader reader) + { + obj.SitTargetPositionLL = ReadVector(reader, "SitTargetPositionLL"); + } + + private static void ProcessSitTargetOrientationLL(SceneObjectPart obj, XmlTextReader reader) + { + obj.SitTargetOrientationLL = ReadQuaternion(reader, "SitTargetOrientationLL"); + } + + private static void ProcessParentID(SceneObjectPart obj, XmlTextReader reader) + { + string str = reader.ReadElementContentAsString("ParentID", String.Empty); + obj.ParentID = Convert.ToUInt32(str); + } + + private static void ProcessCreationDate(SceneObjectPart obj, XmlTextReader reader) + { + obj.CreationDate = reader.ReadElementContentAsInt("CreationDate", String.Empty); + } + + private static void ProcessCategory(SceneObjectPart obj, XmlTextReader reader) + { + obj.Category = (uint)reader.ReadElementContentAsInt("Category", String.Empty); + } + + private static void ProcessSalePrice(SceneObjectPart obj, XmlTextReader reader) + { + obj.SalePrice = reader.ReadElementContentAsInt("SalePrice", String.Empty); + } + + private static void ProcessObjectSaleType(SceneObjectPart obj, XmlTextReader reader) + { + obj.ObjectSaleType = (byte)reader.ReadElementContentAsInt("ObjectSaleType", String.Empty); + } + + private static void ProcessOwnershipCost(SceneObjectPart obj, XmlTextReader reader) + { + obj.OwnershipCost = reader.ReadElementContentAsInt("OwnershipCost", String.Empty); + } + + private static void ProcessGroupID(SceneObjectPart obj, XmlTextReader reader) + { + obj.GroupID = ReadUUID(reader, "GroupID"); + } + + private static void ProcessOwnerID(SceneObjectPart obj, XmlTextReader reader) + { + obj.OwnerID = ReadUUID(reader, "OwnerID"); + } + + private static void ProcessLastOwnerID(SceneObjectPart obj, XmlTextReader reader) + { + obj.LastOwnerID = ReadUUID(reader, "LastOwnerID"); + } + + private static void ProcessBaseMask(SceneObjectPart obj, XmlTextReader reader) + { + obj.BaseMask = (uint)reader.ReadElementContentAsInt("BaseMask", String.Empty); + } + + private static void ProcessOwnerMask(SceneObjectPart obj, XmlTextReader reader) + { + obj.OwnerMask = (uint)reader.ReadElementContentAsInt("OwnerMask", String.Empty); + } + + private static void ProcessGroupMask(SceneObjectPart obj, XmlTextReader reader) + { + obj.GroupMask = (uint)reader.ReadElementContentAsInt("GroupMask", String.Empty); + } + + private static void ProcessEveryoneMask(SceneObjectPart obj, XmlTextReader reader) + { + obj.EveryoneMask = (uint)reader.ReadElementContentAsInt("EveryoneMask", String.Empty); + } + + private static void ProcessNextOwnerMask(SceneObjectPart obj, XmlTextReader reader) + { + obj.NextOwnerMask = (uint)reader.ReadElementContentAsInt("NextOwnerMask", String.Empty); + } + + private static void ProcessFlags(SceneObjectPart obj, XmlTextReader reader) + { + string value = reader.ReadElementContentAsString("Flags", String.Empty); + // !!!!! to deal with flags without commas + if (value.Contains(" ") && !value.Contains(",")) + value = value.Replace(" ", ", "); + obj.Flags = (PrimFlags)Enum.Parse(typeof(PrimFlags), value); + } + + private static void ProcessCollisionSound(SceneObjectPart obj, XmlTextReader reader) + { + obj.CollisionSound = ReadUUID(reader, "CollisionSound"); + } + + private static void ProcessCollisionSoundVolume(SceneObjectPart obj, XmlTextReader reader) + { + obj.CollisionSoundVolume = reader.ReadElementContentAsFloat("CollisionSoundVolume", String.Empty); + } + + private static void ProcessMediaUrl(SceneObjectPart obj, XmlTextReader reader) + { + obj.MediaUrl = reader.ReadElementContentAsString("MediaUrl", String.Empty); + } + + private static void ProcessTextureAnimation(SceneObjectPart obj, XmlTextReader reader) + { + obj.TextureAnimation = Convert.FromBase64String(reader.ReadElementContentAsString("TextureAnimation", String.Empty)); + } + + private static void ProcessParticleSystem(SceneObjectPart obj, XmlTextReader reader) + { + obj.ParticleSystem = Convert.FromBase64String(reader.ReadElementContentAsString("ParticleSystem", String.Empty)); + } + #endregion + + #region TaskInventoryXmlProcessors + private static void ProcessTIAssetID(TaskInventoryItem item, XmlTextReader reader) + { + item.AssetID = ReadUUID(reader, "AssetID"); + } + + private static void ProcessTIBasePermissions(TaskInventoryItem item, XmlTextReader reader) + { + item.BasePermissions = (uint)reader.ReadElementContentAsInt("BasePermissions", String.Empty); + } + + private static void ProcessTICreationDate(TaskInventoryItem item, XmlTextReader reader) + { + item.CreationDate = (uint)reader.ReadElementContentAsInt("CreationDate", String.Empty); + } + + private static void ProcessTICreatorID(TaskInventoryItem item, XmlTextReader reader) + { + item.CreatorID = ReadUUID(reader, "CreatorID"); + } + + private static void ProcessTICreatorData(TaskInventoryItem item, XmlTextReader reader) + { + item.CreatorData = reader.ReadElementContentAsString("CreatorData", String.Empty); + } + + private static void ProcessTIDescription(TaskInventoryItem item, XmlTextReader reader) + { + item.Description = reader.ReadElementContentAsString("Description", String.Empty); + } + + private static void ProcessTIEveryonePermissions(TaskInventoryItem item, XmlTextReader reader) + { + item.EveryonePermissions = (uint)reader.ReadElementContentAsInt("EveryonePermissions", String.Empty); + } + + private static void ProcessTIFlags(TaskInventoryItem item, XmlTextReader reader) + { + item.Flags = (uint)reader.ReadElementContentAsInt("Flags", String.Empty); + } + + private static void ProcessTIGroupID(TaskInventoryItem item, XmlTextReader reader) + { + item.GroupID = ReadUUID(reader, "GroupID"); + } + + private static void ProcessTIGroupPermissions(TaskInventoryItem item, XmlTextReader reader) + { + item.GroupPermissions = (uint)reader.ReadElementContentAsInt("GroupPermissions", String.Empty); + } + + private static void ProcessTIInvType(TaskInventoryItem item, XmlTextReader reader) + { + item.InvType = reader.ReadElementContentAsInt("InvType", String.Empty); + } + + private static void ProcessTIItemID(TaskInventoryItem item, XmlTextReader reader) + { + item.ItemID = ReadUUID(reader, "ItemID"); + } + + private static void ProcessTIOldItemID(TaskInventoryItem item, XmlTextReader reader) + { + ReadUUID(reader, "OldItemID"); + // On deserialization, the old item id MUST BE UUID.Zero!!!!! + // Setting this to the saved value will BREAK script persistence! + // item.OldItemID = ReadUUID(reader, "OldItemID"); + } + + private static void ProcessTILastOwnerID(TaskInventoryItem item, XmlTextReader reader) + { + item.LastOwnerID = ReadUUID(reader, "LastOwnerID"); + } + + private static void ProcessTIName(TaskInventoryItem item, XmlTextReader reader) + { + item.Name = reader.ReadElementContentAsString("Name", String.Empty); + } + + private static void ProcessTINextPermissions(TaskInventoryItem item, XmlTextReader reader) + { + item.NextPermissions = (uint)reader.ReadElementContentAsInt("NextPermissions", String.Empty); + } + + private static void ProcessTIOwnerID(TaskInventoryItem item, XmlTextReader reader) + { + item.OwnerID = ReadUUID(reader, "OwnerID"); + } + + private static void ProcessTICurrentPermissions(TaskInventoryItem item, XmlTextReader reader) + { + item.CurrentPermissions = (uint)reader.ReadElementContentAsInt("CurrentPermissions", String.Empty); + } + + private static void ProcessTIParentID(TaskInventoryItem item, XmlTextReader reader) + { + item.ParentID = ReadUUID(reader, "ParentID"); + } + + private static void ProcessTIParentPartID(TaskInventoryItem item, XmlTextReader reader) + { + item.ParentPartID = ReadUUID(reader, "ParentPartID"); + } + + private static void ProcessTIPermsGranter(TaskInventoryItem item, XmlTextReader reader) + { + item.PermsGranter = ReadUUID(reader, "PermsGranter"); + } + + private static void ProcessTIPermsMask(TaskInventoryItem item, XmlTextReader reader) + { + item.PermsMask = reader.ReadElementContentAsInt("PermsMask", String.Empty); + } + + private static void ProcessTIType(TaskInventoryItem item, XmlTextReader reader) + { + item.Type = reader.ReadElementContentAsInt("Type", String.Empty); + } + + private static void ProcessTIOwnerChanged(TaskInventoryItem item, XmlTextReader reader) + { + item.OwnerChanged = reader.ReadElementContentAsBoolean("OwnerChanged", String.Empty); + } + + #endregion + + #region ShapeXmlProcessors + private static void ProcessShpProfileCurve(PrimitiveBaseShape shp, XmlTextReader reader) + { + shp.ProfileCurve = (byte)reader.ReadElementContentAsInt("ProfileCurve", String.Empty); + } + + private static void ProcessShpTextureEntry(PrimitiveBaseShape shp, XmlTextReader reader) + { + byte[] teData = Convert.FromBase64String(reader.ReadElementString("TextureEntry")); + shp.Textures = new Primitive.TextureEntry(teData, 0, teData.Length); + } + + private static void ProcessShpExtraParams(PrimitiveBaseShape shp, XmlTextReader reader) + { + shp.ExtraParams = Convert.FromBase64String(reader.ReadElementString("ExtraParams")); + } + + private static void ProcessShpPathBegin(PrimitiveBaseShape shp, XmlTextReader reader) + { + shp.PathBegin = (ushort)reader.ReadElementContentAsInt("PathBegin", String.Empty); + } + + private static void ProcessShpPathCurve(PrimitiveBaseShape shp, XmlTextReader reader) + { + shp.PathCurve = (byte)reader.ReadElementContentAsInt("PathCurve", String.Empty); + } + + private static void ProcessShpPathEnd(PrimitiveBaseShape shp, XmlTextReader reader) + { + shp.PathEnd = (ushort)reader.ReadElementContentAsInt("PathEnd", String.Empty); + } + + private static void ProcessShpPathRadiusOffset(PrimitiveBaseShape shp, XmlTextReader reader) + { + shp.PathRadiusOffset = (sbyte)reader.ReadElementContentAsInt("PathRadiusOffset", String.Empty); + } + + private static void ProcessShpPathRevolutions(PrimitiveBaseShape shp, XmlTextReader reader) + { + shp.PathRevolutions = (byte)reader.ReadElementContentAsInt("PathRevolutions", String.Empty); + } + + private static void ProcessShpPathScaleX(PrimitiveBaseShape shp, XmlTextReader reader) + { + shp.PathScaleX = (byte)reader.ReadElementContentAsInt("PathScaleX", String.Empty); + } + + private static void ProcessShpPathScaleY(PrimitiveBaseShape shp, XmlTextReader reader) + { + shp.PathScaleY = (byte)reader.ReadElementContentAsInt("PathScaleY", String.Empty); + } + + private static void ProcessShpPathShearX(PrimitiveBaseShape shp, XmlTextReader reader) + { + shp.PathShearX = (byte)reader.ReadElementContentAsInt("PathShearX", String.Empty); + } + + private static void ProcessShpPathShearY(PrimitiveBaseShape shp, XmlTextReader reader) + { + shp.PathShearY = (byte)reader.ReadElementContentAsInt("PathShearY", String.Empty); + } + + private static void ProcessShpPathSkew(PrimitiveBaseShape shp, XmlTextReader reader) + { + shp.PathSkew = (sbyte)reader.ReadElementContentAsInt("PathSkew", String.Empty); + } + + private static void ProcessShpPathTaperX(PrimitiveBaseShape shp, XmlTextReader reader) + { + shp.PathTaperX = (sbyte)reader.ReadElementContentAsInt("PathTaperX", String.Empty); + } + + private static void ProcessShpPathTaperY(PrimitiveBaseShape shp, XmlTextReader reader) + { + shp.PathTaperY = (sbyte)reader.ReadElementContentAsInt("PathTaperY", String.Empty); + } + + private static void ProcessShpPathTwist(PrimitiveBaseShape shp, XmlTextReader reader) + { + shp.PathTwist = (sbyte)reader.ReadElementContentAsInt("PathTwist", String.Empty); + } + + private static void ProcessShpPathTwistBegin(PrimitiveBaseShape shp, XmlTextReader reader) + { + shp.PathTwistBegin = (sbyte)reader.ReadElementContentAsInt("PathTwistBegin", String.Empty); + } + + private static void ProcessShpPCode(PrimitiveBaseShape shp, XmlTextReader reader) + { + shp.PCode = (byte)reader.ReadElementContentAsInt("PCode", String.Empty); + } + + private static void ProcessShpProfileBegin(PrimitiveBaseShape shp, XmlTextReader reader) + { + shp.ProfileBegin = (ushort)reader.ReadElementContentAsInt("ProfileBegin", String.Empty); + } + + private static void ProcessShpProfileEnd(PrimitiveBaseShape shp, XmlTextReader reader) + { + shp.ProfileEnd = (ushort)reader.ReadElementContentAsInt("ProfileEnd", String.Empty); + } + + private static void ProcessShpProfileHollow(PrimitiveBaseShape shp, XmlTextReader reader) + { + shp.ProfileHollow = (ushort)reader.ReadElementContentAsInt("ProfileHollow", String.Empty); + } + + private static void ProcessShpScale(PrimitiveBaseShape shp, XmlTextReader reader) + { + shp.Scale = ReadVector(reader, "Scale"); + } + + private static void ProcessShpState(PrimitiveBaseShape shp, XmlTextReader reader) + { + shp.State = (byte)reader.ReadElementContentAsInt("State", String.Empty); + } + + private static void ProcessShpProfileShape(PrimitiveBaseShape shp, XmlTextReader reader) + { + string value = reader.ReadElementContentAsString("ProfileShape", String.Empty); + // !!!!! to deal with flags without commas + if (value.Contains(" ") && !value.Contains(",")) + value = value.Replace(" ", ", "); + shp.ProfileShape = (ProfileShape)Enum.Parse(typeof(ProfileShape), value); + } + + private static void ProcessShpHollowShape(PrimitiveBaseShape shp, XmlTextReader reader) + { + string value = reader.ReadElementContentAsString("HollowShape", String.Empty); + // !!!!! to deal with flags without commas + if (value.Contains(" ") && !value.Contains(",")) + value = value.Replace(" ", ", "); + shp.HollowShape = (HollowShape)Enum.Parse(typeof(HollowShape), value); + } + + private static void ProcessShpSculptTexture(PrimitiveBaseShape shp, XmlTextReader reader) + { + shp.SculptTexture = ReadUUID(reader, "SculptTexture"); + } + + private static void ProcessShpSculptType(PrimitiveBaseShape shp, XmlTextReader reader) + { + shp.SculptType = (byte)reader.ReadElementContentAsInt("SculptType", String.Empty); + } + + private static void ProcessShpSculptData(PrimitiveBaseShape shp, XmlTextReader reader) + { + shp.SculptData = Convert.FromBase64String(reader.ReadElementString("SculptData")); + } + + private static void ProcessShpFlexiSoftness(PrimitiveBaseShape shp, XmlTextReader reader) + { + shp.FlexiSoftness = reader.ReadElementContentAsInt("FlexiSoftness", String.Empty); + } + + private static void ProcessShpFlexiTension(PrimitiveBaseShape shp, XmlTextReader reader) + { + shp.FlexiTension = reader.ReadElementContentAsFloat("FlexiTension", String.Empty); + } + + private static void ProcessShpFlexiDrag(PrimitiveBaseShape shp, XmlTextReader reader) + { + shp.FlexiDrag = reader.ReadElementContentAsFloat("FlexiDrag", String.Empty); + } + + private static void ProcessShpFlexiGravity(PrimitiveBaseShape shp, XmlTextReader reader) + { + shp.FlexiGravity = reader.ReadElementContentAsFloat("FlexiGravity", String.Empty); + } + + private static void ProcessShpFlexiWind(PrimitiveBaseShape shp, XmlTextReader reader) + { + shp.FlexiWind = reader.ReadElementContentAsFloat("FlexiWind", String.Empty); + } + + private static void ProcessShpFlexiForceX(PrimitiveBaseShape shp, XmlTextReader reader) + { + shp.FlexiForceX = reader.ReadElementContentAsFloat("FlexiForceX", String.Empty); + } + + private static void ProcessShpFlexiForceY(PrimitiveBaseShape shp, XmlTextReader reader) + { + shp.FlexiForceY = reader.ReadElementContentAsFloat("FlexiForceY", String.Empty); + } + + private static void ProcessShpFlexiForceZ(PrimitiveBaseShape shp, XmlTextReader reader) + { + shp.FlexiForceZ = reader.ReadElementContentAsFloat("FlexiForceZ", String.Empty); + } + + private static void ProcessShpLightColorR(PrimitiveBaseShape shp, XmlTextReader reader) + { + shp.LightColorR = reader.ReadElementContentAsFloat("LightColorR", String.Empty); + } + + private static void ProcessShpLightColorG(PrimitiveBaseShape shp, XmlTextReader reader) + { + shp.LightColorG = reader.ReadElementContentAsFloat("LightColorG", String.Empty); + } + + private static void ProcessShpLightColorB(PrimitiveBaseShape shp, XmlTextReader reader) + { + shp.LightColorB = reader.ReadElementContentAsFloat("LightColorB", String.Empty); + } + + private static void ProcessShpLightColorA(PrimitiveBaseShape shp, XmlTextReader reader) + { + shp.LightColorA = reader.ReadElementContentAsFloat("LightColorA", String.Empty); + } + + private static void ProcessShpLightRadius(PrimitiveBaseShape shp, XmlTextReader reader) + { + shp.LightRadius = reader.ReadElementContentAsFloat("LightRadius", String.Empty); + } + + private static void ProcessShpLightCutoff(PrimitiveBaseShape shp, XmlTextReader reader) + { + shp.LightCutoff = reader.ReadElementContentAsFloat("LightCutoff", String.Empty); + } + + private static void ProcessShpLightFalloff(PrimitiveBaseShape shp, XmlTextReader reader) + { + shp.LightFalloff = reader.ReadElementContentAsFloat("LightFalloff", String.Empty); + } + + private static void ProcessShpLightIntensity(PrimitiveBaseShape shp, XmlTextReader reader) + { + shp.LightIntensity = reader.ReadElementContentAsFloat("LightIntensity", String.Empty); + } + + private static void ProcessShpFlexiEntry(PrimitiveBaseShape shp, XmlTextReader reader) + { + shp.FlexiEntry = reader.ReadElementContentAsBoolean("FlexiEntry", String.Empty); + } + + private static void ProcessShpLightEntry(PrimitiveBaseShape shp, XmlTextReader reader) + { + shp.LightEntry = reader.ReadElementContentAsBoolean("LightEntry", String.Empty); + } + + private static void ProcessShpSculptEntry(PrimitiveBaseShape shp, XmlTextReader reader) + { + shp.SculptEntry = reader.ReadElementContentAsBoolean("SculptEntry", String.Empty); + } + + private static void ProcessShpMedia(PrimitiveBaseShape shp, XmlTextReader reader) + { + string value = reader.ReadElementContentAsString("Media", String.Empty); + shp.Media = PrimitiveBaseShape.MediaList.FromXml(value); + } + + + #endregion + + ////////// Write ///////// + + public static void SOGToXml2(XmlTextWriter writer, SceneObjectGroup sog, Dictionaryoptions) + { writer.WriteStartElement(String.Empty, "SceneObjectGroup", String.Empty); //REGION SYNG @@ -284,25 +1078,522 @@ namespace OpenSim.Region.Framework.Scenes.Serialization //writer.WriteStartElement(String.Empty, "LocX", String.Empty); //end of REGION SYGN - sceneObject.RootPart.ToXml(writer); writer.WriteStartElement(String.Empty, "OtherParts", String.Empty); - lock (sceneObject.Children) + sog.ForEachPart(delegate(SceneObjectPart sop) { - foreach (SceneObjectPart part in sceneObject.Children.Values) + if (sop.UUID != sog.RootPart.UUID) + SOPToXml2(writer, sop, options); + }); + + writer.WriteEndElement(); + writer.WriteEndElement(); + } + + public static void SOPToXml2(XmlTextWriter writer, SceneObjectPart sop, Dictionary options) + { + writer.WriteStartElement("SceneObjectPart"); + writer.WriteAttributeString("xmlns:xsi", "http://www.w3.org/2001/XMLSchema-instance"); + writer.WriteAttributeString("xmlns:xsd", "http://www.w3.org/2001/XMLSchema"); + + writer.WriteElementString("AllowedDrop", sop.AllowedDrop.ToString().ToLower()); + + WriteUUID(writer, "CreatorID", sop.CreatorID, options); + + if (sop.CreatorData != null && sop.CreatorData != string.Empty) + writer.WriteElementString("CreatorData", sop.CreatorData); + else if (options.ContainsKey("profile")) + { + if (m_UserManagement == null) + m_UserManagement = sop.ParentGroup.Scene.RequestModuleInterface(); + string name = m_UserManagement.GetUserName(sop.CreatorID); + writer.WriteElementString("CreatorData", (string)options["profile"] + "/" + sop.CreatorID + ";" + name); + } + + WriteUUID(writer, "FolderID", sop.FolderID, options); + writer.WriteElementString("InventorySerial", sop.InventorySerial.ToString()); + + WriteTaskInventory(writer, sop.TaskInventory, options, sop.ParentGroup.Scene); + + WriteUUID(writer, "UUID", sop.UUID, options); + writer.WriteElementString("LocalId", sop.LocalId.ToString()); + writer.WriteElementString("Name", sop.Name); + writer.WriteElementString("Material", sop.Material.ToString()); + writer.WriteElementString("PassTouches", sop.PassTouches.ToString().ToLower()); + writer.WriteElementString("RegionHandle", sop.RegionHandle.ToString()); + writer.WriteElementString("ScriptAccessPin", sop.ScriptAccessPin.ToString()); + + WriteVector(writer, "GroupPosition", sop.GroupPosition); + WriteVector(writer, "OffsetPosition", sop.OffsetPosition); + + WriteQuaternion(writer, "RotationOffset", sop.RotationOffset); + WriteVector(writer, "Velocity", sop.Velocity); + WriteVector(writer, "AngularVelocity", sop.AngularVelocity); + WriteVector(writer, "Acceleration", sop.Acceleration); + writer.WriteElementString("Description", sop.Description); + if (sop.Color != null) + { + writer.WriteStartElement("Color"); + writer.WriteElementString("R", sop.Color.R.ToString(Utils.EnUsCulture)); + writer.WriteElementString("G", sop.Color.G.ToString(Utils.EnUsCulture)); + writer.WriteElementString("B", sop.Color.B.ToString(Utils.EnUsCulture)); + writer.WriteElementString("A", sop.Color.G.ToString(Utils.EnUsCulture)); + writer.WriteEndElement(); + } + + writer.WriteElementString("Text", sop.Text); + writer.WriteElementString("SitName", sop.SitName); + writer.WriteElementString("TouchName", sop.TouchName); + + writer.WriteElementString("LinkNum", sop.LinkNum.ToString()); + writer.WriteElementString("ClickAction", sop.ClickAction.ToString()); + + WriteShape(writer, sop.Shape, options); + + WriteVector(writer, "Scale", sop.Scale); + writer.WriteElementString("UpdateFlag", sop.UpdateFlag.ToString()); + WriteQuaternion(writer, "SitTargetOrientation", sop.SitTargetOrientation); + WriteVector(writer, "SitTargetPosition", sop.SitTargetPosition); + WriteVector(writer, "SitTargetPositionLL", sop.SitTargetPositionLL); + WriteQuaternion(writer, "SitTargetOrientationLL", sop.SitTargetOrientationLL); + writer.WriteElementString("ParentID", sop.ParentID.ToString()); + writer.WriteElementString("CreationDate", sop.CreationDate.ToString()); + writer.WriteElementString("Category", sop.Category.ToString()); + writer.WriteElementString("SalePrice", sop.SalePrice.ToString()); + writer.WriteElementString("ObjectSaleType", sop.ObjectSaleType.ToString()); + writer.WriteElementString("OwnershipCost", sop.OwnershipCost.ToString()); + WriteUUID(writer, "GroupID", sop.GroupID, options); + WriteUUID(writer, "OwnerID", sop.OwnerID, options); + WriteUUID(writer, "LastOwnerID", sop.LastOwnerID, options); + writer.WriteElementString("BaseMask", sop.BaseMask.ToString()); + writer.WriteElementString("OwnerMask", sop.OwnerMask.ToString()); + writer.WriteElementString("GroupMask", sop.GroupMask.ToString()); + writer.WriteElementString("EveryoneMask", sop.EveryoneMask.ToString()); + writer.WriteElementString("NextOwnerMask", sop.NextOwnerMask.ToString()); + WriteFlags(writer, "Flags", sop.Flags.ToString(), options); + WriteUUID(writer, "CollisionSound", sop.CollisionSound, options); + writer.WriteElementString("CollisionSoundVolume", sop.CollisionSoundVolume.ToString()); + if (sop.MediaUrl != null) + writer.WriteElementString("MediaUrl", sop.MediaUrl.ToString()); + WriteBytes(writer, "TextureAnimation", sop.TextureAnimation); + WriteBytes(writer, "ParticleSystem", sop.ParticleSystem); + + writer.WriteEndElement(); + } + + static void WriteUUID(XmlTextWriter writer, string name, UUID id, Dictionary options) + { + writer.WriteStartElement(name); + if (options.ContainsKey("old-guids")) + writer.WriteElementString("Guid", id.ToString()); + else + writer.WriteElementString("UUID", id.ToString()); + writer.WriteEndElement(); + } + + static void WriteVector(XmlTextWriter writer, string name, Vector3 vec) + { + writer.WriteStartElement(name); + writer.WriteElementString("X", vec.X.ToString(Utils.EnUsCulture)); + writer.WriteElementString("Y", vec.Y.ToString(Utils.EnUsCulture)); + writer.WriteElementString("Z", vec.Z.ToString(Utils.EnUsCulture)); + writer.WriteEndElement(); + } + + static void WriteQuaternion(XmlTextWriter writer, string name, Quaternion quat) + { + writer.WriteStartElement(name); + writer.WriteElementString("X", quat.X.ToString(Utils.EnUsCulture)); + writer.WriteElementString("Y", quat.Y.ToString(Utils.EnUsCulture)); + writer.WriteElementString("Z", quat.Z.ToString(Utils.EnUsCulture)); + writer.WriteElementString("W", quat.W.ToString(Utils.EnUsCulture)); + writer.WriteEndElement(); + } + + static void WriteBytes(XmlTextWriter writer, string name, byte[] data) + { + writer.WriteStartElement(name); + byte[] d; + if (data != null) + d = data; + else + d = Utils.EmptyBytes; + writer.WriteBase64(d, 0, d.Length); + writer.WriteEndElement(); // name + + } + + static void WriteFlags(XmlTextWriter writer, string name, string flagsStr, Dictionary options) + { + // Older versions of serialization can't cope with commas + if (options.ContainsKey("version")) + { + float version = 0.5F; + float.TryParse(options["version"].ToString(), out version); + if (version < 0.5) + flagsStr = flagsStr.Replace(",", ""); + } + + writer.WriteElementString(name, flagsStr); + } + + static void WriteTaskInventory(XmlTextWriter writer, TaskInventoryDictionary tinv, Dictionary options, Scene scene) + { + if (tinv.Count > 0) // otherwise skip this + { + writer.WriteStartElement("TaskInventory"); + + foreach (TaskInventoryItem item in tinv.Values) { - if (part.UUID != sceneObject.RootPart.UUID) + writer.WriteStartElement("TaskInventoryItem"); + + WriteUUID(writer, "AssetID", item.AssetID, options); + writer.WriteElementString("BasePermissions", item.BasePermissions.ToString()); + writer.WriteElementString("CreationDate", item.CreationDate.ToString()); + + + WriteUUID(writer, "CreatorID", item.CreatorID, options); + + if (item.CreatorData != null && item.CreatorData != string.Empty) + writer.WriteElementString("CreatorData", item.CreatorData); + else if (options.ContainsKey("profile")) { - part.ToXml(writer); + if (m_UserManagement == null) + m_UserManagement = scene.RequestModuleInterface(); + string name = m_UserManagement.GetUserName(item.CreatorID); + writer.WriteElementString("CreatorData", (string)options["profile"] + "/" + item.CreatorID + ";" + name); } + + writer.WriteElementString("Description", item.Description); + writer.WriteElementString("EveryonePermissions", item.EveryonePermissions.ToString()); + writer.WriteElementString("Flags", item.Flags.ToString()); + WriteUUID(writer, "GroupID", item.GroupID, options); + writer.WriteElementString("GroupPermissions", item.GroupPermissions.ToString()); + writer.WriteElementString("InvType", item.InvType.ToString()); + WriteUUID(writer, "ItemID", item.ItemID, options); + WriteUUID(writer, "OldItemID", item.OldItemID, options); + WriteUUID(writer, "LastOwnerID", item.LastOwnerID, options); + writer.WriteElementString("Name", item.Name); + writer.WriteElementString("NextPermissions", item.NextPermissions.ToString()); + WriteUUID(writer, "OwnerID", item.OwnerID, options); + writer.WriteElementString("CurrentPermissions", item.CurrentPermissions.ToString()); + WriteUUID(writer, "ParentID", item.ParentID, options); + WriteUUID(writer, "ParentPartID", item.ParentPartID, options); + WriteUUID(writer, "PermsGranter", item.PermsGranter, options); + writer.WriteElementString("PermsMask", item.PermsMask.ToString()); + writer.WriteElementString("Type", item.Type.ToString()); + writer.WriteElementString("OwnerChanged", item.OwnerChanged.ToString().ToLower()); + + writer.WriteEndElement(); // TaskInventoryItem + } + + writer.WriteEndElement(); // TaskInventory + } + } + + static void WriteShape(XmlTextWriter writer, PrimitiveBaseShape shp, Dictionary options) + { + if (shp != null) + { + writer.WriteStartElement("Shape"); + + writer.WriteElementString("ProfileCurve", shp.ProfileCurve.ToString()); + + writer.WriteStartElement("TextureEntry"); + byte[] te; + if (shp.TextureEntry != null) + te = shp.TextureEntry; + else + te = Utils.EmptyBytes; + writer.WriteBase64(te, 0, te.Length); + writer.WriteEndElement(); // TextureEntry + + writer.WriteStartElement("ExtraParams"); + byte[] ep; + if (shp.ExtraParams != null) + ep = shp.ExtraParams; + else + ep = Utils.EmptyBytes; + writer.WriteBase64(ep, 0, ep.Length); + writer.WriteEndElement(); // ExtraParams + + writer.WriteElementString("PathBegin", shp.PathBegin.ToString()); + writer.WriteElementString("PathCurve", shp.PathCurve.ToString()); + writer.WriteElementString("PathEnd", shp.PathEnd.ToString()); + writer.WriteElementString("PathRadiusOffset", shp.PathRadiusOffset.ToString()); + writer.WriteElementString("PathRevolutions", shp.PathRevolutions.ToString()); + writer.WriteElementString("PathScaleX", shp.PathScaleX.ToString()); + writer.WriteElementString("PathScaleY", shp.PathScaleY.ToString()); + writer.WriteElementString("PathShearX", shp.PathShearX.ToString()); + writer.WriteElementString("PathShearY", shp.PathShearY.ToString()); + writer.WriteElementString("PathSkew", shp.PathSkew.ToString()); + writer.WriteElementString("PathTaperX", shp.PathTaperX.ToString()); + writer.WriteElementString("PathTaperY", shp.PathTaperY.ToString()); + writer.WriteElementString("PathTwist", shp.PathTwist.ToString()); + writer.WriteElementString("PathTwistBegin", shp.PathTwistBegin.ToString()); + writer.WriteElementString("PCode", shp.PCode.ToString()); + writer.WriteElementString("ProfileBegin", shp.ProfileBegin.ToString()); + writer.WriteElementString("ProfileEnd", shp.ProfileEnd.ToString()); + writer.WriteElementString("ProfileHollow", shp.ProfileHollow.ToString()); + writer.WriteElementString("State", shp.State.ToString()); + + WriteFlags(writer, "ProfileShape", shp.ProfileShape.ToString(), options); + WriteFlags(writer, "HollowShape", shp.HollowShape.ToString(), options); + + WriteUUID(writer, "SculptTexture", shp.SculptTexture, options); + writer.WriteElementString("SculptType", shp.SculptType.ToString()); + writer.WriteStartElement("SculptData"); + byte[] sd; + if (shp.SculptData != null) + sd = shp.ExtraParams; + else + sd = Utils.EmptyBytes; + writer.WriteBase64(sd, 0, sd.Length); + writer.WriteEndElement(); // SculptData + + writer.WriteElementString("FlexiSoftness", shp.FlexiSoftness.ToString()); + writer.WriteElementString("FlexiTension", shp.FlexiTension.ToString()); + writer.WriteElementString("FlexiDrag", shp.FlexiDrag.ToString()); + writer.WriteElementString("FlexiGravity", shp.FlexiGravity.ToString()); + writer.WriteElementString("FlexiWind", shp.FlexiWind.ToString()); + writer.WriteElementString("FlexiForceX", shp.FlexiForceX.ToString()); + writer.WriteElementString("FlexiForceY", shp.FlexiForceY.ToString()); + writer.WriteElementString("FlexiForceZ", shp.FlexiForceZ.ToString()); + + writer.WriteElementString("LightColorR", shp.LightColorR.ToString()); + writer.WriteElementString("LightColorG", shp.LightColorG.ToString()); + writer.WriteElementString("LightColorB", shp.LightColorB.ToString()); + writer.WriteElementString("LightColorA", shp.LightColorA.ToString()); + writer.WriteElementString("LightRadius", shp.LightRadius.ToString()); + writer.WriteElementString("LightCutoff", shp.LightCutoff.ToString()); + writer.WriteElementString("LightFalloff", shp.LightFalloff.ToString()); + writer.WriteElementString("LightIntensity", shp.LightIntensity.ToString()); + + writer.WriteElementString("FlexiEntry", shp.FlexiEntry.ToString().ToLower()); + writer.WriteElementString("LightEntry", shp.LightEntry.ToString().ToLower()); + writer.WriteElementString("SculptEntry", shp.SculptEntry.ToString().ToLower()); + + if (shp.Media != null) + writer.WriteElementString("Media", shp.Media.ToXml()); + + writer.WriteEndElement(); // Shape + } + } + + //////// Read ///////// + public static bool Xml2ToSOG(XmlTextReader reader, SceneObjectGroup sog) + { + reader.Read(); + reader.ReadStartElement("SceneObjectGroup"); + SceneObjectPart root = Xml2ToSOP(reader); + if (root != null) + sog.SetRootPart(root); + else + { + return false; + } + + if (sog.UUID == UUID.Zero) + sog.UUID = sog.RootPart.UUID; + + reader.Read(); // OtherParts + + while (!reader.EOF) + { + switch (reader.NodeType) + { + case XmlNodeType.Element: + if (reader.Name == "SceneObjectPart") + { + SceneObjectPart child = Xml2ToSOP(reader); + if (child != null) + sog.AddPart(child); + } + else + { + //Logger.Log("Found unexpected prim XML element " + reader.Name, Helpers.LogLevel.Debug); + reader.Read(); + } + break; + case XmlNodeType.EndElement: + default: + reader.Read(); + break; + } + + } + return true; + } + + public static SceneObjectPart Xml2ToSOP(XmlTextReader reader) + { + SceneObjectPart obj = new SceneObjectPart(); + + reader.ReadStartElement("SceneObjectPart"); + + string nodeName = string.Empty; + while (reader.NodeType != XmlNodeType.EndElement) + { + nodeName = reader.Name; + SOPXmlProcessor p = null; + if (m_SOPXmlProcessors.TryGetValue(reader.Name, out p)) + { + //m_log.DebugFormat("[XXX] Processing: {0}", reader.Name); + try + { + p(obj, reader); + } + catch (Exception e) + { + m_log.DebugFormat("[SceneObjectSerializer]: exception while parsing {0}: {1}", nodeName, e); + if (reader.NodeType == XmlNodeType.EndElement) + reader.Read(); + } + } + else + { +// m_log.DebugFormat("[SceneObjectSerializer]: caught unknown element {0}", nodeName); + reader.ReadOuterXml(); // ignore + } + + } + + reader.ReadEndElement(); // SceneObjectPart + + //m_log.DebugFormat("[XXX]: parsed SOP {0} - {1}", obj.Name, obj.UUID); + return obj; + } + + static UUID ReadUUID(XmlTextReader reader, string name) + { + UUID id; + string idStr; + + reader.ReadStartElement(name); + + if (reader.Name == "Guid") + idStr = reader.ReadElementString("Guid"); + else // UUID + idStr = reader.ReadElementString("UUID"); + + UUID.TryParse(idStr, out id); + reader.ReadEndElement(); + + return id; + } + + static Vector3 ReadVector(XmlTextReader reader, string name) + { + Vector3 vec; + + reader.ReadStartElement(name); + vec.X = reader.ReadElementContentAsFloat(reader.Name, String.Empty); // X or x + vec.Y = reader.ReadElementContentAsFloat(reader.Name, String.Empty); // Y or y + vec.Z = reader.ReadElementContentAsFloat(reader.Name, String.Empty); // Z or z + reader.ReadEndElement(); + + return vec; + } + + static Quaternion ReadQuaternion(XmlTextReader reader, string name) + { + Quaternion quat = new Quaternion(); + + reader.ReadStartElement(name); + while (reader.NodeType != XmlNodeType.EndElement) + { + switch (reader.Name.ToLower()) + { + case "x": + quat.X = reader.ReadElementContentAsFloat(reader.Name, String.Empty); + break; + case "y": + quat.Y = reader.ReadElementContentAsFloat(reader.Name, String.Empty); + break; + case "z": + quat.Z = reader.ReadElementContentAsFloat(reader.Name, String.Empty); + break; + case "w": + quat.W = reader.ReadElementContentAsFloat(reader.Name, String.Empty); + break; } } - writer.WriteEndElement(); // End of OtherParts - sceneObject.SaveScriptedState(writer); - writer.WriteEndElement(); // End of SceneObjectGroup + reader.ReadEndElement(); - //m_log.DebugFormat("[SERIALIZER]: Finished serialization of SOG {0} to XML2, {1}ms", Name, System.Environment.TickCount - time); + return quat; } + + static TaskInventoryDictionary ReadTaskInventory(XmlTextReader reader, string name) + { + TaskInventoryDictionary tinv = new TaskInventoryDictionary(); + + reader.ReadStartElement(name, String.Empty); + + while (reader.Name == "TaskInventoryItem") + { + reader.ReadStartElement("TaskInventoryItem", String.Empty); // TaskInventory + + TaskInventoryItem item = new TaskInventoryItem(); + while (reader.NodeType != XmlNodeType.EndElement) + { + TaskInventoryXmlProcessor p = null; + if (m_TaskInventoryXmlProcessors.TryGetValue(reader.Name, out p)) + p(item, reader); + else + { +// m_log.DebugFormat("[SceneObjectSerializer]: caught unknown element in TaskInventory {0}, {1}", reader.Name, reader.Value); + reader.ReadOuterXml(); + } + } + reader.ReadEndElement(); // TaskInventoryItem + tinv.Add(item.ItemID, item); + + } + + if (reader.NodeType == XmlNodeType.EndElement) + reader.ReadEndElement(); // TaskInventory + + return tinv; + } + + static PrimitiveBaseShape ReadShape(XmlTextReader reader, string name) + { + PrimitiveBaseShape shape = new PrimitiveBaseShape(); + + reader.ReadStartElement(name, String.Empty); // Shape + + string nodeName = string.Empty; + while (reader.NodeType != XmlNodeType.EndElement) + { + nodeName = reader.Name; + //m_log.DebugFormat("[XXX] Processing: {0}", reader.Name); + ShapeXmlProcessor p = null; + if (m_ShapeXmlProcessors.TryGetValue(reader.Name, out p)) + { + try + { + p(shape, reader); + } + catch (Exception e) + { + m_log.DebugFormat("[SceneObjectSerializer]: exception while parsing Shape {0}: {1}", nodeName, e); + if (reader.NodeType == XmlNodeType.EndElement) + reader.Read(); + } + } + else + { + // m_log.DebugFormat("[SceneObjectSerializer]: caught unknown element in Shape {0}", reader.Name); + reader.ReadOuterXml(); + } + } + + reader.ReadEndElement(); // Shape + + return shape; + } + + #endregion } } diff --git a/OpenSim/Region/Framework/Scenes/Serialization/SceneXmlLoader.cs b/OpenSim/Region/Framework/Scenes/Serialization/SceneXmlLoader.cs index b6677f092e..d214eba1fc 100644 --- a/OpenSim/Region/Framework/Scenes/Serialization/SceneXmlLoader.cs +++ b/OpenSim/Region/Framework/Scenes/Serialization/SceneXmlLoader.cs @@ -45,6 +45,7 @@ namespace OpenSim.Region.Framework.Scenes.Serialization { private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); + #region old xml format public static void LoadPrimsFromXml(Scene scene, string fileName, bool newIDS, Vector3 loadOffset) { XmlDocument doc = new XmlDocument(); @@ -84,9 +85,8 @@ namespace OpenSim.Region.Framework.Scenes.Serialization int primCount = 0; stream.WriteLine("\n"); - List EntityList = scene.GetEntities(); - - foreach (EntityBase ent in EntityList) + EntityBase[] entityList = scene.GetEntities(); + foreach (EntityBase ent in entityList) { if (ent is SceneObjectGroup) { @@ -99,11 +99,128 @@ namespace OpenSim.Region.Framework.Scenes.Serialization file.Close(); } - public static string SaveGroupToXml2(SceneObjectGroup grp) + #endregion + + #region XML2 serialization + + // Called by archives (save oar) + public static string SaveGroupToXml2(SceneObjectGroup grp, Dictionary options) { - return SceneObjectSerializer.ToXml2Format(grp); + //return SceneObjectSerializer.ToXml2Format(grp); + using (MemoryStream mem = new MemoryStream()) + { + using (XmlTextWriter writer = new XmlTextWriter(mem, System.Text.Encoding.UTF8)) + { + SceneObjectSerializer.SOGToXml2(writer, grp, options); + writer.Flush(); + + using (StreamReader reader = new StreamReader(mem)) + { + mem.Seek(0, SeekOrigin.Begin); + return reader.ReadToEnd(); + } + } + } } + // Called by scene serializer (save xml2) + public static void SavePrimsToXml2(Scene scene, string fileName) + { + EntityBase[] entityList = scene.GetEntities(); + SavePrimListToXml2(entityList, fileName); + } + + // Called by scene serializer (save xml2) + public static void SaveNamedPrimsToXml2(Scene scene, string primName, string fileName) + { + m_log.InfoFormat( + "[SERIALISER]: Saving prims with name {0} in xml2 format for region {1} to {2}", + primName, scene.RegionInfo.RegionName, fileName); + + EntityBase[] entityList = scene.GetEntities(); + List primList = new List(); + + foreach (EntityBase ent in entityList) + { + if (ent is SceneObjectGroup) + { + if (ent.Name == primName) + { + primList.Add(ent); + } + } + } + + SavePrimListToXml2(primList.ToArray(), fileName); + } + + // Called by REST Application plugin + public static void SavePrimsToXml2(Scene scene, TextWriter stream, Vector3 min, Vector3 max) + { + EntityBase[] entityList = scene.GetEntities(); + SavePrimListToXml2(entityList, stream, min, max); + } + + // Called here only. Should be private? + public static void SavePrimListToXml2(EntityBase[] entityList, string fileName) + { + FileStream file = new FileStream(fileName, FileMode.Create); + try + { + StreamWriter stream = new StreamWriter(file); + try + { + SavePrimListToXml2(entityList, stream, Vector3.Zero, Vector3.Zero); + } + finally + { + stream.Close(); + } + } + finally + { + file.Close(); + } + } + + // Called here only. Should be private? + public static void SavePrimListToXml2(EntityBase[] entityList, TextWriter stream, Vector3 min, Vector3 max) + { + XmlTextWriter writer = new XmlTextWriter(stream); + + int primCount = 0; + stream.WriteLine("\n"); + + foreach (EntityBase ent in entityList) + { + if (ent is SceneObjectGroup) + { + SceneObjectGroup g = (SceneObjectGroup)ent; + if (!min.Equals(Vector3.Zero) || !max.Equals(Vector3.Zero)) + { + Vector3 pos = g.RootPart.GetWorldPosition(); + if (min.X > pos.X || min.Y > pos.Y || min.Z > pos.Z) + continue; + if (max.X < pos.X || max.Y < pos.Y || max.Z < pos.Z) + continue; + } + + //stream.WriteLine(SceneObjectSerializer.ToXml2Format(g)); + SceneObjectSerializer.SOGToXml2(writer, (SceneObjectGroup)ent, new Dictionary()); + stream.WriteLine(); + + primCount++; + } + } + + stream.WriteLine("\n"); + stream.Flush(); + } + + #endregion + + #region XML2 deserialization + public static SceneObjectGroup DeserializeGroupFromXml2(string xmlString) { XmlDocument doc = new XmlDocument(); @@ -125,14 +242,30 @@ namespace OpenSim.Region.Framework.Scenes.Serialization foreach (XmlNode aPrimNode in rootNode.ChildNodes) { // There is only ever one prim. This oddity should be removeable post 0.5.9 - return SceneObjectSerializer.FromXml2Format(aPrimNode.OuterXml); + //return SceneObjectSerializer.FromXml2Format(aPrimNode.OuterXml); + using (reader = new XmlTextReader(new StringReader(aPrimNode.OuterXml))) + { + SceneObjectGroup obj = new SceneObjectGroup(); + if (SceneObjectSerializer.Xml2ToSOG(reader, obj)) + return obj; + + return null; + } } return null; } else { - return SceneObjectSerializer.FromXml2Format(rootNode.OuterXml); + //return SceneObjectSerializer.FromXml2Format(rootNode.OuterXml); + using (reader = new XmlTextReader(new StringReader(rootNode.OuterXml))) + { + SceneObjectGroup obj = new SceneObjectGroup(); + if (SceneObjectSerializer.Xml2ToSOG(reader, obj)) + return obj; + + return null; + } } } @@ -194,98 +327,19 @@ namespace OpenSim.Region.Framework.Scenes.Serialization /// The scene object created. null if the scene object already existed protected static SceneObjectGroup CreatePrimFromXml2(Scene scene, string xmlData) { - SceneObjectGroup obj = SceneObjectSerializer.FromXml2Format(xmlData); - - if (scene.AddRestoredSceneObject(obj, true, false)) - return obj; - else - return null; - } - - public static void SavePrimsToXml2(Scene scene, string fileName) - { - List EntityList = scene.GetEntities(); - - SavePrimListToXml2(EntityList, fileName); - } - - public static void SavePrimsToXml2(Scene scene, TextWriter stream, Vector3 min, Vector3 max) - { - List EntityList = scene.GetEntities(); - - SavePrimListToXml2(EntityList, stream, min, max); - } - - public static void SaveNamedPrimsToXml2(Scene scene, string primName, string fileName) - { - m_log.InfoFormat( - "[SERIALISER]: Saving prims with name {0} in xml2 format for region {1} to {2}", - primName, scene.RegionInfo.RegionName, fileName); - - List entityList = scene.GetEntities(); - List primList = new List(); - - foreach (EntityBase ent in entityList) + //SceneObjectGroup obj = SceneObjectSerializer.FromXml2Format(xmlData); + using (XmlTextReader reader = new XmlTextReader(new StringReader(xmlData))) { - if (ent is SceneObjectGroup) - { - if (ent.Name == primName) - { - primList.Add(ent); - } - } - } + SceneObjectGroup obj = new SceneObjectGroup(); + SceneObjectSerializer.Xml2ToSOG(reader, obj); - SavePrimListToXml2(primList, fileName); - } - - public static void SavePrimListToXml2(List entityList, string fileName) - { - FileStream file = new FileStream(fileName, FileMode.Create); - try - { - StreamWriter stream = new StreamWriter(file); - try - { - SavePrimListToXml2(entityList, stream, Vector3.Zero, Vector3.Zero); - } - finally - { - stream.Close(); - } - } - finally - { - file.Close(); + if (scene.AddRestoredSceneObject(obj, true, false)) + return obj; + else + return null; } } - public static void SavePrimListToXml2(List entityList, TextWriter stream, Vector3 min, Vector3 max) - { - int primCount = 0; - stream.WriteLine("\n"); - - foreach (EntityBase ent in entityList) - { - if (ent is SceneObjectGroup) - { - SceneObjectGroup g = (SceneObjectGroup)ent; - if (!min.Equals(Vector3.Zero) || !max.Equals(Vector3.Zero)) - { - Vector3 pos = g.RootPart.GetWorldPosition(); - if (min.X > pos.X || min.Y > pos.Y || min.Z > pos.Z) - continue; - if (max.X < pos.X || max.Y < pos.Y || max.Z < pos.Z) - continue; - } - - stream.WriteLine(SceneObjectSerializer.ToXml2Format(g)); - primCount++; - } - } - stream.WriteLine("\n"); - stream.Flush(); - } - + #endregion } } diff --git a/OpenSim/Region/Framework/Scenes/SimStatsReporter.cs b/OpenSim/Region/Framework/Scenes/SimStatsReporter.cs index fd2329409e..87dcdeea14 100644 --- a/OpenSim/Region/Framework/Scenes/SimStatsReporter.cs +++ b/OpenSim/Region/Framework/Scenes/SimStatsReporter.cs @@ -108,7 +108,7 @@ namespace OpenSim.Region.Framework.Scenes private int m_activeScripts = 0; private int m_scriptLinesPerSecond = 0; - private int objectCapacity = 45000; + private int m_objectCapacity = 45000; private Scene m_scene; @@ -124,6 +124,7 @@ namespace OpenSim.Region.Framework.Scenes m_scene = scene; ReportingRegion = scene.RegionInfo; + m_objectCapacity = scene.RegionInfo.ObjectCapacity; m_report.AutoReset = true; m_report.Interval = statsUpdatesEveryMS; m_report.Elapsed += new ElapsedEventHandler(statsHeartBeat); @@ -271,7 +272,7 @@ namespace OpenSim.Region.Framework.Scenes SimStats simStats = new SimStats( - ReportingRegion.RegionLocX, ReportingRegion.RegionLocY, regionFlags, (uint)objectCapacity, rb, sb, m_scene.RegionInfo.originRegionID); + ReportingRegion.RegionLocX, ReportingRegion.RegionLocY, regionFlags, (uint)m_objectCapacity, rb, sb, m_scene.RegionInfo.originRegionID); handlerSendStatResult = OnSendStatsResult; if (handlerSendStatResult != null) @@ -435,11 +436,6 @@ namespace OpenSim.Region.Framework.Scenes m_activeScripts = count; } - public void SetObjectCapacity(int objects) - { - objectCapacity = objects; - } - /// /// This is for llGetRegionFPS /// diff --git a/OpenSim/Region/Framework/Scenes/Tests/BorderTests.cs b/OpenSim/Region/Framework/Scenes/Tests/BorderTests.cs index e140cd5785..3a0dd00ad5 100644 --- a/OpenSim/Region/Framework/Scenes/Tests/BorderTests.cs +++ b/OpenSim/Region/Framework/Scenes/Tests/BorderTests.cs @@ -28,20 +28,21 @@ using System; using System.Collections.Generic; using System.Text; +using NUnit.Framework; using OpenMetaverse; using OpenSim.Region.Framework.Scenes; - -using NUnit.Framework; +using OpenSim.Tests.Common; namespace OpenSim.Region.Framework.Scenes.Tests { [TestFixture] public class BorderTests { - [Test] public void TestCross() { + TestHelper.InMethod(); + List testborders = new List(); Border NorthBorder = new Border(); @@ -75,8 +76,6 @@ namespace OpenSim.Region.Framework.Scenes.Tests position = new Vector3(200,280,21); Assert.That(NorthBorder.TestCross(position)); - - // Test automatic border crossing // by setting the border crossing aabb to be the whole region position = new Vector3(25,25,21); // safely within one 256m region @@ -95,12 +94,13 @@ namespace OpenSim.Region.Framework.Scenes.Tests WestBorder.BorderLine = new Vector3(0, 256, 255); // automatic border cross in the region Assert.That(WestBorder.TestCross(position)); - } [Test] public void TestCrossSquare512() { + TestHelper.InMethod(); + List testborders = new List(); Border NorthBorder = new Border(); @@ -174,12 +174,13 @@ namespace OpenSim.Region.Framework.Scenes.Tests Assert.That(!b.TestCross(position)); } - } [Test] public void TestCrossRectangle512x256() { + TestHelper.InMethod(); + List testborders = new List(); Border NorthBorder = new Border(); @@ -258,6 +259,8 @@ namespace OpenSim.Region.Framework.Scenes.Tests [Test] public void TestCrossOdd512x512w256hole() { + TestHelper.InMethod(); + List testborders = new List(); // 512____ // | | diff --git a/OpenSim/Region/Framework/Scenes/Tests/EntityManagerTests.cs b/OpenSim/Region/Framework/Scenes/Tests/EntityManagerTests.cs index fc66c85b84..b3c3e22af6 100644 --- a/OpenSim/Region/Framework/Scenes/Tests/EntityManagerTests.cs +++ b/OpenSim/Region/Framework/Scenes/Tests/EntityManagerTests.cs @@ -53,7 +53,6 @@ namespace OpenSim.Region.Framework.Scenes.Tests public void T010_AddObjects() { TestHelper.InMethod(); - // Console.WriteLine("Beginning test {0}", MethodBase.GetCurrentMethod()); random = new Random(); SceneObjectGroup found; @@ -89,7 +88,6 @@ namespace OpenSim.Region.Framework.Scenes.Tests public void T011_ThreadAddRemoveTest() { TestHelper.InMethod(); - // Console.WriteLine("Beginning test {0}", MethodBase.GetCurrentMethod()); // This test adds and removes with mutiple threads, attempting to break the // uuid and localid dictionary coherence. @@ -134,7 +132,7 @@ namespace OpenSim.Region.Framework.Scenes.Tests sop.Text = RandomName(); sop.SitName = RandomName(); sop.TouchName = RandomName(); - sop.ObjectFlags |= (uint)PrimFlags.Phantom; + sop.Flags |= PrimFlags.Phantom; SceneObjectGroup sog = new SceneObjectGroup(sop); scene.AddNewSceneObject(sog, false); diff --git a/OpenSim/Region/Framework/Scenes/Tests/SceneBaseTests.cs b/OpenSim/Region/Framework/Scenes/Tests/SceneBaseTests.cs deleted file mode 100644 index 42587c1116..0000000000 --- a/OpenSim/Region/Framework/Scenes/Tests/SceneBaseTests.cs +++ /dev/null @@ -1,86 +0,0 @@ -/* - * Copyright (c) Contributors, http://opensimulator.org/ - * See CONTRIBUTORS.TXT for a full list of copyright holders. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * * Neither the name of the OpenSimulator Project nor the - * names of its contributors may be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE DEVELOPERS ``AS IS'' AND ANY - * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED - * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL THE CONTRIBUTORS BE LIABLE FOR ANY - * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES - * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; - * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ - -using System; -using NUnit.Framework; -using OpenMetaverse; -using OpenSim.Framework; -using GridRegion = OpenSim.Services.Interfaces.GridRegion; - -namespace OpenSim.Region.Framework.Scenes.Tests -{ - /// - /// Scene presence tests - /// - [TestFixture] - public class SceneBaseTests - { - private class SceneBaseImpl : SceneBase - { - public override void Update() - { - throw new NotImplementedException(); - } - - public override void LoadWorldMap() - { - throw new NotImplementedException(); - } - - public override void AddNewClient(IClientAPI client) - { - throw new NotImplementedException(); - } - - public override void RemoveClient(UUID agentID) - { - throw new NotImplementedException(); - } - - public override void OtherRegionUp(GridRegion otherRegion) - { - throw new NotImplementedException(); - } - - public override bool TryGetScenePresence(UUID agentID, out ScenePresence scenePresence) - { - throw new NotImplementedException(); - } - - public override bool CheckClient(UUID agentID, System.Net.IPEndPoint ep) - { - throw new NotImplementedException(); - } - } - - [Test] - public void TestConstructor() - { - new SceneBaseImpl(); - } - } -} diff --git a/OpenSim/Region/Framework/Scenes/Tests/SceneGraphTests.cs b/OpenSim/Region/Framework/Scenes/Tests/SceneGraphTests.cs new file mode 100644 index 0000000000..9244bc3461 --- /dev/null +++ b/OpenSim/Region/Framework/Scenes/Tests/SceneGraphTests.cs @@ -0,0 +1,89 @@ +/* + * Copyright (c) Contributors, http://opensimulator.org/ + * See CONTRIBUTORS.TXT for a full list of copyright holders. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * * Neither the name of the OpenSimulator Project nor the + * names of its contributors may be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE DEVELOPERS ``AS IS'' AND ANY + * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED + * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + * DISCLAIMED. IN NO EVENT SHALL THE CONTRIBUTORS BE LIABLE FOR ANY + * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES + * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND + * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS + * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +using System; +using System.Reflection; +using NUnit.Framework; +using NUnit.Framework.SyntaxHelpers; +using OpenMetaverse; +using OpenSim.Framework; +using OpenSim.Framework.Communications; +using OpenSim.Region.Framework.Scenes; +using OpenSim.Tests.Common; +using OpenSim.Tests.Common.Mock; +using OpenSim.Tests.Common.Setup; + +namespace OpenSim.Region.Framework.Scenes.Tests +{ + [TestFixture] + public class SceneGraphTests + { + [Test] + public void TestDuplicateObject() + { + TestHelper.InMethod(); + Scene scene = SceneSetupHelpers.SetupScene(); + + UUID ownerId = new UUID("00000000-0000-0000-0000-000000000010"); + string part1Name = "part1"; + UUID part1Id = new UUID("00000000-0000-0000-0000-000000000001"); + string part2Name = "part2"; + UUID part2Id = new UUID("00000000-0000-0000-0000-000000000002"); + + SceneObjectPart part1 + = new SceneObjectPart(ownerId, PrimitiveBaseShape.Default, Vector3.Zero, Quaternion.Identity, Vector3.Zero) + { Name = part1Name, UUID = part1Id }; + SceneObjectGroup so = new SceneObjectGroup(part1); + SceneObjectPart part2 + = new SceneObjectPart(ownerId, PrimitiveBaseShape.Default, Vector3.Zero, Quaternion.Identity, Vector3.Zero) + { Name = part2Name, UUID = part2Id }; + so.AddPart(part2); + + scene.AddNewSceneObject(so, false); + + SceneObjectGroup dupeSo + = scene.SceneGraph.DuplicateObject( + part1.LocalId, new Vector3(10, 0, 0), 0, ownerId, UUID.Zero, Quaternion.Identity); + Assert.That(dupeSo.Parts.Length, Is.EqualTo(2)); + + SceneObjectPart dupePart1 = dupeSo.GetLinkNumPart(1); + SceneObjectPart dupePart2 = dupeSo.GetLinkNumPart(2); + Assert.That(dupePart1.LocalId, Is.Not.EqualTo(part1.LocalId)); + Assert.That(dupePart2.LocalId, Is.Not.EqualTo(part2.LocalId)); + + Assert.That(dupePart1.Flags, Is.EqualTo(part1.Flags)); + Assert.That(dupePart2.Flags, Is.EqualTo(part2.Flags)); + + /* + Assert.That(part1.PhysActor, Is.Not.Null); + Assert.That(part2.PhysActor, Is.Not.Null); + Assert.That(dupePart1.PhysActor, Is.Not.Null); + Assert.That(dupePart2.PhysActor, Is.Not.Null); + */ + } + } +} \ No newline at end of file diff --git a/OpenSim/Region/Framework/Scenes/Tests/SceneObjectBasicTests.cs b/OpenSim/Region/Framework/Scenes/Tests/SceneObjectBasicTests.cs index 4baa22c0fb..4969b09149 100644 --- a/OpenSim/Region/Framework/Scenes/Tests/SceneObjectBasicTests.cs +++ b/OpenSim/Region/Framework/Scenes/Tests/SceneObjectBasicTests.cs @@ -32,7 +32,6 @@ using NUnit.Framework.SyntaxHelpers; using OpenMetaverse; using OpenSim.Framework; using OpenSim.Framework.Communications; - using OpenSim.Region.Framework.Scenes; using OpenSim.Tests.Common; using OpenSim.Tests.Common.Mock; @@ -131,11 +130,11 @@ namespace OpenSim.Region.Framework.Scenes.Tests { TestHelper.InMethod(); //log4net.Config.XmlConfigurator.Configure(); - + UUID agentId = UUID.Parse("00000000-0000-0000-0000-000000000001"); - + TestScene scene = SceneSetupHelpers.SetupScene(); - + // Turn off the timer on the async sog deleter - we'll crank it by hand for this test. AsyncSceneObjectGroupDeleter sogd = scene.SceneObjectGroupDeleter; sogd.Enabled = false; @@ -143,12 +142,12 @@ namespace OpenSim.Region.Framework.Scenes.Tests SceneObjectPart part = SceneSetupHelpers.AddSceneObject(scene); IClientAPI client = SceneSetupHelpers.AddRootAgent(scene, agentId); - scene.DeRezObject(client, part.LocalId, UUID.Zero, DeRezAction.Delete, UUID.Zero); + scene.DeRezObjects(client, new System.Collections.Generic.List() { part.LocalId }, UUID.Zero, DeRezAction.Delete, UUID.Zero); SceneObjectPart retrievedPart = scene.GetSceneObjectPart(part.LocalId); Assert.That(retrievedPart, Is.Not.Null); - + sogd.InventoryDeQueueAndDelete(); SceneObjectPart retrievedPart2 = scene.GetSceneObjectPart(part.LocalId); @@ -190,5 +189,40 @@ namespace OpenSim.Region.Framework.Scenes.Tests // SceneObjectPart retrievedPart = scene.GetSceneObjectPart(part.LocalId); // Assert.That(retrievedPart, Is.Null); //} + + /// + /// Changing a scene object uuid changes the root part uuid. This is a valid operation if the object is not + /// in a scene and is useful if one wants to supply a UUID directly rather than use the one generated by + /// OpenSim. + /// + [Test] + public void TestChangeSceneObjectUuid() + { + string rootPartName = "rootpart"; + UUID rootPartUuid = new UUID("00000000-0000-0000-0000-000000000001"); + string childPartName = "childPart"; + UUID childPartUuid = new UUID("00000000-0000-0000-0001-000000000000"); + + SceneObjectPart rootPart + = new SceneObjectPart(UUID.Zero, PrimitiveBaseShape.Default, Vector3.Zero, Quaternion.Identity, Vector3.Zero) + { Name = rootPartName, UUID = rootPartUuid }; + SceneObjectPart linkPart + = new SceneObjectPart(UUID.Zero, PrimitiveBaseShape.Default, Vector3.Zero, Quaternion.Identity, Vector3.Zero) + { Name = childPartName, UUID = childPartUuid }; + + SceneObjectGroup sog = new SceneObjectGroup(rootPart); + sog.AddPart(linkPart); + + Assert.That(sog.UUID, Is.EqualTo(rootPartUuid)); + Assert.That(sog.RootPart.UUID, Is.EqualTo(rootPartUuid)); + Assert.That(sog.Parts.Length, Is.EqualTo(2)); + + UUID newRootPartUuid = new UUID("00000000-0000-0000-0000-000000000002"); + sog.UUID = newRootPartUuid; + + Assert.That(sog.UUID, Is.EqualTo(newRootPartUuid)); + Assert.That(sog.RootPart.UUID, Is.EqualTo(newRootPartUuid)); + Assert.That(sog.Parts.Length, Is.EqualTo(2)); + } } } diff --git a/OpenSim/Region/Framework/Scenes/Tests/SceneObjectLinkingTests.cs b/OpenSim/Region/Framework/Scenes/Tests/SceneObjectLinkingTests.cs index 0b7608d0b8..f57cf98b37 100644 --- a/OpenSim/Region/Framework/Scenes/Tests/SceneObjectLinkingTests.cs +++ b/OpenSim/Region/Framework/Scenes/Tests/SceneObjectLinkingTests.cs @@ -26,13 +26,13 @@ */ using System; +using System.Collections.Generic; using System.Reflection; using NUnit.Framework; using NUnit.Framework.SyntaxHelpers; using OpenMetaverse; using OpenSim.Framework; using OpenSim.Framework.Communications; - using OpenSim.Region.Framework.Scenes; using OpenSim.Tests.Common; using OpenSim.Tests.Common.Mock; @@ -81,12 +81,12 @@ namespace OpenSim.Region.Framework.Scenes.Tests // FIXME: Can't do this test yet since group 2 still has its root part! We can't yet null this since // it might cause SOG.ProcessBackup() to fail due to the race condition. This really needs to be fixed. Assert.That(grp2.IsDeleted, "SOG 2 was not registered as deleted after link."); - Assert.That(grp2.Children.Count, Is.EqualTo(0), "Group 2 still contained children after delink."); - Assert.That(grp1.Children.Count == 2); + Assert.That(grp2.Parts.Length, Is.EqualTo(0), "Group 2 still contained children after delink."); + Assert.That(grp1.Parts.Length == 2); if (debugtest) { - m_log.Debug("parts: " + grp1.Children.Count); + m_log.Debug("parts: " + grp1.Parts.Length); m_log.Debug("Group1: Pos:"+grp1.AbsolutePosition+", Rot:"+grp1.Rotation); m_log.Debug("Group1: Prim1: OffsetPosition:"+ part1.OffsetPosition+", OffsetRotation:"+part1.RotationOffset); m_log.Debug("Group1: Prim2: OffsetPosition:"+part2.OffsetPosition+", OffsetRotation:"+part2.RotationOffset); @@ -126,7 +126,7 @@ namespace OpenSim.Region.Framework.Scenes.Tests if (debugtest) m_log.Debug("Group2: Prim2: OffsetPosition:" + part2.AbsolutePosition + ", OffsetRotation:" + part2.RotationOffset); - Assert.That(grp1.Children.Count, Is.EqualTo(1), "Group 1 still contained part2 after delink."); + Assert.That(grp1.Parts.Length, Is.EqualTo(1), "Group 1 still contained part2 after delink."); Assert.That(part2.AbsolutePosition == Vector3.Zero, "The absolute position should be zero"); } @@ -177,22 +177,22 @@ namespace OpenSim.Region.Framework.Scenes.Tests grp3.LinkToGroup(grp4); // At this point we should have 4 parts total in two groups. - Assert.That(grp1.Children.Count == 2, "Group1 children count should be 2"); + Assert.That(grp1.Parts.Length == 2, "Group1 children count should be 2"); Assert.That(grp2.IsDeleted, "Group 2 was not registered as deleted after link."); - Assert.That(grp2.Children.Count, Is.EqualTo(0), "Group 2 still contained parts after delink."); - Assert.That(grp3.Children.Count == 2, "Group3 children count should be 2"); + Assert.That(grp2.Parts.Length, Is.EqualTo(0), "Group 2 still contained parts after delink."); + Assert.That(grp3.Parts.Length == 2, "Group3 children count should be 2"); Assert.That(grp4.IsDeleted, "Group 4 was not registered as deleted after link."); - Assert.That(grp4.Children.Count, Is.EqualTo(0), "Group 4 still contained parts after delink."); + Assert.That(grp4.Parts.Length, Is.EqualTo(0), "Group 4 still contained parts after delink."); if (debugtest) { m_log.Debug("--------After Link-------"); - m_log.Debug("Group1: parts:" + grp1.Children.Count); + m_log.Debug("Group1: parts:" + grp1.Parts.Length); m_log.Debug("Group1: Pos:"+grp1.AbsolutePosition+", Rot:"+grp1.Rotation); m_log.Debug("Group1: Prim1: OffsetPosition:" + part1.OffsetPosition + ", OffsetRotation:" + part1.RotationOffset); m_log.Debug("Group1: Prim2: OffsetPosition:"+part2.OffsetPosition+", OffsetRotation:"+ part2.RotationOffset); - - m_log.Debug("Group3: parts:"+grp3.Children.Count); + + m_log.Debug("Group3: parts:" + grp3.Parts.Length); m_log.Debug("Group3: Pos:"+grp3.AbsolutePosition+", Rot:"+grp3.Rotation); m_log.Debug("Group3: Prim1: OffsetPosition:"+part3.OffsetPosition+", OffsetRotation:"+part3.RotationOffset); m_log.Debug("Group3: Prim2: OffsetPosition:"+part4.OffsetPosition+", OffsetRotation:"+part4.RotationOffset); @@ -240,12 +240,12 @@ namespace OpenSim.Region.Framework.Scenes.Tests if (debugtest) { m_log.Debug("--------After De-Link-------"); - m_log.Debug("Group1: parts:" + grp1.Children.Count); + m_log.Debug("Group1: parts:" + grp1.Parts.Length); m_log.Debug("Group1: Pos:" + grp1.AbsolutePosition + ", Rot:" + grp1.Rotation); m_log.Debug("Group1: Prim1: OffsetPosition:" + part1.OffsetPosition + ", OffsetRotation:" + part1.RotationOffset); m_log.Debug("Group1: Prim2: OffsetPosition:" + part2.OffsetPosition + ", OffsetRotation:" + part2.RotationOffset); - m_log.Debug("Group3: parts:" + grp3.Children.Count); + m_log.Debug("Group3: parts:" + grp3.Parts.Length); m_log.Debug("Group3: Pos:" + grp3.AbsolutePosition + ", Rot:" + grp3.Rotation); m_log.Debug("Group3: Prim1: OffsetPosition:" + part3.OffsetPosition + ", OffsetRotation:" + part3.RotationOffset); m_log.Debug("Group3: Prim2: OffsetPosition:" + part4.OffsetPosition + ", OffsetRotation:" + part4.RotationOffset); @@ -260,5 +260,86 @@ namespace OpenSim.Region.Framework.Scenes.Tests && (part4.RotationOffset.W - compareQuaternion.W < 0.00003), "Badness 3"); } + + /// + /// Test that a new scene object which is already linked is correctly persisted to the persistence layer. + /// + [Test] + public void TestNewSceneObjectLinkPersistence() + { + TestHelper.InMethod(); + //log4net.Config.XmlConfigurator.Configure(); + + TestScene scene = SceneSetupHelpers.SetupScene(); + + string rootPartName = "rootpart"; + UUID rootPartUuid = new UUID("00000000-0000-0000-0000-000000000001"); + string linkPartName = "linkpart"; + UUID linkPartUuid = new UUID("00000000-0000-0000-0001-000000000000"); + + SceneObjectPart rootPart + = new SceneObjectPart(UUID.Zero, PrimitiveBaseShape.Default, Vector3.Zero, Quaternion.Identity, Vector3.Zero) + { Name = rootPartName, UUID = rootPartUuid }; + SceneObjectPart linkPart + = new SceneObjectPart(UUID.Zero, PrimitiveBaseShape.Default, Vector3.Zero, Quaternion.Identity, Vector3.Zero) + { Name = linkPartName, UUID = linkPartUuid }; + + SceneObjectGroup sog = new SceneObjectGroup(rootPart); + sog.AddPart(linkPart); + scene.AddNewSceneObject(sog, true); + + // In a test, we have to crank the backup handle manually. Normally this would be done by the timer invoked + // scene backup thread. + scene.Backup(true); + + List storedObjects = scene.SimulationDataService.LoadObjects(scene.RegionInfo.RegionID); + + Assert.That(storedObjects.Count, Is.EqualTo(1)); + Assert.That(storedObjects[0].Parts.Length, Is.EqualTo(2)); + Assert.That(storedObjects[0].ContainsPart(rootPartUuid)); + Assert.That(storedObjects[0].ContainsPart(linkPartUuid)); + } + + /// + /// Test that a delink of a previously linked object is correctly persisted to the database + /// + [Test] + public void TestDelinkPersistence() + { + TestHelper.InMethod(); + //log4net.Config.XmlConfigurator.Configure(); + + TestScene scene = SceneSetupHelpers.SetupScene(); + + string rootPartName = "rootpart"; + UUID rootPartUuid = new UUID("00000000-0000-0000-0000-000000000001"); + string linkPartName = "linkpart"; + UUID linkPartUuid = new UUID("00000000-0000-0000-0001-000000000000"); + + SceneObjectPart rootPart + = new SceneObjectPart(UUID.Zero, PrimitiveBaseShape.Default, Vector3.Zero, Quaternion.Identity, Vector3.Zero) + { Name = rootPartName, UUID = rootPartUuid }; + SceneObjectPart linkPart + = new SceneObjectPart(UUID.Zero, PrimitiveBaseShape.Default, Vector3.Zero, Quaternion.Identity, Vector3.Zero) + { Name = linkPartName, UUID = linkPartUuid }; + + SceneObjectGroup sog = new SceneObjectGroup(rootPart); + sog.AddPart(linkPart); + scene.AddNewSceneObject(sog, true); + + // In a test, we have to crank the backup handle manually. Normally this would be done by the timer invoked + // scene backup thread. + scene.Backup(true); + + // These changes should occur immediately without waiting for a backup pass + SceneObjectGroup groupToDelete = sog.DelinkFromGroup(linkPart, false); + scene.DeleteSceneObject(groupToDelete, false); + + List storedObjects = scene.SimulationDataService.LoadObjects(scene.RegionInfo.RegionID); + + Assert.That(storedObjects.Count, Is.EqualTo(1)); + Assert.That(storedObjects[0].Parts.Length, Is.EqualTo(1)); + Assert.That(storedObjects[0].ContainsPart(rootPartUuid)); + } } } diff --git a/OpenSim/Region/Framework/Scenes/Tests/SceneObjectUserTests.cs b/OpenSim/Region/Framework/Scenes/Tests/SceneObjectUserTests.cs new file mode 100644 index 0000000000..b3b99f4922 --- /dev/null +++ b/OpenSim/Region/Framework/Scenes/Tests/SceneObjectUserTests.cs @@ -0,0 +1,129 @@ +/* + * Copyright (c) Contributors, http://opensimulator.org/ + * See CONTRIBUTORS.TXT for a full list of copyright holders. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * * Neither the name of the OpenSimulator Project nor the + * names of its contributors may be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE DEVELOPERS ``AS IS'' AND ANY + * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED + * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + * DISCLAIMED. IN NO EVENT SHALL THE CONTRIBUTORS BE LIABLE FOR ANY + * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES + * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND + * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS + * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +using System; +using System.Collections.Generic; +using System.Reflection; +using Nini.Config; +using NUnit.Framework; +using NUnit.Framework.SyntaxHelpers; +using OpenMetaverse; +using OpenSim.Framework; +using OpenSim.Framework.Communications; +using OpenSim.Region.CoreModules.World.Permissions; +using OpenSim.Region.Framework.Scenes; +using OpenSim.Tests.Common; +using OpenSim.Tests.Common.Mock; +using OpenSim.Tests.Common.Setup; + +namespace OpenSim.Region.Framework.Scenes.Tests +{ + /// + /// Tests manipulation of scene objects by users. + /// + /// + /// This is at a level above the SceneObjectBasicTests, which act on the scene directly. + /// FIXME: These tests are very incomplete - they only test for a few conditions. + [TestFixture] + public class SceneObjectUserTests + { + /// + /// Test deleting an object from a scene. + /// + [Test] + public void TestDeRezSceneObject() + { + TestHelper.InMethod(); +// log4net.Config.XmlConfigurator.Configure(); + + UUID userId = UUID.Parse("10000000-0000-0000-0000-000000000001"); + + TestScene scene = SceneSetupHelpers.SetupScene(); + IConfigSource configSource = new IniConfigSource(); + IConfig config = configSource.AddConfig("Startup"); + config.Set("serverside_object_permissions", true); + SceneSetupHelpers.SetupSceneModules(scene, configSource, new object[] { new PermissionsModule() }); + TestClient client = SceneSetupHelpers.AddRootAgent(scene, userId); + + // Turn off the timer on the async sog deleter - we'll crank it by hand for this test. + AsyncSceneObjectGroupDeleter sogd = scene.SceneObjectGroupDeleter; + sogd.Enabled = false; + + SceneObjectPart part + = new SceneObjectPart(userId, PrimitiveBaseShape.Default, Vector3.Zero, Quaternion.Identity, Vector3.Zero); + part.Name = "obj1"; + scene.AddNewSceneObject(new SceneObjectGroup(part), false); + List localIds = new List(); + localIds.Add(part.LocalId); + + scene.DeRezObjects(client, localIds, UUID.Zero, DeRezAction.Delete, UUID.Zero); + sogd.InventoryDeQueueAndDelete(); + + SceneObjectPart retrievedPart = scene.GetSceneObjectPart(part.LocalId); + Assert.That(retrievedPart, Is.Null); + } + + /// + /// Test deleting an object from a scene where the deleter is not the owner + /// + /// + /// This test assumes that the deleter is not a god. + [Test] + public void TestDeRezSceneObjectNotOwner() + { + TestHelper.InMethod(); +// log4net.Config.XmlConfigurator.Configure(); + + UUID userId = UUID.Parse("10000000-0000-0000-0000-000000000001"); + UUID objectOwnerId = UUID.Parse("20000000-0000-0000-0000-000000000001"); + + TestScene scene = SceneSetupHelpers.SetupScene(); + IConfigSource configSource = new IniConfigSource(); + IConfig config = configSource.AddConfig("Startup"); + config.Set("serverside_object_permissions", true); + SceneSetupHelpers.SetupSceneModules(scene, configSource, new object[] { new PermissionsModule() }); + TestClient client = SceneSetupHelpers.AddRootAgent(scene, userId); + + // Turn off the timer on the async sog deleter - we'll crank it by hand for this test. + AsyncSceneObjectGroupDeleter sogd = scene.SceneObjectGroupDeleter; + sogd.Enabled = false; + + SceneObjectPart part + = new SceneObjectPart(objectOwnerId, PrimitiveBaseShape.Default, Vector3.Zero, Quaternion.Identity, Vector3.Zero); + part.Name = "obj1"; + scene.AddNewSceneObject(new SceneObjectGroup(part), false); + List localIds = new List(); + localIds.Add(part.LocalId); + + scene.DeRezObjects(client, localIds, UUID.Zero, DeRezAction.Delete, UUID.Zero); + sogd.InventoryDeQueueAndDelete(); + + SceneObjectPart retrievedPart = scene.GetSceneObjectPart(part.LocalId); + Assert.That(retrievedPart.UUID, Is.EqualTo(part.UUID)); + } + } +} \ No newline at end of file diff --git a/OpenSim/Region/Framework/Scenes/Tests/ScenePresenceTests.cs b/OpenSim/Region/Framework/Scenes/Tests/ScenePresenceTests.cs index 501207e041..ef52363611 100644 --- a/OpenSim/Region/Framework/Scenes/Tests/ScenePresenceTests.cs +++ b/OpenSim/Region/Framework/Scenes/Tests/ScenePresenceTests.cs @@ -65,6 +65,8 @@ namespace OpenSim.Region.Framework.Scenes.Tests [TestFixtureSetUp] public void Init() { + TestHelper.InMethod(); + scene = SceneSetupHelpers.SetupScene("Neighbour x", UUID.Random(), 1000, 1000); scene2 = SceneSetupHelpers.SetupScene("Neighbour x+1", UUID.Random(), 1001, 1000); scene3 = SceneSetupHelpers.SetupScene("Neighbour x-1", UUID.Random(), 999, 1000); @@ -104,8 +106,8 @@ namespace OpenSim.Region.Framework.Scenes.Tests agent.AgentID = agent1; agent.firstname = firstName; agent.lastname = "testlastname"; - agent.SessionID = UUID.Zero; - agent.SecureSessionID = UUID.Zero; + agent.SessionID = UUID.Random(); + agent.SecureSessionID = UUID.Random(); agent.circuitcode = 123; agent.BaseFolder = UUID.Zero; agent.InventoryFolder = UUID.Zero; @@ -114,6 +116,11 @@ namespace OpenSim.Region.Framework.Scenes.Tests agent.ChildrenCapSeeds = new Dictionary(); agent.child = true; + if (scene.PresenceService == null) + Console.WriteLine("Presence Service is null"); + + scene.PresenceService.LoginAgent(agent.AgentID.ToString(), agent.SessionID, agent.SecureSessionID); + string reason; scene.NewUserConnection(agent, (uint)TeleportFlags.ViaLogin, out reason); testclient = new TestClient(agent, scene); @@ -168,6 +175,7 @@ namespace OpenSim.Region.Framework.Scenes.Tests Assert.That(neighbours.Count, Is.EqualTo(2)); } + public void fixNullPresence() { string firstName = "testfirstname"; @@ -384,8 +392,6 @@ namespace OpenSim.Region.Framework.Scenes.Tests public static string GetRandomCapsObjectPath() { - TestHelper.InMethod(); - UUID caps = UUID.Random(); string capsPath = caps.ToString(); capsPath = capsPath.Remove(capsPath.Length - 4, 4); @@ -424,4 +430,4 @@ namespace OpenSim.Region.Framework.Scenes.Tests return name.ToString(); } } -} +} \ No newline at end of file diff --git a/OpenSim/Region/Framework/Scenes/Tests/SceneTests.cs b/OpenSim/Region/Framework/Scenes/Tests/SceneTests.cs deleted file mode 100644 index a6cf003f0b..0000000000 --- a/OpenSim/Region/Framework/Scenes/Tests/SceneTests.cs +++ /dev/null @@ -1,154 +0,0 @@ -/* - * Copyright (c) Contributors, http://opensimulator.org/ - * See CONTRIBUTORS.TXT for a full list of copyright holders. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * * Neither the name of the OpenSimulator Project nor the - * names of its contributors may be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE DEVELOPERS ``AS IS'' AND ANY - * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED - * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL THE CONTRIBUTORS BE LIABLE FOR ANY - * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES - * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; - * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ - -using System; -using System.Collections.Generic; -using NUnit.Framework; -using OpenMetaverse; -using OpenSim.Framework; -using OpenSim.Region.Framework.Interfaces; - -namespace OpenSim.Region.Framework.Scenes.Tests -{ - /// - /// Scene presence tests - /// - [TestFixture] - public class SceneTests - { - private class FakeStorageManager : StorageManager - { - private class FakeRegionDataStore : IRegionDataStore - { - public void Initialise(string filename) - { - } - - public void Dispose() - { - } - - public void StoreObject(SceneObjectGroup obj, UUID regionUUID) - { - throw new NotImplementedException(); - } - - public void RemoveObject(UUID uuid, UUID regionUUID) - { - throw new NotImplementedException(); - } - - public void StorePrimInventory(UUID primID, ICollection items) - { - throw new NotImplementedException(); - } - - public List LoadObjects(UUID regionUUID) - { - throw new NotImplementedException(); - } - - public void StoreTerrain(double[,] terrain, UUID regionID) - { - throw new NotImplementedException(); - } - - public double[,] LoadTerrain(UUID regionID) - { - throw new NotImplementedException(); - } - - public void StoreLandObject(ILandObject Parcel) - { - throw new NotImplementedException(); - } - - public void RemoveLandObject(UUID globalID) - { - throw new NotImplementedException(); - } - - public List LoadLandObjects(UUID regionUUID) - { - throw new NotImplementedException(); - } - - public void StoreRegionSettings(RegionSettings rs) - { - throw new NotImplementedException(); - } - public RegionLightShareData LoadRegionWindlightSettings(UUID regionUUID) - { - //This connector doesn't support the windlight module yet - //Return default LL windlight settings - return new RegionLightShareData(); - } - public void StoreRegionWindlightSettings(RegionLightShareData wl) - { - //This connector doesn't support the windlight module yet - } - public RegionSettings LoadRegionSettings(UUID regionUUID) - { - return null; - } - - public void Shutdown() - { - throw new NotImplementedException(); - } - - #region REGION SYNC - public List LoadObjectsInGivenSpace(UUID regionID, float lowerX, float lowerY, float upperX, float upperY) - { - return null; - } - #endregion REGION SYNC - } - - public FakeStorageManager() : base(new FakeRegionDataStore()) - { - } - - public FakeStorageManager(IRegionDataStore storage) : this() - { - } - - public FakeStorageManager(string dllName, string connectionstring, string estateconnectionstring) : this() - { - } - } - - [Test] - public void TestConstructor() - { - RegionInfo regionInfo = new RegionInfo(0,0,null,null); - FakeStorageManager storageManager = new FakeStorageManager(); - - new Scene(regionInfo, null, null, storageManager, null, false, false, false, null, null); - } - } -} diff --git a/OpenSim/Region/Framework/Scenes/Tests/TaskInventoryTests.cs b/OpenSim/Region/Framework/Scenes/Tests/TaskInventoryTests.cs new file mode 100644 index 0000000000..fe59d4f031 --- /dev/null +++ b/OpenSim/Region/Framework/Scenes/Tests/TaskInventoryTests.cs @@ -0,0 +1,145 @@ +/* + * Copyright (c) Contributors, http://opensimulator.org/ + * See CONTRIBUTORS.TXT for a full list of copyright holders. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * * Neither the name of the OpenSimulator Project nor the + * names of its contributors may be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE DEVELOPERS ``AS IS'' AND ANY + * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED + * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + * DISCLAIMED. IN NO EVENT SHALL THE CONTRIBUTORS BE LIABLE FOR ANY + * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES + * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND + * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS + * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +using System; +using System.Collections.Generic; +using System.Reflection; +using System.Text; +using System.Threading; +using System.Timers; +using Timer=System.Timers.Timer; +using Nini.Config; +using NUnit.Framework; +using NUnit.Framework.SyntaxHelpers; +using OpenMetaverse; +using OpenMetaverse.Assets; +using OpenSim.Framework; +using OpenSim.Framework.Communications; +using OpenSim.Region.Framework.Scenes; +using OpenSim.Region.Framework.Interfaces; +using OpenSim.Region.CoreModules.Avatar.Inventory.Archiver; +using OpenSim.Region.CoreModules.World.Serialiser; +using OpenSim.Region.CoreModules.ServiceConnectorsOut.Simulation; +using OpenSim.Services.Interfaces; +using OpenSim.Tests.Common; +using OpenSim.Tests.Common.Mock; +using OpenSim.Tests.Common.Setup; + +namespace OpenSim.Region.Framework.Tests +{ + [TestFixture] + public class TaskInventoryTests + { + protected UserAccount CreateUser(Scene scene) + { + string userFirstName = "Jock"; + string userLastName = "Stirrup"; + string userPassword = "troll"; + UUID userId = UUID.Parse("00000000-0000-0000-0000-000000000020"); + return UserProfileTestUtils.CreateUserWithInventory(scene, userFirstName, userLastName, userId, userPassword); + } + + protected SceneObjectGroup CreateSO1(Scene scene, UUID ownerId) + { + string part1Name = "part1"; + UUID part1Id = UUID.Parse("10000000-0000-0000-0000-000000000000"); + SceneObjectPart part1 + = new SceneObjectPart(ownerId, PrimitiveBaseShape.Default, Vector3.Zero, Quaternion.Identity, Vector3.Zero) + { Name = part1Name, UUID = part1Id }; + return new SceneObjectGroup(part1); + } + + protected TaskInventoryItem CreateSOItem1(Scene scene, SceneObjectPart part) + { + AssetNotecard nc = new AssetNotecard(); + nc.BodyText = "Hello World!"; + nc.Encode(); + UUID ncAssetUuid = new UUID("00000000-0000-0000-1000-000000000000"); + UUID ncItemUuid = new UUID("00000000-0000-0000-1100-000000000000"); + AssetBase ncAsset + = AssetHelpers.CreateAsset(ncAssetUuid, AssetType.Notecard, nc.AssetData, UUID.Zero); + scene.AssetService.Store(ncAsset); + TaskInventoryItem ncItem + = new TaskInventoryItem + { Name = "ncItem", AssetID = ncAssetUuid, ItemID = ncItemUuid, + Type = (int)AssetType.Notecard, InvType = (int)InventoryType.Notecard }; + part.Inventory.AddInventoryItem(ncItem, true); + + return ncItem; + } + + /// + /// Test MoveTaskInventoryItem where the item has no parent folder assigned. + /// + /// This should place it in the most suitable user folder. + [Test] + public void TestMoveTaskInventoryItem() + { + TestHelper.InMethod(); +// log4net.Config.XmlConfigurator.Configure(); + + Scene scene = SceneSetupHelpers.SetupScene("inventory"); + UserAccount user1 = CreateUser(scene); + SceneObjectGroup sog1 = CreateSO1(scene, user1.PrincipalID); + SceneObjectPart sop1 = sog1.RootPart; + TaskInventoryItem sopItem1 = CreateSOItem1(scene, sop1); + InventoryFolderBase folder + = InventoryArchiveUtils.FindFolderByPath(scene.InventoryService, user1.PrincipalID, "Objects")[0]; + + // Perform test + scene.MoveTaskInventoryItem(user1.PrincipalID, folder.ID, sop1, sopItem1.ItemID); + + InventoryItemBase ncUserItem + = InventoryArchiveUtils.FindItemByPath(scene.InventoryService, user1.PrincipalID, "Objects/ncItem"); + Assert.That(ncUserItem, Is.Not.Null, "Objects/ncItem was not found"); + } + + /// + /// Test MoveTaskInventoryItem where the item has no parent folder assigned. + /// + /// This should place it in the most suitable user folder. + [Test] + public void TestMoveTaskInventoryItemNoParent() + { + TestHelper.InMethod(); +// log4net.Config.XmlConfigurator.Configure(); + + Scene scene = SceneSetupHelpers.SetupScene("inventory"); + UserAccount user1 = CreateUser(scene); + SceneObjectGroup sog1 = CreateSO1(scene, user1.PrincipalID); + SceneObjectPart sop1 = sog1.RootPart; + TaskInventoryItem sopItem1 = CreateSOItem1(scene, sop1); + + // Perform test + scene.MoveTaskInventoryItem(user1.PrincipalID, UUID.Zero, sop1, sopItem1.ItemID); + + InventoryItemBase ncUserItem + = InventoryArchiveUtils.FindItemByPath(scene.InventoryService, user1.PrincipalID, "Notecards/ncItem"); + Assert.That(ncUserItem, Is.Not.Null, "Notecards/ncItem was not found"); + } + } +} \ No newline at end of file diff --git a/OpenSim/Region/Framework/Scenes/Types/BasicQuadTreeNode.cs b/OpenSim/Region/Framework/Scenes/Types/BasicQuadTreeNode.cs deleted file mode 100644 index 38a9203a45..0000000000 --- a/OpenSim/Region/Framework/Scenes/Types/BasicQuadTreeNode.cs +++ /dev/null @@ -1,269 +0,0 @@ -/* - * Copyright (c) Contributors, http://opensimulator.org/ - * See CONTRIBUTORS.TXT for a full list of copyright holders. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * * Neither the name of the OpenSimulator Project nor the - * names of its contributors may be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE DEVELOPERS ``AS IS'' AND ANY - * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED - * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL THE CONTRIBUTORS BE LIABLE FOR ANY - * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES - * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; - * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ - -using System; -using System.Collections.Generic; -using OpenSim.Region.Framework.Scenes; - -namespace OpenSim.Region.Framework.Scenes.Types -{ - public class BasicQuadTreeNode - { - private List m_objects = new List(); - private BasicQuadTreeNode[] m_childNodes = null; - private BasicQuadTreeNode m_parent = null; - - private short m_leftX; - private short m_leftY; - private short m_width; - private short m_height; - //private int m_quadNumber; - private string m_quadID; - - public BasicQuadTreeNode(BasicQuadTreeNode parent, string quadID, short leftX, short leftY, short width, - short height) - { - m_parent = parent; - m_quadID = quadID; - m_leftX = leftX; - m_leftY = leftY; - m_width = width; - m_height = height; - // m_log.Debug("creating quadtree node " + m_quadID); - } - - public void AddObject(SceneObjectGroup obj) - { - if (m_childNodes == null) - { - if (!m_objects.Contains(obj)) - { - m_objects.Add(obj); - } - } - else - { - if (obj.AbsolutePosition.X < (m_leftX + (m_width/2))) - { - if (obj.AbsolutePosition.Y < (m_leftY + (m_height/2))) - { - m_childNodes[0].AddObject(obj); - } - else - { - m_childNodes[2].AddObject(obj); - } - } - else - { - if (obj.AbsolutePosition.Y < (m_leftY + (m_height/2))) - { - m_childNodes[1].AddObject(obj); - } - else - { - m_childNodes[3].AddObject(obj); - } - } - } - } - - public void Subdivide() - { - if (m_childNodes == null) - { - m_childNodes = new BasicQuadTreeNode[4]; - m_childNodes[0] = - new BasicQuadTreeNode(this, m_quadID + "1/", m_leftX, m_leftY, (short) (m_width/2), - (short) (m_height/2)); - m_childNodes[1] = - new BasicQuadTreeNode(this, m_quadID + "2/", (short) (m_leftX + (m_width/2)), m_leftY, - (short) (m_width/2), (short) (m_height/2)); - m_childNodes[2] = - new BasicQuadTreeNode(this, m_quadID + "3/", m_leftX, (short) (m_leftY + (m_height/2)), - (short) (m_width/2), (short) (m_height/2)); - m_childNodes[3] = - new BasicQuadTreeNode(this, m_quadID + "4/", (short) (m_leftX + (m_width/2)), - (short) (m_height + (m_height/2)), (short) (m_width/2), (short) (m_height/2)); - } - else - { - for (int i = 0; i < m_childNodes.Length; i++) - { - m_childNodes[i].Subdivide(); - } - } - } - - public List GetObjectsFrom(float x, float y) - { - if (m_childNodes == null) - { - return new List(m_objects); - } - else - { - if (x < m_leftX + (m_width/2)) - { - if (y < m_leftY + (m_height/2)) - { - return m_childNodes[0].GetObjectsFrom(x, y); - } - else - { - return m_childNodes[2].GetObjectsFrom(x, y); - } - } - else - { - if (y < m_leftY + (m_height/2)) - { - return m_childNodes[1].GetObjectsFrom(x, y); - } - else - { - return m_childNodes[3].GetObjectsFrom(x, y); - } - } - } - } - - public List GetObjectsFrom(string nodeName) - { - if (nodeName == m_quadID) - { - return new List(m_objects); - } - else if (m_childNodes != null) - { - for (int i = 0; i < 4; i++) - { - List retVal; - retVal = m_childNodes[i].GetObjectsFrom(nodeName); - if (retVal != null) - { - return retVal; - } - } - } - return null; - } - - public string GetNodeID(float x, float y) - { - if (m_childNodes == null) - { - return m_quadID; - } - else - { - if (x < m_leftX + (m_width/2)) - { - if (y < m_leftY + (m_height/2)) - { - return m_childNodes[0].GetNodeID(x, y); - } - else - { - return m_childNodes[2].GetNodeID(x, y); - } - } - else - { - if (y < m_leftY + (m_height/2)) - { - return m_childNodes[1].GetNodeID(x, y); - } - else - { - return m_childNodes[3].GetNodeID(x, y); - } - } - } - } - - public void Update() - { - if (m_childNodes != null) - { - for (int i = 0; i < 4; i++) - { - m_childNodes[i].Update(); - } - } - else - { - List outBounds = new List(); - foreach (SceneObjectGroup group in m_objects) - { - if (((group.AbsolutePosition.X > m_leftX) && (group.AbsolutePosition.X < (m_leftX + m_width))) && - ((group.AbsolutePosition.Y > m_leftY) && (group.AbsolutePosition.Y < (m_leftY + m_height)))) - { - //still in bounds - } - else - { - outBounds.Add(group); - } - } - - foreach (SceneObjectGroup removee in outBounds) - { - m_objects.Remove(removee); - if (m_parent != null) - { - m_parent.PassUp(removee); - } - } - outBounds.Clear(); - } - } - - public void PassUp(SceneObjectGroup group) - { - if (((group.AbsolutePosition.X > m_leftX) && (group.AbsolutePosition.X < (m_leftX + m_width))) && - ((group.AbsolutePosition.Y > m_leftY) && (group.AbsolutePosition.Y < (m_leftY + m_height)))) - { - AddObject(group); - } - else - { - if (m_parent != null) - { - m_parent.PassUp(group); - } - } - } - - public string[] GetNeighbours(string nodeName) - { - string[] retVal = new string[1]; - retVal[0] = String.Empty; - return retVal; - } - } -} diff --git a/OpenSim/Region/Framework/Scenes/UuidGatherer.cs b/OpenSim/Region/Framework/Scenes/UuidGatherer.cs index e3965ce978..aee2d1086a 100644 --- a/OpenSim/Region/Framework/Scenes/UuidGatherer.cs +++ b/OpenSim/Region/Framework/Scenes/UuidGatherer.cs @@ -121,8 +121,11 @@ namespace OpenSim.Region.Framework.Scenes // m_log.DebugFormat( // "[ASSET GATHERER]: Getting assets for object {0}, {1}", sceneObject.Name, sceneObject.UUID); - foreach (SceneObjectPart part in sceneObject.GetParts()) + SceneObjectPart[] parts = sceneObject.Parts; + for (int i = 0; i < parts.Length; i++) { + SceneObjectPart part = parts[i]; + // m_log.DebugFormat( // "[ARCHIVER]: Getting part {0}, {1} for object {2}", part.Name, part.UUID, sceneObject.UUID); @@ -288,9 +291,16 @@ namespace OpenSim.Region.Framework.Scenes } } + /// + /// Get the asset uuid associated with a gesture + /// + /// + /// protected void GetGestureAssetUuids(UUID gestureUuid, IDictionary assetUuids) { AssetBase assetBase = GetAsset(gestureUuid); + if (null == assetBase) + return; MemoryStream ms = new MemoryStream(assetBase.Data); StreamReader sr = new StreamReader(ms); diff --git a/OpenSim/Region/Framework/StorageManager.cs b/OpenSim/Region/Framework/StorageManager.cs deleted file mode 100644 index 9375b4add2..0000000000 --- a/OpenSim/Region/Framework/StorageManager.cs +++ /dev/null @@ -1,96 +0,0 @@ -/* - * Copyright (c) Contributors, http://opensimulator.org/ - * See CONTRIBUTORS.TXT for a full list of copyright holders. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * * Neither the name of the OpenSimulator Project nor the - * names of its contributors may be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE DEVELOPERS ``AS IS'' AND ANY - * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED - * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL THE CONTRIBUTORS BE LIABLE FOR ANY - * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES - * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; - * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ - -using System; -using System.Reflection; -using log4net; -using OpenSim.Region.Framework.Interfaces; - -namespace OpenSim.Region.Framework -{ - public class StorageManager - { - private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); - - protected IRegionDataStore m_dataStore; - - public IRegionDataStore DataStore - { - get { return m_dataStore; } - } - - private IEstateDataStore m_estateDataStore; - - public IEstateDataStore EstateDataStore - { - get { return m_estateDataStore; } - } - - public StorageManager(IRegionDataStore storage) - { - m_dataStore = storage; - } - - public StorageManager(string dllName, string connectionstring, string estateconnectionstring) - { - m_log.Info("[DATASTORE]: Attempting to load " + dllName); - Assembly pluginAssembly = Assembly.LoadFrom(dllName); - - foreach (Type pluginType in pluginAssembly.GetTypes()) - { - if (pluginType.IsPublic) - { - Type typeInterface = pluginType.GetInterface("IRegionDataStore", true); - - if (typeInterface != null) - { - IRegionDataStore plug = - (IRegionDataStore) Activator.CreateInstance(pluginAssembly.GetType(pluginType.ToString())); - plug.Initialise(connectionstring); - - m_dataStore = plug; - - m_log.Info("[DATASTORE]: Added IRegionDataStore Interface"); - } - - typeInterface = pluginType.GetInterface("IEstateDataStore", true); - - if (typeInterface != null) - { - IEstateDataStore estPlug = - (IEstateDataStore) Activator.CreateInstance(pluginAssembly.GetType(pluginType.ToString())); - estPlug.Initialise(estateconnectionstring); - - m_estateDataStore = estPlug; - } - } - } - - //TODO: Add checking and warning to make sure it initialised. - } - } -} diff --git a/OpenSim/Region/OptionalModules/Agent/InternetRelayClientView/Server/IRCClientView.cs b/OpenSim/Region/OptionalModules/Agent/InternetRelayClientView/Server/IRCClientView.cs index 6fc6602dfb..bca91dc367 100644 --- a/OpenSim/Region/OptionalModules/Agent/InternetRelayClientView/Server/IRCClientView.cs +++ b/OpenSim/Region/OptionalModules/Agent/InternetRelayClientView/Server/IRCClientView.cs @@ -375,8 +375,7 @@ namespace OpenSim.Region.OptionalModules.Agent.InternetRelayClientView.Server private void IRC_SendNamesReply() { - List users = m_scene.Entities.GetAllByType(); - + EntityBase[] users = m_scene.Entities.GetAllByType(); foreach (EntityBase user in users) { SendServerCommand("353 " + m_nick + " = " + IrcRegionName + " :" + user.Name.Replace(" ", "")); @@ -386,8 +385,7 @@ namespace OpenSim.Region.OptionalModules.Agent.InternetRelayClientView.Server private void IRC_SendWhoReply() { - List users = m_scene.Entities.GetAllByType(); - + EntityBase[] users = m_scene.Entities.GetAllByType(); foreach (EntityBase user in users) { /*SendServerCommand(String.Format("352 {0} {1} {2} {3} {4} {5} :0 {6}", IrcRegionName, @@ -415,11 +413,11 @@ namespace OpenSim.Region.OptionalModules.Agent.InternetRelayClientView.Server private void IRC_SendReplyUsers() { - List users = m_scene.Entities.GetAllByType(); + EntityBase[] users = m_scene.Entities.GetAllByType(); SendServerCommand("392 :UserID Terminal Host"); - if (users.Count == 0) + if (users.Length == 0) { SendServerCommand("395 :Nobody logged in"); return; @@ -685,7 +683,7 @@ namespace OpenSim.Region.OptionalModules.Agent.InternetRelayClientView.Server public event TeleportLandmarkRequest OnTeleportLandmarkRequest; public event DeRezObject OnDeRezObject; public event Action OnRegionHandShakeReply; - public event GenericCall2 OnRequestWearables; + public event GenericCall1 OnRequestWearables; public event GenericCall1 OnCompleteMovementToRegion; public event UpdateAgent OnPreAgentUpdate; public event UpdateAgent OnAgentUpdate; @@ -909,7 +907,7 @@ namespace OpenSim.Region.OptionalModules.Agent.InternetRelayClientView.Server Scene scene = (Scene)Scene; AvatarAppearance appearance; scene.GetAvatarAppearance(this, out appearance); - OnSetAppearance(appearance.Texture, (byte[])appearance.VisualParams.Clone()); + OnSetAppearance(this, appearance.Texture, (byte[])appearance.VisualParams.Clone()); } public void SendRegionHandshake(RegionInfo regionInfo, RegionHandshakeArgs args) @@ -1043,11 +1041,15 @@ namespace OpenSim.Region.OptionalModules.Agent.InternetRelayClientView.Server } - public void SendTeleportLocationStart() + public void SendTeleportStart(uint flags) { } + public void SendTeleportProgress(uint flags, string message) + { + } + public void SendMoneyBalance(UUID transaction, bool success, byte[] description, int balance) { diff --git a/OpenSim/Region/OptionalModules/Avatar/Voice/FreeSwitchVoice/FreeSwitchDialplan.cs b/OpenSim/Region/OptionalModules/Avatar/Voice/FreeSwitchVoice/FreeSwitchDialplan.cs deleted file mode 100644 index 46ad30fdfd..0000000000 --- a/OpenSim/Region/OptionalModules/Avatar/Voice/FreeSwitchVoice/FreeSwitchDialplan.cs +++ /dev/null @@ -1,104 +0,0 @@ -/* - * Copyright (c) Contributors, http://opensimulator.org/ - * See CONTRIBUTORS.TXT for a full list of copyright holders. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * * Neither the name of the OpenSimulator Project nor the - * names of its contributors may be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE DEVELOPERS ``AS IS'' AND ANY - * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED - * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL THE CONTRIBUTORS BE LIABLE FOR ANY - * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES - * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; - * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ - -using log4net; -using System; -using System.Reflection; -using System.Text; -using System.Collections; - -namespace OpenSim.Region.OptionalModules.Avatar.Voice.FreeSwitchVoice -{ - public class FreeSwitchDialplan - { - private static readonly ILog m_log = - LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); - - - public Hashtable HandleDialplanRequest(string Context, string Realm, Hashtable request) - { - m_log.DebugFormat("[FreeSwitchVoice] HandleDialplanRequest called with {0}",request.ToString()); - - Hashtable response = new Hashtable(); - - foreach (DictionaryEntry item in request) - { - m_log.InfoFormat("[FreeSwitchDirectory] requestBody item {0} {1}",item.Key, item.Value); - } - - string requestcontext = (string) request["Hunt-Context"]; - response["content_type"] = "text/xml"; - response["keepalive"] = false; - response["int_response_code"] = 200; - if (Context != String.Empty && Context != requestcontext) - { - m_log.Debug("[FreeSwitchDirectory] returning empty as it's for another context"); - response["str_response_string"] = ""; - } else { - response["str_response_string"] = String.Format(@" - -
- " + - -/* - - - - - - */ - - @" - - - - - - - - - - - - - - - - - - - - -
-
", Context, Realm); - } - - return response; - } - } - -} diff --git a/OpenSim/Region/OptionalModules/Avatar/Voice/FreeSwitchVoice/FreeSwitchDirectory.cs b/OpenSim/Region/OptionalModules/Avatar/Voice/FreeSwitchVoice/FreeSwitchDirectory.cs deleted file mode 100644 index 17cdf741b5..0000000000 --- a/OpenSim/Region/OptionalModules/Avatar/Voice/FreeSwitchVoice/FreeSwitchDirectory.cs +++ /dev/null @@ -1,348 +0,0 @@ -/* - * Copyright (c) Contributors, http://opensimulator.org/ - * See CONTRIBUTORS.TXT for a full list of copyright holders. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * * Neither the name of the OpenSimulator Project nor the - * names of its contributors may be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE DEVELOPERS ``AS IS'' AND ANY - * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED - * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL THE CONTRIBUTORS BE LIABLE FOR ANY - * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES - * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; - * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ - -using log4net; -using System; -using System.Reflection; -using System.Text; -using System.Collections; - -namespace OpenSim.Region.OptionalModules.Avatar.Voice.FreeSwitchVoice -{ - public class FreeSwitchDirectory - { - private static readonly ILog m_log = - LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); - - public Hashtable HandleDirectoryRequest(string Context, string Realm, Hashtable request) - { - Hashtable response = new Hashtable(); - string domain = (string) request["domain"]; - if (domain != Realm) { - response["content_type"] = "text/xml"; - response["keepalive"] = false; - response["int_response_code"] = 200; - response["str_response_string"] = ""; - } else { - m_log.DebugFormat("[FreeSwitchDirectory] HandleDirectoryRequest called with {0}",request.ToString()); - - // information in the request we might be interested in - - // Request 1 sip_auth for users account - - //Event-Calling-Function=sofia_reg_parse_auth - //Event-Calling-Line-Number=1494 - //action=sip_auth - //sip_user_agent=Vivox-SDK-2.1.3010.6151-Mac%20(Feb-11-2009/16%3A42%3A41) - //sip_auth_username=xhZuXKmRpECyr2AARJYyGgg%3D%3D (==) - //sip_auth_realm=9.20.151.43 - //sip_contact_user=xhZuXKmRpECyr2AARJYyGgg%3D%3D (==) - //sip_contact_host=192.168.0.3 // this shouldnt really be a local IP, investigate STUN servers - //sip_to_user=xhZuXKmRpECyr2AARJYyGgg%3D%3D - //sip_to_host=9.20.151.43 - //sip_auth_method=REGISTER - //user=xhZuXKmRpECyr2AARJYyGgg%3D%3D - //domain=9.20.151.43 - //ip=9.167.220.137 // this is the correct IP rather than sip_contact_host above when through a vpn or NAT setup - - foreach (DictionaryEntry item in request) - { - m_log.InfoFormat("[FreeSwitchDirectory] requestBody item {0} {1}", item.Key, item.Value); - } - - string eventCallingFunction = (string) request["Event-Calling-Function"]; - if (eventCallingFunction == null) - { - eventCallingFunction = "sofia_reg_parse_auth"; - } - - if (eventCallingFunction.Length == 0) - { - eventCallingFunction = "sofia_reg_parse_auth"; - } - - if (eventCallingFunction == "sofia_reg_parse_auth") - { - string sipAuthMethod = (string)request["sip_auth_method"]; - - if (sipAuthMethod == "REGISTER") - { - response = HandleRegister(Context, Realm, request); - } - else if (sipAuthMethod == "INVITE") - { - response = HandleInvite(Context, Realm, request); - } - else - { - m_log.ErrorFormat("[FreeSwitchVoice] HandleDirectoryRequest unknown sip_auth_method {0}",sipAuthMethod); - response["int_response_code"] = 404; - response["content_type"] = "text/xml"; - response["str_response_string"] = ""; - } - } - else if (eventCallingFunction == "switch_xml_locate_user") - { - response = HandleLocateUser(Realm, request); - } - else if (eventCallingFunction == "user_data_function") // gets called when an avatar to avatar call is made - { - response = HandleLocateUser(Realm, request); - } - else if (eventCallingFunction == "user_outgoing_channel") - { - response = HandleRegister(Context, Realm, request); - } - else if (eventCallingFunction == "config_sofia") // happens once on freeswitch startup - { - response = HandleConfigSofia(Context, Realm, request); - } - else if (eventCallingFunction == "switch_load_network_lists") - { - //response = HandleLoadNetworkLists(request); - response["int_response_code"] = 404; - response["keepalive"] = false; - response["content_type"] = "text/xml"; - response["str_response_string"] = ""; - } - else - { - m_log.ErrorFormat("[FreeSwitchVoice] HandleDirectoryRequest unknown Event-Calling-Function {0}",eventCallingFunction); - response["int_response_code"] = 404; - response["keepalive"] = false; - response["content_type"] = "text/xml"; - response["str_response_string"] = ""; - } - } - return response; - } - - private Hashtable HandleRegister(string Context, string Realm, Hashtable request) - { - m_log.Info("[FreeSwitchDirectory] HandleRegister called"); - - // TODO the password we return needs to match that sent in the request, this is hard coded for now - string password = "1234"; - string domain = (string) request["domain"]; - string user = (string) request["user"]; - - Hashtable response = new Hashtable(); - response["content_type"] = "text/xml"; - response["keepalive"] = false; - response["int_response_code"] = 200; - - response["str_response_string"] = String.Format( - "\r\n" + - "\r\n" + - "
\r\n" + - "\r\n" + - "\r\n" + - "\r\n" + - "\r\n" + - "\r\n" + - "\r\n" + - "\r\n" + - "\r\n" + - ""+ - "\r\n" + - "\r\n" + - "\r\n" + - "
\r\n" + - "
\r\n", - domain , user, password, Context); - - return response; - } - - private Hashtable HandleInvite(string Context, string Realm, Hashtable request) - { - m_log.Info("[FreeSwitchDirectory] HandleInvite called"); - - // TODO the password we return needs to match that sent in the request, this is hard coded for now - string password = "1234"; - string domain = (string) request["domain"]; - string user = (string) request["user"]; - string sipRequestUser = (string) request["sip_request_user"]; - - Hashtable response = new Hashtable(); - response["content_type"] = "text/xml"; - response["keepalive"] = false; - response["int_response_code"] = 200; - response["str_response_string"] = String.Format( - "\r\n" + - "\r\n" + - "
\r\n" + - "\r\n" + - "\r\n" + - "\r\n" + - "\r\n" + - "\r\n" + - "\r\n" + - "\r\n" + - "\r\n" + - ""+ - "\r\n" + - "\r\n" + - "\r\n" + - "\r\n" + - "\r\n" + - "\r\n" + - "\r\n" + - "\r\n" + - "\r\n" + - ""+ - "\r\n" + - "\r\n" + - "\r\n" + - "
\r\n" + - "
\r\n", - domain , user, password,sipRequestUser, Context); - - return response; - } - - private Hashtable HandleLocateUser(String Realm, Hashtable request) - { - m_log.Info("[FreeSwitchDirectory] HandleLocateUser called"); - - // TODO the password we return needs to match that sent in the request, this is hard coded for now - string domain = (string) request["domain"]; - string user = (string) request["user"]; - - Hashtable response = new Hashtable(); - response["content_type"] = "text/xml"; - response["keepalive"] = false; - response["int_response_code"] = 200; - response["str_response_string"] = String.Format( - "\r\n" + - "\r\n" + - "
\r\n" + - "\r\n" + - "\r\n" + - "\r\n" + - "\r\n" + - "\r\n" + - "\r\n"+ - "\r\n"+ - ""+ - "\r\n"+ - "\r\n" + - "\r\n" + - "
\r\n" + - "
\r\n", - domain , user); - - return response; - } - - private Hashtable HandleConfigSofia(string Context, string Realm, Hashtable request) - { - m_log.Info("[FreeSwitchDirectory] HandleConfigSofia called"); - - // TODO the password we return needs to match that sent in the request, this is hard coded for now - string domain = (string) request["domain"]; - - Hashtable response = new Hashtable(); - response["content_type"] = "text/xml"; - response["keepalive"] = false; - response["int_response_code"] = 200; - response["str_response_string"] = String.Format( - "\r\n" + - "\r\n" + - "
\r\n" + - "\r\n" + - "\r\n" + - "\r\n" + - "\r\n" + - "\r\n"+ - "\r\n"+ - "\r\n"+ - "\r\n"+ - "\r\n"+ - "\r\n"+ - "\r\n"+ - "\r\n"+ - "\r\n"+ - "\r\n"+ - "\r\n"+ - "\r\n"+ - "\r\n"+ - "\r\n"+ - "\r\n"+ - "\r\n"+ - "\r\n"+ - "\r\n"+ - "\r\n"+ - "\r\n"+ - "\r\n"+ - ""+ - "\r\n" + - "\r\n"+ - "\r\n"+ - "\r\n"+ - "\r\n" + - "
\r\n" + - "
\r\n", - domain, Context); - - return response; - } - - -// private Hashtable HandleLoadNetworkLists(Hashtable request) -// { -// m_log.Info("[FreeSwitchDirectory] HandleLoadNetworkLists called"); -// -// // TODO the password we return needs to match that sent in the request, this is hard coded for now -// string domain = (string) request["domain"]; -// -// Hashtable response = new Hashtable(); -// response["content_type"] = "text/xml"; -// response["keepalive"] = false; -// response["int_response_code"] = 200; -// response["str_response_string"] = String.Format( -// "\r\n" + -// "\r\n" + -// "
\r\n" + -// "\r\n" + -// "\r\n" + -// "\r\n" + -// "\r\n" + -// "\r\n" + -// "\r\n"+ -// "\r\n"+ -// "\r\n"+ -// "\r\n" + -// "
\r\n" + -// "
\r\n", -// domain); -// -// -// return response; -// } - } -} diff --git a/OpenSim/Region/OptionalModules/Avatar/Voice/FreeSwitchVoice/FreeSwitchVoiceModule.cs b/OpenSim/Region/OptionalModules/Avatar/Voice/FreeSwitchVoice/FreeSwitchVoiceModule.cs index 242bc3fdeb..a583ccaae5 100644 --- a/OpenSim/Region/OptionalModules/Avatar/Voice/FreeSwitchVoice/FreeSwitchVoiceModule.cs +++ b/OpenSim/Region/OptionalModules/Avatar/Voice/FreeSwitchVoice/FreeSwitchVoiceModule.cs @@ -37,10 +37,12 @@ using System.Collections; using System.Collections.Generic; using System.Reflection; using OpenMetaverse; +using OpenMetaverse.StructuredData; using log4net; using Nini.Config; using Nwc.XmlRpc; using OpenSim.Framework; +using Mono.Addins; using OpenSim.Framework.Capabilities; using OpenSim.Framework.Servers; @@ -49,28 +51,27 @@ using OpenSim.Region.Framework.Interfaces; using OpenSim.Region.Framework.Scenes; using Caps = OpenSim.Framework.Capabilities.Caps; using System.Text.RegularExpressions; +using OpenSim.Server.Base; +using OpenSim.Services.Interfaces; +using OSDMap = OpenMetaverse.StructuredData.OSDMap; namespace OpenSim.Region.OptionalModules.Avatar.Voice.FreeSwitchVoice { - public class FreeSwitchVoiceModule : IRegionModule, IVoiceModule + [Extension(Path = "/OpenSim/RegionModules", NodeName = "RegionModule", Id = "FreeSwitchVoiceModule")] + public class FreeSwitchVoiceModule : ISharedRegionModule, IVoiceModule { private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); - private bool UseProxy = false; - // Capability string prefixes private static readonly string m_parcelVoiceInfoRequestPath = "0007/"; private static readonly string m_provisionVoiceAccountRequestPath = "0008/"; private static readonly string m_chatSessionRequestPath = "0009/"; // Control info - private static bool m_WOF = true; - private static bool m_pluginEnabled = false; + private static bool m_Enabled = false; // FreeSwitch server is going to contact us and ask us all // sorts of things. - private static string m_freeSwitchServerUser; - private static string m_freeSwitchServerPass; // SLVoice client will do a GET on this prefix private static string m_freeSwitchAPIPrefix; @@ -84,143 +85,149 @@ namespace OpenSim.Region.OptionalModules.Avatar.Voice.FreeSwitchVoice private static string m_freeSwitchRealm; private static string m_freeSwitchSIPProxy; private static bool m_freeSwitchAttemptUseSTUN; - // private static string m_freeSwitchSTUNServer; private static string m_freeSwitchEchoServer; private static int m_freeSwitchEchoPort; private static string m_freeSwitchDefaultWellKnownIP; private static int m_freeSwitchDefaultTimeout; - // private static int m_freeSwitchSubscribeRetry; private static string m_freeSwitchUrlResetPassword; - // private static IPEndPoint m_FreeSwitchServiceIP; - private int m_freeSwitchServicePort; + private uint m_freeSwitchServicePort; private string m_openSimWellKnownHTTPAddress; private string m_freeSwitchContext; - private FreeSwitchDirectory m_FreeSwitchDirectory; - private FreeSwitchDialplan m_FreeSwitchDialplan; - private readonly Dictionary m_UUIDName = new Dictionary(); private Dictionary m_ParcelAddress = new Dictionary(); - private Scene m_scene; + private IConfig m_Config; + private IFreeswitchService m_FreeswitchService; - private IConfig m_config; - - public void Initialise(Scene scene, IConfigSource config) + public void Initialise(IConfigSource config) { - m_scene = scene; - m_config = config.Configs["FreeSwitchVoice"]; + m_Config = config.Configs["FreeSwitchVoice"]; - if (null == m_config) + if (m_Config == null) { m_log.Info("[FreeSwitchVoice] no config found, plugin disabled"); return; } - if (!m_config.GetBoolean("enabled", false)) + if (!m_Config.GetBoolean("Enabled", false)) { m_log.Info("[FreeSwitchVoice] plugin disabled by configuration"); return; } - // This is only done the FIRST time this method is invoked. - if (m_WOF) + try { - m_pluginEnabled = true; - m_WOF = false; + string serviceDll = m_Config.GetString("LocalServiceModule", + String.Empty); - try + if (serviceDll == String.Empty) { - m_freeSwitchServerUser = m_config.GetString("freeswitch_server_user", String.Empty); - m_freeSwitchServerPass = m_config.GetString("freeswitch_server_pass", String.Empty); - m_freeSwitchAPIPrefix = m_config.GetString("freeswitch_api_prefix", String.Empty); - - // XXX: get IP address of HTTP server. (This can be this OpenSim server or another, or could be a dedicated grid service or may live on the freeswitch server) - - string serviceIP = m_config.GetString("freeswitch_service_server", String.Empty); - int servicePort = m_config.GetInt("freeswitch_service_port", 80); - IPAddress serviceIPAddress = IPAddress.Parse(serviceIP); - // m_FreeSwitchServiceIP = new IPEndPoint(serviceIPAddress, servicePort); - m_freeSwitchServicePort = servicePort; - m_freeSwitchRealm = m_config.GetString("freeswitch_realm", String.Empty); - m_freeSwitchSIPProxy = m_config.GetString("freeswitch_sip_proxy", m_freeSwitchRealm); - m_freeSwitchAttemptUseSTUN = m_config.GetBoolean("freeswitch_attempt_stun", true); - // m_freeSwitchSTUNServer = m_config.GetString("freeswitch_stun_server", m_freeSwitchRealm); - m_freeSwitchEchoServer = m_config.GetString("freeswitch_echo_server", m_freeSwitchRealm); - m_freeSwitchEchoPort = m_config.GetInt("freeswitch_echo_port", 50505); - m_freeSwitchDefaultWellKnownIP = m_config.GetString("freeswitch_well_known_ip", m_freeSwitchRealm); - m_openSimWellKnownHTTPAddress = m_config.GetString("opensim_well_known_http_address", serviceIPAddress.ToString()); - m_freeSwitchDefaultTimeout = m_config.GetInt("freeswitch_default_timeout", 5000); - // m_freeSwitchSubscribeRetry = m_config.GetInt("freeswitch_subscribe_retry", 120); - m_freeSwitchUrlResetPassword = m_config.GetString("freeswitch_password_reset_url", String.Empty); - m_freeSwitchContext = m_config.GetString("freeswitch_context", "default"); - - if (String.IsNullOrEmpty(m_freeSwitchServerUser) || - String.IsNullOrEmpty(m_freeSwitchServerPass) || - String.IsNullOrEmpty(m_freeSwitchRealm) || - String.IsNullOrEmpty(m_freeSwitchAPIPrefix)) - { - m_log.Error("[FreeSwitchVoice] plugin mis-configured"); - m_log.Info("[FreeSwitchVoice] plugin disabled: incomplete configuration"); - return; - } - - // set up http request handlers for - // - prelogin: viv_get_prelogin.php - // - signin: viv_signin.php - // - buddies: viv_buddy.php - // - ???: viv_watcher.php - // - signout: viv_signout.php - if (UseProxy) - { - MainServer.Instance.AddHTTPHandler(String.Format("{0}/", m_freeSwitchAPIPrefix), - ForwardProxyRequest); - } - else - { - MainServer.Instance.AddHTTPHandler(String.Format("{0}/viv_get_prelogin.php", m_freeSwitchAPIPrefix), - FreeSwitchSLVoiceGetPreloginHTTPHandler); - - // RestStreamHandler h = new - // RestStreamHandler("GET", - // String.Format("{0}/viv_get_prelogin.php", m_freeSwitchAPIPrefix), FreeSwitchSLVoiceGetPreloginHTTPHandler); - // MainServer.Instance.AddStreamHandler(h); - - - - MainServer.Instance.AddHTTPHandler(String.Format("{0}/viv_signin.php", m_freeSwitchAPIPrefix), - FreeSwitchSLVoiceSigninHTTPHandler); - - // set up http request handlers to provide - // on-demand FreeSwitch configuration to - // FreeSwitch's mod_curl_xml - MainServer.Instance.AddHTTPHandler(String.Format("{0}/freeswitch-config", m_freeSwitchAPIPrefix), - FreeSwitchConfigHTTPHandler); - - MainServer.Instance.AddHTTPHandler(String.Format("{0}/viv_buddy.php", m_freeSwitchAPIPrefix), - FreeSwitchSLVoiceBuddyHTTPHandler); - } - - m_log.InfoFormat("[FreeSwitchVoice] using FreeSwitch server {0}", m_freeSwitchRealm); - - m_FreeSwitchDirectory = new FreeSwitchDirectory(); - m_FreeSwitchDialplan = new FreeSwitchDialplan(); - - m_pluginEnabled = true; - m_WOF = false; - - m_log.Info("[FreeSwitchVoice] plugin enabled"); - } - catch (Exception e) - { - m_log.ErrorFormat("[FreeSwitchVoice] plugin initialization failed: {0}", e.Message); - m_log.DebugFormat("[FreeSwitchVoice] plugin initialization failed: {0}", e.ToString()); + m_log.Error("[FreeSwitchVoice]: No LocalServiceModule named in section FreeSwitchVoice"); return; } + + Object[] args = new Object[] { config }; + m_FreeswitchService = ServerUtils.LoadPlugin(serviceDll, args); + + string jsonConfig = m_FreeswitchService.GetJsonConfig(); + m_log.Debug("[FreeSwitchVoice]: Configuration string: " + jsonConfig); + OSDMap map = (OSDMap)OSDParser.DeserializeJson(jsonConfig); + + m_freeSwitchAPIPrefix = map["APIPrefix"].AsString(); + m_freeSwitchRealm = map["Realm"].AsString(); + m_freeSwitchSIPProxy = map["SIPProxy"].AsString(); + m_freeSwitchAttemptUseSTUN = map["AttemptUseSTUN"].AsBoolean(); + m_freeSwitchEchoServer = map["EchoServer"].AsString(); + m_freeSwitchEchoPort = map["EchoPort"].AsInteger(); + m_freeSwitchDefaultWellKnownIP = map["DefaultWellKnownIP"].AsString(); + m_freeSwitchDefaultTimeout = map["DefaultTimeout"].AsInteger(); + m_freeSwitchUrlResetPassword = String.Empty; + m_freeSwitchContext = map["Context"].AsString(); + + if (String.IsNullOrEmpty(m_freeSwitchRealm) || + String.IsNullOrEmpty(m_freeSwitchAPIPrefix)) + { + m_log.Error("[FreeSwitchVoice] plugin mis-configured"); + m_log.Info("[FreeSwitchVoice] plugin disabled: incomplete configuration"); + return; + } + + // set up http request handlers for + // - prelogin: viv_get_prelogin.php + // - signin: viv_signin.php + // - buddies: viv_buddy.php + // - ???: viv_watcher.php + // - signout: viv_signout.php + MainServer.Instance.AddHTTPHandler(String.Format("{0}/viv_get_prelogin.php", m_freeSwitchAPIPrefix), + FreeSwitchSLVoiceGetPreloginHTTPHandler); + + MainServer.Instance.AddHTTPHandler(String.Format("{0}/freeswitch-config", m_freeSwitchAPIPrefix), FreeSwitchConfigHTTPHandler); + + // RestStreamHandler h = new + // RestStreamHandler("GET", + // String.Format("{0}/viv_get_prelogin.php", m_freeSwitchAPIPrefix), FreeSwitchSLVoiceGetPreloginHTTPHandler); + // MainServer.Instance.AddStreamHandler(h); + + + + MainServer.Instance.AddHTTPHandler(String.Format("{0}/viv_signin.php", m_freeSwitchAPIPrefix), + FreeSwitchSLVoiceSigninHTTPHandler); + + MainServer.Instance.AddHTTPHandler(String.Format("{0}/viv_buddy.php", m_freeSwitchAPIPrefix), + FreeSwitchSLVoiceBuddyHTTPHandler); + + m_log.InfoFormat("[FreeSwitchVoice] using FreeSwitch server {0}", m_freeSwitchRealm); + + m_Enabled = true; + + m_log.Info("[FreeSwitchVoice] plugin enabled"); + } + catch (Exception e) + { + m_log.ErrorFormat("[FreeSwitchVoice] plugin initialization failed: {0}", e.Message); + m_log.DebugFormat("[FreeSwitchVoice] plugin initialization failed: {0}", e.ToString()); + return; } - if (m_pluginEnabled) + // This here is a region module trying to make a global setting. + // Not really a good idea but it's Windows only, so I can't test. + try + { + ServicePointManager.ServerCertificateValidationCallback += CustomCertificateValidation; + } + catch (NotImplementedException) + { + try + { +#pragma warning disable 0612, 0618 + // Mono does not implement the ServicePointManager.ServerCertificateValidationCallback yet! Don't remove this! + ServicePointManager.CertificatePolicy = new MonoCert(); +#pragma warning restore 0612, 0618 + } + catch (Exception) + { + // COmmented multiline spam log message + //m_log.Error("[FreeSwitchVoice]: Certificate validation handler change not supported. You may get ssl certificate validation errors teleporting from your region to some SSL regions."); + } + } + } + + public void PostInitialise() + { + } + + public void AddRegion(Scene scene) + { + // We generate these like this: The region's external host name + // as defined in Regions.ini is a good address to use. It's a + // dotted quad (or should be!) and it can reach this host from + // a client. The port is grabbed from the region's HTTP server. + m_openSimWellKnownHTTPAddress = scene.RegionInfo.ExternalHostName; + m_freeSwitchServicePort = MainServer.Instance.Port; + + if (m_Enabled) { // we need to capture scene in an anonymous method // here as we need it later in the callbacks @@ -228,36 +235,21 @@ namespace OpenSim.Region.OptionalModules.Avatar.Voice.FreeSwitchVoice { OnRegisterCaps(scene, agentID, caps); }; - - try - { - ServicePointManager.ServerCertificateValidationCallback += CustomCertificateValidation; - } - catch (NotImplementedException) - { - try - { -#pragma warning disable 0612, 0618 - // Mono does not implement the ServicePointManager.ServerCertificateValidationCallback yet! Don't remove this! - ServicePointManager.CertificatePolicy = new MonoCert(); -#pragma warning restore 0612, 0618 - } - catch (Exception) - { - m_log.Error("[FreeSwitchVoice]: Certificate validation handler change not supported. You may get ssl certificate validation errors teleporting from your region to some SSL regions."); - } - } } } - public void PostInitialise() + public void RemoveRegion(Scene scene) { - if (m_pluginEnabled) + } + + public void RegionLoaded(Scene scene) + { + if (m_Enabled) { m_log.Info("[FreeSwitchVoice] registering IVoiceModule with the scene"); // register the voice interface for this module, so the script engine can call us - m_scene.RegisterModuleInterface(this); + scene.RegisterModuleInterface(this); } } @@ -270,9 +262,9 @@ namespace OpenSim.Region.OptionalModules.Avatar.Voice.FreeSwitchVoice get { return "FreeSwitchVoiceModule"; } } - public bool IsSharedModule + public Type ReplaceableInterface { - get { return true; } + get { return null; } } // @@ -611,7 +603,7 @@ namespace OpenSim.Region.OptionalModules.Avatar.Voice.FreeSwitchVoice response["str_response_string"] = string.Empty; response["content-type"] = "text/xml"; - Hashtable requestBody = parseRequestBody((string)request["body"]); + Hashtable requestBody = ParseRequestBody((string)request["body"]); if (!requestBody.ContainsKey("auth_token")) return response; @@ -683,7 +675,7 @@ namespace OpenSim.Region.OptionalModules.Avatar.Voice.FreeSwitchVoice string uri = (string)request["uri"]; string contenttype = (string)request["content-type"]; - Hashtable requestBody = parseRequestBody((string)request["body"]); + Hashtable requestBody = ParseRequestBody((string)request["body"]); //string pwd = (string) requestBody["pwd"]; string userid = (string) requestBody["userid"]; @@ -725,49 +717,9 @@ namespace OpenSim.Region.OptionalModules.Avatar.Voice.FreeSwitchVoice response["int_response_code"] = 200; return response; - /* - - OKOklib_session - * xMj1QJSc7TA-G7XqcW6QXAg==:1290551700:050d35c6fef96f132f780d8039ff7592:: - * xMj1QJSc7TA-G7XqcW6QXAg==:1290551700:050d35c6fef96f132f780d8039ff7592:: - * 1 - * 7449 - * Teravus Ousley - */ } - public Hashtable FreeSwitchConfigHTTPHandler(Hashtable request) - { - m_log.DebugFormat("[FreeSwitchVoice] FreeSwitchConfigHTTPHandler called with {0}", (string)request["body"]); - - Hashtable response = new Hashtable(); - response["str_response_string"] = string.Empty; - // all the params come as NVPs in the request body - Hashtable requestBody = parseRequestBody((string) request["body"]); - - // is this a dialplan or directory request - string section = (string) requestBody["section"]; - - if (section == "directory") - response = m_FreeSwitchDirectory.HandleDirectoryRequest(m_freeSwitchContext, m_freeSwitchRealm, requestBody); - else if (section == "dialplan") - response = m_FreeSwitchDialplan.HandleDialplanRequest(m_freeSwitchContext, m_freeSwitchRealm, requestBody); - else - m_log.WarnFormat("[FreeSwitchVoice]: section was {0}", section); - - // XXX: re-generate dialplan: - // - conf == region UUID - // - conf number = region port - // -> TODO Initialise(): keep track of regions via events - // re-generate accounts for all avatars - // -> TODO Initialise(): keep track of avatars via events - Regex normalizeEndLines = new Regex(@"\r\n", RegexOptions.Compiled | RegexOptions.Singleline | RegexOptions.Multiline); - - m_log.DebugFormat("[FreeSwitchVoice] FreeSwitchConfigHTTPHandler return {0}",normalizeEndLines.Replace(((string)response["str_response_string"]), "")); - return response; - } - - public Hashtable parseRequestBody(string body) + public Hashtable ParseRequestBody(string body) { Hashtable bodyParams = new Hashtable(); // split string @@ -840,6 +792,28 @@ namespace OpenSim.Region.OptionalModules.Avatar.Voice.FreeSwitchVoice { return true; } + + public Hashtable FreeSwitchConfigHTTPHandler(Hashtable request) + { + Hashtable response = new Hashtable(); + response["str_response_string"] = string.Empty; + response["content_type"] = "text/plain"; + response["keepalive"] = false; + response["int_response_code"] = 500; + + Hashtable requestBody = ParseRequestBody((string) request["body"]); + + string section = (string) requestBody["section"]; + + if (section == "directory") + response = m_FreeswitchService.HandleDirectoryRequest(requestBody); + else if (section == "dialplan") + response = m_FreeswitchService.HandleDialplanRequest(requestBody); + else + m_log.WarnFormat("[FreeSwitchVoice]: section was {0}", section); + + return response; + } } public class MonoCert : ICertificatePolicy diff --git a/OpenSim/Region/OptionalModules/Avatar/XmlRpcGroups/GroupsMessagingModule.cs b/OpenSim/Region/OptionalModules/Avatar/XmlRpcGroups/GroupsMessagingModule.cs index 185d44de80..3d34441a90 100644 --- a/OpenSim/Region/OptionalModules/Avatar/XmlRpcGroups/GroupsMessagingModule.cs +++ b/OpenSim/Region/OptionalModules/Avatar/XmlRpcGroups/GroupsMessagingModule.cs @@ -212,11 +212,14 @@ namespace OpenSim.Region.OptionalModules.Avatar.XmlRpcGroups public void SendMessageToGroup(GridInstantMessage im, UUID groupID) { + List groupMembers = m_groupData.GetGroupMembers(new UUID(im.fromAgentID), groupID); + if (m_debugEnabled) - m_log.DebugFormat("[GROUPS-MESSAGING]: {0} called", System.Reflection.MethodBase.GetCurrentMethod().Name); - - - foreach (GroupMembersData member in m_groupData.GetGroupMembers(UUID.Zero, groupID)) + m_log.DebugFormat( + "[GROUPS-MESSAGING]: SendMessageToGroup called for group {0} with {1} visible members", + groupID, groupMembers.Count); + + foreach (GroupMembersData member in groupMembers) { if (m_groupData.hasAgentDroppedGroupChatSession(member.AgentID, groupID)) { @@ -264,8 +267,6 @@ namespace OpenSim.Region.OptionalModules.Avatar.XmlRpcGroups void OnClientLogin(IClientAPI client) { if (m_debugEnabled) m_log.DebugFormat("[GROUPS-MESSAGING]: OnInstantMessage registered for {0}", client.Name); - - } private void OnNewClient(IClientAPI client) diff --git a/OpenSim/Region/OptionalModules/Avatar/XmlRpcGroups/GroupsModule.cs b/OpenSim/Region/OptionalModules/Avatar/XmlRpcGroups/GroupsModule.cs index 3f15b69944..0c8113e604 100644 --- a/OpenSim/Region/OptionalModules/Avatar/XmlRpcGroups/GroupsModule.cs +++ b/OpenSim/Region/OptionalModules/Avatar/XmlRpcGroups/GroupsModule.cs @@ -599,7 +599,10 @@ namespace OpenSim.Region.OptionalModules.Avatar.XmlRpcGroups public List GroupMembersRequest(IClientAPI remoteClient, UUID groupID) { - if (m_debugEnabled) m_log.DebugFormat("[GROUPS]: {0} called", System.Reflection.MethodBase.GetCurrentMethod().Name); + if (m_debugEnabled) + m_log.DebugFormat( + "[GROUPS]: GroupMembersRequest called for {0} from client {1}", groupID, remoteClient.Name); + List data = m_groupData.GetGroupMembers(GetRequestingAgentID(remoteClient), groupID); if (m_debugEnabled) @@ -962,7 +965,7 @@ namespace OpenSim.Region.OptionalModules.Avatar.XmlRpcGroups if ((groupInfo == null) || (account == null)) { return; - } + } // Send Message to Ejectee GridInstantMessage msg = new GridInstantMessage(); @@ -1129,7 +1132,7 @@ namespace OpenSim.Region.OptionalModules.Avatar.XmlRpcGroups OSDMap NewGroupDataMap = new OSDMap(1); GroupDataMap.Add("GroupID", OSD.FromUUID(membership.GroupID)); - GroupDataMap.Add("GroupPowers", OSD.FromBinary(membership.GroupPowers)); + GroupDataMap.Add("GroupPowers", OSD.FromULong(membership.GroupPowers)); GroupDataMap.Add("AcceptNotices", OSD.FromBoolean(membership.AcceptNotices)); GroupDataMap.Add("GroupInsigniaID", OSD.FromUUID(membership.GroupPicture)); GroupDataMap.Add("Contribution", OSD.FromInteger(membership.Contribution)); diff --git a/OpenSim/Region/OptionalModules/Avatar/XmlRpcGroups/SimianGroupsServicesConnectorModule.cs b/OpenSim/Region/OptionalModules/Avatar/XmlRpcGroups/SimianGroupsServicesConnectorModule.cs index 9363205263..0d265f2501 100644 --- a/OpenSim/Region/OptionalModules/Avatar/XmlRpcGroups/SimianGroupsServicesConnectorModule.cs +++ b/OpenSim/Region/OptionalModules/Avatar/XmlRpcGroups/SimianGroupsServicesConnectorModule.cs @@ -91,11 +91,11 @@ using OpenSim.Services.Interfaces; * + RoleID * * GroupID -> GroupNotice -> NoticeID - * + TimeStamp [uint] - * + FromName [string] - * + Subject [string] - * + Message [string] - * + BinaryBucket [byte[]] + * + TimeStamp [uint] + * + FromName [string] + * + Subject [string] + * + Message [string] + * + BinaryBucket [byte[]] * * */ @@ -309,7 +309,7 @@ namespace OpenSim.Region.OptionalModules.Avatar.XmlRpcGroups GroupInfoMap["OwnerRoleID"] = OSD.FromUUID(OwnerRoleID); GroupInfoMap["OwnersPowers"] = OSD.FromULong((ulong)m_DefaultOwnerPowers); - if(SimianAddGeneric(GroupID, "Group", name, GroupInfoMap)) + if (SimianAddGeneric(GroupID, "Group", name, GroupInfoMap)) { AddGroupRole(requestingAgentID, GroupID, UUID.Zero, "Everyone", "Members of " + name, "Member of " + name, (ulong)m_DefaultEveryonePowers); AddGroupRole(requestingAgentID, GroupID, OwnerRoleID, "Owners", "Owners of " + name, "Owner of " + name, (ulong)m_DefaultOwnerPowers); @@ -334,7 +334,7 @@ namespace OpenSim.Region.OptionalModules.Avatar.XmlRpcGroups string GroupName; OSDMap GroupInfoMap; - if( SimianGetFirstGenericEntry(groupID, "GroupInfo", out GroupName, out GroupInfoMap) ) + if (SimianGetFirstGenericEntry(groupID, "GroupInfo", out GroupName, out GroupInfoMap)) { GroupInfoMap["Charter"] = OSD.FromString(charter); GroupInfoMap["ShowInList"] = OSD.FromBoolean(showInList); @@ -379,7 +379,7 @@ namespace OpenSim.Region.OptionalModules.Avatar.XmlRpcGroups string GroupRoleMemberType = "GroupRole" + groupID.ToString(); if (SimianGetGenericEntries(GroupRoleMemberType, roleID.ToString(), out GroupRoleMembers)) { - foreach(UUID UserID in GroupRoleMembers.Keys) + foreach (UUID UserID in GroupRoleMembers.Keys) { EnsureRoleNotSelectedByMember(groupID, roleID, UserID); @@ -724,7 +724,7 @@ namespace OpenSim.Region.OptionalModules.Avatar.XmlRpcGroups } OSDMap UserGroupMemberInfo; - if( SimianGetGenericEntry(agentID, "GroupMember", groupID.ToString(), out UserGroupMemberInfo) ) + if (SimianGetGenericEntry(agentID, "GroupMember", groupID.ToString(), out UserGroupMemberInfo)) { data.AcceptNotices = UserGroupMemberInfo["AcceptNotices"].AsBoolean(); data.Contribution = UserGroupMemberInfo["Contribution"].AsInteger(); @@ -736,7 +736,7 @@ namespace OpenSim.Region.OptionalModules.Avatar.XmlRpcGroups // OSDMap GroupRoleInfo; - if( SimianGetGenericEntry(groupID, "GroupRole", data.ActiveRole.ToString(), out GroupRoleInfo) ) + if (SimianGetGenericEntry(groupID, "GroupRole", data.ActiveRole.ToString(), out GroupRoleInfo)) { data.GroupTitle = GroupRoleInfo["Title"].AsString(); data.GroupPowers = GroupRoleInfo["Powers"].AsULong(); @@ -748,7 +748,7 @@ namespace OpenSim.Region.OptionalModules.Avatar.XmlRpcGroups // OSDMap GroupInfo; string GroupName; - if( SimianGetFirstGenericEntry(groupID, "Group", out GroupName, out GroupInfo) ) + if (SimianGetFirstGenericEntry(groupID, "Group", out GroupName, out GroupInfo)) { data.GroupID = groupID; data.AllowPublish = GroupInfo["AllowPublish"].AsBoolean(); @@ -928,12 +928,12 @@ namespace OpenSim.Region.OptionalModules.Avatar.XmlRpcGroups Dictionary GroupRoles; if (SimianGetGenericEntries(groupID, "GroupRole", out GroupRoles)) { - foreach( KeyValuePair Role in GroupRoles ) + foreach (KeyValuePair Role in GroupRoles) { Dictionary GroupRoleMembers; - if( SimianGetGenericEntries("GroupRole"+groupID.ToString(), Role.Key, out GroupRoleMembers) ) + if (SimianGetGenericEntries("GroupRole"+groupID.ToString(), Role.Key, out GroupRoleMembers)) { - foreach( KeyValuePair GroupRoleMember in GroupRoleMembers ) + foreach (KeyValuePair GroupRoleMember in GroupRoleMembers) { GroupRoleMembersData data = new GroupRoleMembersData(); @@ -1264,7 +1264,7 @@ namespace OpenSim.Region.OptionalModules.Avatar.XmlRpcGroups if (m_debugEnabled) m_log.InfoFormat("[SIMIAN-GROUPS-CONNECTOR] Generics Result {0}", entryMap["Value"].AsString()); maps.Add(entryMap["Key"].AsString(), (OSDMap)OSDParser.DeserializeJson(entryMap["Value"].AsString())); } - if(maps.Count == 0) + if (maps.Count == 0) { if (m_debugEnabled) m_log.InfoFormat("[SIMIAN-GROUPS-CONNECTOR] No Generics Results"); } @@ -1352,17 +1352,14 @@ namespace OpenSim.Region.OptionalModules.Avatar.XmlRpcGroups } // Check if this is an update or a request - if ( requestArgs["RequestMethod"] == "RemoveGeneric" - || requestArgs["RequestMethod"] == "AddGeneric" - ) - + if (requestArgs["RequestMethod"] == "RemoveGeneric" + || requestArgs["RequestMethod"] == "AddGeneric") { // Any and all updates cause the cache to clear m_memoryCache.Clear(); // Send update to server, return the response without caching it return WebUtil.PostToService(m_groupsServerURI, requestArgs); - } // If we're not doing an update, we must be requesting data @@ -1372,7 +1369,7 @@ namespace OpenSim.Region.OptionalModules.Avatar.XmlRpcGroups OSDMap response = null; if (!m_memoryCache.TryGetValue(CacheKey, out response)) { - // if it wasn't in the cache, pass the request to the Simian Grid Services + // if it wasn't in the cache, pass the request to the Simian Grid Services response = WebUtil.PostToService(m_groupsServerURI, requestArgs); // and cache the response diff --git a/OpenSim/Region/OptionalModules/Avatar/XmlRpcGroups/XmlRpcGroupsServicesConnectorModule.cs b/OpenSim/Region/OptionalModules/Avatar/XmlRpcGroups/XmlRpcGroupsServicesConnectorModule.cs index 79b9a167d0..2631ac10d3 100644 --- a/OpenSim/Region/OptionalModules/Avatar/XmlRpcGroups/XmlRpcGroupsServicesConnectorModule.cs +++ b/OpenSim/Region/OptionalModules/Avatar/XmlRpcGroups/XmlRpcGroupsServicesConnectorModule.cs @@ -641,11 +641,8 @@ namespace OpenSim.Region.OptionalModules.Avatar.XmlRpcGroups } return Roles; - } - - public List GetGroupMembers(UUID requestingAgentID, UUID GroupID) { Hashtable param = new Hashtable(); @@ -957,30 +954,26 @@ namespace OpenSim.Region.OptionalModules.Avatar.XmlRpcGroups CacheKey = sb.ToString(); m_memoryCache.TryGetValue(CacheKey, out resp); } - } - if( resp == null ) + if (resp == null) { string UserService; UUID SessionID; GetClientGroupRequestID(requestingAgentID, out UserService, out SessionID); - param.Add("requestingAgentID", requestingAgentID.ToString()); + + param.Add("RequestingAgentID", requestingAgentID.ToString()); param.Add("RequestingAgentUserService", UserService); param.Add("RequestingSessionID", SessionID.ToString()); - - param.Add("ReadKey", m_groupReadKey); param.Add("WriteKey", m_groupWriteKey); - IList parameters = new ArrayList(); parameters.Add(param); ConfigurableKeepAliveXmlRpcRequest req; req = new ConfigurableKeepAliveXmlRpcRequest(function, parameters, m_disableKeepAlive); - try { resp = req.Send(m_groupsServerURI, 10000); @@ -989,12 +982,14 @@ namespace OpenSim.Region.OptionalModules.Avatar.XmlRpcGroups { m_memoryCache.AddOrUpdate(CacheKey, resp, TimeSpan.FromSeconds(m_cacheTimeout)); } - } catch (Exception e) { - m_log.ErrorFormat("[XMLRPC-GROUPS-CONNECTOR]: An error has occured while attempting to access the XmlRpcGroups server method: {0}", function); - m_log.ErrorFormat("[XMLRPC-GROUPS-CONNECTOR]: {0} ", e.ToString()); + m_log.ErrorFormat( + "[XMLRPC-GROUPS-CONNECTOR]: An error has occured while attempting to access the XmlRpcGroups server method {0} at {1}", + function, m_groupsServerURI); + + m_log.ErrorFormat("[XMLRPC-GROUPS-CONNECTOR]: {0}{1}", e.Message, e.StackTrace); foreach (string ResponseLine in req.RequestResponse.Split(new string[] { Environment.NewLine }, StringSplitOptions.None)) { @@ -1058,14 +1053,12 @@ namespace OpenSim.Region.OptionalModules.Avatar.XmlRpcGroups { m_log.ErrorFormat("[XMLRPC-GROUPS-CONNECTOR]: {0}", line); } - } } - /// /// Group Request Tokens are an attempt to allow the groups service to authenticate - /// requests. + /// requests. /// TODO: This broke after the big grid refactor, either find a better way, or discard this /// /// diff --git a/OpenSim/Region/OptionalModules/ContentManagementSystem/CMEntityCollection.cs b/OpenSim/Region/OptionalModules/ContentManagementSystem/CMEntityCollection.cs index 56656fc8b8..7f64ebdbf7 100644 --- a/OpenSim/Region/OptionalModules/ContentManagementSystem/CMEntityCollection.cs +++ b/OpenSim/Region/OptionalModules/ContentManagementSystem/CMEntityCollection.cs @@ -111,7 +111,7 @@ namespace OpenSim.Region.OptionalModules.ContentManagement } // Check if there are SceneObjectGroups in the list that do not have corresponding ContentManagementGroups in the CMEntityHash - public System.Collections.ArrayList CheckForMissingEntities(System.Collections.Generic.List currList) + public System.Collections.ArrayList CheckForMissingEntities(EntityBase[] currList) { System.Collections.ArrayList missingList = new System.Collections.ArrayList(); SceneObjectGroup temp = null; @@ -123,13 +123,13 @@ namespace OpenSim.Region.OptionalModules.ContentManagement if (m_CMEntityHash.ContainsKey(temp.UUID)) { - foreach (SceneObjectPart part in temp.Children.Values) + foreach (SceneObjectPart part in temp.Parts) if (!((ContentManagementEntity)m_CMEntityHash[temp.UUID]).HasChildPrim(part.UUID)) missingList.Add(part); } else //Entire group is missing from revision. (and is a new part in region) { - foreach (SceneObjectPart part in temp.Children.Values) + foreach (SceneObjectPart part in temp.Parts) missingList.Add(part); } } diff --git a/OpenSim/Region/OptionalModules/ContentManagementSystem/CMModel.cs b/OpenSim/Region/OptionalModules/ContentManagementSystem/CMModel.cs index 0dc78c0d41..3a6996ef9b 100644 --- a/OpenSim/Region/OptionalModules/ContentManagementSystem/CMModel.cs +++ b/OpenSim/Region/OptionalModules/ContentManagementSystem/CMModel.cs @@ -1,4 +1,4 @@ -/* +/* * Copyright (c) Contributors, http://opensimulator.org/ * See CONTRIBUTORS.TXT for a full list of copyright holders. * @@ -167,9 +167,12 @@ namespace OpenSim.Region.OptionalModules.ContentManagement public void RemoveOrUpdateDeletedEntity(SceneObjectGroup group) { // Deal with new parts not revisioned that have been deleted. - foreach (SceneObjectPart part in group.Children.Values) - if (m_MetaEntityCollection.Auras.ContainsKey(part.UUID)) - m_MetaEntityCollection.RemoveNewlyCreatedEntityAura(part.UUID); + SceneObjectPart[] parts = group.Parts; + for (int i = 0; i < parts.Length; i++) + { + if (m_MetaEntityCollection.Auras.ContainsKey(parts[i].UUID)) + m_MetaEntityCollection.RemoveNewlyCreatedEntityAura(parts[i].UUID); + } } /// @@ -207,8 +210,11 @@ namespace OpenSim.Region.OptionalModules.ContentManagement { temp = SceneObjectSerializer.FromXml2Format(xml); temp.SetScene(scene); - foreach (SceneObjectPart part in temp.Children.Values) - part.RegionHandle = scene.RegionInfo.RegionHandle; + + SceneObjectPart[] parts = temp.Parts; + for (int i = 0; i < parts.Length; i++) + parts[i].RegionHandle = scene.RegionInfo.RegionHandle; + ReplacementList.Add(temp.UUID, (EntityBase)temp); } catch (Exception e) @@ -255,7 +261,7 @@ namespace OpenSim.Region.OptionalModules.ContentManagement scene.PhysicsScene.RemovePrim(((SceneObjectGroup)scene.Entities[uuid]).RootPart.PhysActor); scene.SendKillObject(scene.Entities[uuid].LocalId); scene.SceneGraph.DeleteSceneObject(uuid, false); - ((SceneObjectGroup)scene.Entities[uuid]).DeleteGroup(false); + ((SceneObjectGroup)scene.Entities[uuid]).DeleteGroupFromScene(false); } catch(Exception e) { @@ -292,7 +298,7 @@ namespace OpenSim.Region.OptionalModules.ContentManagement } } m_log.Info("[CMMODEL]: Scheduling a backup of new scene object groups to backup."); - scene.Backup(); + scene.Backup(true); } /// @@ -338,15 +344,19 @@ namespace OpenSim.Region.OptionalModules.ContentManagement System.Collections.ArrayList auraList = new System.Collections.ArrayList(); if (group == null) return null; - foreach (SceneObjectPart part in group.Children.Values) + + SceneObjectPart[] parts = group.Parts; + for (int i = 0; i < parts.Length; i++) { + SceneObjectPart part = parts[i]; if (m_MetaEntityCollection.Auras.ContainsKey(part.UUID)) { - ((AuraMetaEntity)m_MetaEntityCollection.Auras[part.UUID]).SetAura(new Vector3(0,254,0), part.Scale); + ((AuraMetaEntity)m_MetaEntityCollection.Auras[part.UUID]).SetAura(new Vector3(0, 254, 0), part.Scale); ((AuraMetaEntity)m_MetaEntityCollection.Auras[part.UUID]).RootPart.GroupPosition = part.GetWorldPosition(); auraList.Add((AuraMetaEntity)m_MetaEntityCollection.Auras[part.UUID]); } } + return auraList; } diff --git a/OpenSim/Region/OptionalModules/ContentManagementSystem/CMView.cs b/OpenSim/Region/OptionalModules/ContentManagementSystem/CMView.cs index 46fbd394dd..3807ccda47 100644 --- a/OpenSim/Region/OptionalModules/ContentManagementSystem/CMView.cs +++ b/OpenSim/Region/OptionalModules/ContentManagementSystem/CMView.cs @@ -186,7 +186,7 @@ namespace OpenSim.Region.OptionalModules.ContentManagement ((ContentManagementEntity)m_model.MetaEntityCollection.Entities[group.UUID]).SendFullDiffUpdateToAll(); // Deal with new parts not revisioned that have been deleted. - foreach (SceneObjectPart part in group.Children.Values) + foreach (SceneObjectPart part in group.Parts) if (m_model.MetaEntityCollection.Auras.ContainsKey(part.UUID)) ((AuraMetaEntity)m_model.MetaEntityCollection.Auras[part.UUID]).HideFromAll(); } diff --git a/OpenSim/Region/OptionalModules/ContentManagementSystem/ContentManagementEntity.cs b/OpenSim/Region/OptionalModules/ContentManagementSystem/ContentManagementEntity.cs index ada67011b3..0248f368f2 100644 --- a/OpenSim/Region/OptionalModules/ContentManagementSystem/ContentManagementEntity.cs +++ b/OpenSim/Region/OptionalModules/ContentManagementSystem/ContentManagementEntity.cs @@ -1,4 +1,4 @@ -/* +/* * Copyright (c) Contributors, http://opensimulator.org/ * See CONTRIBUTORS.TXT for a full list of copyright holders. * @@ -127,12 +127,12 @@ namespace OpenSim.Region.OptionalModules.ContentManagement /// public void FindDifferences() { - System.Collections.Generic.List sceneEntityList = m_Entity.Scene.GetEntities(); + List sceneEntityList = new List(m_Entity.Scene.GetEntities()); DiffersFromSceneGroup = false; // if group is not contained in scene's list if (!ContainsKey(sceneEntityList, m_UnchangedEntity.UUID)) { - foreach (SceneObjectPart part in m_UnchangedEntity.Children.Values) + foreach (SceneObjectPart part in m_UnchangedEntity.Parts) { // if scene list no longer contains this part, display translucent part and mark with red aura if (!ContainsKey(sceneEntityList, part.UUID)) @@ -140,14 +140,14 @@ namespace OpenSim.Region.OptionalModules.ContentManagement // if already displaying a red aura over part, make sure its red if (m_AuraEntities.ContainsKey(part.UUID)) { - m_AuraEntities[part.UUID].SetAura(new Vector3(254,0,0), part.Scale); + m_AuraEntities[part.UUID].SetAura(new Vector3(254, 0, 0), part.Scale); } else { AuraMetaEntity auraGroup = new AuraMetaEntity(m_Entity.Scene, part.GetWorldPosition(), MetaEntity.TRANSLUCENT, - new Vector3(254,0,0), + new Vector3(254, 0, 0), part.Scale ); m_AuraEntities.Add(part.UUID, auraGroup); @@ -180,9 +180,7 @@ namespace OpenSim.Region.OptionalModules.ContentManagement /// public bool HasChildPrim(UUID uuid) { - if (m_UnchangedEntity.Children.ContainsKey(uuid)) - return true; - return false; + return m_UnchangedEntity.ContainsPart(uuid); } /// @@ -190,9 +188,10 @@ namespace OpenSim.Region.OptionalModules.ContentManagement /// public bool HasChildPrim(uint localID) { - foreach (SceneObjectPart part in m_UnchangedEntity.Children.Values) + foreach (SceneObjectPart part in m_UnchangedEntity.Parts) if (part.LocalId == localID) return true; + return false; } @@ -228,20 +227,20 @@ namespace OpenSim.Region.OptionalModules.ContentManagement // Use "UnchangedEntity" to do comparisons because its text, transparency, and other attributes will be just as the user // had originally saved. // m_Entity will NOT necessarily be the same entity as the user had saved. - foreach (SceneObjectPart UnchangedPart in m_UnchangedEntity.Children.Values) + foreach (SceneObjectPart UnchangedPart in m_UnchangedEntity.Parts) { //This is the part that we use to show changes. metaEntityPart = m_Entity.GetLinkNumPart(UnchangedPart.LinkNum); - if (sceneEntityGroup.Children.ContainsKey(UnchangedPart.UUID)) + if (sceneEntityGroup.ContainsPart(UnchangedPart.UUID)) { - sceneEntityPart = sceneEntityGroup.Children[UnchangedPart.UUID]; - differences = Difference.FindDifferences(UnchangedPart, sceneEntityPart); + sceneEntityPart = sceneEntityGroup.GetChildPart(UnchangedPart.UUID); + differences = Difference.FindDifferences(UnchangedPart, sceneEntityPart); if (differences != Diff.NONE) metaEntityPart.Text = "CHANGE: " + differences.ToString(); if (differences != 0) { // Root Part that has been modified - if ((differences&Diff.POSITION) > 0) + if ((differences & Diff.POSITION) > 0) { // If the position of any part has changed, make sure the RootPart of the // meta entity is pointing with a beam particle system @@ -254,7 +253,7 @@ namespace OpenSim.Region.OptionalModules.ContentManagement m_UnchangedEntity.RootPart.GetWorldPosition(), MetaEntity.TRANSLUCENT, sceneEntityPart, - new Vector3(0,0,254) + new Vector3(0, 0, 254) ); m_BeamEntities.Add(m_UnchangedEntity.RootPart.UUID, beamGroup); } @@ -267,7 +266,7 @@ namespace OpenSim.Region.OptionalModules.ContentManagement AuraMetaEntity auraGroup = new AuraMetaEntity(m_Entity.Scene, UnchangedPart.GetWorldPosition(), MetaEntity.TRANSLUCENT, - new Vector3(0,0,254), + new Vector3(0, 0, 254), UnchangedPart.Scale ); m_AuraEntities.Add(UnchangedPart.UUID, auraGroup); @@ -300,15 +299,16 @@ namespace OpenSim.Region.OptionalModules.ContentManagement AuraMetaEntity auraGroup = new AuraMetaEntity(m_Entity.Scene, UnchangedPart.GetWorldPosition(), MetaEntity.TRANSLUCENT, - new Vector3(254,0,0), + new Vector3(254, 0, 0), UnchangedPart.Scale ); m_AuraEntities.Add(UnchangedPart.UUID, auraGroup); SetPartTransparency(metaEntityPart, MetaEntity.TRANSLUCENT); - + DiffersFromSceneGroup = true; } } + return changed; } diff --git a/OpenSim/Region/OptionalModules/ContentManagementSystem/MetaEntity.cs b/OpenSim/Region/OptionalModules/ContentManagementSystem/MetaEntity.cs index 841ee00e59..c7b1ed79cc 100644 --- a/OpenSim/Region/OptionalModules/ContentManagementSystem/MetaEntity.cs +++ b/OpenSim/Region/OptionalModules/ContentManagementSystem/MetaEntity.cs @@ -98,10 +98,9 @@ namespace OpenSim.Region.OptionalModules.ContentManagement #region Public Properties - public Dictionary Children + public SceneObjectPart[] Parts { - get { return m_Entity.Children; } - set { m_Entity.Children = value; } + get { return m_Entity.Parts; } } public uint LocalId @@ -150,7 +149,8 @@ namespace OpenSim.Region.OptionalModules.ContentManagement { //make new uuids Dictionary parts = new Dictionary(); - foreach (SceneObjectPart part in m_Entity.Children.Values) + + foreach (SceneObjectPart part in m_Entity.Parts) { part.ResetIDs(part.LinkNum); parts.Add(part.UUID, part); @@ -158,7 +158,8 @@ namespace OpenSim.Region.OptionalModules.ContentManagement //finalize m_Entity.RootPart.PhysActor = null; - m_Entity.Children = parts; + foreach (SceneObjectPart part in parts.Values) + m_Entity.AddPart(part); } #endregion Protected Methods @@ -173,7 +174,7 @@ namespace OpenSim.Region.OptionalModules.ContentManagement //This deletes the group without removing from any databases. //This is important because we are not IN any database. //m_Entity.FakeDeleteGroup(); - foreach (SceneObjectPart part in m_Entity.Children.Values) + foreach (SceneObjectPart part in m_Entity.Parts) client.SendKillObject(m_Entity.RegionHandle, part.LocalId); } @@ -182,7 +183,7 @@ namespace OpenSim.Region.OptionalModules.ContentManagement /// public virtual void HideFromAll() { - foreach (SceneObjectPart part in m_Entity.Children.Values) + foreach (SceneObjectPart part in m_Entity.Parts) { m_Entity.Scene.ForEachClient( delegate(IClientAPI controller) diff --git a/OpenSim/Region/OptionalModules/Resources/OptionalModules.addin.xml b/OpenSim/Region/OptionalModules/Resources/OptionalModules.addin.xml index 352052a3f5..5eea286fd7 100644 --- a/OpenSim/Region/OptionalModules/Resources/OptionalModules.addin.xml +++ b/OpenSim/Region/OptionalModules/Resources/OptionalModules.addin.xml @@ -12,5 +12,6 @@ + diff --git a/OpenSim/Region/OptionalModules/Scripting/Minimodule/ExtensionHandler.cs b/OpenSim/Region/OptionalModules/Scripting/Minimodule/ExtensionHandler.cs index d8f7a84022..3f1bd54ee7 100644 --- a/OpenSim/Region/OptionalModules/Scripting/Minimodule/ExtensionHandler.cs +++ b/OpenSim/Region/OptionalModules/Scripting/Minimodule/ExtensionHandler.cs @@ -32,7 +32,7 @@ using OpenSim.Region.OptionalModules.Scripting.Minimodule.Interfaces; namespace OpenSim.Region.OptionalModules.Scripting.Minimodule { - class ExtensionHandler : IExtension + class ExtensionHandler : IExtension { private readonly Dictionary m_instances; diff --git a/OpenSim/Region/OptionalModules/Scripting/Minimodule/MRMModule.cs b/OpenSim/Region/OptionalModules/Scripting/Minimodule/MRMModule.cs index 2ddc31bd07..df60709535 100644 --- a/OpenSim/Region/OptionalModules/Scripting/Minimodule/MRMModule.cs +++ b/OpenSim/Region/OptionalModules/Scripting/Minimodule/MRMModule.cs @@ -50,7 +50,7 @@ namespace OpenSim.Region.OptionalModules.Scripting.Minimodule { private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); private Scene m_scene; - + private readonly Dictionary m_scripts = new Dictionary(); private readonly Dictionary m_extensions = new Dictionary(); @@ -77,7 +77,7 @@ namespace OpenSim.Region.OptionalModules.Scripting.Minimodule { m_log.Info("[MRM] Enabling MRM Module"); m_scene = scene; - + // when hidden, we don't listen for client initiated script events // only making the MRM engine available for region modules if (!source.Configs["MRM"].GetBoolean("Hidden", false)) @@ -85,7 +85,7 @@ namespace OpenSim.Region.OptionalModules.Scripting.Minimodule scene.EventManager.OnRezScript += EventManager_OnRezScript; scene.EventManager.OnStopScript += EventManager_OnStopScript; } - + scene.EventManager.OnFrame += EventManager_OnFrame; scene.RegisterModuleInterface(this); @@ -291,7 +291,6 @@ namespace OpenSim.Region.OptionalModules.Scripting.Minimodule public void InitializeMRM(MRMBase mmb, uint localID, UUID itemID) { - m_log.Info("[MRM] Created MRM Instance"); IWorld world; @@ -304,7 +303,6 @@ namespace OpenSim.Region.OptionalModules.Scripting.Minimodule public void PostInitialise() { - } public void Close() @@ -350,7 +348,6 @@ namespace OpenSim.Region.OptionalModules.Scripting.Minimodule if (!Directory.Exists(tmp)) Directory.CreateDirectory(tmp); - m_log.Info("MRM 2"); try @@ -396,8 +393,7 @@ namespace OpenSim.Region.OptionalModules.Scripting.Minimodule parameters.IncludeDebugInformation = true; - string rootPath = - Path.GetDirectoryName(AppDomain.CurrentDomain.BaseDirectory); + string rootPath = Path.GetDirectoryName(AppDomain.CurrentDomain.BaseDirectory); List libraries = new List(); string[] lines = Script.Split(new string[] {"\n"}, StringSplitOptions.RemoveEmptyEntries); diff --git a/OpenSim/Region/OptionalModules/Scripting/Minimodule/ObjectAccessor.cs b/OpenSim/Region/OptionalModules/Scripting/Minimodule/ObjectAccessor.cs index 6ba5ccfdc9..140264b5e7 100644 --- a/OpenSim/Region/OptionalModules/Scripting/Minimodule/ObjectAccessor.cs +++ b/OpenSim/Region/OptionalModules/Scripting/Minimodule/ObjectAccessor.cs @@ -41,12 +41,14 @@ namespace OpenSim.Region.OptionalModules.Scripting.Minimodule private readonly Scene m_scene; private readonly IEnumerator m_sogEnum; private readonly ISecurityCredential m_security; + private readonly List m_entities; public IObjEnum(Scene scene, ISecurityCredential security) { m_scene = scene; m_security = security; - m_sogEnum = m_scene.Entities.GetAllByType().GetEnumerator(); + m_entities = new List(m_scene.Entities.GetEntities()); + m_sogEnum = m_entities.GetEnumerator(); } public void Dispose() diff --git a/OpenSim/Region/OptionalModules/Scripting/Minimodule/SOPObject.cs b/OpenSim/Region/OptionalModules/Scripting/Minimodule/SOPObject.cs index 96cccb77d0..faed522899 100644 --- a/OpenSim/Region/OptionalModules/Scripting/Minimodule/SOPObject.cs +++ b/OpenSim/Region/OptionalModules/Scripting/Minimodule/SOPObject.cs @@ -185,14 +185,17 @@ namespace OpenSim.Region.OptionalModules.Scripting.Minimodule get { SceneObjectPart my = GetSOP(); - int total = my.ParentGroup.Children.Count; + IObject[] rets = null; - IObject[] rets = new IObject[total]; + int total = my.ParentGroup.PrimCount; + + rets = new IObject[total]; int i = 0; - foreach (KeyValuePair pair in my.ParentGroup.Children) + + foreach (SceneObjectPart part in my.ParentGroup.Parts) { - rets[i++] = new SOPObject(m_rootScene, pair.Value.LocalId, m_security); + rets[i++] = new SOPObject(m_rootScene, part.LocalId, m_security); } return rets; @@ -425,7 +428,7 @@ namespace OpenSim.Region.OptionalModules.Scripting.Minimodule return; } - foreach(string button in buttons) + foreach (string button in buttons) { if (button == String.Empty) { @@ -441,7 +444,7 @@ namespace OpenSim.Region.OptionalModules.Scripting.Minimodule dm.SendDialogToUser( avatar, GetSOP().Name, GetSOP().UUID, GetSOP().OwnerID, - message, new UUID("00000000-0000-2222-3333-100000001000"), chat_channel, buttons); + message, new UUID("00000000-0000-2222-3333-100000001000"), chat_channel, buttons); } diff --git a/OpenSim/Region/OptionalModules/Scripting/Minimodule/SPAvatar.cs b/OpenSim/Region/OptionalModules/Scripting/Minimodule/SPAvatar.cs index 0786bd9821..922eaafeda 100644 --- a/OpenSim/Region/OptionalModules/Scripting/Minimodule/SPAvatar.cs +++ b/OpenSim/Region/OptionalModules/Scripting/Minimodule/SPAvatar.cs @@ -29,6 +29,7 @@ using System.Collections; using System.Collections.Generic; using System.Security; using OpenMetaverse; +using OpenSim.Framework; using OpenSim.Region.Framework.Scenes; using OpenSim.Region.Framework.Interfaces; @@ -81,16 +82,12 @@ namespace OpenSim.Region.OptionalModules.Scripting.Minimodule get { List attachments = new List(); - Hashtable internalAttachments = GetSP().Appearance.GetAttachments(); - if (internalAttachments != null) + List internalAttachments = GetSP().Appearance.GetAttachments(); + foreach (AvatarAttachment attach in internalAttachments) { - foreach (DictionaryEntry element in internalAttachments) - { - Hashtable attachInfo = (Hashtable)element.Value; - attachments.Add(new SPAvatarAttachment(m_rootScene, this, (int) element.Key, - new UUID((string) attachInfo["item"]), - new UUID((string) attachInfo["asset"]), m_security)); - } + attachments.Add(new SPAvatarAttachment(m_rootScene, this, attach.AttachPoint, + new UUID(attach.ItemID), + new UUID(attach.AssetID), m_security)); } return attachments.ToArray(); diff --git a/OpenSim/Region/OptionalModules/Scripting/Minimodule/World.cs b/OpenSim/Region/OptionalModules/Scripting/Minimodule/World.cs index 45bb005903..f2324d29a8 100644 --- a/OpenSim/Region/OptionalModules/Scripting/Minimodule/World.cs +++ b/OpenSim/Region/OptionalModules/Scripting/Minimodule/World.cs @@ -205,10 +205,10 @@ namespace OpenSim.Region.OptionalModules.Scripting.Minimodule { get { - List ents = m_internalScene.Entities.GetAllByType(); - IAvatar[] rets = new IAvatar[ents.Count]; + EntityBase[] ents = m_internalScene.Entities.GetAllByType(); + IAvatar[] rets = new IAvatar[ents.Length]; - for (int i = 0; i < ents.Count; i++) + for (int i = 0; i < ents.Length; i++) { EntityBase ent = ents[i]; rets[i] = new SPAvatar(m_internalScene, ent.UUID, m_security); diff --git a/OpenSim/Region/OptionalModules/Scripting/RegionReadyModule/RegionReadyModule.cs b/OpenSim/Region/OptionalModules/Scripting/RegionReadyModule/RegionReadyModule.cs index 672109b773..122ad40719 100644 --- a/OpenSim/Region/OptionalModules/Scripting/RegionReadyModule/RegionReadyModule.cs +++ b/OpenSim/Region/OptionalModules/Scripting/RegionReadyModule/RegionReadyModule.cs @@ -133,7 +133,7 @@ namespace OpenSim.Region.OptionalModules.Scripting.RegionReady m_firstEmptyCompileQueue = false; m_oarFileLoading = false; - m_scene.Backup(); + m_scene.Backup(false); c.From = "RegionReady"; if (m_lastOarLoadedOk) diff --git a/OpenSim/Region/OptionalModules/World/MoneyModule/SampleMoneyModule.cs b/OpenSim/Region/OptionalModules/World/MoneyModule/SampleMoneyModule.cs index 653f856664..b84a34d288 100644 --- a/OpenSim/Region/OptionalModules/World/MoneyModule/SampleMoneyModule.cs +++ b/OpenSim/Region/OptionalModules/World/MoneyModule/SampleMoneyModule.cs @@ -72,8 +72,6 @@ namespace OpenSim.Region.OptionalModules.World.MoneyModule private IConfigSource m_gConfig; - - /// /// Region UUIDS indexed by AgentID /// @@ -85,7 +83,6 @@ namespace OpenSim.Region.OptionalModules.World.MoneyModule // private int m_stipend = 1000; - private int ObjectCapacity = 45000; private int ObjectCount = 0; private int PriceEnergyUnit = 0; private int PriceGroupCreate = 0; @@ -137,7 +134,6 @@ namespace OpenSim.Region.OptionalModules.World.MoneyModule public void AddRegion(Scene scene) { - // Send ObjectCapacity to Scene.. Which sends it to the SimStatsReporter. if (m_enabled) { scene.RegisterModuleInterface(this); @@ -267,13 +263,11 @@ namespace OpenSim.Region.OptionalModules.World.MoneyModule PriceGroupCreate = startupConfig.GetInt("PriceGroupCreate", -1); m_sellEnabled = startupConfig.GetBoolean("SellEnabled", false); } - } private void GetClientFunds(IClientAPI client) { CheckExistAndRefreshFunds(client.AgentId); - } /// @@ -809,13 +803,40 @@ namespace OpenSim.Region.OptionalModules.World.MoneyModule } Scene s = LocateSceneClientIn(remoteClient.AgentId); + + // Implmenting base sale data checking here so the default OpenSimulator implementation isn't useless + // combined with other implementations. We're actually validating that the client is sending the data + // that it should. In theory, the client should already know what to send here because it'll see it when it + // gets the object data. If the data sent by the client doesn't match the object, the viewer probably has an + // old idea of what the object properties are. Viewer developer Hazim informed us that the base module + // didn't check the client sent data against the object do any. Since the base modules are the + // 'crowning glory' examples of good practice.. + + // Validate that the object exists in the scene the user is in SceneObjectPart part = s.GetSceneObjectPart(localID); if (part == null) { remoteClient.SendAgentAlertMessage("Unable to buy now. The object was not found.", false); return; } - s.PerformObjectBuy(remoteClient, categoryID, localID, saleType); + + // Validate that the client sent the price that the object is being sold for + if (part.SalePrice != salePrice) + { + remoteClient.SendAgentAlertMessage("Cannot buy at this price. Buy Failed. If you continue to get this relog.", false); + return; + } + + // Validate that the client sent the proper sale type the object has set + if (part.ObjectSaleType != saleType) + { + remoteClient.SendAgentAlertMessage("Cannot buy this way. Buy Failed. If you continue to get this relog.", false); + return; + } + + IBuySellModule module = s.RequestModuleInterface(); + if (module != null) + module.BuyObject(remoteClient, categoryID, localID, saleType, salePrice); } } @@ -826,6 +847,4 @@ namespace OpenSim.Region.OptionalModules.World.MoneyModule Gift = 2, Purchase = 3 } - - } diff --git a/OpenSim/Region/OptionalModules/World/NPC/NPCAvatar.cs b/OpenSim/Region/OptionalModules/World/NPC/NPCAvatar.cs index 3154a35706..116210bfa5 100644 --- a/OpenSim/Region/OptionalModules/World/NPC/NPCAvatar.cs +++ b/OpenSim/Region/OptionalModules/World/NPC/NPCAvatar.cs @@ -192,7 +192,7 @@ namespace OpenSim.Region.OptionalModules.World.NPC public event DeRezObject OnDeRezObject; public event Action OnRegionHandShakeReply; - public event GenericCall2 OnRequestWearables; + public event GenericCall1 OnRequestWearables; public event GenericCall1 OnCompleteMovementToRegion; public event UpdateAgent OnPreAgentUpdate; public event UpdateAgent OnAgentUpdate; @@ -616,7 +616,11 @@ namespace OpenSim.Region.OptionalModules.World.NPC { } - public virtual void SendTeleportLocationStart() + public virtual void SendTeleportStart(uint flags) + { + } + + public virtual void SendTeleportProgress(uint flags, string message) { } diff --git a/OpenSim/Region/OptionalModules/World/NPC/NPCModule.cs b/OpenSim/Region/OptionalModules/World/NPC/NPCModule.cs index ab0be77715..c471636743 100644 --- a/OpenSim/Region/OptionalModules/World/NPC/NPCModule.cs +++ b/OpenSim/Region/OptionalModules/World/NPC/NPCModule.cs @@ -64,15 +64,13 @@ namespace OpenSim.Region.OptionalModules.World.NPC if (m_appearanceCache.ContainsKey(target)) return m_appearanceCache[target]; - AvatarData adata = scene.AvatarService.GetAvatar(target); - if (adata != null) + AvatarAppearance appearance = scene.AvatarService.GetAppearance(target); + if (appearance != null) { - AvatarAppearance x = adata.ToAvatarAppearance(target); - - m_appearanceCache.Add(target, x); - - return x; + m_appearanceCache.Add(target, appearance); + return appearance; } + return new AvatarAppearance(); } @@ -169,7 +167,9 @@ namespace OpenSim.Region.OptionalModules.World.NPC { AvatarAppearance x = GetAppearance(p_cloneAppearanceFrom, p_scene); - sp.SetAppearance(x.Texture, (byte[])x.VisualParams.Clone()); + sp.Appearance.SetTextureEntries(x.Texture); + sp.Appearance.SetVisualParams((byte[])x.VisualParams.Clone()); + sp.SendAppearanceToAllOtherAgents(); } m_avatars.Add(npcAvatar.AgentId, npcAvatar); diff --git a/OpenSim/Region/OptionalModules/World/TreePopulator/TreePopulatorModule.cs b/OpenSim/Region/OptionalModules/World/TreePopulator/TreePopulatorModule.cs index 3ed338baea..421da3664a 100644 --- a/OpenSim/Region/OptionalModules/World/TreePopulator/TreePopulatorModule.cs +++ b/OpenSim/Region/OptionalModules/World/TreePopulator/TreePopulatorModule.cs @@ -568,8 +568,7 @@ namespace OpenSim.Region.OptionalModules.World.TreePopulator { m_copse = new List(); - List objs = m_scene.GetEntities(); - + EntityBase[] objs = m_scene.GetEntities(); foreach (EntityBase obj in objs) { if (obj is SceneObjectGroup) diff --git a/OpenSim/Region/OptionalModules/World/WorldView/WorldViewModule.cs b/OpenSim/Region/OptionalModules/World/WorldView/WorldViewModule.cs new file mode 100644 index 0000000000..d4b7020542 --- /dev/null +++ b/OpenSim/Region/OptionalModules/World/WorldView/WorldViewModule.cs @@ -0,0 +1,122 @@ +/* + * Copyright (c) Contributors, http://opensimulator.org/ + * See CONTRIBUTORS.TXT for a full list of copyright holders. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * * Neither the name of the OpenSimulator Project nor the + * names of its contributors may be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE DEVELOPERS ``AS IS'' AND ANY + * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED + * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + * DISCLAIMED. IN NO EVENT SHALL THE CONTRIBUTORS BE LIABLE FOR ANY + * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES + * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND + * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS + * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +using System; +using System.Collections.Generic; +using System.Drawing; +using System.Drawing.Imaging; +using System.Reflection; +using System.IO; +using log4net; +using Nini.Config; +using OpenMetaverse; +using OpenMetaverse.Imaging; +using OpenSim.Framework; +using OpenSim.Region.Framework.Interfaces; +using OpenSim.Region.Framework.Scenes; +using OpenSim.Server.Base; +using OpenSim.Framework.Servers.HttpServer; +using OpenSim.Services.Interfaces; + +namespace OpenSim.Region.OptionalModules.World.WorldView +{ + public class WorldViewModule : INonSharedRegionModule + { + private static readonly ILog m_log = + LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); + + + private bool m_Enabled = false; + private IMapImageGenerator m_Generator; + + public void Initialise(IConfigSource config) + { + IConfig moduleConfig = config.Configs["Modules"]; + if (moduleConfig == null) + return; + + if (moduleConfig.GetString("WorldViewModule", String.Empty) != Name) + return; + + m_Enabled = true; + } + + public void AddRegion(Scene scene) + { + } + + public void RegionLoaded(Scene scene) + { + m_Generator = scene.RequestModuleInterface(); + if (m_Generator == null) + { + m_Enabled = false; + return; + } + + m_log.Info("[WORLDVIEW]: Configured and enabled"); + + IHttpServer server = MainServer.GetHttpServer(0); + server.AddStreamHandler(new WorldViewRequestHandler(this, + scene.RegionInfo.RegionID.ToString())); + } + + public void RemoveRegion(Scene scene) + { + } + + public string Name + { + get { return "WorldViewModule"; } + } + + public Type ReplaceableInterface + { + get { return null; } + } + + public void Close() + { + } + + public byte[] GenerateWorldView(Vector3 pos, Vector3 rot, float fov, + int width, int height, bool usetex) + { + if (!m_Enabled) + return new Byte[0]; + + Bitmap bmp = m_Generator.CreateViewImage(pos, rot, fov, width, + height, usetex); + + MemoryStream str = new MemoryStream(); + + bmp.Save(str, ImageFormat.Jpeg); + + return str.ToArray(); + } + } +} diff --git a/OpenSim/Region/OptionalModules/World/WorldView/WorldViewRequestHandler.cs b/OpenSim/Region/OptionalModules/World/WorldView/WorldViewRequestHandler.cs new file mode 100644 index 0000000000..f47d9c7228 --- /dev/null +++ b/OpenSim/Region/OptionalModules/World/WorldView/WorldViewRequestHandler.cs @@ -0,0 +1,148 @@ +/* + * Copyright (c) Contributors, http://opensimulator.org/ + * See CONTRIBUTORS.TXT for a full list of copyright holders. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * * Neither the name of the OpenSimulator Project nor the + * names of its contributors may be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE DEVELOPERS ``AS IS'' AND ANY + * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED + * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + * DISCLAIMED. IN NO EVENT SHALL THE CONTRIBUTORS BE LIABLE FOR ANY + * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES + * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND + * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS + * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +using System; +using System.Collections.Generic; +using System.IO; +using System.Reflection; +using System.Xml; + +using OpenSim.Framework; +using OpenSim.Server.Base; +using OpenSim.Framework.Servers.HttpServer; +using OpenSim.Region.Framework.Scenes; +using OpenSim.Region.Framework.Interfaces; + +using OpenMetaverse; +using log4net; + +namespace OpenSim.Region.OptionalModules.World.WorldView +{ + public class WorldViewRequestHandler : BaseStreamHandler + { + private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); + + protected WorldViewModule m_WorldViewModule; + protected Object m_RequestLock = new Object(); + + public WorldViewRequestHandler(WorldViewModule fmodule, string rid) + : base("GET", "/worldview/" + rid) + { + m_WorldViewModule = fmodule; + } + + public override byte[] Handle(string path, Stream requestData, + OSHttpRequest httpRequest, OSHttpResponse httpResponse) + { + httpResponse.ContentType = "image/jpeg"; + +// StreamReader sr = new StreamReader(requestData); +// string body = sr.ReadToEnd(); +// sr.Close(); +// body = body.Trim(); + + try + { + lock (m_RequestLock) + { + Dictionary request = + new Dictionary(); + foreach (string name in httpRequest.QueryString) + request[name] = httpRequest.QueryString[name]; + + return SendWorldView(request); + } + } + catch (Exception e) + { + m_log.Debug("[WORLDVIEW]: Exception: " + e.ToString()); + } + + return new Byte[0]; + } + + public Byte[] SendWorldView(Dictionary request) + { + float posX; + float posY; + float posZ; + float rotX; + float rotY; + float rotZ; + float fov; + int width; + int height; + bool usetex; + + if (!request.ContainsKey("posX")) + return new Byte[0]; + if (!request.ContainsKey("posY")) + return new Byte[0]; + if (!request.ContainsKey("posZ")) + return new Byte[0]; + if (!request.ContainsKey("rotX")) + return new Byte[0]; + if (!request.ContainsKey("rotY")) + return new Byte[0]; + if (!request.ContainsKey("rotZ")) + return new Byte[0]; + if (!request.ContainsKey("fov")) + return new Byte[0]; + if (!request.ContainsKey("width")) + return new Byte[0]; + if (!request.ContainsKey("height")) + return new Byte[0]; + if (!request.ContainsKey("usetex")) + return new Byte[0]; + + try + { + posX = Convert.ToSingle(request["posX"]); + posY = Convert.ToSingle(request["posY"]); + posZ = Convert.ToSingle(request["posZ"]); + rotX = Convert.ToSingle(request["rotX"]); + rotY = Convert.ToSingle(request["rotY"]); + rotZ = Convert.ToSingle(request["rotZ"]); + fov = Convert.ToSingle(request["fov"]); + width = Convert.ToInt32(request["width"]); + height = Convert.ToInt32(request["height"]); + usetex = Convert.ToBoolean(request["usetex"]); + } + catch + { + return new Byte[0]; + } + + Vector3 pos = new Vector3(posX, posY, posZ); + Vector3 rot = new Vector3(rotX, rotY, rotZ); + + return m_WorldViewModule.GenerateWorldView(pos, rot, fov, width, + height, usetex); + } + } +} + diff --git a/OpenSim/Region/Physics/Manager/PhysicsPluginManager.cs b/OpenSim/Region/Physics/Manager/PhysicsPluginManager.cs index 7130a3e171..376369660f 100644 --- a/OpenSim/Region/Physics/Manager/PhysicsPluginManager.cs +++ b/OpenSim/Region/Physics/Manager/PhysicsPluginManager.cs @@ -81,7 +81,7 @@ namespace OpenSim.Region.Physics.Manager if (_MeshPlugins.ContainsKey(meshEngineName)) { m_log.Info("[PHYSICS]: creating meshing engine " + meshEngineName); - meshEngine = _MeshPlugins[meshEngineName].GetMesher(); + meshEngine = _MeshPlugins[meshEngineName].GetMesher(config); } else { @@ -234,6 +234,6 @@ namespace OpenSim.Region.Physics.Manager public interface IMeshingPlugin { string GetName(); - IMesher GetMesher(); + IMesher GetMesher(IConfigSource config); } } diff --git a/OpenSim/Region/Physics/Manager/ZeroMesher.cs b/OpenSim/Region/Physics/Manager/ZeroMesher.cs index e6e75f964b..ba19db6c18 100644 --- a/OpenSim/Region/Physics/Manager/ZeroMesher.cs +++ b/OpenSim/Region/Physics/Manager/ZeroMesher.cs @@ -28,6 +28,7 @@ using System; using OpenSim.Framework; using OpenMetaverse; +using Nini.Config; /* * This is the zero mesher. @@ -53,7 +54,7 @@ namespace OpenSim.Region.Physics.Manager return "ZeroMesher"; } - public IMesher GetMesher() + public IMesher GetMesher(IConfigSource config) { return new ZeroMesher(); } diff --git a/OpenSim/Region/Physics/Meshing/Meshmerizer.cs b/OpenSim/Region/Physics/Meshing/Meshmerizer.cs index fded95e4bb..3386e729d8 100644 --- a/OpenSim/Region/Physics/Meshing/Meshmerizer.cs +++ b/OpenSim/Region/Physics/Meshing/Meshmerizer.cs @@ -31,12 +31,16 @@ using System.Collections.Generic; using OpenSim.Framework; using OpenSim.Region.Physics.Manager; using OpenMetaverse; +using OpenMetaverse.StructuredData; using System.Drawing; using System.Drawing.Imaging; +using System.IO.Compression; using PrimMesher; using log4net; +using Nini.Config; using System.Reflection; using System.IO; +using ComponentAce.Compression.Libs.zlib; namespace OpenSim.Region.Physics.Meshing { @@ -51,9 +55,9 @@ namespace OpenSim.Region.Physics.Meshing return "Meshmerizer"; } - public IMesher GetMesher() + public IMesher GetMesher(IConfigSource config) { - return new Meshmerizer(); + return new Meshmerizer(config); } } @@ -70,22 +74,29 @@ namespace OpenSim.Region.Physics.Meshing #endif private bool cacheSculptMaps = true; - private string decodedScultMapPath = "j2kDecodeCache"; + private string decodedSculptMapPath = null; + private bool useMeshiesPhysicsMesh = false; private float minSizeForComplexMesh = 0.2f; // prims with all dimensions smaller than this will have a bounding box mesh private Dictionary m_uniqueMeshes = new Dictionary(); - public Meshmerizer() + public Meshmerizer(IConfigSource config) { + IConfig start_config = config.Configs["Startup"]; + + decodedSculptMapPath = start_config.GetString("DecodedSculptMapPath","j2kDecodeCache"); + cacheSculptMaps = start_config.GetBoolean("CacheSculptMaps", cacheSculptMaps); + useMeshiesPhysicsMesh = start_config.GetBoolean("UseMeshiesPhysicsMesh", useMeshiesPhysicsMesh); + try { - if (!Directory.Exists(decodedScultMapPath)) - Directory.CreateDirectory(decodedScultMapPath); + if (!Directory.Exists(decodedSculptMapPath)) + Directory.CreateDirectory(decodedSculptMapPath); } catch (Exception e) { - m_log.WarnFormat("[SCULPT]: Unable to create {0} directory: ", decodedScultMapPath, e.Message); + m_log.WarnFormat("[SCULPT]: Unable to create {0} directory: ", decodedSculptMapPath, e.Message); } } @@ -250,102 +261,223 @@ namespace OpenSim.Region.Physics.Meshing PrimMesh primMesh; PrimMesher.SculptMesh sculptMesh; - List coords; - List faces; + List coords = new List(); + List faces = new List(); Image idata = null; string decodedSculptFileName = ""; if (primShape.SculptEntry) { - if (cacheSculptMaps && primShape.SculptTexture != UUID.Zero) + if (((OpenMetaverse.SculptType)primShape.SculptType) == SculptType.Mesh) { - decodedSculptFileName = System.IO.Path.Combine(decodedScultMapPath, "smap_" + primShape.SculptTexture.ToString()); - try + if (!useMeshiesPhysicsMesh) + return null; + + m_log.Debug("[MESH]: experimental mesh proxy generation"); + + OSD meshOsd = null; + + if (primShape.SculptData.Length <= 0) { - if (File.Exists(decodedSculptFileName)) + m_log.Error("[MESH]: asset data is zero length"); + return null; + } + + long start = 0; + using (MemoryStream data = new MemoryStream(primShape.SculptData)) + { + try { - idata = Image.FromFile(decodedSculptFileName); + meshOsd = (OSDMap)OSDParser.DeserializeLLSDBinary(data); + } + catch (Exception e) + { + m_log.Error("[MESH]: Exception deserializing mesh asset header:" + e.ToString()); + } + start = data.Position; + } + + if (meshOsd is OSDMap) + { + OSDMap map = (OSDMap)meshOsd; + OSDMap physicsParms = (OSDMap)map["physics_shape"]; + int physOffset = physicsParms["offset"].AsInteger() + (int)start; + int physSize = physicsParms["size"].AsInteger(); + + if (physOffset < 0 || physSize == 0) + return null; // no mesh data in asset + + OSD decodedMeshOsd = new OSD(); + byte[] meshBytes = new byte[physSize]; + System.Buffer.BlockCopy(primShape.SculptData, physOffset, meshBytes, 0, physSize); + byte[] decompressed = new byte[physSize * 5]; + try + { + using (MemoryStream inMs = new MemoryStream(meshBytes)) + { + using (MemoryStream outMs = new MemoryStream()) + { + using (ZOutputStream zOut = new ZOutputStream(outMs)) + { + byte[] readBuffer = new byte[2048]; + int readLen = 0; + while ((readLen = inMs.Read(readBuffer, 0, readBuffer.Length)) > 0) + { + zOut.Write(readBuffer, 0, readLen); + } + zOut.Flush(); + outMs.Seek(0, SeekOrigin.Begin); + + byte[] decompressedBuf = outMs.GetBuffer(); + + decodedMeshOsd = OSDParser.DeserializeLLSDBinary(decompressedBuf); + } + } + } + } + catch (Exception e) + { + m_log.Error("[MESH]: exception decoding physical mesh: " + e.ToString()); + return null; + } + + OSDArray decodedMeshOsdArray = null; + + // physics_shape is an array of OSDMaps, one for each submesh + if (decodedMeshOsd is OSDArray) + { + decodedMeshOsdArray = (OSDArray)decodedMeshOsd; + foreach (OSD subMeshOsd in decodedMeshOsdArray) + { + if (subMeshOsd is OSDMap) + { + OSDMap subMeshMap = (OSDMap)subMeshOsd; + + OpenMetaverse.Vector3 posMax = ((OSDMap)subMeshMap["PositionDomain"])["Max"].AsVector3(); + OpenMetaverse.Vector3 posMin = ((OSDMap)subMeshMap["PositionDomain"])["Min"].AsVector3(); + ushort faceIndexOffset = (ushort)coords.Count; + + byte[] posBytes = subMeshMap["Position"].AsBinary(); + for (int i = 0; i < posBytes.Length; i += 6) + { + ushort uX = Utils.BytesToUInt16(posBytes, i); + ushort uY = Utils.BytesToUInt16(posBytes, i + 2); + ushort uZ = Utils.BytesToUInt16(posBytes, i + 4); + + Coord c = new Coord( + Utils.UInt16ToFloat(uX, posMin.X, posMax.X) * size.X, + Utils.UInt16ToFloat(uY, posMin.Y, posMax.Y) * size.Y, + Utils.UInt16ToFloat(uZ, posMin.Z, posMax.Z) * size.Z); + + coords.Add(c); + } + + byte[] triangleBytes = subMeshMap["TriangleList"].AsBinary(); + for (int i = 0; i < triangleBytes.Length; i += 6) + { + ushort v1 = (ushort)(Utils.BytesToUInt16(triangleBytes, i) + faceIndexOffset); + ushort v2 = (ushort)(Utils.BytesToUInt16(triangleBytes, i + 2) + faceIndexOffset); + ushort v3 = (ushort)(Utils.BytesToUInt16(triangleBytes, i + 4) + faceIndexOffset); + Face f = new Face(v1, v2, v3); + faces.Add(f); + } + } + } } } - catch (Exception e) - { - m_log.Error("[SCULPT]: unable to load cached sculpt map " + decodedSculptFileName + " " + e.Message); - - } - //if (idata != null) - // m_log.Debug("[SCULPT]: loaded cached map asset for map ID: " + primShape.SculptTexture.ToString()); } - - if (idata == null) + else { - if (primShape.SculptData == null || primShape.SculptData.Length == 0) - return null; - - try + if (cacheSculptMaps && primShape.SculptTexture != UUID.Zero) { - OpenMetaverse.Imaging.ManagedImage unusedData; - OpenMetaverse.Imaging.OpenJPEG.DecodeToImage(primShape.SculptData, out unusedData, out idata); - unusedData = null; - - //idata = CSJ2K.J2kImage.FromBytes(primShape.SculptData); - - if (cacheSculptMaps && idata != null) + decodedSculptFileName = System.IO.Path.Combine(decodedSculptMapPath, "smap_" + primShape.SculptTexture.ToString()); + try { - try { idata.Save(decodedSculptFileName, ImageFormat.MemoryBmp); } - catch (Exception e) { m_log.Error("[SCULPT]: unable to cache sculpt map " + decodedSculptFileName + " " + e.Message); } + if (File.Exists(decodedSculptFileName)) + { + idata = Image.FromFile(decodedSculptFileName); + } + } + catch (Exception e) + { + m_log.Error("[SCULPT]: unable to load cached sculpt map " + decodedSculptFileName + " " + e.Message); + + } + //if (idata != null) + // m_log.Debug("[SCULPT]: loaded cached map asset for map ID: " + primShape.SculptTexture.ToString()); + } + + if (idata == null) + { + if (primShape.SculptData == null || primShape.SculptData.Length == 0) + return null; + + try + { + OpenMetaverse.Imaging.ManagedImage unusedData; + OpenMetaverse.Imaging.OpenJPEG.DecodeToImage(primShape.SculptData, out unusedData, out idata); + unusedData = null; + + //idata = CSJ2K.J2kImage.FromBytes(primShape.SculptData); + + if (cacheSculptMaps && idata != null) + { + try { idata.Save(decodedSculptFileName, ImageFormat.MemoryBmp); } + catch (Exception e) { m_log.Error("[SCULPT]: unable to cache sculpt map " + decodedSculptFileName + " " + e.Message); } + } + } + catch (DllNotFoundException) + { + m_log.Error("[PHYSICS]: OpenJpeg is not installed correctly on this system. Physics Proxy generation failed. Often times this is because of an old version of GLIBC. You must have version 2.4 or above!"); + return null; + } + catch (IndexOutOfRangeException) + { + m_log.Error("[PHYSICS]: OpenJpeg was unable to decode this. Physics Proxy generation failed"); + return null; + } + catch (Exception ex) + { + m_log.Error("[PHYSICS]: Unable to generate a Sculpty physics proxy. Sculpty texture decode failed: " + ex.Message); + return null; } } - catch (DllNotFoundException) + + PrimMesher.SculptMesh.SculptType sculptType; + switch ((OpenMetaverse.SculptType)primShape.SculptType) { - m_log.Error("[PHYSICS]: OpenJpeg is not installed correctly on this system. Physics Proxy generation failed. Often times this is because of an old version of GLIBC. You must have version 2.4 or above!"); - return null; - } - catch (IndexOutOfRangeException) - { - m_log.Error("[PHYSICS]: OpenJpeg was unable to decode this. Physics Proxy generation failed"); - return null; - } - catch (Exception ex) - { - m_log.Error("[PHYSICS]: Unable to generate a Sculpty physics proxy. Sculpty texture decode failed: " + ex.Message); - return null; + case OpenMetaverse.SculptType.Cylinder: + sculptType = PrimMesher.SculptMesh.SculptType.cylinder; + break; + case OpenMetaverse.SculptType.Plane: + sculptType = PrimMesher.SculptMesh.SculptType.plane; + break; + case OpenMetaverse.SculptType.Torus: + sculptType = PrimMesher.SculptMesh.SculptType.torus; + break; + case OpenMetaverse.SculptType.Sphere: + sculptType = PrimMesher.SculptMesh.SculptType.sphere; + break; + default: + sculptType = PrimMesher.SculptMesh.SculptType.plane; + break; } + + bool mirror = ((primShape.SculptType & 128) != 0); + bool invert = ((primShape.SculptType & 64) != 0); + + sculptMesh = new PrimMesher.SculptMesh((Bitmap)idata, sculptType, (int)lod, false, mirror, invert); + + idata.Dispose(); + + sculptMesh.DumpRaw(baseDir, primName, "primMesh"); + + sculptMesh.Scale(size.X, size.Y, size.Z); + + coords = sculptMesh.coords; + faces = sculptMesh.faces; } - - PrimMesher.SculptMesh.SculptType sculptType; - switch ((OpenMetaverse.SculptType)primShape.SculptType) - { - case OpenMetaverse.SculptType.Cylinder: - sculptType = PrimMesher.SculptMesh.SculptType.cylinder; - break; - case OpenMetaverse.SculptType.Plane: - sculptType = PrimMesher.SculptMesh.SculptType.plane; - break; - case OpenMetaverse.SculptType.Torus: - sculptType = PrimMesher.SculptMesh.SculptType.torus; - break; - case OpenMetaverse.SculptType.Sphere: - sculptType = PrimMesher.SculptMesh.SculptType.sphere; - break; - default: - sculptType = PrimMesher.SculptMesh.SculptType.plane; - break; - } - - bool mirror = ((primShape.SculptType & 128) != 0); - bool invert = ((primShape.SculptType & 64) != 0); - - sculptMesh = new PrimMesher.SculptMesh((Bitmap)idata, sculptType, (int)lod, false, mirror, invert); - - idata.Dispose(); - - sculptMesh.DumpRaw(baseDir, primName, "primMesh"); - - sculptMesh.Scale(size.X, size.Y, size.Z); - - coords = sculptMesh.coords; - faces = sculptMesh.faces; } else { diff --git a/OpenSim/Region/Physics/OdePlugin/ODEPrim.cs b/OpenSim/Region/Physics/OdePlugin/ODEPrim.cs index 3cf45019e7..c91658e946 100644 --- a/OpenSim/Region/Physics/OdePlugin/ODEPrim.cs +++ b/OpenSim/Region/Physics/OdePlugin/ODEPrim.cs @@ -170,7 +170,7 @@ namespace OpenSim.Region.Physics.OdePlugin private bool m_lastUpdateSent; public IntPtr Body = IntPtr.Zero; - public String m_primName; + public String Name { get; private set; } private Vector3 _target_velocity; public d.Mass pMass; @@ -188,6 +188,7 @@ namespace OpenSim.Region.Physics.OdePlugin public OdePrim(String primName, OdeScene parent_scene, Vector3 pos, Vector3 size, Quaternion rotation, IMesh mesh, PrimitiveBaseShape pbs, bool pisPhysical, CollisionLocker dode) { + Name = primName; m_vehicle = new ODEDynamics(); //gc = GCHandle.Alloc(prim_geom, GCHandleType.Pinned); ode = dode; @@ -195,7 +196,7 @@ namespace OpenSim.Region.Physics.OdePlugin { pos = new Vector3(((float)Constants.RegionSize * 0.5f), ((float)Constants.RegionSize * 0.5f), parent_scene.GetTerrainHeightAtXY(((float)Constants.RegionSize * 0.5f), ((float)Constants.RegionSize * 0.5f)) + 0.5f); - m_log.Warn("[PHYSICS]: Got nonFinite Object create Position"); + m_log.WarnFormat("[PHYSICS]: Got nonFinite Object create Position for {0}", Name); } _position = pos; m_taintposition = pos; @@ -212,7 +213,7 @@ namespace OpenSim.Region.Physics.OdePlugin if (!pos.IsFinite()) { size = new Vector3(0.5f, 0.5f, 0.5f); - m_log.Warn("[PHYSICS]: Got nonFinite Object create Size"); + m_log.WarnFormat("[PHYSICS]: Got nonFinite Object create Size for {0}", Name); } if (size.X <= 0) size.X = 0.01f; @@ -225,7 +226,7 @@ namespace OpenSim.Region.Physics.OdePlugin if (!QuaternionIsFinite(rotation)) { rotation = Quaternion.Identity; - m_log.Warn("[PHYSICS]: Got nonFinite Object create Rotation"); + m_log.WarnFormat("[PHYSICS]: Got nonFinite Object create Rotation for {0}", Name); } _orientation = rotation; @@ -246,7 +247,7 @@ namespace OpenSim.Region.Physics.OdePlugin if (m_isphysical) m_targetSpace = _parent_scene.space; } - m_primName = primName; + m_taintadd = true; _parent_scene.AddPhysicsActorTaint(this); // don't do .add() here; old geoms get recycled with the same hash @@ -304,7 +305,7 @@ namespace OpenSim.Region.Physics.OdePlugin { prev_geom = prim_geom; prim_geom = geom; -//Console.WriteLine("SetGeom to " + prim_geom + " for " + m_primName); +//Console.WriteLine("SetGeom to " + prim_geom + " for " + Name); if (prim_geom != IntPtr.Zero) { d.GeomSetCategoryBits(prim_geom, (int)m_collisionCategories); @@ -402,300 +403,285 @@ namespace OpenSim.Region.Physics.OdePlugin private float CalculateMass() { - float volume = 0; - - // No material is passed to the physics engines yet.. soo.. - // we're using the m_density constant in the class definition + float volume = _size.X * _size.Y * _size.Z; // default + float tmp; float returnMass = 0; - + float hollowAmount = (float)_pbs.ProfileHollow * 2.0e-5f; + float hollowVolume = hollowAmount * hollowAmount; + switch (_pbs.ProfileShape) { case ProfileShape.Square: - // Profile Volume + // default box - volume = _size.X*_size.Y*_size.Z; - - // If the user has 'hollowed out' - // ProfileHollow is one of those 0 to 50000 values :P - // we like percentages better.. so turning into a percentage - - if (((float) _pbs.ProfileHollow/50000f) > 0.0) - { - float hollowAmount = (float) _pbs.ProfileHollow/50000f; - - // calculate the hollow volume by it's shape compared to the prim shape - float hollowVolume = 0; - switch (_pbs.HollowShape) + if (_pbs.PathCurve == (byte)Extrusion.Straight) { - case HollowShape.Square: - case HollowShape.Same: - // Cube Hollow volume calculation - float hollowsizex = _size.X*hollowAmount; - float hollowsizey = _size.Y*hollowAmount; - float hollowsizez = _size.Z*hollowAmount; - hollowVolume = hollowsizex*hollowsizey*hollowsizez; - break; + if (hollowAmount > 0.0) + { + switch (_pbs.HollowShape) + { + case HollowShape.Square: + case HollowShape.Same: + break; - case HollowShape.Circle: - // Hollow shape is a perfect cyllinder in respect to the cube's scale - // Cyllinder hollow volume calculation - float hRadius = _size.X/2; - float hLength = _size.Z; + case HollowShape.Circle: - // pi * r2 * h - hollowVolume = ((float) (Math.PI*Math.Pow(hRadius, 2)*hLength)*hollowAmount); - break; + hollowVolume *= 0.78539816339f; + break; - case HollowShape.Triangle: - // Equilateral Triangular Prism volume hollow calculation - // Triangle is an Equilateral Triangular Prism with aLength = to _size.Y + case HollowShape.Triangle: - float aLength = _size.Y; - // 1/2 abh - hollowVolume = (float) ((0.5*aLength*_size.X*_size.Z)*hollowAmount); - break; + hollowVolume *= (0.5f * .5f); + break; - default: - hollowVolume = 0; - break; + default: + hollowVolume = 0; + break; + } + volume *= (1.0f - hollowVolume); + } + } + + else if (_pbs.PathCurve == (byte)Extrusion.Curve1) + { + //a tube + + volume *= 0.78539816339e-2f * (float)(200 - _pbs.PathScaleX); + tmp= 1.0f -2.0e-2f * (float)(200 - _pbs.PathScaleY); + volume -= volume*tmp*tmp; + + if (hollowAmount > 0.0) + { + hollowVolume *= hollowAmount; + + switch (_pbs.HollowShape) + { + case HollowShape.Square: + case HollowShape.Same: + break; + + case HollowShape.Circle: + hollowVolume *= 0.78539816339f;; + break; + + case HollowShape.Triangle: + hollowVolume *= 0.5f * 0.5f; + break; + default: + hollowVolume = 0; + break; + } + volume *= (1.0f - hollowVolume); + } } - volume = volume - hollowVolume; - } break; + case ProfileShape.Circle: + if (_pbs.PathCurve == (byte)Extrusion.Straight) - { - // Cylinder - float volume1 = (float)(Math.PI * Math.Pow(_size.X/2, 2) * _size.Z); - float volume2 = (float)(Math.PI * Math.Pow(_size.Y/2, 2) * _size.Z); - - // Approximating the cylinder's irregularity. - if (volume1 > volume2) { - volume = (float)volume1 - (volume1 - volume2); + volume *= 0.78539816339f; // elipse base + + if (hollowAmount > 0.0) + { + switch (_pbs.HollowShape) + { + case HollowShape.Same: + case HollowShape.Circle: + break; + + case HollowShape.Square: + hollowVolume *= 0.5f * 2.5984480504799f; + break; + + case HollowShape.Triangle: + hollowVolume *= .5f * 1.27323954473516f; + break; + + default: + hollowVolume = 0; + break; + } + volume *= (1.0f - hollowVolume); + } } - else if (volume2 > volume1) + + else if (_pbs.PathCurve == (byte)Extrusion.Curve1) { - volume = (float)volume2 - (volume2 - volume1); + volume *= 0.61685027506808491367715568749226e-2f * (float)(200 - _pbs.PathScaleX); + tmp = 1.0f - .02f * (float)(200 - _pbs.PathScaleY); + volume *= (1.0f - tmp * tmp); + + if (hollowAmount > 0.0) + { + + // calculate the hollow volume by it's shape compared to the prim shape + hollowVolume *= hollowAmount; + + switch (_pbs.HollowShape) + { + case HollowShape.Same: + case HollowShape.Circle: + break; + + case HollowShape.Square: + hollowVolume *= 0.5f * 2.5984480504799f; + break; + + case HollowShape.Triangle: + hollowVolume *= .5f * 1.27323954473516f; + break; + + default: + hollowVolume = 0; + break; + } + volume *= (1.0f - hollowVolume); + } } - else - { - // Regular cylinder - volume = volume1; - } - } - else - { - // We don't know what the shape is yet, so use default - volume = _size.X * _size.Y * _size.Z; - } - // If the user has 'hollowed out' - // ProfileHollow is one of those 0 to 50000 values :P - // we like percentages better.. so turning into a percentage - - if (((float)_pbs.ProfileHollow / 50000f) > 0.0) - { - float hollowAmount = (float)_pbs.ProfileHollow / 50000f; - - // calculate the hollow volume by it's shape compared to the prim shape - float hollowVolume = 0; - switch (_pbs.HollowShape) - { - case HollowShape.Same: - case HollowShape.Circle: - // Hollow shape is a perfect cyllinder in respect to the cube's scale - // Cyllinder hollow volume calculation - float hRadius = _size.X / 2; - float hLength = _size.Z; - - // pi * r2 * h - hollowVolume = ((float)(Math.PI * Math.Pow(hRadius, 2) * hLength) * hollowAmount); - break; - - case HollowShape.Square: - // Cube Hollow volume calculation - float hollowsizex = _size.X * hollowAmount; - float hollowsizey = _size.Y * hollowAmount; - float hollowsizez = _size.Z * hollowAmount; - hollowVolume = hollowsizex * hollowsizey * hollowsizez; - break; - - case HollowShape.Triangle: - // Equilateral Triangular Prism volume hollow calculation - // Triangle is an Equilateral Triangular Prism with aLength = to _size.Y - - float aLength = _size.Y; - // 1/2 abh - hollowVolume = (float)((0.5 * aLength * _size.X * _size.Z) * hollowAmount); - break; - - default: - hollowVolume = 0; - break; - } - volume = volume - hollowVolume; - } break; case ProfileShape.HalfCircle: if (_pbs.PathCurve == (byte)Extrusion.Curve1) { - if (_size.X == _size.Y && _size.Y == _size.Z) - { - // regular sphere - // v = 4/3 * pi * r^3 - float sradius3 = (float)Math.Pow((_size.X / 2), 3); - volume = (float)((4f / 3f) * Math.PI * sradius3); - } - else - { - // we treat this as a box currently - volume = _size.X * _size.Y * _size.Z; - } - } - else - { - // We don't know what the shape is yet, so use default - volume = _size.X * _size.Y * _size.Z; + volume *= 0.52359877559829887307710723054658f; } break; case ProfileShape.EquilateralTriangle: - /* - v = (abs((xB*yA-xA*yB)+(xC*yB-xB*yC)+(xA*yC-xC*yA))/2) * h - // seed mesh - Vertex MM = new Vertex(-0.25f, -0.45f, 0.0f); - Vertex PM = new Vertex(+0.5f, 0f, 0.0f); - Vertex PP = new Vertex(-0.25f, +0.45f, 0.0f); - */ - float xA = -0.25f * _size.X; - float yA = -0.45f * _size.Y; - - float xB = 0.5f * _size.X; - float yB = 0; - - float xC = -0.25f * _size.X; - float yC = 0.45f * _size.Y; - - volume = (float)((Math.Abs((xB * yA - xA * yB) + (xC * yB - xB * yC) + (xA * yC - xC * yA)) / 2) * _size.Z); - - // If the user has 'hollowed out' - // ProfileHollow is one of those 0 to 50000 values :P - // we like percentages better.. so turning into a percentage - float fhollowFactor = ((float)_pbs.ProfileHollow / 1.9f); - if (((float)fhollowFactor / 50000f) > 0.0) - { - float hollowAmount = (float)fhollowFactor / 50000f; - - // calculate the hollow volume by it's shape compared to the prim shape - float hollowVolume = 0; - switch (_pbs.HollowShape) + if (_pbs.PathCurve == (byte)Extrusion.Straight) { - case HollowShape.Same: - case HollowShape.Triangle: - // Equilateral Triangular Prism volume hollow calculation - // Triangle is an Equilateral Triangular Prism with aLength = to _size.Y + volume *= 0.32475953f; - float aLength = _size.Y; - // 1/2 abh - hollowVolume = (float)((0.5 * aLength * _size.X * _size.Z) * hollowAmount); - break; + if (hollowAmount > 0.0) + { - case HollowShape.Square: - // Cube Hollow volume calculation - float hollowsizex = _size.X * hollowAmount; - float hollowsizey = _size.Y * hollowAmount; - float hollowsizez = _size.Z * hollowAmount; - hollowVolume = hollowsizex * hollowsizey * hollowsizez; - break; + // calculate the hollow volume by it's shape compared to the prim shape + switch (_pbs.HollowShape) + { + case HollowShape.Same: + case HollowShape.Triangle: + hollowVolume *= .25f; + break; - case HollowShape.Circle: - // Hollow shape is a perfect cyllinder in respect to the cube's scale - // Cyllinder hollow volume calculation - float hRadius = _size.X / 2; - float hLength = _size.Z; + case HollowShape.Square: + hollowVolume *= 0.499849f * 3.07920140172638f; + break; - // pi * r2 * h - hollowVolume = ((float)((Math.PI * Math.Pow(hRadius, 2) * hLength)/2) * hollowAmount); - break; + case HollowShape.Circle: + // Hollow shape is a perfect cyllinder in respect to the cube's scale + // Cyllinder hollow volume calculation - default: - hollowVolume = 0; - break; + hollowVolume *= 0.1963495f * 3.07920140172638f; + break; + + default: + hollowVolume = 0; + break; + } + volume *= (1.0f - hollowVolume); + } } - volume = volume - hollowVolume; - } - break; + else if (_pbs.PathCurve == (byte)Extrusion.Curve1) + { + volume *= 0.32475953f; + volume *= 0.01f * (float)(200 - _pbs.PathScaleX); + tmp = 1.0f - .02f * (float)(200 - _pbs.PathScaleY); + volume *= (1.0f - tmp * tmp); + + if (hollowAmount > 0.0) + { + + hollowVolume *= hollowAmount; + + switch (_pbs.HollowShape) + { + case HollowShape.Same: + case HollowShape.Triangle: + hollowVolume *= .25f; + break; + + case HollowShape.Square: + hollowVolume *= 0.499849f * 3.07920140172638f; + break; + + case HollowShape.Circle: + + hollowVolume *= 0.1963495f * 3.07920140172638f; + break; + + default: + hollowVolume = 0; + break; + } + volume *= (1.0f - hollowVolume); + } + } + break; default: - // we don't have all of the volume formulas yet so - // use the common volume formula for all - volume = _size.X*_size.Y*_size.Z; break; - } - - // Calculate Path cut effect on volume - // Not exact, in the triangle hollow example - // They should never be zero or less then zero.. - // we'll ignore it if it's less then zero - - // ProfileEnd and ProfileBegin are values - // from 0 to 50000 - - // Turning them back into percentages so that I can cut that percentage off the volume - - float PathCutEndAmount = _pbs.ProfileEnd; - float PathCutStartAmount = _pbs.ProfileBegin; - if (((PathCutStartAmount + PathCutEndAmount)/50000f) > 0.0f) - { - float pathCutAmount = ((PathCutStartAmount + PathCutEndAmount)/50000f); - - // Check the return amount for sanity - if (pathCutAmount >= 0.99f) - pathCutAmount = 0.99f; - - volume = volume - (volume*pathCutAmount); - } - UInt16 taperX = _pbs.PathScaleX; - UInt16 taperY = _pbs.PathScaleY; - float taperFactorX = 0; - float taperFactorY = 0; - - // Mass = density * volume - if (taperX != 100) - { - if (taperX > 100) - { - taperFactorX = 1.0f - ((float)taperX / 200); - //m_log.Warn("taperTopFactorX: " + extr.taperTopFactorX.ToString()); } - else - { - taperFactorX = 1.0f - ((100 - (float)taperX) / 100); - //m_log.Warn("taperBotFactorX: " + extr.taperBotFactorX.ToString()); - } - volume = (float)volume * ((taperFactorX / 3f) + 0.001f); - } - if (taperY != 100) - { - if (taperY > 100) + + + float taperX1; + float taperY1; + float taperX; + float taperY; + float pathBegin; + float pathEnd; + float profileBegin; + float profileEnd; + + if (_pbs.PathCurve == (byte)Extrusion.Straight || _pbs.PathCurve == (byte)Extrusion.Flexible) { - taperFactorY = 1.0f - ((float)taperY / 200); - //m_log.Warn("taperTopFactorY: " + extr.taperTopFactorY.ToString()); + taperX1 = _pbs.PathScaleX * 0.01f; + if (taperX1 > 1.0f) + taperX1 = 2.0f - taperX1; + taperX = 1.0f - taperX1; + + taperY1 = _pbs.PathScaleY * 0.01f; + if (taperY1 > 1.0f) + taperY1 = 2.0f - taperY1; + taperY = 1.0f - taperY1; } - else + else { - taperFactorY = 1.0f - ((100 - (float)taperY) / 100); - //m_log.Warn("taperBotFactorY: " + extr.taperBotFactorY.ToString()); + taperX = _pbs.PathTaperX * 0.01f; + if (taperX < 0.0f) + taperX = -taperX; + taperX1 = 1.0f - taperX; + + taperY = _pbs.PathTaperY * 0.01f; + if (taperY < 0.0f) + taperY = -taperY; + taperY1 = 1.0f - taperY; + } - volume = (float)volume * ((taperFactorY / 3f) + 0.001f); - } - returnMass = m_density*volume; - if (returnMass <= 0) returnMass = 0.0001f;//ckrinke: Mass must be greater then zero. + + + volume *= (taperX1 * taperY1 + 0.5f * (taperX1 * taperY + taperX * taperY1) + 0.3333333333f * taperX * taperY); + + pathBegin = (float)_pbs.PathBegin * 2.0e-5f; + pathEnd = 1.0f - (float)_pbs.PathEnd * 2.0e-5f; + volume *= (pathEnd - pathBegin); + +// this is crude aproximation + profileBegin = (float)_pbs.ProfileBegin * 2.0e-5f; + profileEnd = 1.0f - (float)_pbs.ProfileEnd * 2.0e-5f; + volume *= (profileEnd - profileBegin); + + returnMass = m_density * volume; + + if (returnMass <= 0) + returnMass = 0.0001f;//ckrinke: Mass must be greater then zero. +// else if (returnMass > _parent_scene.maximumMassObject) +// returnMass = _parent_scene.maximumMassObject; + @@ -857,7 +843,7 @@ namespace OpenSim.Region.Physics.OdePlugin } catch (AccessViolationException) { - m_log.Error("[PHYSICS]: MESH LOCKED"); + m_log.ErrorFormat("[PHYSICS]: MESH LOCKED FOR {0}", Name); return; } @@ -874,7 +860,7 @@ namespace OpenSim.Region.Physics.OdePlugin public void ProcessTaints(float timestep) { -//Console.WriteLine("ProcessTaints for " + m_primName); +//Console.WriteLine("ProcessTaints for " + Name); if (m_taintadd) { changeadd(timestep); @@ -945,7 +931,7 @@ namespace OpenSim.Region.Physics.OdePlugin } else { - m_log.Error("[PHYSICS]: The scene reused a disposed PhysActor! *waves finger*, Don't be evil. A couple of things can cause this. An improper prim breakdown(be sure to set prim_geom to zero after d.GeomDestroy! An improper buildup (creating the geom failed). Or, the Scene Reused a physics actor after disposing it.)"); + m_log.ErrorFormat("[PHYSICS]: The scene reused a disposed PhysActor for {0}! *waves finger*, Don't be evil. A couple of things can cause this. An improper prim breakdown(be sure to set prim_geom to zero after d.GeomDestroy! An improper buildup (creating the geom failed). Or, the Scene Reused a physics actor after disposing it.)", Name); } } @@ -1035,7 +1021,7 @@ namespace OpenSim.Region.Physics.OdePlugin // prim is the child public void ParentPrim(OdePrim prim) { -//Console.WriteLine("ParentPrim " + m_primName); +//Console.WriteLine("ParentPrim " + Name); if (this.m_localID != prim.m_localID) { if (Body == IntPtr.Zero) @@ -1071,18 +1057,20 @@ namespace OpenSim.Region.Physics.OdePlugin d.MassTranslate(ref m2, Position.X - prm.Position.X, Position.Y - prm.Position.Y, Position.Z - prm.Position.Z); d.MassAdd(ref pMass, ref m2); } + foreach (OdePrim prm in childrenPrim) { - prm.m_collisionCategories |= CollisionCategories.Body; prm.m_collisionFlags |= (CollisionCategories.Land | CollisionCategories.Wind); if (prm.prim_geom == IntPtr.Zero) { - m_log.Warn("[PHYSICS]: Unable to link one of the linkset elements. No geom yet"); + m_log.WarnFormat( + "[PHYSICS]: Unable to link one of the linkset elements {0} for parent {1}. No geom yet", + prm.Name, prim.Name); continue; } -//Console.WriteLine(" GeomSetCategoryBits 1: " + prm.prim_geom + " - " + (int)prm.m_collisionCategories + " for " + m_primName); +//Console.WriteLine(" GeomSetCategoryBits 1: " + prm.prim_geom + " - " + (int)prm.m_collisionCategories + " for " + Name); d.GeomSetCategoryBits(prm.prim_geom, (int)prm.m_collisionCategories); d.GeomSetCollideBits(prm.prim_geom, (int)prm.m_collisionFlags); @@ -1111,7 +1099,7 @@ namespace OpenSim.Region.Physics.OdePlugin } else { - m_log.Debug("[PHYSICS]:I ain't got no boooooooooddy, no body"); + m_log.DebugFormat("[PHYSICS]: {0} ain't got no boooooooooddy, no body", Name); } @@ -1130,7 +1118,7 @@ namespace OpenSim.Region.Physics.OdePlugin m_collisionCategories |= CollisionCategories.Body; m_collisionFlags |= (CollisionCategories.Land | CollisionCategories.Wind); -//Console.WriteLine("GeomSetCategoryBits 2: " + prim_geom + " - " + (int)m_collisionCategories + " for " + m_primName); +//Console.WriteLine("GeomSetCategoryBits 2: " + prim_geom + " - " + (int)m_collisionCategories + " for " + Name); d.GeomSetCategoryBits(prim_geom, (int)m_collisionCategories); //Console.WriteLine(" Post GeomSetCategoryBits 2"); d.GeomSetCollideBits(prim_geom, (int)m_collisionFlags); @@ -1373,7 +1361,7 @@ namespace OpenSim.Region.Physics.OdePlugin } catch (AccessViolationException) { - m_log.Warn("[PHYSICS]: Unable to create physics proxy for object"); + m_log.WarnFormat("[PHYSICS]: Unable to create physics proxy for object {0}", Name); ode.dunlock(_parent_scene.world); return; } @@ -1388,7 +1376,7 @@ namespace OpenSim.Region.Physics.OdePlugin } catch (AccessViolationException) { - m_log.Warn("[PHYSICS]: Unable to create physics proxy for object"); + m_log.WarnFormat("[PHYSICS]: Unable to create physics proxy for object {0}", Name); ode.dunlock(_parent_scene.world); return; } @@ -1404,7 +1392,7 @@ namespace OpenSim.Region.Physics.OdePlugin } catch (AccessViolationException) { - m_log.Warn("[PHYSICS]: Unable to create physics proxy for object"); + m_log.WarnFormat("[PHYSICS]: Unable to create physics proxy for object {0}", Name); ode.dunlock(_parent_scene.world); return; } @@ -1421,7 +1409,7 @@ namespace OpenSim.Region.Physics.OdePlugin } catch (AccessViolationException) { - m_log.Warn("[PHYSICS]: Unable to create physics proxy for object"); + m_log.WarnFormat("[PHYSICS]: Unable to create physics proxy for object {0}", Name); ode.dunlock(_parent_scene.world); return; } @@ -1444,7 +1432,7 @@ namespace OpenSim.Region.Physics.OdePlugin if (_parent_scene.needsMeshing(_pbs)) { // Don't need to re-enable body.. it's done in SetMesh - _mesh = _parent_scene.mesher.CreateMesh(m_primName, _pbs, _size, _parent_scene.meshSculptLOD, IsPhysical); + _mesh = _parent_scene.mesher.CreateMesh(Name, _pbs, _size, _parent_scene.meshSculptLOD, IsPhysical); // createmesh returns null when it's a shape that isn't a cube. // m_log.Debug(m_localID); } @@ -1473,7 +1461,7 @@ namespace OpenSim.Region.Physics.OdePlugin } } - _parent_scene.geom_name_map[prim_geom] = this.m_primName; + _parent_scene.geom_name_map[prim_geom] = this.Name; _parent_scene.actor_name_map[prim_geom] = (PhysicsActor)this; changeSelectedStatus(timestep); @@ -1524,7 +1512,7 @@ Console.WriteLine(" JointCreateFixed"); } else { - m_log.Warn("[PHYSICS]: Body Still null after enableBody(). This is a crash scenario."); + m_log.WarnFormat("[PHYSICS]: Body for {0} still null after enableBody(). This is a crash scenario.", Name); } } //else @@ -1573,7 +1561,7 @@ Console.WriteLine(" JointCreateFixed"); } else { -//Console.WriteLine("Move " + m_primName); +//Console.WriteLine("Move " + Name); if (!d.BodyIsEnabled (Body)) d.BodyEnable (Body); // KF add 161009 // NON-'VEHICLES' are dealt with here // if (d.BodyIsEnabled(Body) && !m_angularlock.ApproxEquals(Vector3.Zero, 0.003f)) @@ -1605,7 +1593,7 @@ Console.WriteLine(" JointCreateFixed"); if (m_usePID) { -//Console.WriteLine("PID " + m_primName); +//Console.WriteLine("PID " + Name); // KF - this is for object move? eg. llSetPos() ? //if (!d.BodyIsEnabled(Body)) //d.BodySetForce(Body, 0f, 0f, 0f); @@ -1677,7 +1665,7 @@ Console.WriteLine(" JointCreateFixed"); // Hover PID Controller needs to be mutually exlusive to MoveTo PID controller if (m_useHoverPID && !m_usePID) { -//Console.WriteLine("Hover " + m_primName); +//Console.WriteLine("Hover " + Name); // If we're using the PID controller, then we have no gravity fz = (-1 * _parent_scene.gravityz) * m_mass; @@ -1803,7 +1791,7 @@ Console.WriteLine(" JointCreateFixed"); { // is not physical, or is not a body or is selected // _zeroPosition = d.BodyGetPosition(Body); return; -//Console.WriteLine("Nothing " + m_primName); +//Console.WriteLine("Nothing " + Name); } } @@ -1891,10 +1879,10 @@ Console.WriteLine(" JointCreateFixed"); catch (System.AccessViolationException) { prim_geom = IntPtr.Zero; - m_log.Error("[PHYSICS]: PrimGeom dead"); + m_log.ErrorFormat("[PHYSICS]: PrimGeom dead for {0}", Name); } } -//Console.WriteLine("changePhysicsStatus for " + m_primName); +//Console.WriteLine("changePhysicsStatus for " + Name); changeadd(2f); } if (childPrim) @@ -2063,7 +2051,7 @@ Console.WriteLine(" JointCreateFixed"); catch (System.AccessViolationException) { prim_geom = IntPtr.Zero; - m_log.Error("[PHYSICS]: PrimGeom dead"); + m_log.ErrorFormat("[PHYSICS]: PrimGeom dead for {0}", Name); } prim_geom = IntPtr.Zero; // we don't need to do space calculation because the client sends a position update also. @@ -2307,7 +2295,7 @@ Console.WriteLine(" JointCreateFixed"); } else { - m_log.Warn("[PHYSICS]: Got NaN Size on object"); + m_log.WarnFormat("[PHYSICS]: Got NaN Size on object {0}", Name); } } } @@ -2329,7 +2317,7 @@ Console.WriteLine(" JointCreateFixed"); } else { - m_log.Warn("[PHYSICS]: NaN in Force Applied to an Object"); + m_log.WarnFormat("[PHYSICS]: NaN in Force Applied to an Object {0}", Name); } } } @@ -2413,7 +2401,7 @@ Console.WriteLine(" JointCreateFixed"); } else { - m_log.Warn("[PHYSICS]: Got NaN Velocity in Object"); + m_log.WarnFormat("[PHYSICS]: Got NaN Velocity in Object {0}", Name); } } @@ -2438,7 +2426,7 @@ Console.WriteLine(" JointCreateFixed"); } else { - m_log.Warn("[PHYSICS]: Got NaN Torque in Object"); + m_log.WarnFormat("[PHYSICS]: Got NaN Torque in Object {0}", Name); } } } @@ -2465,7 +2453,7 @@ Console.WriteLine(" JointCreateFixed"); _orientation = value; } else - m_log.Warn("[PHYSICS]: Got NaN quaternion Orientation from Scene in Object"); + m_log.WarnFormat("[PHYSICS]: Got NaN quaternion Orientation from Scene in Object {0}", Name); } } @@ -2505,7 +2493,7 @@ Console.WriteLine(" JointCreateFixed"); } else { - m_log.Warn("[PHYSICS]: Got Invalid linear force vector from Scene in Object"); + m_log.WarnFormat("[PHYSICS]: Got Invalid linear force vector from Scene in Object {0}", Name); } //m_log.Info("[PHYSICS]: Added Force:" + force.ToString() + " to prim at " + Position.ToString()); } @@ -2519,7 +2507,7 @@ Console.WriteLine(" JointCreateFixed"); } else { - m_log.Warn("[PHYSICS]: Got Invalid Angular force vector from Scene in Object"); + m_log.WarnFormat("[PHYSICS]: Got Invalid Angular force vector from Scene in Object {0}", Name); } } @@ -2545,7 +2533,7 @@ Console.WriteLine(" JointCreateFixed"); } else { - m_log.Warn("[PHYSICS]: Got NaN RotationalVelocity in Object"); + m_log.WarnFormat("[PHYSICS]: Got NaN RotationalVelocity in Object {0}", Name); } } } @@ -2560,7 +2548,7 @@ Console.WriteLine(" JointCreateFixed"); } else if (m_crossingfailures == _parent_scene.geomCrossingFailuresBeforeOutofbounds) { - m_log.Warn("[PHYSICS]: Too many crossing failures for: " + m_primName); + m_log.Warn("[PHYSICS]: Too many crossing failures for: " + Name); } } @@ -2593,7 +2581,7 @@ Console.WriteLine(" JointCreateFixed"); } else { - m_log.Warn("[PHYSICS]: Got NaN locking axis from Scene on Object"); + m_log.WarnFormat("[PHYSICS]: Got NaN locking axis from Scene on Object {0}", Name); } } @@ -2685,7 +2673,7 @@ Console.WriteLine(" JointCreateFixed"); } //float Adiff = 1.0f - Math.Abs(Quaternion.Dot(m_lastorientation, l_orientation)); -//Console.WriteLine("Adiff " + m_primName + " = " + Adiff); +//Console.WriteLine("Adiff " + Name + " = " + Adiff); if ((Math.Abs(m_lastposition.X - l_position.X) < 0.02) && (Math.Abs(m_lastposition.Y - l_position.Y) < 0.02) && (Math.Abs(m_lastposition.Z - l_position.Z) < 0.02) @@ -2826,7 +2814,7 @@ Console.WriteLine(" JointCreateFixed"); m_PIDTarget = value; } else - m_log.Warn("[PHYSICS]: Got NaN PIDTarget from Scene on Object"); + m_log.WarnFormat("[PHYSICS]: Got NaN PIDTarget from Scene on Object {0}", Name); } } public override bool PIDActive { set { m_usePID = value; } } diff --git a/OpenSim/Region/Physics/OdePlugin/Tests/ODETestClass.cs b/OpenSim/Region/Physics/OdePlugin/Tests/ODETestClass.cs index 69e2d03482..a7f8baa729 100644 --- a/OpenSim/Region/Physics/OdePlugin/Tests/ODETestClass.cs +++ b/OpenSim/Region/Physics/OdePlugin/Tests/ODETestClass.cs @@ -48,6 +48,10 @@ namespace OpenSim.Region.Physics.OdePlugin [SetUp] public void Initialize() { + IConfigSource TopConfig = new IniConfigSource(); + IConfig config = TopConfig.AddConfig("Startup"); + config.Set("DecodedSculptMapPath","j2kDecodeCache"); + // Loading ODEPlugin cbt = new OdePlugin(); // Loading Zero Mesher @@ -55,7 +59,7 @@ namespace OpenSim.Region.Physics.OdePlugin // Getting Physics Scene ps = cbt.GetScene("test"); // Initializing Physics Scene. - ps.Initialise(imp.GetMesher(),null); + ps.Initialise(imp.GetMesher(TopConfig),null); float[] _heightmap = new float[(int)Constants.RegionSize * (int)Constants.RegionSize]; for (int i = 0; i < ((int)Constants.RegionSize * (int)Constants.RegionSize); i++) { diff --git a/OpenSim/Region/RegionCombinerModule/RegionCombinerIndividualEventForwarder.cs b/OpenSim/Region/RegionCombinerModule/RegionCombinerIndividualEventForwarder.cs index 9d41c9c225..f424e7f42c 100644 --- a/OpenSim/Region/RegionCombinerModule/RegionCombinerIndividualEventForwarder.cs +++ b/OpenSim/Region/RegionCombinerModule/RegionCombinerIndividualEventForwarder.cs @@ -28,11 +28,14 @@ using System; using OpenMetaverse; using OpenSim.Framework; +using OpenSim.Region.CoreModules.Avatar.Attachments; +using OpenSim.Region.CoreModules.Avatar.Gods; +using OpenSim.Region.Framework.Interfaces; using OpenSim.Region.Framework.Scenes; namespace OpenSim.Region.RegionCombinerModule { - public class RegionCombinerIndividualEventForwarder + public class RegionCombinerIndividualEventForwarder { private Scene m_rootScene; private Scene m_virtScene; @@ -48,20 +51,29 @@ namespace OpenSim.Region.RegionCombinerModule m_virtScene.UnSubscribeToClientPrimEvents(client); m_virtScene.UnSubscribeToClientPrimRezEvents(client); m_virtScene.UnSubscribeToClientInventoryEvents(client); - m_virtScene.UnSubscribeToClientAttachmentEvents(client); + ((AttachmentsModule)m_virtScene.AttachmentsModule).UnsubscribeFromClientEvents(client); //m_virtScene.UnSubscribeToClientTeleportEvents(client); m_virtScene.UnSubscribeToClientScriptEvents(client); - m_virtScene.UnSubscribeToClientGodEvents(client); + + IGodsModule virtGodsModule = m_virtScene.RequestModuleInterface(); + if (virtGodsModule != null) + ((GodsModule)virtGodsModule).UnsubscribeFromClientEvents(client); + m_virtScene.UnSubscribeToClientNetworkEvents(client); m_rootScene.SubscribeToClientPrimEvents(client); client.OnAddPrim += LocalAddNewPrim; client.OnRezObject += LocalRezObject; + m_rootScene.SubscribeToClientInventoryEvents(client); - m_rootScene.SubscribeToClientAttachmentEvents(client); + ((AttachmentsModule)m_rootScene.AttachmentsModule).SubscribeToClientEvents(client); //m_rootScene.SubscribeToClientTeleportEvents(client); m_rootScene.SubscribeToClientScriptEvents(client); - m_rootScene.SubscribeToClientGodEvents(client); + + IGodsModule rootGodsModule = m_virtScene.RequestModuleInterface(); + if (rootGodsModule != null) + ((GodsModule)rootGodsModule).UnsubscribeFromClientEvents(client); + m_rootScene.SubscribeToClientNetworkEvents(client); } diff --git a/OpenSim/Region/RegionCombinerModule/RegionCombinerLargeLandChannel.cs b/OpenSim/Region/RegionCombinerModule/RegionCombinerLargeLandChannel.cs index 33ff707e9f..be5411a34b 100644 --- a/OpenSim/Region/RegionCombinerModule/RegionCombinerLargeLandChannel.cs +++ b/OpenSim/Region/RegionCombinerModule/RegionCombinerLargeLandChannel.cs @@ -118,7 +118,7 @@ public class RegionCombinerLargeLandChannel : ILandChannel return regionData.RegionScene.LandChannel.GetLandObject(x - offsetX, y - offsetY); } } - + ILandObject obj = new LandObject(UUID.Zero, false, RegData.RegionScene); obj.LandData.Name = "NO LAND"; return obj; @@ -142,14 +142,14 @@ public class RegionCombinerLargeLandChannel : ILandChannel public void Join(int start_x, int start_y, int end_x, int end_y, UUID attempting_user_id) { - RootRegionLandChannel.Join(start_x, start_y, end_x, end_y, attempting_user_id); + RootRegionLandChannel.Join(start_x, start_y, end_x, end_y, attempting_user_id); } public void Subdivide(int start_x, int start_y, int end_x, int end_y, UUID attempting_user_id) { RootRegionLandChannel.Subdivide(start_x, start_y, end_x, end_y, attempting_user_id); } - + public void ReturnObjectsInParcel(int localID, uint returnType, UUID[] agentIDs, UUID[] taskIDs, IClientAPI remoteClient) { RootRegionLandChannel.ReturnObjectsInParcel(localID, returnType, agentIDs, taskIDs, remoteClient); diff --git a/OpenSim/Region/ScriptEngine/Interfaces/IScriptEngine.cs b/OpenSim/Region/ScriptEngine/Interfaces/IScriptEngine.cs index 02d15118f7..581a9a9443 100644 --- a/OpenSim/Region/ScriptEngine/Interfaces/IScriptEngine.cs +++ b/OpenSim/Region/ScriptEngine/Interfaces/IScriptEngine.cs @@ -82,6 +82,7 @@ namespace OpenSim.Region.ScriptEngine.Interfaces IConfig Config { get; } IConfigSource ConfigSource { get; } string ScriptEngineName { get; } + string ScriptEnginePath { get; } IScriptApi GetApi(UUID itemID, string name); } } diff --git a/OpenSim/Region/ScriptEngine/Interfaces/IScriptInstance.cs b/OpenSim/Region/ScriptEngine/Interfaces/IScriptInstance.cs index 9f6ea35e31..0c99d8cb95 100644 --- a/OpenSim/Region/ScriptEngine/Interfaces/IScriptInstance.cs +++ b/OpenSim/Region/ScriptEngine/Interfaces/IScriptInstance.cs @@ -38,10 +38,11 @@ namespace OpenSim.Region.ScriptEngine.Interfaces { public enum StateSource { - NewRez = 0, - PrimCrossing = 1, - ScriptedRez = 2, - AttachedRez = 3 + RegionStart = 0, + NewRez = 1, + PrimCrossing = 2, + ScriptedRez = 3, + AttachedRez = 4 } public interface IScriptWorkItem diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs index f4e08a46e3..e84dbc206d 100644 --- a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs +++ b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs @@ -24,7 +24,7 @@ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ - + using System; using System.Collections; using System.Collections.Generic; @@ -68,6 +68,14 @@ using System.Reflection; namespace OpenSim.Region.ScriptEngine.Shared.Api { + // MUST be a ref type + public class UserInfoCacheEntry + { + public int time; + public UserAccount account; + public PresenceInfo pinfo; + } + /// /// Contains all LSL ll-functions. This class will be in Default AppDomain. /// @@ -92,6 +100,8 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api protected int m_scriptConsoleChannel = 0; protected bool m_scriptConsoleChannelEnabled = false; protected IUrlModule m_UrlModule = null; + protected Dictionary m_userInfoCache = + new Dictionary(); public void Initialize(IScriptEngine ScriptEngine, SceneObjectPart host, uint localID, UUID itemID) { @@ -225,7 +235,9 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api { case ScriptBaseClass.LINK_SET: if (m_host.ParentGroup != null) - return new List(m_host.ParentGroup.Children.Values); + { + return new List(m_host.ParentGroup.Parts); + } return ret; case ScriptBaseClass.LINK_ROOT: @@ -240,7 +252,9 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api case ScriptBaseClass.LINK_ALL_OTHERS: if (m_host.ParentGroup == null) return new List(); - ret = new List(m_host.ParentGroup.Children.Values); + + ret = new List(m_host.ParentGroup.Parts); + if (ret.Contains(m_host)) ret.Remove(m_host); return ret; @@ -248,7 +262,9 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api case ScriptBaseClass.LINK_ALL_CHILDREN: if (m_host.ParentGroup == null) return new List(); - ret = new List(m_host.ParentGroup.Children.Values); + + ret = new List(m_host.ParentGroup.Parts); + if (ret.Contains(m_host.ParentGroup.RootPart)) ret.Remove(m_host.ParentGroup.RootPart); return ret; @@ -1175,7 +1191,8 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api if (group == null) return; bool allow = true; - foreach (SceneObjectPart part in group.Children.Values) + + foreach (SceneObjectPart part in group.Parts) { if (part.Scale.X > World.m_maxPhys || part.Scale.Y > World.m_maxPhys || part.Scale.Z > World.m_maxPhys) { @@ -1406,6 +1423,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api if (face == ScriptBaseClass.ALL_SIDES) face = SceneObjectPart.ALL_SIDES; + // REGION SYNC if (World.ScriptEngineToSceneConnectorModule == null) { m_host.SetFaceColor(new Vector3((float)color.x, (float)color.y, (float)color.z), face); @@ -1953,14 +1971,14 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api protected void SetPos(SceneObjectPart part, LSL_Vector targetPos) { // Capped movemment if distance > 10m (http://wiki.secondlife.com/wiki/LlSetPos) - LSL_Vector currentPos = llGetLocalPos(); + LSL_Vector currentPos = GetPartLocalPos(part); float ground = World.GetGroundHeight((float)targetPos.x, (float)targetPos.y); bool disable_underground_movement = m_ScriptEngine.Config.GetBoolean("DisableUndergroundMovement", true); if (part.ParentGroup.RootPart == part) { - if ((targetPos.z < ground) && disable_underground_movement) + if ((targetPos.z < ground) && disable_underground_movement && m_host.AttachmentPoint == 0) targetPos.z = ground; SceneObjectGroup parent = part.ParentGroup; LSL_Vector real_vec = SetPosAdjust(currentPos, targetPos); @@ -1979,25 +1997,25 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api } else { - if (llVecDist(new LSL_Vector(0,0,0), targetPos) <= 10.0f) + LSL_Vector rel_vec = SetPosAdjust(currentPos, targetPos); + + //KittyL: edited below + if ((World.ScriptEngineToSceneConnectorModule == null)) { - //KittyL: edited below - if ((World.ScriptEngineToSceneConnectorModule == null)) - { - part.OffsetPosition = new Vector3((float)targetPos.x, (float)targetPos.y, (float)targetPos.z); - SceneObjectGroup parent = part.ParentGroup; - parent.HasGroupChanged = true; - parent.ScheduleGroupForTerseUpdate(); - } - else - { - object[] valParams = new object[3]; - valParams[0] = (object)targetPos.x; - valParams[1] = (object)targetPos.y; - valParams[2] = (object)targetPos.z; - World.ScriptEngineToSceneConnectorModule.SendSetPrimProperties(m_host.ParentGroup.LocX, m_host.ParentGroup.LocY, m_host.UUID, "pos", (object)valParams); - } + part.OffsetPosition = new Vector3((float)rel_vec.x, (float)rel_vec.y, (float)rel_vec.z); + SceneObjectGroup parent = part.ParentGroup; + parent.HasGroupChanged = true; + parent.ScheduleGroupForTerseUpdate(); } + else + { + object[] valParams = new object[3]; + valParams[0] = (object)rel_vec.x; + valParams[1] = (object)rel_vec.y; + valParams[2] = (object)rel_vec.z; + World.ScriptEngineToSceneConnectorModule.SendSetPrimProperties(m_host.ParentGroup.LocX, m_host.ParentGroup.LocY, m_host.UUID, "pos", (object)valParams); + } + } } @@ -2011,17 +2029,32 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api public LSL_Vector llGetLocalPos() { m_host.AddScriptLPS(1); - if (m_host.ParentID != 0) + return GetPartLocalPos(m_host); + } + + protected LSL_Vector GetPartLocalPos(SceneObjectPart part) + { + m_host.AddScriptLPS(1); + if (part.ParentID == 0) { - return new LSL_Vector(m_host.OffsetPosition.X, - m_host.OffsetPosition.Y, - m_host.OffsetPosition.Z); + return new LSL_Vector(part.AbsolutePosition.X, + part.AbsolutePosition.Y, + part.AbsolutePosition.Z); } else { - return new LSL_Vector(m_host.AbsolutePosition.X, - m_host.AbsolutePosition.Y, - m_host.AbsolutePosition.Z); + if (m_host.IsRoot) + { + return new LSL_Vector(m_host.AttachedPos.X, + m_host.AttachedPos.Y, + m_host.AttachedPos.Z); + } + else + { + return new LSL_Vector(part.OffsetPosition.X, + part.OffsetPosition.Y, + part.OffsetPosition.Z); + } } } @@ -2066,7 +2099,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api //KF: Do NOT use this next line if using ODE physics engine. This need a switch based on .ini Phys Engine type // part.ParentGroup.AbsolutePosition = part.ParentGroup.AbsolutePosition; - + // So, after thinking about this for a bit, the issue with the part.ParentGroup.AbsolutePosition = part.ParentGroup.AbsolutePosition line // is it isn't compatible with vehicles because it causes the vehicle body to have to be broken down and rebuilt // It's perfectly okay when the object is not an active physical body though. @@ -3035,17 +3068,25 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api if ((item.PermsMask & ScriptBaseClass.PERMISSION_ATTACH) != 0) { - SceneObjectGroup grp = m_host.ParentGroup; - UUID itemID = grp.GetFromItemID(); - - ScenePresence presence = World.GetScenePresence(m_host.OwnerID); - IAttachmentsModule attachmentsModule = m_ScriptEngine.World.AttachmentsModule; if (attachmentsModule != null) - attachmentsModule.ShowDetachInUserInventory(itemID, presence.ControllingClient); + Util.FireAndForget(DetachWrapper, m_host); } } + private void DetachWrapper(object o) + { + SceneObjectPart host = (SceneObjectPart)o; + + SceneObjectGroup grp = host.ParentGroup; + UUID itemID = grp.GetFromItemID(); + ScenePresence presence = World.GetScenePresence(host.OwnerID); + + IAttachmentsModule attachmentsModule = m_ScriptEngine.World.AttachmentsModule; + if (attachmentsModule != null) + attachmentsModule.ShowDetachInUserInventory(itemID, presence.ControllingClient); + } + public void llTakeCamera(string avatar) { m_host.AddScriptLPS(1); @@ -3332,17 +3373,11 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api public void llPointAt(LSL_Vector pos) { m_host.AddScriptLPS(1); - ScenePresence Owner = World.GetScenePresence(m_host.UUID); - LSL_Rotation rot = llEuler2Rot(pos); - Owner.PreviousRotation = Owner.Rotation; - Owner.Rotation = (new Quaternion((float)rot.x,(float)rot.y,(float)rot.z,(float)rot.s)); } public void llStopPointAt() { m_host.AddScriptLPS(1); - ScenePresence Owner = m_host.ParentGroup.Scene.GetScenePresence(m_host.OwnerID); - Owner.Rotation = Owner.PreviousRotation; } public void llTargetOmega(LSL_Vector axis, double spinrate, double gain) @@ -3557,7 +3592,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api { m_host.AddScriptLPS(1); - if (m_host.ParentGroup.Children.Count > 1) + if (m_host.ParentGroup.PrimCount > 1) { return m_host.LinkNum; } @@ -3579,6 +3614,10 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api { m_host.AddScriptLPS(1); UUID invItemID = InventorySelf(); + UUID targetID; + + if (!UUID.TryParse(target, out targetID)) + return; TaskInventoryItem item; lock (m_host.TaskInventory) @@ -3598,7 +3637,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api if (sp != null) client = sp.ControllingClient; - SceneObjectPart targetPart = World.GetSceneObjectPart((UUID)target); + SceneObjectPart targetPart = World.GetSceneObjectPart((UUID)targetID); if (targetPart.ParentGroup.RootPart.AttachmentPoint != 0) return; // Fail silently if attached @@ -3665,7 +3704,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api case ScriptBaseClass.LINK_ALL_OTHERS: case ScriptBaseClass.LINK_ALL_CHILDREN: case ScriptBaseClass.LINK_THIS: - foreach (SceneObjectPart part in parentPrim.Children.Values) + foreach (SceneObjectPart part in parentPrim.Parts) { if (part.UUID != m_host.UUID) { @@ -3684,7 +3723,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api if (linknum == ScriptBaseClass.LINK_ROOT) { // Restructuring Multiple Prims. - List parts = new List(parentPrim.Children.Values); + List parts = new List(parentPrim.Parts); parts.Remove(parentPrim.RootPart); foreach (SceneObjectPart part in parts) { @@ -3726,7 +3765,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api if (parentPrim.RootPart.AttachmentPoint != 0) return; // Fail silently if attached - List parts = new List(parentPrim.Children.Values); + List parts = new List(parentPrim.Parts); parts.Remove(parentPrim.RootPart); foreach (SceneObjectPart part in parts) @@ -3914,18 +3953,16 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api if (World.GetScenePresence(destId) != null) { // destination is an avatar - InventoryItemBase agentItem = - World.MoveTaskInventoryItem(destId, UUID.Zero, m_host, objId); + InventoryItemBase agentItem = World.MoveTaskInventoryItem(destId, UUID.Zero, m_host, objId); if (agentItem == null) return; byte[] bucket = new byte[17]; bucket[0] = (byte)assetType; - byte[] objBytes = objId.GetBytes(); + byte[] objBytes = agentItem.ID.GetBytes(); Array.Copy(objBytes, 0, bucket, 1, 16); - Console.WriteLine("Giving inventory"); GridInstantMessage msg = new GridInstantMessage(World, m_host.UUID, m_host.Name+", an object owned by "+ resolveName(m_host.OwnerID)+",", destId, @@ -3998,26 +4035,74 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api m_host.AddScriptLPS(1); UUID uuid = (UUID)id; - - UserAccount account = World.UserAccountService.GetUserAccount(World.RegionInfo.ScopeID, uuid); - PresenceInfo pinfo = null; - PresenceInfo[] pinfos = World.PresenceService.GetAgents(new string[] { uuid.ToString() }); - if (pinfos != null && pinfos.Length > 0) - pinfo = pinfos[0]; + UserAccount account; - if (pinfo == null) - return UUID.Zero.ToString(); + UserInfoCacheEntry ce; + if (!m_userInfoCache.TryGetValue(uuid, out ce)) + { + account = World.UserAccountService.GetUserAccount(World.RegionInfo.ScopeID, uuid); + if (account == null) + { + m_userInfoCache[uuid] = null; // Cache negative + return UUID.Zero.ToString(); + } + + + PresenceInfo[] pinfos = World.PresenceService.GetAgents(new string[] { uuid.ToString() }); + if (pinfos != null && pinfos.Length > 0) + { + foreach (PresenceInfo p in pinfos) + { + if (p.RegionID != UUID.Zero) + { + pinfo = p; + } + } + } + + ce = new UserInfoCacheEntry(); + ce.time = Util.EnvironmentTickCount(); + ce.account = account; + ce.pinfo = pinfo; + } + else + { + if (ce == null) + return UUID.Zero.ToString(); + + account = ce.account; + pinfo = ce.pinfo; + } + + if (Util.EnvironmentTickCount() < ce.time || (Util.EnvironmentTickCount() - ce.time) >= 20000) + { + PresenceInfo[] pinfos = World.PresenceService.GetAgents(new string[] { uuid.ToString() }); + if (pinfos != null && pinfos.Length > 0) + { + foreach (PresenceInfo p in pinfos) + { + if (p.RegionID != UUID.Zero) + { + pinfo = p; + } + } + } + else + pinfo = null; + + ce.time = Util.EnvironmentTickCount(); + ce.pinfo = pinfo; + } string reply = String.Empty; switch (data) { case 1: // DATA_ONLINE (0|1) - // TODO: implement fetching of this information - if (pinfo != null) + if (pinfo != null && pinfo.RegionID != UUID.Zero) reply = "1"; - else + else reply = "0"; break; case 2: // DATA_NAME (First Last) @@ -4112,7 +4197,6 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api if (m_host.OwnerID == World.LandChannel.GetLandObject( presence.AbsolutePosition.X, presence.AbsolutePosition.Y).LandData.OwnerID) { - presence.ControllingClient.SendTeleportLocationStart(); World.TeleportClientHome(agentId, presence.ControllingClient); } } @@ -4211,7 +4295,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api return currentAnimationState; } } - + return String.Empty; } @@ -4232,7 +4316,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api { partItemID = item.ItemID; int linkNumber = m_host.LinkNum; - if (m_host.ParentGroup.Children.Count == 1) + if (m_host.ParentGroup.PrimCount == 1) linkNumber = 0; object[] resobj = new object[] @@ -4326,7 +4410,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api return; // Need provisions for Group Owned here - if (m_host.OwnerID == targetlandObj.LandData.OwnerID || + if (m_host.OwnerID == targetlandObj.LandData.OwnerID || targetlandObj.LandData.IsGroupOwned || m_host.OwnerID == targetID) { pushAllowed = true; @@ -4346,8 +4430,8 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api if ((targetlandObj.LandData.Flags & (uint)ParcelFlags.RestrictPushObject) == (uint)ParcelFlags.RestrictPushObject) { // Need provisions for Group Owned here - if (m_host.OwnerID == targetlandObj.LandData.OwnerID || - targetlandObj.LandData.IsGroupOwned || + if (m_host.OwnerID == targetlandObj.LandData.OwnerID || + targetlandObj.LandData.IsGroupOwned || m_host.OwnerID == targetID) { pushAllowed = true; @@ -4472,7 +4556,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api return sides; } - + /* The new / changed functions were tested with the following LSL script: @@ -5479,7 +5563,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api flags |= ScriptBaseClass.AGENT_SITTING; } - if (agent.Animator.Animations.DefaultAnimation.AnimID + if (agent.Animator.Animations.DefaultAnimation.AnimID == AnimationSet.Animations.AnimsUUID["SIT_GROUND_CONSTRAINED"]) { flags |= ScriptBaseClass.AGENT_SITTING; @@ -5610,78 +5694,6 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api ScriptSleep(5000); } - public LSL_List llParseString2List(string str, LSL_List separators, LSL_List in_spacers) - { - m_host.AddScriptLPS(1); - LSL_List ret = new LSL_List(); - LSL_List spacers = new LSL_List(); - if (in_spacers.Length > 0 && separators.Length > 0) - { - for (int i = 0; i < in_spacers.Length; i++) - { - object s = in_spacers.Data[i]; - for (int j = 0; j < separators.Length; j++) - { - if (separators.Data[j].ToString() == s.ToString()) - { - s = null; - break; - } - } - if (s != null) - { - spacers.Add(s); - } - } - } - object[] delimiters = new object[separators.Length + spacers.Length]; - separators.Data.CopyTo(delimiters, 0); - spacers.Data.CopyTo(delimiters, separators.Length); - bool dfound = false; - do - { - dfound = false; - int cindex = -1; - string cdeli = ""; - for (int i = 0; i < delimiters.Length; i++) - { - int index = str.IndexOf(delimiters[i].ToString()); - bool found = index != -1; - if (found && String.Empty != delimiters[i].ToString()) - { - if ((cindex > index) || (cindex == -1)) - { - cindex = index; - cdeli = delimiters[i].ToString(); - } - dfound = dfound || found; - } - } - if (cindex != -1) - { - if (cindex > 0) - { - ret.Add(new LSL_String(str.Substring(0, cindex))); - } - // Cannot use spacers.Contains() because spacers may be either type String or LSLString - for (int j = 0; j < spacers.Length; j++) - { - if (spacers.Data[j].ToString() == cdeli) - { - ret.Add(new LSL_String(cdeli)); - break; - } - } - str = str.Substring(cindex + cdeli.Length); - } - } while (dfound); - if (str != "") - { - ret.Add(new LSL_String(str)); - } - return ret; - } - public LSL_Integer llOverMyLand(string id) { m_host.AddScriptLPS(1); @@ -5918,7 +5930,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api m_host.AddScriptLPS(1); return World.SimulatorFPS; } - + /* particle system rules should be coming into this routine as doubles, that is rule[0] should be an integer from this list and rule[1] should be the arg @@ -6001,7 +6013,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api private void SetParticleSystem(SceneObjectPart part, LSL_List rules) { - + if (rules.Length == 0) { part.RemoveParticleSystem(); @@ -6172,7 +6184,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api if (m_host.PhysActor != null) { float ground = (float)llGround(new LSL_Types.Vector3(0, 0, 0)); - float waterLevel = (float)llWater(new LSL_Types.Vector3(0, 0, 0)); + float waterLevel = (float)llWater(new LSL_Types.Vector3(0, 0, 0)); PIDHoverType hoverType = PIDHoverType.Ground; if (water != 0) { @@ -6186,7 +6198,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api { height += ground; } - + m_host.SetHoverHeight((float)height, hoverType, (float)tau); } } @@ -6568,19 +6580,19 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api if (xmlRpcRouter != null) { string ExternalHostName = m_ScriptEngine.World.RegionInfo.ExternalHostName; - - xmlRpcRouter.RegisterNewReceiver(m_ScriptEngine.ScriptModule, channelID, m_host.UUID, - m_itemID, String.Format("http://{0}:{1}/", ExternalHostName, + + xmlRpcRouter.RegisterNewReceiver(m_ScriptEngine.ScriptModule, channelID, m_host.UUID, + m_itemID, String.Format("http://{0}:{1}/", ExternalHostName, xmlrpcMod.Port.ToString())); } - object[] resobj = new object[] - { - new LSL_Integer(1), - new LSL_String(channelID.ToString()), - new LSL_String(UUID.Zero.ToString()), - new LSL_String(String.Empty), - new LSL_Integer(0), - new LSL_String(String.Empty) + object[] resobj = new object[] + { + new LSL_Integer(1), + new LSL_String(channelID.ToString()), + new LSL_String(UUID.Zero.ToString()), + new LSL_String(String.Empty), + new LSL_Integer(0), + new LSL_String(String.Empty) }; m_ScriptEngine.PostScriptEvent(m_itemID, new EventParams("remote_data", resobj, new DetectParams[0])); @@ -6957,6 +6969,8 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api { m_host.AddScriptLPS(1); SetPrimParams(m_host, rules); + + ScriptSleep(200); } public void llSetLinkPrimitiveParams(int linknumber, LSL_List rules) @@ -6967,11 +6981,18 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api foreach (SceneObjectPart part in parts) SetPrimParams(part, rules); + + ScriptSleep(200); } public void llSetLinkPrimitiveParamsFast(int linknumber, LSL_List rules) { - llSetLinkPrimitiveParams(linknumber, rules); + m_host.AddScriptLPS(1); + + List parts = GetLinkParts(linknumber); + + foreach (SceneObjectPart part in parts) + SetPrimParams(part, rules); } protected void SetPrimParams(SceneObjectPart part, LSL_List rules) @@ -7124,7 +7145,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api radiusoffset = (float)rules.GetLSLFloatItem(idx++); skew = (float)rules.GetLSLFloatItem(idx++); part.Shape.PathCurve = (byte)Extrusion.Curve1; - SetPrimitiveShapeParams(part, face, v, hollow, twist, holesize, topshear, profilecut, taper_b, + SetPrimitiveShapeParams(part, face, v, hollow, twist, holesize, topshear, profilecut, taper_b, revolutions, radiusoffset, skew, 0); break; @@ -7144,7 +7165,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api radiusoffset = (float)rules.GetLSLFloatItem(idx++); skew = (float)rules.GetLSLFloatItem(idx++); part.Shape.PathCurve = (byte)Extrusion.Curve1; - SetPrimitiveShapeParams(part, face, v, hollow, twist, holesize, topshear, profilecut, taper_b, + SetPrimitiveShapeParams(part, face, v, hollow, twist, holesize, topshear, profilecut, taper_b, revolutions, radiusoffset, skew, 1); break; @@ -7164,7 +7185,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api radiusoffset = (float)rules.GetLSLFloatItem(idx++); skew = (float)rules.GetLSLFloatItem(idx++); part.Shape.PathCurve = (byte)Extrusion.Curve1; - SetPrimitiveShapeParams(part, face, v, hollow, twist, holesize, topshear, profilecut, taper_b, + SetPrimitiveShapeParams(part, face, v, hollow, twist, holesize, topshear, profilecut, taper_b, revolutions, radiusoffset, skew, 3); break; @@ -7210,7 +7231,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api SetAlpha(part, alpha, face); break; - + case (int)ScriptBaseClass.PRIM_FLEXIBLE: if (remain < 7) return; @@ -7226,7 +7247,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api SetFlexi(part, flexi, softness, gravity, friction, wind, tension, force); break; - + case (int)ScriptBaseClass.PRIM_POINT_LIGHT: if (remain < 5) return; @@ -7239,7 +7260,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api SetPointLight(part, light, lightcolor, intensity, radius, falloff); break; - + case (int)ScriptBaseClass.PRIM_GLOW: if (remain < 2) return; @@ -7249,7 +7270,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api SetGlow(part, face, glow); break; - + case (int)ScriptBaseClass.PRIM_BUMP_SHINY: if (remain < 3) return; @@ -7260,7 +7281,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api SetShiny(part, face, shiny, bump); break; - + case (int)ScriptBaseClass.PRIM_FULLBRIGHT: if (remain < 2) return; @@ -7268,7 +7289,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api bool st = rules.GetLSLIntegerItem(idx++); SetFullBright(part, face , st); break; - + case (int)ScriptBaseClass.PRIM_MATERIAL: if (remain < 1) return; @@ -7278,7 +7299,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api part.Material = Convert.ToByte(mat); break; - + case (int)ScriptBaseClass.PRIM_PHANTOM: if (remain < 1) return; @@ -7293,7 +7314,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api part.ScriptSetPhantomStatus(phantom); break; - + case (int)ScriptBaseClass.PRIM_PHYSICS: if (remain < 1) return; @@ -7307,7 +7328,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api part.ScriptSetPhysicsStatus(physics); break; - + case (int)ScriptBaseClass.PRIM_TEMP_ON_REZ: if (remain < 1) return; @@ -7341,6 +7362,24 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api Util.Clip((float)primTextColor.z, 0.0f, 1.0f)); part.SetText(primText, av3, Util.Clip((float)primTextAlpha, 0.0f, 1.0f)); + break; + case (int)ScriptBaseClass.PRIM_NAME: + if (remain < 1) + return; + string primName = rules.GetLSLStringItem(idx++); + part.Name = primName; + break; + case (int)ScriptBaseClass.PRIM_DESC: + if (remain < 1) + return; + string primDesc = rules.GetLSLStringItem(idx++); + part.Description = primDesc; + break; + case (int)ScriptBaseClass.PRIM_ROT_LOCAL: + if (remain < 1) + return; + LSL_Rotation lr = rules.GetQuaternionItem(idx++); + SetRot(part, Rot2Quaternion(lr)); break; } } @@ -7433,7 +7472,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api public LSL_Vector llGetRootPosition() { m_host.AddScriptLPS(1); - return new LSL_Vector(m_host.ParentGroup.AbsolutePosition.X, m_host.ParentGroup.AbsolutePosition.Y, + return new LSL_Vector(m_host.ParentGroup.AbsolutePosition.X, m_host.ParentGroup.AbsolutePosition.Y, m_host.ParentGroup.AbsolutePosition.Z); } @@ -7527,7 +7566,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api { LSL_Vector lower; LSL_Vector upper; - if (presence.Animator.Animations.DefaultAnimation.AnimID + if (presence.Animator.Animations.DefaultAnimation.AnimID == AnimationSet.Animations.AnimsUUID["SIT_GROUND_CONSTRAINED"]) { // This is for ground sitting avatars @@ -7726,8 +7765,8 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api res.Add(new LSL_Float((Shape.PathRevolutions * 0.015) + 1.0)); // Slightly inaccurate, because an unsigned // byte is being used to represent the entire // range of floating-point values from 1.0 - // through 4.0 (which is how SL does it). - + // through 4.0 (which is how SL does it). + // float radiusoffset res.Add(new LSL_Float(Shape.PathRadiusOffset / 100.0)); @@ -7887,11 +7926,255 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api textColor.B)); res.Add(new LSL_Float(textColor.A)); break; + case (int)ScriptBaseClass.PRIM_NAME: + res.Add(part.Name); + break; + case (int)ScriptBaseClass.PRIM_DESC: + res.Add(part.Description); + break; + case (int)ScriptBaseClass.PRIM_ROT_LOCAL: + res.Add(new LSL_Rotation(part.RotationOffset.X, part.RotationOffset.Y, part.RotationOffset.Z, part.RotationOffset.W)); + break; } } return res; } + public LSL_List llGetPrimMediaParams(int face, LSL_List rules) + { + m_host.AddScriptLPS(1); + ScriptSleep(1000); + + // LSL Spec http://wiki.secondlife.com/wiki/LlGetPrimMediaParams says to fail silently if face is invalid + // TODO: Need to correctly handle case where a face has no media (which gives back an empty list). + // Assuming silently fail means give back an empty list. Ideally, need to check this. + if (face < 0 || face > m_host.GetNumberOfSides() - 1) + return new LSL_List(); + + return GetPrimMediaParams(face, rules); + } + + private LSL_List GetPrimMediaParams(int face, LSL_List rules) + { + IMoapModule module = m_ScriptEngine.World.RequestModuleInterface(); + if (null == module) + throw new Exception("Media on a prim functions not available"); + + MediaEntry me = module.GetMediaEntry(m_host, face); + + // As per http://wiki.secondlife.com/wiki/LlGetPrimMediaParams + if (null == me) + return new LSL_List(); + + LSL_List res = new LSL_List(); + + for (int i = 0; i < rules.Length; i++) + { + int code = (int)rules.GetLSLIntegerItem(i); + + switch (code) + { + case ScriptBaseClass.PRIM_MEDIA_ALT_IMAGE_ENABLE: + // Not implemented + res.Add(new LSL_Integer(0)); + break; + + case ScriptBaseClass.PRIM_MEDIA_CONTROLS: + if (me.Controls == MediaControls.Standard) + res.Add(new LSL_Integer(ScriptBaseClass.PRIM_MEDIA_CONTROLS_STANDARD)); + else + res.Add(new LSL_Integer(ScriptBaseClass.PRIM_MEDIA_CONTROLS_MINI)); + break; + + case ScriptBaseClass.PRIM_MEDIA_CURRENT_URL: + res.Add(new LSL_String(me.CurrentURL)); + break; + + case ScriptBaseClass.PRIM_MEDIA_HOME_URL: + res.Add(new LSL_String(me.HomeURL)); + break; + + case ScriptBaseClass.PRIM_MEDIA_AUTO_LOOP: + res.Add(me.AutoLoop ? ScriptBaseClass.TRUE : ScriptBaseClass.FALSE); + break; + + case ScriptBaseClass.PRIM_MEDIA_AUTO_PLAY: + res.Add(me.AutoPlay ? ScriptBaseClass.TRUE : ScriptBaseClass.FALSE); + break; + + case ScriptBaseClass.PRIM_MEDIA_AUTO_SCALE: + res.Add(me.AutoScale ? ScriptBaseClass.TRUE : ScriptBaseClass.FALSE); + break; + + case ScriptBaseClass.PRIM_MEDIA_AUTO_ZOOM: + res.Add(me.AutoZoom ? ScriptBaseClass.TRUE : ScriptBaseClass.FALSE); + break; + + case ScriptBaseClass.PRIM_MEDIA_FIRST_CLICK_INTERACT: + res.Add(me.InteractOnFirstClick ? ScriptBaseClass.TRUE : ScriptBaseClass.FALSE); + break; + + case ScriptBaseClass.PRIM_MEDIA_WIDTH_PIXELS: + res.Add(new LSL_Integer(me.Width)); + break; + + case ScriptBaseClass.PRIM_MEDIA_HEIGHT_PIXELS: + res.Add(new LSL_Integer(me.Height)); + break; + + case ScriptBaseClass.PRIM_MEDIA_WHITELIST_ENABLE: + res.Add(me.EnableWhiteList ? ScriptBaseClass.TRUE : ScriptBaseClass.FALSE); + break; + + case ScriptBaseClass.PRIM_MEDIA_WHITELIST: + string[] urls = (string[])me.WhiteList.Clone(); + + for (int j = 0; j < urls.Length; j++) + urls[j] = Uri.EscapeDataString(urls[j]); + + res.Add(new LSL_String(string.Join(", ", urls))); + break; + + case ScriptBaseClass.PRIM_MEDIA_PERMS_INTERACT: + res.Add(new LSL_Integer((int)me.InteractPermissions)); + break; + + case ScriptBaseClass.PRIM_MEDIA_PERMS_CONTROL: + res.Add(new LSL_Integer((int)me.ControlPermissions)); + break; + } + } + + return res; + } + + public LSL_Integer llSetPrimMediaParams(int face, LSL_List rules) + { + m_host.AddScriptLPS(1); + ScriptSleep(1000); + + // LSL Spec http://wiki.secondlife.com/wiki/LlSetPrimMediaParams says to fail silently if face is invalid + // Assuming silently fail means sending back LSL_STATUS_OK. Ideally, need to check this. + // Don't perform the media check directly + if (face < 0 || face > m_host.GetNumberOfSides() - 1) + return ScriptBaseClass.LSL_STATUS_OK; + + return SetPrimMediaParams(face, rules); + } + + private LSL_Integer SetPrimMediaParams(int face, LSL_List rules) + { + IMoapModule module = m_ScriptEngine.World.RequestModuleInterface(); + if (null == module) + throw new Exception("Media on a prim functions not available"); + + MediaEntry me = module.GetMediaEntry(m_host, face); + if (null == me) + me = new MediaEntry(); + + int i = 0; + + while (i < rules.Length - 1) + { + int code = rules.GetLSLIntegerItem(i++); + + switch (code) + { + case ScriptBaseClass.PRIM_MEDIA_ALT_IMAGE_ENABLE: + me.EnableAlterntiveImage = (rules.GetLSLIntegerItem(i++) != 0 ? true : false); + break; + + case ScriptBaseClass.PRIM_MEDIA_CONTROLS: + int v = rules.GetLSLIntegerItem(i++); + if (ScriptBaseClass.PRIM_MEDIA_CONTROLS_STANDARD == v) + me.Controls = MediaControls.Standard; + else + me.Controls = MediaControls.Mini; + break; + + case ScriptBaseClass.PRIM_MEDIA_CURRENT_URL: + me.CurrentURL = rules.GetLSLStringItem(i++); + break; + + case ScriptBaseClass.PRIM_MEDIA_HOME_URL: + me.HomeURL = rules.GetLSLStringItem(i++); + break; + + case ScriptBaseClass.PRIM_MEDIA_AUTO_LOOP: + me.AutoLoop = (ScriptBaseClass.TRUE == rules.GetLSLIntegerItem(i++) ? true : false); + break; + + case ScriptBaseClass.PRIM_MEDIA_AUTO_PLAY: + me.AutoPlay = (ScriptBaseClass.TRUE == rules.GetLSLIntegerItem(i++) ? true : false); + break; + + case ScriptBaseClass.PRIM_MEDIA_AUTO_SCALE: + me.AutoScale = (ScriptBaseClass.TRUE == rules.GetLSLIntegerItem(i++) ? true : false); + break; + + case ScriptBaseClass.PRIM_MEDIA_AUTO_ZOOM: + me.AutoZoom = (ScriptBaseClass.TRUE == rules.GetLSLIntegerItem(i++) ? true : false); + break; + + case ScriptBaseClass.PRIM_MEDIA_FIRST_CLICK_INTERACT: + me.InteractOnFirstClick = (ScriptBaseClass.TRUE == rules.GetLSLIntegerItem(i++) ? true : false); + break; + + case ScriptBaseClass.PRIM_MEDIA_WIDTH_PIXELS: + me.Width = (int)rules.GetLSLIntegerItem(i++); + break; + + case ScriptBaseClass.PRIM_MEDIA_HEIGHT_PIXELS: + me.Height = (int)rules.GetLSLIntegerItem(i++); + break; + + case ScriptBaseClass.PRIM_MEDIA_WHITELIST_ENABLE: + me.EnableWhiteList = (ScriptBaseClass.TRUE == rules.GetLSLIntegerItem(i++) ? true : false); + break; + + case ScriptBaseClass.PRIM_MEDIA_WHITELIST: + string[] rawWhiteListUrls = rules.GetLSLStringItem(i++).ToString().Split(new char[] { ',' }); + List whiteListUrls = new List(); + Array.ForEach( + rawWhiteListUrls, delegate(string rawUrl) { whiteListUrls.Add(rawUrl.Trim()); }); + me.WhiteList = whiteListUrls.ToArray(); + break; + + case ScriptBaseClass.PRIM_MEDIA_PERMS_INTERACT: + me.InteractPermissions = (MediaPermission)(byte)(int)rules.GetLSLIntegerItem(i++); + break; + + case ScriptBaseClass.PRIM_MEDIA_PERMS_CONTROL: + me.ControlPermissions = (MediaPermission)(byte)(int)rules.GetLSLIntegerItem(i++); + break; + } + } + + module.SetMediaEntry(m_host, face, me); + + return ScriptBaseClass.LSL_STATUS_OK; + } + + public LSL_Integer llClearPrimMedia(LSL_Integer face) + { + m_host.AddScriptLPS(1); + ScriptSleep(1000); + + // LSL Spec http://wiki.secondlife.com/wiki/LlClearPrimMedia says to fail silently if face is invalid + // Assuming silently fail means sending back LSL_STATUS_OK. Ideally, need to check this. + // FIXME: Don't perform the media check directly + if (face < 0 || face > m_host.GetNumberOfSides() - 1) + return ScriptBaseClass.LSL_STATUS_OK; + + IMoapModule module = m_ScriptEngine.World.RequestModuleInterface(); + if (null == module) + throw new Exception("Media on a prim functions not available"); + + module.ClearMediaEntry(m_host, face); + + return ScriptBaseClass.LSL_STATUS_OK; + } + // // // The .NET definition of base 64 is: @@ -8151,7 +8434,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api public LSL_String llGetHTTPHeader(LSL_Key request_id, string header) { m_host.AddScriptLPS(1); - + if (m_UrlModule != null) return m_UrlModule.GetHttpHeader(new UUID(request_id), header); return String.Empty; @@ -8212,7 +8495,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api // of arrays or other objects. // - public LSL_List llParseStringKeepNulls(string src, LSL_List separators, LSL_List spacers) + private LSL_List ParseString(string src, LSL_List separators, LSL_List spacers, bool keepNulls) { int beginning = 0; int srclen = src.Length; @@ -8232,8 +8515,6 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api LSL_List tokens = new LSL_List(); - m_host.AddScriptLPS(1); - // All entries are initially valid for (int i = 0; i < mlen; i++) @@ -8250,6 +8531,9 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api for (j = 0; j < seplen; j++) { + if (separray[j].ToString() == String.Empty) + active[j] = false; + if (active[j]) { // scan all of the markers @@ -8278,6 +8562,9 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api { for (j = seplen; (j < mlen) && (offset[best] > beginning); j++) { + if (spcarray[j-seplen].ToString() == String.Empty) + active[j] = false; + if (active[j]) { // scan all of the markers @@ -8305,14 +8592,15 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api { // no markers were found on this pass // so we're pretty much done - tokens.Add(new LSL_String(src.Substring(beginning, srclen - beginning))); + if ((keepNulls) || ((!keepNulls) && (srclen - beginning) > 0)) + tokens.Add(new LSL_String(src.Substring(beginning, srclen - beginning))); break; } // Otherwise we just add the newly delimited token // and recalculate where the search should continue. - - tokens.Add(new LSL_String(src.Substring(beginning,offset[best]-beginning))); + if ((keepNulls) || ((!keepNulls) && (offset[best] - beginning) > 0)) + tokens.Add(new LSL_String(src.Substring(beginning,offset[best]-beginning))); if (best < seplen) { @@ -8321,7 +8609,9 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api else { beginning = offset[best] + (spcarray[best - seplen].ToString()).Length; - tokens.Add(new LSL_String(spcarray[best - seplen].ToString())); + string str = spcarray[best - seplen].ToString(); + if ((keepNulls) || ((!keepNulls) && (str.Length > 0))) + tokens.Add(new LSL_String(str)); } } @@ -8331,7 +8621,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api // arduous. Alternatively the 'break' could be replced with a return // but that's shabby programming. - if (beginning == srclen) + if ((beginning == srclen) && (keepNulls)) { if (srclen != 0) tokens.Add(new LSL_String("")); @@ -8340,6 +8630,18 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api return tokens; } + public LSL_List llParseString2List(string src, LSL_List separators, LSL_List spacers) + { + m_host.AddScriptLPS(1); + return this.ParseString(src, separators, spacers, false); + } + + public LSL_List llParseStringKeepNulls(string src, LSL_List separators, LSL_List spacers) + { + m_host.AddScriptLPS(1); + return this.ParseString(src, separators, spacers, true); + } + public LSL_Integer llGetObjectPermMask(int mask) { m_host.AddScriptLPS(1); @@ -8526,28 +8828,33 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api string reply = String.Empty; - GridRegion info = m_ScriptEngine.World.GridService.GetRegionByName(m_ScriptEngine.World.RegionInfo.ScopeID, simulator); + GridRegion info; + + if (m_ScriptEngine.World.RegionInfo.RegionName == simulator) + info = new GridRegion(m_ScriptEngine.World.RegionInfo); + else + info = m_ScriptEngine.World.GridService.GetRegionByName(m_ScriptEngine.World.RegionInfo.ScopeID, simulator); switch (data) { - case 5: // DATA_SIM_POS + case ScriptBaseClass.DATA_SIM_POS: if (info == null) { ScriptSleep(1000); return UUID.Zero.ToString(); } reply = new LSL_Vector( - info.RegionLocX * Constants.RegionSize, - info.RegionLocY * Constants.RegionSize, + info.RegionLocX, + info.RegionLocY, 0).ToString(); break; - case 6: // DATA_SIM_STATUS + case ScriptBaseClass.DATA_SIM_STATUS: if (info != null) reply = "up"; // Duh! else reply = "unknown"; break; - case 7: // DATA_SIM_RATING + case ScriptBaseClass.DATA_SIM_RATING: if (info == null) { ScriptSleep(1000); @@ -8563,7 +8870,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api else reply = "UNKNOWN"; break; - case 128: + case ScriptBaseClass.DATA_SIM_RELEASE: if (ossl != null) ossl.CheckThreatLevel(ThreatLevel.High, "llRequestSimulatorData"); reply = "OpenSim"; @@ -8909,17 +9216,17 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api // we send to all landData.MediaID = new UUID(texture); landData.MediaAutoScale = autoAlign ? (byte)1 : (byte)0; - landData.MediaSize[0] = width; - landData.MediaSize[1] = height; + landData.MediaWidth = width; + landData.MediaHeight = height; landData.MediaType = mediaType; // do that one last, it will cause a ParcelPropertiesUpdate landObject.SetMediaUrl(url); - // now send to all (non-child) agents + // now send to all (non-child) agents in the parcel World.ForEachScenePresence(delegate(ScenePresence sp) { - if (!sp.IsChildAgent) + if (!sp.IsChildAgent && (sp.currentParcelUUID == landData.GlobalID)) { sp.ControllingClient.SendParcelMediaUpdate(landData.MediaURL, landData.MediaID, @@ -8949,10 +9256,10 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api // the commandList contained a start/stop/... command, too if (presence == null) { - // send to all (non-child) agents + // send to all (non-child) agents in the parcel World.ForEachScenePresence(delegate(ScenePresence sp) { - if (!sp.IsChildAgent) + if (!sp.IsChildAgent && (sp.currentParcelUUID == landData.GlobalID)) { sp.ControllingClient.SendParcelMediaCommand(0x4, // TODO what is this? (ParcelMediaCommandEnum)commandToSend, @@ -8996,8 +9303,8 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api list.Add(new LSL_String(World.GetLandData(m_host.AbsolutePosition.X, m_host.AbsolutePosition.Y).MediaType)); break; case ParcelMediaCommandEnum.Size: - list.Add(new LSL_String(World.GetLandData(m_host.AbsolutePosition.X, m_host.AbsolutePosition.Y).MediaSize[0])); - list.Add(new LSL_String(World.GetLandData(m_host.AbsolutePosition.X, m_host.AbsolutePosition.Y).MediaSize[1])); + list.Add(new LSL_String(World.GetLandData(m_host.AbsolutePosition.X, m_host.AbsolutePosition.Y).MediaWidth)); + list.Add(new LSL_String(World.GetLandData(m_host.AbsolutePosition.X, m_host.AbsolutePosition.Y).MediaHeight)); break; default: ParcelMediaCommandEnum mediaCommandEnum = ParcelMediaCommandEnum.Url; @@ -9670,6 +9977,9 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api case "4": ret = ret + new LSL_List(land.Area); break; + case "5": + ret = ret + new LSL_List(land.GlobalID); + break; default: ret = ret + new LSL_List(0); break; diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LS_Api.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LS_Api.cs index fe71ed54cd..645566eaf0 100644 --- a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LS_Api.cs +++ b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LS_Api.cs @@ -1,4 +1,4 @@ -/* +/* * Copyright (c) Contributors, http://opensimulator.org/ * See CONTRIBUTORS.TXT for a full list of copyright holders. * @@ -253,16 +253,14 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api idx++; } - return values; - } private RegionLightShareData getWindlightProfileFromRules(LSL_List rules) { RegionLightShareData wl = (RegionLightShareData)m_host.ParentGroup.Scene.RegionInfo.WindlightSettings.Clone(); - LSL_List values = new LSL_List(); +// LSL_List values = new LSL_List(); int idx = 0; while (idx < rules.Length) { @@ -457,6 +455,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api if (LightShareModule.EnableWindlight) { RegionLightShareData wl = getWindlightProfileFromRules(rules); + wl.valid = true; m_host.ParentGroup.Scene.StoreWindlightProfile(wl); success = 1; } @@ -467,6 +466,23 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api } return success; } + public void lsClearWindlightScene() + { + if (!m_LSFunctionsEnabled) + { + LSShoutError("LightShare functions are not enabled."); + return; + } + if (!World.RegionInfo.EstateSettings.IsEstateManager(m_host.OwnerID) && World.GetScenePresence(m_host.OwnerID).GodLevel < 200) + { + LSShoutError("lsSetWindlightScene can only be used by estate managers or owners."); + return; + } + + m_host.ParentGroup.Scene.RegionInfo.WindlightSettings.valid = false; + if (m_host.ParentGroup.Scene.SimulationDataService != null) + m_host.ParentGroup.Scene.SimulationDataService.RemoveRegionWindlightSettings(m_host.ParentGroup.Scene.RegionInfo.RegionID); + } /// /// Set the current Windlight scene to a target avatar /// diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs index 01b64eb08f..fc92f23a62 100644 --- a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs +++ b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs @@ -639,6 +639,11 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api // CheckThreatLevel(ThreatLevel.High, "osTeleportAgent"); + TeleportAgent(agent, regionName, position, lookat); + } + + private void TeleportAgent(string agent, string regionName, LSL_Types.Vector3 position, LSL_Types.Vector3 lookat) + { m_host.AddScriptLPS(1); UUID agentId = new UUID(); if (UUID.TryParse(agent, out agentId)) @@ -651,7 +656,6 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api == World.LandChannel.GetLandObject( presence.AbsolutePosition.X, presence.AbsolutePosition.Y).LandData.OwnerID) { - // Check for hostname , attempt to make a hglink // and convert the regionName to the target region if (regionName.Contains(".") && regionName.Contains(":")) @@ -661,10 +665,13 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api if (regions != null && regions.Count > 0) { GridRegion regInfo = regions[0]; - regionName = regInfo.RegionName; + string[] parts = regInfo.RegionName.Split(new char[] { ':' }); + if (parts.Length > 2) + regionName = parts[2]; + else + regionName = parts[0]; } } - presence.ControllingClient.SendTeleportLocationStart(); World.RequestTeleportLocation(presence.ControllingClient, regionName, new Vector3((float)position.x, (float)position.y, (float)position.z), new Vector3((float)lookat.x, (float)lookat.y, (float)lookat.z), (uint)TPFlags.ViaLocation); @@ -675,13 +682,17 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api } } - // Teleport functions public void osTeleportAgent(string agent, int regionX, int regionY, LSL_Types.Vector3 position, LSL_Types.Vector3 lookat) { // High because there is no security check. High griefer potential // CheckThreatLevel(ThreatLevel.High, "osTeleportAgent"); + TeleportAgent(agent, regionX, regionY, position, lookat); + } + + private void TeleportAgent(string agent, int regionX, int regionY, LSL_Types.Vector3 position, LSL_Types.Vector3 lookat) + { ulong regionHandle = Util.UIntsToLong(((uint)regionX * (uint)Constants.RegionSize), ((uint)regionY * (uint)Constants.RegionSize)); m_host.AddScriptLPS(1); @@ -696,7 +707,6 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api == World.LandChannel.GetLandObject( presence.AbsolutePosition.X, presence.AbsolutePosition.Y).LandData.OwnerID) { - presence.ControllingClient.SendTeleportLocationStart(); World.RequestTeleportLocation(presence.ControllingClient, regionHandle, new Vector3((float)position.x, (float)position.y, (float)position.z), new Vector3((float)lookat.x, (float)lookat.y, (float)lookat.z), (uint)TPFlags.ViaLocation); @@ -711,6 +721,26 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api osTeleportAgent(agent, World.RegionInfo.RegionName, position, lookat); } + public void osTeleportOwner(string regionName, LSL_Types.Vector3 position, LSL_Types.Vector3 lookat) + { + // Threat level None because this is what can already be done with the World Map in the viewer + CheckThreatLevel(ThreatLevel.None, "osTeleportOwner"); + + TeleportAgent(m_host.OwnerID.ToString(), regionName, position, lookat); + } + + public void osTeleportOwner(LSL_Types.Vector3 position, LSL_Types.Vector3 lookat) + { + osTeleportOwner(World.RegionInfo.RegionName, position, lookat); + } + + public void osTeleportOwner(int regionX, int regionY, LSL_Types.Vector3 position, LSL_Types.Vector3 lookat) + { + CheckThreatLevel(ThreatLevel.None, "osTeleportOwner"); + + TeleportAgent(m_host.OwnerID.ToString(), regionX, regionY, position, lookat); + } + // Functions that get information from the agent itself. // // osGetAgentIP - this is used to determine the IP address of @@ -1192,7 +1222,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api World.LandChannel.Join(startx,starty,endx,endy,m_host.OwnerID); } - + public void osParcelSubdivide(LSL_Vector pos1, LSL_Vector pos2) { CheckThreatLevel(ThreatLevel.High, "osParcelSubdivide"); @@ -1215,7 +1245,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api // can modify it ILandObject startLandObject = World.LandChannel.GetLandObject((int)pos.x, (int)pos.y); - if (startLandObject == null) + if (startLandObject == null) { OSSLShoutError("There is no land at that location"); return; @@ -1232,7 +1262,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api UUID uuid; // Process the rules, not sure what the impact would be of changing owner or group - for (int idx = 0; idx < rules.Length; ) + for (int idx = 0; idx < rules.Length;) { int code = rules.GetLSLIntegerItem(idx++); string arg = rules.GetLSLStringItem(idx++); @@ -2202,6 +2232,48 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api m_LSL_Api.SetPrimitiveParamsEx(prim, rules); } + + /// + /// Set parameters for light projection in host prim + /// + public void osSetProjectionParams(bool projection, LSL_Key texture, double fov, double focus, double amb) + { + CheckThreatLevel(ThreatLevel.High, "osSetProjectionParams"); + + osSetProjectionParams(UUID.Zero.ToString(), projection, texture, fov, focus, amb); + } + + /// + /// Set parameters for light projection with uuid of target prim + /// + public void osSetProjectionParams(LSL_Key prim, bool projection, LSL_Key texture, double fov, double focus, double amb) + { + CheckThreatLevel(ThreatLevel.High, "osSetProjectionParams"); + m_host.AddScriptLPS(1); + + SceneObjectPart obj = null; + if (prim == UUID.Zero.ToString()) + { + obj = m_host; + } + else + { + obj = World.GetSceneObjectPart(new UUID(prim)); + if (obj == null) + return; + } + + obj.Shape.ProjectionEntry = projection; + obj.Shape.ProjectionTextureUUID = new UUID(texture); + obj.Shape.ProjectionFOV = (float)fov; + obj.Shape.ProjectionFocus = (float)focus; + obj.Shape.ProjectionAmbiance = (float)amb; + + + obj.ParentGroup.HasGroupChanged = true; + obj.ScheduleFullUpdate(); + + } /// /// Like osGetAgents but returns enough info for a radar @@ -2226,5 +2298,21 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api }); return result; } + + /// + /// Convert a unix time to a llGetTimestamp() like string + /// + /// + /// + public LSL_String osUnixTimeToTimestamp(long time) + { + CheckThreatLevel(ThreatLevel.VeryLow, "osUnixTimeToTimestamp"); + long baseTicks = 621355968000000000; + long tickResolution = 10000000; + long epochTicks = (time * tickResolution) + baseTicks; + DateTime date = new DateTime(epochTicks); + + return date.ToString("yyyy-MM-ddTHH:mm:ss.fffffffZ"); + } } -} +} \ No newline at end of file diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/Plugins/SensorRepeat.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/Plugins/SensorRepeat.cs index 5c2abd5e9d..fefbb35760 100644 --- a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/Plugins/SensorRepeat.cs +++ b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/Plugins/SensorRepeat.cs @@ -286,7 +286,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api.Plugins } else { - Entities = m_CmdManager.m_ScriptEngine.World.GetEntities(); + Entities = new List(m_CmdManager.m_ScriptEngine.World.GetEntities()); } SceneObjectPart SensePoint = ts.host; @@ -416,7 +416,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api.Plugins List sensedEntities = new List(); // If nobody about quit fast - if(m_CmdManager.m_ScriptEngine.World.GetRootAgentCount() == 0) + if (m_CmdManager.m_ScriptEngine.World.GetRootAgentCount() == 0) return sensedEntities; SceneObjectPart SensePoint = ts.host; @@ -485,7 +485,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api.Plugins { ScenePresence sp; // Try direct lookup by UUID - if(!m_CmdManager.m_ScriptEngine.World.TryGetScenePresence(ts.keyID, out sp)) + if (!m_CmdManager.m_ScriptEngine.World.TryGetScenePresence(ts.keyID, out sp)) return sensedEntities; senseEntity(sp); } diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Interface/ILSL_Api.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Interface/ILSL_Api.cs index cba46a36c7..561e3b3213 100644 --- a/OpenSim/Region/ScriptEngine/Shared/Api/Interface/ILSL_Api.cs +++ b/OpenSim/Region/ScriptEngine/Shared/Api/Interface/ILSL_Api.cs @@ -62,6 +62,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api.Interfaces void llBreakLink(int linknum); LSL_Integer llCeil(double f); void llClearCameraParams(); + LSL_Integer llClearPrimMedia(LSL_Integer face); void llCloseRemoteDataChannel(string channel); LSL_Float llCloud(LSL_Vector offset); void llCollisionFilter(string name, string id, int accept); @@ -162,6 +163,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api.Interfaces LSL_List llGetParcelPrimOwners(LSL_Vector pos); LSL_Integer llGetPermissions(); LSL_Key llGetPermissionsKey(); + LSL_List llGetPrimMediaParams(int face, LSL_List rules); LSL_Vector llGetPos(); LSL_List llGetPrimitiveParams(LSL_List rules); LSL_Integer llGetRegionAgentCount(); @@ -332,6 +334,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api.Interfaces void llSetParcelMusicURL(string url); void llSetPayPrice(int price, LSL_List quick_pay_buttons); void llSetPos(LSL_Vector pos); + LSL_Integer llSetPrimMediaParams(int face, LSL_List rules); void llSetPrimitiveParams(LSL_List rules); void llSetLinkPrimitiveParamsFast(int linknum, LSL_List rules); void llSetPrimURL(string url); diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Interface/ILS_Api.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Interface/ILS_Api.cs index 9aa437b37e..f2df094abf 100644 --- a/OpenSim/Region/ScriptEngine/Shared/Api/Interface/ILS_Api.cs +++ b/OpenSim/Region/ScriptEngine/Shared/Api/Interface/ILS_Api.cs @@ -44,5 +44,6 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api.Interfaces LSL_List lsGetWindlightScene(LSL_List rules); int lsSetWindlightScene(LSL_List rules); int lsSetWindlightSceneTargeted(LSL_List rules, key target); + void lsClearWindlightScene(); } } diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Interface/IOSSL_Api.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Interface/IOSSL_Api.cs index 78ee43cc08..10d61caeff 100644 --- a/OpenSim/Region/ScriptEngine/Shared/Api/Interface/IOSSL_Api.cs +++ b/OpenSim/Region/ScriptEngine/Shared/Api/Interface/IOSSL_Api.cs @@ -86,6 +86,9 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api.Interfaces void osTeleportAgent(string agent, string regionName, LSL_Types.Vector3 position, LSL_Types.Vector3 lookat); void osTeleportAgent(string agent, int regionX, int regionY, LSL_Types.Vector3 position, LSL_Types.Vector3 lookat); void osTeleportAgent(string agent, LSL_Types.Vector3 position, LSL_Types.Vector3 lookat); + void osTeleportOwner(string regionName, LSL_Types.Vector3 position, LSL_Types.Vector3 lookat); + void osTeleportOwner(int regionX, int regionY, LSL_Types.Vector3 position, LSL_Types.Vector3 lookat); + void osTeleportOwner(LSL_Types.Vector3 position, LSL_Types.Vector3 lookat); // Animation commands void osAvatarPlayAnimation(string avatar, string animation); @@ -176,7 +179,11 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api.Interfaces void osCauseDamage(string avatar, double damage); LSL_List osGetPrimitiveParams(LSL_Key prim, LSL_List rules); void osSetPrimitiveParams(LSL_Key prim, LSL_List rules); + void osSetProjectionParams(bool projection, LSL_Key texture, double fov, double focus, double amb); + void osSetProjectionParams(LSL_Key prim, bool projection, LSL_Key texture, double fov, double focus, double amb); + LSL_List osGetAvatarList(); + LSL_String osUnixTimeToTimestamp(long time); } } diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Runtime/LSL_Constants.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Runtime/LSL_Constants.cs index dba6502f4b..b3c4d95c48 100644 --- a/OpenSim/Region/ScriptEngine/Shared/Api/Runtime/LSL_Constants.cs +++ b/OpenSim/Region/ScriptEngine/Shared/Api/Runtime/LSL_Constants.cs @@ -273,9 +273,11 @@ namespace OpenSim.Region.ScriptEngine.Shared.ScriptBase public const int CHANGED_LINK = 32; public const int CHANGED_ALLOWED_DROP = 64; public const int CHANGED_OWNER = 128; - public const int CHANGED_REGION_RESTART = 256; - public const int CHANGED_REGION = 512; - public const int CHANGED_TELEPORT = 1024; + public const int CHANGED_REGION = 256; + public const int CHANGED_TELEPORT = 512; + public const int CHANGED_REGION_RESTART = 1024; + public const int CHANGED_REGION_START = 1024; //LL Changed the constant from CHANGED_REGION_RESTART + public const int CHANGED_MEDIA = 2048; public const int CHANGED_ANIMATION = 16384; public const int TYPE_INVALID = 0; public const int TYPE_INTEGER = 1; @@ -314,6 +316,9 @@ namespace OpenSim.Region.ScriptEngine.Shared.ScriptBase public const int PRIM_POINT_LIGHT = 23; // Huh? public const int PRIM_GLOW = 25; public const int PRIM_TEXT = 26; + public const int PRIM_NAME = 27; + public const int PRIM_DESC = 28; + public const int PRIM_ROT_LOCAL = 29; public const int PRIM_TEXGEN_DEFAULT = 0; public const int PRIM_TEXGEN_PLANAR = 1; @@ -502,6 +507,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.ScriptBase public const int PARCEL_DETAILS_OWNER = 2; public const int PARCEL_DETAILS_GROUP = 3; public const int PARCEL_DETAILS_AREA = 4; + public const int PARCEL_DETAILS_ID = 5; // constants for llSetClickAction public const int CLICK_ACTION_NONE = 0; @@ -517,6 +523,41 @@ namespace OpenSim.Region.ScriptEngine.Shared.ScriptBase public const int TOUCH_INVALID_FACE = -1; public static readonly vector TOUCH_INVALID_TEXCOORD = new vector(-1.0, -1.0, 0.0); public static readonly vector TOUCH_INVALID_VECTOR = ZERO_VECTOR; + + // constants for llGetPrimMediaParams/llSetPrimMediaParams + public const int PRIM_MEDIA_ALT_IMAGE_ENABLE = 0; + public const int PRIM_MEDIA_CONTROLS = 1; + public const int PRIM_MEDIA_CURRENT_URL = 2; + public const int PRIM_MEDIA_HOME_URL = 3; + public const int PRIM_MEDIA_AUTO_LOOP = 4; + public const int PRIM_MEDIA_AUTO_PLAY = 5; + public const int PRIM_MEDIA_AUTO_SCALE = 6; + public const int PRIM_MEDIA_AUTO_ZOOM = 7; + public const int PRIM_MEDIA_FIRST_CLICK_INTERACT = 8; + public const int PRIM_MEDIA_WIDTH_PIXELS = 9; + public const int PRIM_MEDIA_HEIGHT_PIXELS = 10; + public const int PRIM_MEDIA_WHITELIST_ENABLE = 11; + public const int PRIM_MEDIA_WHITELIST = 12; + public const int PRIM_MEDIA_PERMS_INTERACT = 13; + public const int PRIM_MEDIA_PERMS_CONTROL = 14; + + public const int PRIM_MEDIA_CONTROLS_STANDARD = 0; + public const int PRIM_MEDIA_CONTROLS_MINI = 1; + + public const int PRIM_MEDIA_PERM_NONE = 0; + public const int PRIM_MEDIA_PERM_OWNER = 1; + public const int PRIM_MEDIA_PERM_GROUP = 2; + public const int PRIM_MEDIA_PERM_ANYONE = 4; + + // extra constants for llSetPrimMediaParams + public static readonly LSLInteger LSL_STATUS_OK = new LSLInteger(0); + public static readonly LSLInteger LSL_STATUS_MALFORMED_PARAMS = new LSLInteger(1000); + public static readonly LSLInteger LSL_STATUS_TYPE_MISMATCH = new LSLInteger(1001); + public static readonly LSLInteger LSL_STATUS_BOUNDS_ERROR = new LSLInteger(1002); + public static readonly LSLInteger LSL_STATUS_NOT_FOUND = new LSLInteger(1003); + public static readonly LSLInteger LSL_STATUS_NOT_SUPPORTED = new LSLInteger(1004); + public static readonly LSLInteger LSL_STATUS_INTERNAL_ERROR = new LSLInteger(1999); + public static readonly LSLInteger LSL_STATUS_WHITELIST_FAILED = new LSLInteger(2001); // Constants for default textures public const string TEXTURE_BLANK = "5748decc-f629-461c-9a36-a35a221fe21f"; diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Runtime/LSL_Stub.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Runtime/LSL_Stub.cs index 3339995f66..451163fe99 100644 --- a/OpenSim/Region/ScriptEngine/Shared/Api/Runtime/LSL_Stub.cs +++ b/OpenSim/Region/ScriptEngine/Shared/Api/Runtime/LSL_Stub.cs @@ -1832,5 +1832,20 @@ namespace OpenSim.Region.ScriptEngine.Shared.ScriptBase { return m_LSL_Functions.llXorBase64StringsCorrect(str1, str2); } + + public LSL_List llGetPrimMediaParams(int face, LSL_List rules) + { + return m_LSL_Functions.llGetPrimMediaParams(face, rules); + } + + public LSL_Integer llSetPrimMediaParams(int face, LSL_List rules) + { + return m_LSL_Functions.llSetPrimMediaParams(face, rules); + } + + public LSL_Integer llClearPrimMedia(LSL_Integer face) + { + return m_LSL_Functions.llClearPrimMedia(face); + } } } diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Runtime/LS_Stub.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Runtime/LS_Stub.cs index f8dbe03ccc..143b497cd8 100644 --- a/OpenSim/Region/ScriptEngine/Shared/Api/Runtime/LS_Stub.cs +++ b/OpenSim/Region/ScriptEngine/Shared/Api/Runtime/LS_Stub.cs @@ -72,5 +72,9 @@ namespace OpenSim.Region.ScriptEngine.Shared.ScriptBase { return m_LS_Functions.lsSetWindlightSceneTargeted(rules, target); } + public void lsClearWindlightScene() + { + m_LS_Functions.lsClearWindlightScene(); + } } } diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Runtime/OSSL_Stub.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Runtime/OSSL_Stub.cs index 6cc5f518ae..f3142e65f0 100644 --- a/OpenSim/Region/ScriptEngine/Shared/Api/Runtime/OSSL_Stub.cs +++ b/OpenSim/Region/ScriptEngine/Shared/Api/Runtime/OSSL_Stub.cs @@ -227,6 +227,21 @@ namespace OpenSim.Region.ScriptEngine.Shared.ScriptBase m_OSSL_Functions.osTeleportAgent(agent, position, lookat); } + public void osTeleportOwner(string regionName, vector position, vector lookat) + { + m_OSSL_Functions.osTeleportOwner(regionName, position, lookat); + } + + public void osTeleportOwner(int regionX, int regionY, vector position, vector lookat) + { + m_OSSL_Functions.osTeleportOwner(regionX, regionY, position, lookat); + } + + public void osTeleportOwner(vector position, vector lookat) + { + m_OSSL_Functions.osTeleportOwner(position, lookat); + } + // Avatar info functions public string osGetAgentIP(string agent) { @@ -663,34 +678,55 @@ namespace OpenSim.Region.ScriptEngine.Shared.ScriptBase { return m_OSSL_Functions.osGetSimulatorMemory(); } + public void osKickAvatar(string FirstName,string SurName,string alert) { m_OSSL_Functions.osKickAvatar(FirstName, SurName, alert); } + public void osSetSpeed(string UUID, float SpeedModifier) { m_OSSL_Functions.osSetSpeed(UUID, SpeedModifier); } + public void osCauseDamage(string avatar, double damage) { m_OSSL_Functions.osCauseDamage(avatar, damage); } + public void osCauseHealing(string avatar, double healing) { m_OSSL_Functions.osCauseHealing(avatar, healing); } + public LSL_List osGetPrimitiveParams(LSL_Key prim, LSL_List rules) { return m_OSSL_Functions.osGetPrimitiveParams(prim, rules); } + public void osSetPrimitiveParams(LSL_Key prim, LSL_List rules) { m_OSSL_Functions.osSetPrimitiveParams(prim, rules); } + public void osSetProjectionParams(bool projection, LSL_Key texture, double fov, double focus, double amb) + { + m_OSSL_Functions.osSetProjectionParams(projection, texture, fov, focus, amb); + } + + public void osSetProjectionParams(LSL_Key prim, bool projection, LSL_Key texture, double fov, double focus, double amb) + { + m_OSSL_Functions.osSetProjectionParams(prim, projection, texture, fov, focus, amb); + } + public LSL_List osGetAvatarList() { return m_OSSL_Functions.osGetAvatarList(); } + + public LSL_String osUnixTimeToTimestamp(long time) + { + return m_OSSL_Functions.osUnixTimeToTimestamp(time); + } } -} +} \ No newline at end of file diff --git a/OpenSim/Region/ScriptEngine/Shared/AssemblyResolver.cs b/OpenSim/Region/ScriptEngine/Shared/AssemblyResolver.cs index ade192475e..130e197841 100644 --- a/OpenSim/Region/ScriptEngine/Shared/AssemblyResolver.cs +++ b/OpenSim/Region/ScriptEngine/Shared/AssemblyResolver.cs @@ -32,7 +32,7 @@ using System.Reflection; namespace OpenSim.Region.ScriptEngine.Shared { [Serializable] - public class AssemblyResolver + public class AssemblyResolver : MarshalByRefObject { public static Assembly OnAssemblyResolve(object sender, ResolveEventArgs args) @@ -42,9 +42,10 @@ namespace OpenSim.Region.ScriptEngine.Shared AppDomain myDomain = (AppDomain)sender; string dirName = myDomain.FriendlyName; + string ScriptEnginesPath = myDomain.SetupInformation.PrivateBinPath; - string[] pathList = new string[] {"bin", "ScriptEngines", - Path.Combine("ScriptEngines", dirName)}; + string[] pathList = new string[] {"bin", ScriptEnginesPath, + Path.Combine(ScriptEnginesPath, dirName)}; string assemblyName = args.Name; if (assemblyName.IndexOf(",") != -1) diff --git a/OpenSim/Region/ScriptEngine/Shared/CodeTools/Compiler.cs b/OpenSim/Region/ScriptEngine/Shared/CodeTools/Compiler.cs index cd8c67e601..49d6abec07 100644 --- a/OpenSim/Region/ScriptEngine/Shared/CodeTools/Compiler.cs +++ b/OpenSim/Region/ScriptEngine/Shared/CodeTools/Compiler.cs @@ -72,7 +72,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.CodeTools private Dictionary LanguageMapping = new Dictionary(StringComparer.CurrentCultureIgnoreCase); private string FilePrefix; - private string ScriptEnginesPath = "ScriptEngines"; + private string ScriptEnginesPath = null; // mapping between LSL and C# line/column numbers private ICodeConverter LSL_Converter; @@ -95,7 +95,8 @@ namespace OpenSim.Region.ScriptEngine.Shared.CodeTools public Compiler(IScriptEngine scriptEngine) { - m_scriptEngine = scriptEngine; + m_scriptEngine = scriptEngine;; + ScriptEnginesPath = scriptEngine.ScriptEnginePath; ReadConfig(); } diff --git a/OpenSim/Region/ScriptEngine/Shared/Helpers.cs b/OpenSim/Region/ScriptEngine/Shared/Helpers.cs index 4855d6448e..3575889d3c 100644 --- a/OpenSim/Region/ScriptEngine/Shared/Helpers.cs +++ b/OpenSim/Region/ScriptEngine/Shared/Helpers.cs @@ -209,7 +209,7 @@ namespace OpenSim.Region.ScriptEngine.Shared else Type = 0x02; // Passive - foreach (SceneObjectPart p in part.ParentGroup.Children.Values) + foreach (SceneObjectPart p in part.ParentGroup.Parts) { if (p.Inventory.ContainsScripts()) { diff --git a/OpenSim/Region/ScriptEngine/Shared/Instance/ScriptInstance.cs b/OpenSim/Region/ScriptEngine/Shared/Instance/ScriptInstance.cs index 3dd381dd43..660e9a36f3 100644 --- a/OpenSim/Region/ScriptEngine/Shared/Instance/ScriptInstance.cs +++ b/OpenSim/Region/ScriptEngine/Shared/Instance/ScriptInstance.cs @@ -388,17 +388,19 @@ namespace OpenSim.Region.ScriptEngine.Shared.Instance PostEvent(new EventParams("attach", new object[] { new LSL_Types.LSLString(m_AttachedAvatar.ToString()) }, new DetectParams[0])); } - else if (m_stateSource == StateSource.NewRez) + else if (m_stateSource == StateSource.RegionStart) { // m_log.Debug("[Script] Posted changed(CHANGED_REGION_RESTART) to script"); PostEvent(new EventParams("changed", - new Object[] {new LSL_Types.LSLInteger(256)}, new DetectParams[0])); + new Object[] { new LSL_Types.LSLInteger((int)Changed.REGION_RESTART) }, + new DetectParams[0])); } else if (m_stateSource == StateSource.PrimCrossing) { // CHANGED_REGION PostEvent(new EventParams("changed", - new Object[] {new LSL_Types.LSLInteger(512)}, new DetectParams[0])); + new Object[] { new LSL_Types.LSLInteger((int)Changed.REGION) }, + new DetectParams[0])); } } else diff --git a/OpenSim/Region/ScriptEngine/Shared/Tests/LSL_ApiTest.cs b/OpenSim/Region/ScriptEngine/Shared/Tests/LSL_ApiTest.cs index 358ce220b5..dfc9aa3dea 100644 --- a/OpenSim/Region/ScriptEngine/Shared/Tests/LSL_ApiTest.cs +++ b/OpenSim/Region/ScriptEngine/Shared/Tests/LSL_ApiTest.cs @@ -134,5 +134,35 @@ namespace OpenSim.Region.ScriptEngine.Shared.Tests #endregion + [Test] + // llRot2Euler test. + public void TestllRot2Euler() + { + // 180, 90 and zero degree rotations. + CheckllRot2Euler(new LSL_Types.Quaternion(1.0f, 0.0f, 0.0f, 0.0f), new LSL_Types.Vector3(Math.PI, 0.0f, 0.0f)); + CheckllRot2Euler(new LSL_Types.Quaternion(0.0f, 1.0f, 0.0f, 0.0f), new LSL_Types.Vector3(Math.PI, 0.0f, Math.PI)); + CheckllRot2Euler(new LSL_Types.Quaternion(0.0f, 0.0f, 1.0f, 0.0f), new LSL_Types.Vector3(0.0f, 0.0f, Math.PI)); + CheckllRot2Euler(new LSL_Types.Quaternion(0.0f, 0.0f, 0.0f, 1.0f), new LSL_Types.Vector3(0.0f, 0.0f, 0.0f)); + CheckllRot2Euler(new LSL_Types.Quaternion(-0.5f, -0.5f, 0.5f, 0.5f), new LSL_Types.Vector3(0, -Math.PI / 2.0f, Math.PI / 2.0f)); + CheckllRot2Euler(new LSL_Types.Quaternion(-0.707107f, 0.0f, 0.0f, -0.707107f), new LSL_Types.Vector3(Math.PI / 2.0f, 0.0f, 0.0f)); + // A couple of messy rotations. + CheckllRot2Euler(new LSL_Types.Quaternion(1.0f, 5.651f, -3.1f, 67.023f), new LSL_Types.Vector3(0.037818f, 0.166447f, -0.095595f)); + CheckllRot2Euler(new LSL_Types.Quaternion(0.719188f, -0.408934f, -0.363998f, -0.427841f), new LSL_Types.Vector3(-1.954769f, -0.174533f, 1.151917f)); + } + + private void CheckllRot2Euler(LSL_Types.Quaternion rot, LSL_Types.Vector3 eulerCheck) + { + // Call LSL function to convert quaternion rotaion to euler radians. + LSL_Types.Vector3 eulerCalc = m_lslApi.llRot2Euler(rot); + // Check upper and lower bounds of x, y and z. + // This type of check is performed as opposed to comparing for equal numbers, in order to allow slight + // differences in accuracy. + Assert.Greater(eulerCalc.x, eulerCheck.x - ANGLE_ACCURACY_IN_RADIANS, "TestllRot2Euler X lower bounds check fail"); + Assert.Less(eulerCalc.x, eulerCheck.x + ANGLE_ACCURACY_IN_RADIANS, "TestllRot2Euler X upper bounds check fail"); + Assert.Greater(eulerCalc.y, eulerCheck.y - ANGLE_ACCURACY_IN_RADIANS, "TestllRot2Euler Y lower bounds check fail"); + Assert.Less(eulerCalc.y, eulerCheck.y + ANGLE_ACCURACY_IN_RADIANS, "TestllRot2Euler Y upper bounds check fail"); + Assert.Greater(eulerCalc.z, eulerCheck.z - ANGLE_ACCURACY_IN_RADIANS, "TestllRot2Euler Z lower bounds check fail"); + Assert.Less(eulerCalc.z, eulerCheck.z + ANGLE_ACCURACY_IN_RADIANS, "TestllRot2Euler Z upper bounds check fail"); + } } } diff --git a/OpenSim/Region/ScriptEngine/XEngine/XEngine.cs b/OpenSim/Region/ScriptEngine/XEngine/XEngine.cs index a8eed284d8..e1fc4649c9 100644 --- a/OpenSim/Region/ScriptEngine/XEngine/XEngine.cs +++ b/OpenSim/Region/ScriptEngine/XEngine/XEngine.cs @@ -88,6 +88,7 @@ namespace OpenSim.Region.ScriptEngine.XEngine private IXmlRpcRouter m_XmlRpcRouter; private int m_EventLimit; private bool m_KillTimedOutScripts; + private string m_ScriptEnginesPath = null; private static List m_ScriptEngines = new List(); @@ -156,6 +157,11 @@ namespace OpenSim.Region.ScriptEngine.XEngine get { return m_ScriptConfig; } } + public string ScriptEnginePath + { + get { return m_ScriptEnginesPath; } + } + public IConfigSource ConfigSource { get { return m_ConfigSource; } @@ -213,6 +219,7 @@ namespace OpenSim.Region.ScriptEngine.XEngine m_EventLimit = m_ScriptConfig.GetInt("EventLimit", 30); m_KillTimedOutScripts = m_ScriptConfig.GetBoolean("KillTimedOutScripts", false); m_SaveTime = m_ScriptConfig.GetInt("SaveInterval", 120) * 1000; + m_ScriptEnginesPath = m_ScriptConfig.GetString("ScriptEnginesPath", "ScriptEngines"); m_Prio = ThreadPriority.BelowNormal; switch (priority) @@ -414,7 +421,7 @@ namespace OpenSim.Region.ScriptEngine.XEngine return 0; } - public Type ReplaceableInterface + public Type ReplaceableInterface { get { return null; } } @@ -568,7 +575,7 @@ namespace OpenSim.Region.ScriptEngine.XEngine bool postOnRez = (bool)p[4]; StateSource stateSource = (StateSource)p[5]; - lock(m_CompileDict) + lock (m_CompileDict) { if (!m_CompileDict.ContainsKey(itemID)) return false; @@ -705,9 +712,9 @@ namespace OpenSim.Region.ScriptEngine.XEngine } } + ScriptInstance instance = null; lock (m_Scripts) { - ScriptInstance instance = null; // Create the object record if ((!m_Scripts.ContainsKey(itemID)) || @@ -723,9 +730,9 @@ namespace OpenSim.Region.ScriptEngine.XEngine try { AppDomainSetup appSetup = new AppDomainSetup(); -// appSetup.ApplicationBase = Path.Combine( -// "ScriptEngines", -// m_Scene.RegionInfo.RegionID.ToString()); + appSetup.PrivateBinPath = Path.Combine( + m_ScriptEnginesPath, + m_Scene.RegionInfo.RegionID.ToString()); Evidence baseEvidence = AppDomain.CurrentDomain.Evidence; Evidence evidence = new Evidence(baseEvidence); @@ -790,28 +797,29 @@ namespace OpenSim.Region.ScriptEngine.XEngine m_Scripts[itemID] = instance; } - - lock (m_PrimObjects) - { - if (!m_PrimObjects.ContainsKey(localID)) - m_PrimObjects[localID] = new List(); - - if (!m_PrimObjects[localID].Contains(itemID)) - m_PrimObjects[localID].Add(itemID); - - } - - if (!m_Assemblies.ContainsKey(assetID)) - m_Assemblies[assetID] = assembly; - - lock (m_AddingAssemblies) - { - m_AddingAssemblies[assembly]--; - } - - if (instance!=null) - instance.Init(); } + + lock (m_PrimObjects) + { + if (!m_PrimObjects.ContainsKey(localID)) + m_PrimObjects[localID] = new List(); + + if (!m_PrimObjects[localID].Contains(itemID)) + m_PrimObjects[localID].Add(itemID); + + } + + if (!m_Assemblies.ContainsKey(assetID)) + m_Assemblies[assetID] = assembly; + + lock (m_AddingAssemblies) + { + m_AddingAssemblies[assembly]--; + } + + if (instance != null) + instance.Init(); + return true; } @@ -824,60 +832,60 @@ namespace OpenSim.Region.ScriptEngine.XEngine m_CompileDict.Remove(itemID); } + IScriptInstance instance = null; + lock (m_Scripts) { // Do we even have it? if (!m_Scripts.ContainsKey(itemID)) return; - IScriptInstance instance=m_Scripts[itemID]; + instance=m_Scripts[itemID]; m_Scripts.Remove(itemID); + } - instance.ClearQueue(); - instance.Stop(0); - + instance.ClearQueue(); + instance.Stop(0); // bool objectRemoved = false; - lock (m_PrimObjects) + lock (m_PrimObjects) + { + // Remove the script from it's prim + if (m_PrimObjects.ContainsKey(localID)) { - // Remove the script from it's prim - if (m_PrimObjects.ContainsKey(localID)) - { - // Remove inventory item record - if (m_PrimObjects[localID].Contains(itemID)) - m_PrimObjects[localID].Remove(itemID); + // Remove inventory item record + if (m_PrimObjects[localID].Contains(itemID)) + m_PrimObjects[localID].Remove(itemID); - // If there are no more scripts, remove prim - if (m_PrimObjects[localID].Count == 0) - { - m_PrimObjects.Remove(localID); + // If there are no more scripts, remove prim + if (m_PrimObjects[localID].Count == 0) + { + m_PrimObjects.Remove(localID); // objectRemoved = true; - } } } - - instance.RemoveState(); - instance.DestroyScriptInstance(); - - m_DomainScripts[instance.AppDomain].Remove(instance.ItemID); - if (m_DomainScripts[instance.AppDomain].Count == 0) - { - m_DomainScripts.Remove(instance.AppDomain); - UnloadAppDomain(instance.AppDomain); - } - - instance = null; - - ObjectRemoved handlerObjectRemoved = OnObjectRemoved; - if (handlerObjectRemoved != null) - { - SceneObjectPart part = m_Scene.GetSceneObjectPart(localID); - handlerObjectRemoved(part.UUID); - } - - CleanAssemblies(); } + instance.RemoveState(); + instance.DestroyScriptInstance(); + + m_DomainScripts[instance.AppDomain].Remove(instance.ItemID); + if (m_DomainScripts[instance.AppDomain].Count == 0) + { + m_DomainScripts.Remove(instance.AppDomain); + UnloadAppDomain(instance.AppDomain); + } + + instance = null; + + ObjectRemoved handlerObjectRemoved = OnObjectRemoved; + if (handlerObjectRemoved != null) + { + SceneObjectPart part = m_Scene.GetSceneObjectPart(localID); + handlerObjectRemoved(part.UUID); + } + + ScriptRemoved handlerScriptRemoved = OnScriptRemoved; if (handlerScriptRemoved != null) handlerScriptRemoved(itemID); @@ -968,7 +976,7 @@ namespace OpenSim.Region.ScriptEngine.XEngine startInfo.IdleTimeout = idleTimeout*1000; // convert to seconds as stated in .ini startInfo.MaxWorkerThreads = maxThreads; startInfo.MinWorkerThreads = minThreads; - startInfo.ThreadPriority = threadPriority; + startInfo.ThreadPriority = threadPriority;; startInfo.StackSize = stackSize; startInfo.StartSuspended = true; @@ -1011,26 +1019,33 @@ namespace OpenSim.Region.ScriptEngine.XEngine public bool PostObjectEvent(uint localID, EventParams p) { bool result = false; - + List uuids = null; + lock (m_PrimObjects) { if (!m_PrimObjects.ContainsKey(localID)) return false; - - foreach (UUID itemID in m_PrimObjects[localID]) + uuids = m_PrimObjects[localID]; + } + + foreach (UUID itemID in uuids) + { + IScriptInstance instance = null; + try { if (m_Scripts.ContainsKey(itemID)) - { - IScriptInstance instance = m_Scripts[itemID]; - if (instance != null) - { - instance.PostEvent(p); - result = true; - } - } + instance = m_Scripts[itemID]; + } + catch { /* ignore race conditions */ } + + if (instance != null) + { + instance.PostEvent(p); + result = true; } } + return result; } @@ -1106,8 +1121,8 @@ namespace OpenSim.Region.ScriptEngine.XEngine if (!(sender is System.AppDomain)) return null; - string[] pathList = new string[] {"bin", "ScriptEngines", - Path.Combine("ScriptEngines", + string[] pathList = new string[] {"bin", m_ScriptEnginesPath, + Path.Combine(m_ScriptEnginesPath, m_Scene.RegionInfo.RegionID.ToString())}; string assemblyName = args.Name; @@ -1290,7 +1305,7 @@ namespace OpenSim.Region.ScriptEngine.XEngine { sdoc.LoadXml(xml); } - catch (System.Xml.XmlException e) + catch (System.Xml.XmlException) { loadedState = false; } @@ -1481,7 +1496,7 @@ namespace OpenSim.Region.ScriptEngine.XEngine string fn = assemE.GetAttribute("Filename"); string base64 = assemE.InnerText; - string path = Path.Combine("ScriptEngines", World.RegionInfo.RegionID.ToString()); + string path = Path.Combine(m_ScriptEnginesPath, World.RegionInfo.RegionID.ToString()); path = Path.Combine(path, fn); if (!File.Exists(path)) @@ -1521,7 +1536,7 @@ namespace OpenSim.Region.ScriptEngine.XEngine } } - string statepath = Path.Combine("ScriptEngines", World.RegionInfo.RegionID.ToString()); + string statepath = Path.Combine(m_ScriptEnginesPath, World.RegionInfo.RegionID.ToString()); statepath = Path.Combine(statepath, itemID.ToString() + ".state"); try @@ -1547,7 +1562,7 @@ namespace OpenSim.Region.ScriptEngine.XEngine { XmlElement mapE = (XmlElement)mapL[0]; - string mappath = Path.Combine("ScriptEngines", World.RegionInfo.RegionID.ToString()); + string mappath = Path.Combine(m_ScriptEnginesPath, World.RegionInfo.RegionID.ToString()); mappath = Path.Combine(mappath, mapE.GetAttribute("Filename")); try diff --git a/OpenSim/Server/Base/ServerUtils.cs b/OpenSim/Server/Base/ServerUtils.cs index e7a8294fef..f4472c7dc0 100644 --- a/OpenSim/Server/Base/ServerUtils.cs +++ b/OpenSim/Server/Base/ServerUtils.cs @@ -62,7 +62,7 @@ namespace OpenSim.Server.Base /// /// /// The arguments which control which constructor is invoked on the plugin - /// + /// public static T LoadPlugin(string dllName, Object[] args) where T:class { string[] parts = dllName.Split(new char[] {':'}); diff --git a/OpenSim/Server/Base/ServicesServerBase.cs b/OpenSim/Server/Base/ServicesServerBase.cs index dee31bdf58..2652ff2869 100644 --- a/OpenSim/Server/Base/ServicesServerBase.cs +++ b/OpenSim/Server/Base/ServicesServerBase.cs @@ -85,11 +85,13 @@ namespace OpenSim.Server.Base argvConfig.AddSwitch("Startup", "logfile", "l"); argvConfig.AddSwitch("Startup", "inifile", "i"); argvConfig.AddSwitch("Startup", "prompt", "p"); + argvConfig.AddSwitch("Startup", "logconfig", "g"); // Automagically create the ini file name // string fileName = Path.GetFileNameWithoutExtension(Assembly.GetEntryAssembly().Location); string iniFile = fileName + ".ini"; + string logConfig = null; IConfig startupConfig = argvConfig.Configs["Startup"]; if (startupConfig != null) @@ -100,6 +102,9 @@ namespace OpenSim.Server.Base // // Check if a prompt was given on the command line prompt = startupConfig.GetString("prompt", prompt); + // + // Check for a Log4Net config file on the command line + logConfig =startupConfig.GetString("logconfig",logConfig); } // Find out of the file name is a URI and remote load it @@ -171,7 +176,15 @@ namespace OpenSim.Server.Base OpenSimAppender consoleAppender = null; FileAppender fileAppender = null; - XmlConfigurator.Configure(); + if (logConfig != null) + { + FileInfo cfg = new FileInfo(logConfig); + XmlConfigurator.Configure(cfg); + } + else + { + XmlConfigurator.Configure(); + } ILoggerRepository repository = LogManager.GetRepository(); IAppender[] appenders = repository.GetAppenders(); @@ -207,11 +220,12 @@ namespace OpenSim.Server.Base { if (startupConfig != null) { - - fileName = startupConfig.GetString("logfile", fileName+".log"); - fileName = Path.GetFullPath(Path.Combine(".", fileName)); - fileAppender.File = fileName; - fileAppender.ActivateOptions(); + string cfgFileName = startupConfig.GetString("logfile", null); + if (cfgFileName != null) + { + fileAppender.File = cfgFileName; + fileAppender.ActivateOptions(); + } } } diff --git a/OpenSim/Server/Handlers/Freeswitch/FreeswitchServerConnector.cs b/OpenSim/Server/Handlers/Freeswitch/FreeswitchServerConnector.cs index 07bafc8c01..da56b8778d 100644 --- a/OpenSim/Server/Handlers/Freeswitch/FreeswitchServerConnector.cs +++ b/OpenSim/Server/Handlers/Freeswitch/FreeswitchServerConnector.cs @@ -26,18 +26,27 @@ */ using System; +using System.Collections; +using System.Web; +using System.Reflection; using Nini.Config; using OpenSim.Server.Base; using OpenSim.Services.Interfaces; using OpenSim.Framework.Servers.HttpServer; using OpenSim.Server.Handlers.Base; +using log4net; +using OpenMetaverse; +using OpenMetaverse.StructuredData; namespace OpenSim.Server.Handlers.Freeswitch { public class FreeswitchServerConnector : ServiceConnector { + private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); + private IFreeswitchService m_FreeswitchService; private string m_ConfigName = "FreeswitchService"; + protected readonly string m_freeSwitchAPIPrefix = "/fsapi"; public FreeswitchServerConnector(IConfigSource config, IHttpServer server, string configName) : base(config, server, configName) @@ -59,7 +68,61 @@ namespace OpenSim.Server.Handlers.Freeswitch m_FreeswitchService = ServerUtils.LoadPlugin(freeswitchService, args); - server.AddStreamHandler(new FreeswitchServerGetHandler(m_FreeswitchService)); + server.AddHTTPHandler(String.Format("{0}/freeswitch-config", m_freeSwitchAPIPrefix), FreeSwitchConfigHTTPHandler); + server.AddHTTPHandler(String.Format("{0}/region-config", m_freeSwitchAPIPrefix), RegionConfigHTTPHandler); } + + public Hashtable FreeSwitchConfigHTTPHandler(Hashtable request) + { + Hashtable response = new Hashtable(); + response["str_response_string"] = string.Empty; + response["content_type"] = "text/plain"; + response["keepalive"] = false; + response["int_response_code"] = 500; + + Hashtable requestBody = ParseRequestBody((string) request["body"]); + + string section = (string) requestBody["section"]; + + if (section == "directory") + response = m_FreeswitchService.HandleDirectoryRequest(requestBody); + else if (section == "dialplan") + response = m_FreeswitchService.HandleDialplanRequest(requestBody); + else + m_log.WarnFormat("[FreeSwitchVoice]: section was {0}", section); + + return response; + } + + private Hashtable ParseRequestBody(string body) + { + Hashtable bodyParams = new Hashtable(); + // split string + string [] nvps = body.Split(new Char [] {'&'}); + + foreach (string s in nvps) + { + if (s.Trim() != "") + { + string [] nvp = s.Split(new Char [] {'='}); + bodyParams.Add(HttpUtility.UrlDecode(nvp[0]), HttpUtility.UrlDecode(nvp[1])); + } + } + + return bodyParams; + } + + public Hashtable RegionConfigHTTPHandler(Hashtable request) + { + Hashtable response = new Hashtable(); + response["content_type"] = "text/json"; + response["keepalive"] = false; + response["int_response_code"] = 200; + + response["str_response_string"] = m_FreeswitchService.GetJsonConfig(); + + return response; + } + } } diff --git a/OpenSim/Server/Handlers/Grid/GridInfoHandlers.cs b/OpenSim/Server/Handlers/Grid/GridInfoHandlers.cs index d1233dc0e4..cdab49ed6b 100644 --- a/OpenSim/Server/Handlers/Grid/GridInfoHandlers.cs +++ b/OpenSim/Server/Handlers/Grid/GridInfoHandlers.cs @@ -102,16 +102,15 @@ namespace OpenSim.Server.Handlers.Grid } catch (Exception) { - _log.Debug("[GRID INFO SERVICE]: Cannot get grid info from config source, using minimal defaults"); + _log.Warn("[GRID INFO SERVICE]: Cannot get grid info from config source, using minimal defaults"); } _log.DebugFormat("[GRID INFO SERVICE]: Grid info service initialized with {0} keys", _info.Count); - } private void IssueWarning() { - _log.Warn("[GRID INFO SERVICE]: found no [GridInfo] section in your OpenSim.ini"); + _log.Warn("[GRID INFO SERVICE]: found no [GridInfo] section in your configuration files"); _log.Warn("[GRID INFO SERVICE]: trying to guess sensible defaults, you might want to provide better ones:"); foreach (string k in _info.Keys) @@ -125,7 +124,7 @@ namespace OpenSim.Server.Handlers.Grid XmlRpcResponse response = new XmlRpcResponse(); Hashtable responseData = new Hashtable(); - _log.Info("[GRID INFO SERVICE]: Request for grid info"); + _log.Debug("[GRID INFO SERVICE]: Request for grid info"); foreach (string k in _info.Keys) { diff --git a/OpenSim/Server/Handlers/Grid/GridServerPostHandler.cs b/OpenSim/Server/Handlers/Grid/GridServerPostHandler.cs index c90dd6f771..913c6c9b3a 100644 --- a/OpenSim/Server/Handlers/Grid/GridServerPostHandler.cs +++ b/OpenSim/Server/Handlers/Grid/GridServerPostHandler.cs @@ -109,6 +109,9 @@ namespace OpenSim.Server.Handlers.Grid case "get_fallback_regions": return GetFallbackRegions(request); + case "get_hyperlinks": + return GetHyperlinks(request); + case "get_region_flags": return GetRegionFlags(request); } @@ -483,6 +486,36 @@ namespace OpenSim.Server.Handlers.Grid return encoding.GetBytes(xmlString); } + byte[] GetHyperlinks(Dictionary request) + { + //m_log.DebugFormat("[GRID HANDLER]: GetHyperlinks"); + UUID scopeID = UUID.Zero; + if (request.ContainsKey("SCOPEID")) + UUID.TryParse(request["SCOPEID"].ToString(), out scopeID); + else + m_log.WarnFormat("[GRID HANDLER]: no scopeID in request to get linked regions"); + + List rinfos = m_GridService.GetHyperlinks(scopeID); + + Dictionary result = new Dictionary(); + if ((rinfos == null) || ((rinfos != null) && (rinfos.Count == 0))) + result["result"] = "null"; + else + { + int i = 0; + foreach (GridRegion rinfo in rinfos) + { + Dictionary rinfoDict = rinfo.ToKeyValuePairs(); + result["region" + i] = rinfoDict; + i++; + } + } + string xmlString = ServerUtils.BuildXmlResponse(result); + //m_log.DebugFormat("[GRID HANDLER]: resp string: {0}", xmlString); + UTF8Encoding encoding = new UTF8Encoding(); + return encoding.GetBytes(xmlString); + } + byte[] GetRegionFlags(Dictionary request) { UUID scopeID = UUID.Zero; diff --git a/OpenSim/Server/Handlers/GridUser/GridUserServerPostHandler.cs b/OpenSim/Server/Handlers/GridUser/GridUserServerPostHandler.cs index f8fa42967f..485bc3e911 100644 --- a/OpenSim/Server/Handlers/GridUser/GridUserServerPostHandler.cs +++ b/OpenSim/Server/Handlers/GridUser/GridUserServerPostHandler.cs @@ -131,7 +131,7 @@ namespace OpenSim.Server.Handlers.GridUser if (!UnpackArgs(request, out userID, out regionID, out position, out lookat)) return FailureResult(); - if (m_GridUserService.LoggedOut(userID, regionID, position, lookat)) + if (m_GridUserService.LoggedOut(userID, UUID.Zero, regionID, position, lookat)) return SuccessResult(); return FailureResult(); @@ -166,7 +166,7 @@ namespace OpenSim.Server.Handlers.GridUser if (!UnpackArgs(request, out user, out region, out position, out look)) return FailureResult(); - if (m_GridUserService.SetLastPosition(user, region, position, look)) + if (m_GridUserService.SetLastPosition(user, UUID.Zero, region, position, look)) return SuccessResult(); return FailureResult(); diff --git a/OpenSim/Server/Handlers/Hypergrid/AgentHandlers.cs b/OpenSim/Server/Handlers/Hypergrid/AgentHandlers.cs index c95165398b..31eefb1a6e 100644 --- a/OpenSim/Server/Handlers/Hypergrid/AgentHandlers.cs +++ b/OpenSim/Server/Handlers/Hypergrid/AgentHandlers.cs @@ -54,9 +54,10 @@ namespace OpenSim.Server.Handlers.Hypergrid private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); private IGatekeeperService m_GatekeeperService; - public GatekeeperAgentHandler(IGatekeeperService gatekeeper) + public GatekeeperAgentHandler(IGatekeeperService gatekeeper, bool proxy) { m_GatekeeperService = gatekeeper; + m_Proxy = proxy; } protected override bool CreateAgent(GridRegion destination, AgentCircuitData aCircuit, uint teleportFlags, out string reason) diff --git a/OpenSim/Server/Handlers/Hypergrid/GatekeeperServerConnector.cs b/OpenSim/Server/Handlers/Hypergrid/GatekeeperServerConnector.cs index dcb27257a0..49de8b1c66 100644 --- a/OpenSim/Server/Handlers/Hypergrid/GatekeeperServerConnector.cs +++ b/OpenSim/Server/Handlers/Hypergrid/GatekeeperServerConnector.cs @@ -51,6 +51,8 @@ namespace OpenSim.Server.Handlers.Hypergrid get { return m_GatekeeperService; } } + bool m_Proxy = false; + public GatekeeperServiceInConnector(IConfigSource config, IHttpServer server, ISimulationService simService) : base(config, server, String.Empty) { @@ -65,11 +67,13 @@ namespace OpenSim.Server.Handlers.Hypergrid if (m_GatekeeperService == null) throw new Exception("Gatekeeper server connector cannot proceed because of missing service"); + m_Proxy = gridConfig.GetBoolean("HasProxy", false); + HypergridHandlers hghandlers = new HypergridHandlers(m_GatekeeperService); server.AddXmlRPCHandler("link_region", hghandlers.LinkRegionRequest, false); server.AddXmlRPCHandler("get_region", hghandlers.GetRegion, false); - server.AddHTTPHandler("/foreignagent/", new GatekeeperAgentHandler(m_GatekeeperService).Handler); + server.AddHTTPHandler("/foreignagent/", new GatekeeperAgentHandler(m_GatekeeperService, m_Proxy).Handler); } public GatekeeperServiceInConnector(IConfigSource config, IHttpServer server) diff --git a/OpenSim/Server/Handlers/Freeswitch/FreeswitchServerGetHandler.cs b/OpenSim/Server/Handlers/Hypergrid/HeloServerConnector.cs similarity index 63% rename from OpenSim/Server/Handlers/Freeswitch/FreeswitchServerGetHandler.cs rename to OpenSim/Server/Handlers/Hypergrid/HeloServerConnector.cs index 8b41742916..39baa324cb 100644 --- a/OpenSim/Server/Handlers/Freeswitch/FreeswitchServerGetHandler.cs +++ b/OpenSim/Server/Handlers/Hypergrid/HeloServerConnector.cs @@ -25,48 +25,55 @@ * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ +using System; +using System.Collections.Generic; +using System.IO; +using System.Net; +using System.Reflection; using Nini.Config; using log4net; -using System; -using System.IO; -using System.Reflection; -using System.Net; -using System.Text; -using System.Text.RegularExpressions; -using System.Xml; -using System.Xml.Serialization; using OpenSim.Server.Base; using OpenSim.Services.Interfaces; -using OpenSim.Framework; using OpenSim.Framework.Servers.HttpServer; +using OpenSim.Server.Handlers.Base; -namespace OpenSim.Server.Handlers.Freeswitch +namespace OpenSim.Server.Handlers.Hypergrid { - public class FreeswitchServerGetHandler : BaseStreamHandler + public class HeloServiceInConnector : ServiceConnector { - // private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); - - //private IFreeswitchService m_FreeswitchService; - - public FreeswitchServerGetHandler(IFreeswitchService service) : - base("GET", "/api") + public HeloServiceInConnector(IConfigSource config, IHttpServer server, string configName) : + base(config, server, configName) { - //m_FreeswitchService = service; - } - - public override byte[] Handle(string path, Stream request, - OSHttpRequest httpRequest, OSHttpResponse httpResponse) - { - byte[] result = new byte[0]; - - string[] p = SplitParams(path); - - if (p.Length == 0) - return result; - - // Process web request - - return result; + server.AddStreamHandler(new HeloServerGetHandler("opensim-robust")); } } + + public class HeloServerGetHandler : BaseStreamHandler + { + private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); + + private string m_HandlersType; + + public HeloServerGetHandler(string handlersType) : + base("GET", "/helo") + { + m_HandlersType = handlersType; + } + + public override byte[] Handle(string path, Stream requestData, + OSHttpRequest httpRequest, OSHttpResponse httpResponse) + { + return OKResponse(httpResponse); + } + + private byte[] OKResponse(OSHttpResponse httpResponse) + { + m_log.Debug("[HELO]: hi, I was called"); + httpResponse.AddHeader("X-Handlers-Provided", m_HandlersType); + httpResponse.StatusCode = (int)HttpStatusCode.OK; + httpResponse.StatusDescription = "OK"; + return new byte[0]; + } + + } } diff --git a/OpenSim/Server/Handlers/Hypergrid/HomeAgentHandlers.cs b/OpenSim/Server/Handlers/Hypergrid/HomeAgentHandlers.cs index e50481a259..f64a07973e 100644 --- a/OpenSim/Server/Handlers/Hypergrid/HomeAgentHandlers.cs +++ b/OpenSim/Server/Handlers/Hypergrid/HomeAgentHandlers.cs @@ -54,9 +54,14 @@ namespace OpenSim.Server.Handlers.Hypergrid private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); private IUserAgentService m_UserAgentService; - public HomeAgentHandler(IUserAgentService userAgentService) + private string m_LoginServerIP; + private bool m_Proxy = false; + + public HomeAgentHandler(IUserAgentService userAgentService, string loginServerIP, bool proxy) { m_UserAgentService = userAgentService; + m_LoginServerIP = loginServerIP; + m_Proxy = proxy; } public Hashtable Handler(Hashtable request) @@ -120,6 +125,7 @@ namespace OpenSim.Server.Handlers.Hypergrid string regionname = string.Empty; string gatekeeper_host = string.Empty; int gatekeeper_port = 0; + IPEndPoint client_ipaddress = null; if (args.ContainsKey("gatekeeper_host") && args["gatekeeper_host"] != null) gatekeeper_host = args["gatekeeper_host"].AsString(); @@ -144,6 +150,24 @@ namespace OpenSim.Server.Handlers.Hypergrid if (args.ContainsKey("destination_name") && args["destination_name"] != null) regionname = args["destination_name"].ToString(); + if (args.ContainsKey("client_ip") && args["client_ip"] != null) + { + string ip_str = args["client_ip"].ToString(); + try + { + string callerIP = GetCallerIP(request); + // Verify if this caller has authority to send the client IP + if (callerIP == m_LoginServerIP) + client_ipaddress = new IPEndPoint(IPAddress.Parse(ip_str), 0); + else // leaving this for now, but this warning should be removed + m_log.WarnFormat("[HOME AGENT HANDLER]: Unauthorized machine {0} tried to set client ip to {1}", callerIP, ip_str); + } + catch + { + m_log.DebugFormat("[HOME AGENT HANDLER]: Exception parsing client ip address from {0}", ip_str); + } + } + GridRegion destination = new GridRegion(); destination.RegionID = uuid; destination.RegionLocX = x; @@ -166,7 +190,7 @@ namespace OpenSim.Server.Handlers.Hypergrid OSDMap resp = new OSDMap(2); string reason = String.Empty; - bool result = m_UserAgentService.LoginAgentToGrid(aCircuit, gatekeeper, destination, out reason); + bool result = m_UserAgentService.LoginAgentToGrid(aCircuit, gatekeeper, destination, client_ipaddress, out reason); resp["reason"] = OSD.FromString(reason); resp["success"] = OSD.FromBoolean(result); @@ -176,6 +200,23 @@ namespace OpenSim.Server.Handlers.Hypergrid responsedata["str_response_string"] = OSDParser.SerializeJsonString(resp); } + private string GetCallerIP(Hashtable request) + { + if (!m_Proxy) + return Util.GetCallerIP(request); + + // We're behind a proxy + Hashtable headers = (Hashtable)request["headers"]; + if (headers.ContainsKey("X-Forwarded-For") && headers["X-Forwarded-For"] != null) + { + IPEndPoint ep = Util.GetClientIPFromXFF((string)headers["X-Forwarded-For"]); + if (ep != null) + return ep.Address.ToString(); + } + + // Oops + return Util.GetCallerIP(request); + } } } diff --git a/OpenSim/Server/Handlers/Hypergrid/UserAgentServerConnector.cs b/OpenSim/Server/Handlers/Hypergrid/UserAgentServerConnector.cs index 6b1152b00e..e5f6a5def5 100644 --- a/OpenSim/Server/Handlers/Hypergrid/UserAgentServerConnector.cs +++ b/OpenSim/Server/Handlers/Hypergrid/UserAgentServerConnector.cs @@ -66,13 +66,16 @@ namespace OpenSim.Server.Handlers.Hypergrid if (m_HomeUsersService == null) throw new Exception("UserAgent server connector cannot proceed because of missing service"); + string loginServerIP = gridConfig.GetString("LoginServerIP", "127.0.0.1"); + bool proxy = gridConfig.GetBoolean("HasProxy", false); + server.AddXmlRPCHandler("agent_is_coming_home", AgentIsComingHome, false); server.AddXmlRPCHandler("get_home_region", GetHomeRegion, false); server.AddXmlRPCHandler("verify_agent", VerifyAgent, false); server.AddXmlRPCHandler("verify_client", VerifyClient, false); server.AddXmlRPCHandler("logout_agent", LogoutAgent, false); - server.AddHTTPHandler("/homeagent/", new HomeAgentHandler(m_HomeUsersService).Handler); + server.AddHTTPHandler("/homeagent/", new HomeAgentHandler(m_HomeUsersService, loginServerIP, proxy).Handler); } public XmlRpcResponse GetHomeRegion(XmlRpcRequest request, IPEndPoint remoteClient) diff --git a/OpenSim/Server/Handlers/Inventory/XInventoryInConnector.cs b/OpenSim/Server/Handlers/Inventory/XInventoryInConnector.cs index ac6a3ab929..22a718a354 100644 --- a/OpenSim/Server/Handlers/Inventory/XInventoryInConnector.cs +++ b/OpenSim/Server/Handlers/Inventory/XInventoryInConnector.cs @@ -600,7 +600,10 @@ namespace OpenSim.Server.Handlers.Asset ret["AssetType"] = item.AssetType.ToString(); ret["BasePermissions"] = item.BasePermissions.ToString(); ret["CreationDate"] = item.CreationDate.ToString(); - ret["CreatorId"] = item.CreatorId.ToString(); + if (item.CreatorId != null) + ret["CreatorId"] = item.CreatorId.ToString(); + else + ret["CreatorId"] = String.Empty; ret["CurrentPermissions"] = item.CurrentPermissions.ToString(); ret["Description"] = item.Description.ToString(); ret["EveryOnePermissions"] = item.EveryOnePermissions.ToString(); @@ -646,6 +649,7 @@ namespace OpenSim.Server.Handlers.Asset item.InvType = int.Parse(data["InvType"].ToString()); item.Folder = new UUID(data["Folder"].ToString()); item.CreatorId = data["CreatorId"].ToString(); + item.CreatorData = data["CreatorData"].ToString(); item.Description = data["Description"].ToString(); item.NextPermissions = uint.Parse(data["NextPermissions"].ToString()); item.CurrentPermissions = uint.Parse(data["CurrentPermissions"].ToString()); diff --git a/OpenSim/Server/Handlers/Land/LandHandlers.cs b/OpenSim/Server/Handlers/Land/LandHandlers.cs index a21f9de29b..561f285a4b 100644 --- a/OpenSim/Server/Handlers/Land/LandHandlers.cs +++ b/OpenSim/Server/Handlers/Land/LandHandlers.cs @@ -66,7 +66,8 @@ namespace OpenSim.Server.Handlers.Land uint y = Convert.ToUInt32(requestData["y"]); m_log.DebugFormat("[LAND HANDLER]: Got request for land data at {0}, {1} for region {2}", x, y, regionHandle); - LandData landData = m_LocalService.GetLandData(regionHandle, x, y); + byte regionAccess; + LandData landData = m_LocalService.GetLandData(regionHandle, x, y, out regionAccess); Hashtable hash = new Hashtable(); if (landData != null) { @@ -83,6 +84,7 @@ namespace OpenSim.Server.Handlers.Land hash["SalePrice"] = landData.SalePrice.ToString(); hash["SnapshotID"] = landData.SnapshotID.ToString(); hash["UserLocation"] = landData.UserLocation.ToString(); + hash["RegionAccess"] = regionAccess.ToString(); } XmlRpcResponse response = new XmlRpcResponse(); diff --git a/OpenSim/Server/Handlers/Login/LLLoginHandlers.cs b/OpenSim/Server/Handlers/Login/LLLoginHandlers.cs index 5bb529c89e..48f5f99ed3 100644 --- a/OpenSim/Server/Handlers/Login/LLLoginHandlers.cs +++ b/OpenSim/Server/Handlers/Login/LLLoginHandlers.cs @@ -52,15 +52,24 @@ namespace OpenSim.Server.Handlers.Login private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); private ILoginService m_LocalService; + private bool m_Proxy; - public LLLoginHandlers(ILoginService service) + public LLLoginHandlers(ILoginService service, bool hasProxy) { m_LocalService = service; + m_Proxy = hasProxy; } public XmlRpcResponse HandleXMLRPCLogin(XmlRpcRequest request, IPEndPoint remoteClient) { Hashtable requestData = (Hashtable)request.Params[0]; + if (m_Proxy && request.Params[3] != null) + { + IPEndPoint ep = Util.GetClientIPFromXFF((string)request.Params[3]); + if (ep != null) + // Bang! + remoteClient = ep; + } if (requestData != null) { @@ -79,14 +88,26 @@ namespace OpenSim.Server.Handlers.Login startLocation = requestData["start"].ToString(); string clientVersion = "Unknown"; - if (requestData.Contains("version")) + if (requestData.Contains("version") && requestData["version"] != null) clientVersion = requestData["version"].ToString(); // We should do something interesting with the client version... + string channel = "Unknown"; + if (requestData.Contains("channel") && requestData["channel"] != null) + channel = requestData["channel"].ToString(); + + string mac = "Unknown"; + if (requestData.Contains("mac") && requestData["mac"] != null) + mac = requestData["mac"].ToString(); + + string id0 = "Unknown"; + if (requestData.Contains("id0") && requestData["id0"] != null) + id0 = requestData["id0"].ToString(); + //m_log.InfoFormat("[LOGIN]: XMLRPC Login Requested for {0} {1}, starting in {2}, using {3}", first, last, startLocation, clientVersion); LoginResponse reply = null; - reply = m_LocalService.Login(first, last, passwd, startLocation, scopeID, clientVersion, remoteClient); + reply = m_LocalService.Login(first, last, passwd, startLocation, scopeID, clientVersion, channel, mac, id0, remoteClient); XmlRpcResponse response = new XmlRpcResponse(); response.Value = reply.ToHashtable(); @@ -157,7 +178,8 @@ namespace OpenSim.Server.Handlers.Login m_log.Info("[LOGIN]: LLSD Login Requested for: '" + map["first"].AsString() + "' '" + map["last"].AsString() + "' / " + startLocation); LoginResponse reply = null; - reply = m_LocalService.Login(map["first"].AsString(), map["last"].AsString(), map["passwd"].AsString(), startLocation, scopeID, String.Empty, remoteClient); + reply = m_LocalService.Login(map["first"].AsString(), map["last"].AsString(), map["passwd"].AsString(), startLocation, scopeID, + map["version"].AsString(), map["channel"].AsString(), map["mac"].AsString(), map["id0"].AsString(), remoteClient); return reply.ToOSDMap(); } @@ -189,6 +211,7 @@ namespace OpenSim.Server.Handlers.Login return map; } + } } diff --git a/OpenSim/Server/Handlers/Login/LLLoginServiceInConnector.cs b/OpenSim/Server/Handlers/Login/LLLoginServiceInConnector.cs index 67e83924d0..16c93c8e2c 100644 --- a/OpenSim/Server/Handlers/Login/LLLoginServiceInConnector.cs +++ b/OpenSim/Server/Handlers/Login/LLLoginServiceInConnector.cs @@ -43,6 +43,7 @@ namespace OpenSim.Server.Handlers.Login private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); private ILoginService m_LoginService; + private bool m_Proxy; public LLLoginServiceInConnector(IConfigSource config, IHttpServer server, IScene scene) : base(config, server, String.Empty) @@ -81,12 +82,14 @@ namespace OpenSim.Server.Handlers.Login if (loginService == string.Empty) throw new Exception(String.Format("No LocalServiceModule for LoginService in config file")); + m_Proxy = serverConfig.GetBoolean("HasProxy", false); + return loginService; } private void InitializeHandlers(IHttpServer server) { - LLLoginHandlers loginHandlers = new LLLoginHandlers(m_LoginService); + LLLoginHandlers loginHandlers = new LLLoginHandlers(m_LoginService, m_Proxy); server.AddXmlRPCHandler("login_to_simulator", loginHandlers.HandleXMLRPCLogin, false); server.AddXmlRPCHandler("set_login_level", loginHandlers.HandleXMLRPCSetLoginLevel, false); server.SetDefaultLLSDHandler(loginHandlers.HandleLLSDLogin); diff --git a/OpenSim/Server/Handlers/Simulation/AgentHandlers.cs b/OpenSim/Server/Handlers/Simulation/AgentHandlers.cs index d261678159..1f7e50217f 100644 --- a/OpenSim/Server/Handlers/Simulation/AgentHandlers.cs +++ b/OpenSim/Server/Handlers/Simulation/AgentHandlers.cs @@ -52,6 +52,8 @@ namespace OpenSim.Server.Handlers.Simulation private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); private ISimulationService m_SimulationService; + protected bool m_Proxy = false; + public AgentHandler() { } public AgentHandler(ISimulationService sim) @@ -178,12 +180,32 @@ namespace OpenSim.Server.Handlers.Simulation resp["reason"] = OSD.FromString(reason); resp["success"] = OSD.FromBoolean(result); + // Let's also send out the IP address of the caller back to the caller (HG 1.5) + resp["your_ip"] = OSD.FromString(GetCallerIP(request)); // TODO: add reason if not String.Empty? responsedata["int_response_code"] = HttpStatusCode.OK; responsedata["str_response_string"] = OSDParser.SerializeJsonString(resp); } + private string GetCallerIP(Hashtable request) + { + if (!m_Proxy) + return Util.GetCallerIP(request); + + // We're behind a proxy + Hashtable headers = (Hashtable)request["headers"]; + if (headers.ContainsKey("X-Forwarded-For") && headers["X-Forwarded-For"] != null) + { + IPEndPoint ep = Util.GetClientIPFromXFF((string)headers["X-Forwarded-For"]); + if (ep != null) + return ep.Address.ToString(); + } + + // Oops + return Util.GetCallerIP(request); + } + // subclasses can override this protected virtual bool CreateAgent(GridRegion destination, AgentCircuitData aCircuit, uint teleportFlags, out string reason) { @@ -352,6 +374,7 @@ namespace OpenSim.Server.Handlers.Simulation { m_SimulationService.ReleaseAgent(regionID, id, ""); } + } } diff --git a/OpenSim/Server/Handlers/Simulation/ObjectHandlers.cs b/OpenSim/Server/Handlers/Simulation/ObjectHandlers.cs index 33e5aa6b05..04ff83f9f3 100644 --- a/OpenSim/Server/Handlers/Simulation/ObjectHandlers.cs +++ b/OpenSim/Server/Handlers/Simulation/ObjectHandlers.cs @@ -162,6 +162,11 @@ namespace OpenSim.Server.Handlers.Simulation return; } + if (args.ContainsKey("modified")) + sog.HasGroupChanged = args["modified"].AsBoolean(); + else + sog.HasGroupChanged = false; + if ((args["state"] != null) && s.AllowScriptCrossings) { stateXmlStr = args["state"].AsString(); @@ -243,4 +248,4 @@ namespace OpenSim.Server.Handlers.Simulation } } -} \ No newline at end of file +} diff --git a/OpenSim/Services/AvatarService/AvatarService.cs b/OpenSim/Services/AvatarService/AvatarService.cs index 19e662ca19..53ca7c868b 100644 --- a/OpenSim/Services/AvatarService/AvatarService.cs +++ b/OpenSim/Services/AvatarService/AvatarService.cs @@ -51,15 +51,30 @@ namespace OpenSim.Services.AvatarService m_log.Debug("[AVATAR SERVICE]: Starting avatar service"); } + public AvatarAppearance GetAppearance(UUID principalID) + { + AvatarData avatar = GetAvatar(principalID); + return avatar.ToAvatarAppearance(principalID); + } + + public bool SetAppearance(UUID principalID, AvatarAppearance appearance) + { + AvatarData avatar = new AvatarData(appearance); + return SetAvatar(principalID,avatar); + } + public AvatarData GetAvatar(UUID principalID) { AvatarBaseData[] av = m_Database.Get("PrincipalID", principalID.ToString()); - if (av.Length == 0) - return null; - AvatarData ret = new AvatarData(); ret.Data = new Dictionary(); + if (av.Length == 0) + { + ret.AvatarType = 1; // SL avatar + return ret; + } + foreach (AvatarBaseData b in av) { if (b.Data["Name"] == "AvatarType") diff --git a/OpenSim/Services/Connectors/Asset/HGAssetServiceConnector.cs b/OpenSim/Services/Connectors/Asset/HGAssetServiceConnector.cs index 34df54a90b..5c31639ac2 100644 --- a/OpenSim/Services/Connectors/Asset/HGAssetServiceConnector.cs +++ b/OpenSim/Services/Connectors/Asset/HGAssetServiceConnector.cs @@ -32,6 +32,8 @@ using System.Collections.Generic; using System.Reflection; using OpenSim.Framework; using OpenSim.Services.Interfaces; +using OpenSim.Services.Connectors.Hypergrid; +using OpenSim.Services.Connectors.SimianGrid; namespace OpenSim.Services.Connectors { @@ -41,7 +43,7 @@ namespace OpenSim.Services.Connectors LogManager.GetLogger( MethodBase.GetCurrentMethod().DeclaringType); - private Dictionary m_connectors = new Dictionary(); + private Dictionary m_connectors = new Dictionary(); public HGAssetServiceConnector(IConfigSource source) { @@ -81,7 +83,7 @@ namespace OpenSim.Services.Connectors private IAssetService GetConnector(string url) { - AssetServicesConnector connector = null; + IAssetService connector = null; lock (m_connectors) { if (m_connectors.ContainsKey(url)) @@ -90,12 +92,17 @@ namespace OpenSim.Services.Connectors } else { - // We're instantiating this class explicitly, but this won't - // work in general, because the remote grid may be running - // an asset server that has a different protocol. - // Eventually we will want a piece of protocol asking - // the remote server about its kind. Definitely cool thing to do! - connector = new AssetServicesConnector(url); + // Still not as flexible as I would like this to be, + // but good enough for now + string connectorType = new HeloServicesConnector(url).Helo(); + m_log.DebugFormat("[HG ASSET SERVICE]: HELO returned {0}", connectorType); + if (connectorType == "opensim-simian") + { + connector = new SimianAssetServiceConnector(url); + } + else + connector = new AssetServicesConnector(url); + m_connectors.Add(url, connector); } } diff --git a/OpenSim/Services/Connectors/Avatar/AvatarServiceConnector.cs b/OpenSim/Services/Connectors/Avatar/AvatarServiceConnector.cs index 96c05a99f5..1cd6bf8e1a 100644 --- a/OpenSim/Services/Connectors/Avatar/AvatarServiceConnector.cs +++ b/OpenSim/Services/Connectors/Avatar/AvatarServiceConnector.cs @@ -87,6 +87,18 @@ namespace OpenSim.Services.Connectors #region IAvatarService + public AvatarAppearance GetAppearance(UUID userID) + { + AvatarData avatar = GetAvatar(userID); + return avatar.ToAvatarAppearance(userID); + } + + public bool SetAppearance(UUID userID, AvatarAppearance appearance) + { + AvatarData avatar = new AvatarData(appearance); + return SetAvatar(userID,avatar); + } + public AvatarData GetAvatar(UUID userID) { Dictionary sendData = new Dictionary(); diff --git a/OpenSim/Services/Connectors/Freeswitch/RemoteFreeswitchConnector.cs b/OpenSim/Services/Connectors/Freeswitch/RemoteFreeswitchConnector.cs new file mode 100644 index 0000000000..c9bba0b730 --- /dev/null +++ b/OpenSim/Services/Connectors/Freeswitch/RemoteFreeswitchConnector.cs @@ -0,0 +1,104 @@ +/* + * Copyright (c) Contributors, http://opensimulator.org/ + * See CONTRIBUTORS.TXT for a full list of copyright holders. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * * Neither the name of the OpenSimulator Project nor the + * names of its contributors may be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE DEVELOPERS ``AS IS'' AND ANY + * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED + * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + * DISCLAIMED. IN NO EVENT SHALL THE CONTRIBUTORS BE LIABLE FOR ANY + * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES + * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND + * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS + * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +using log4net; +using System; +using System.IO; +using System.Collections; +using System.Reflection; +using Nini.Config; +using OpenSim.Framework; +using OpenSim.Framework.Communications; +using OpenSim.Framework.Servers.HttpServer; +using OpenSim.Services.Interfaces; +using OpenSim.Server.Base; +using OpenMetaverse; + +namespace OpenSim.Services.Connectors +{ + public class RemoteFreeswitchConnector : IFreeswitchService + { + private static readonly ILog m_log = + LogManager.GetLogger( + MethodBase.GetCurrentMethod().DeclaringType); + + private string m_ServerURI = String.Empty; + + public RemoteFreeswitchConnector() + { + } + + public RemoteFreeswitchConnector(string serverURI) + { + m_ServerURI = serverURI.TrimEnd('/') + "/region-config"; + } + + public RemoteFreeswitchConnector(IConfigSource source) + { + Initialise(source); + } + + public virtual void Initialise(IConfigSource source) + { + IConfig freeswitchConfig = source.Configs["FreeSwitchVoice"]; + if (freeswitchConfig == null) + { + m_log.Error("[FREESWITCH CONNECTOR]: FreeSwitchVoice missing from OpenSim.ini"); + throw new Exception("Freeswitch connector init error"); + } + + string serviceURI = freeswitchConfig.GetString("FreeswitchServiceURL", + String.Empty); + + if (serviceURI == String.Empty) + { + m_log.Error("[FREESWITCH CONNECTOR]: No FreeswitchServiceURL named in section FreeSwitchVoice"); + throw new Exception("Freeswitch connector init error"); + } + m_ServerURI = serviceURI.TrimEnd('/') + "/region-config"; + } + + public Hashtable HandleDirectoryRequest(Hashtable requestBody) + { + // not used here + return new Hashtable(); + } + + public Hashtable HandleDialplanRequest(Hashtable requestBody) + { + // not used here + return new Hashtable(); + } + + public string GetJsonConfig() + { + m_log.DebugFormat("[FREESWITCH CONNECTOR]: Requesting config from {0}", m_ServerURI); + return SynchronousRestFormsRequester.MakeRequest("GET", + m_ServerURI, String.Empty); + } + } +} diff --git a/OpenSim/Services/Connectors/Friends/FriendsServiceConnector.cs b/OpenSim/Services/Connectors/Friends/FriendsServiceConnector.cs index d7a5731daa..36b5083860 100644 --- a/OpenSim/Services/Connectors/Friends/FriendsServiceConnector.cs +++ b/OpenSim/Services/Connectors/Friends/FriendsServiceConnector.cs @@ -156,8 +156,6 @@ namespace OpenSim.Services.Connectors sendData["METHOD"] = "storefriend"; - string reqString = ServerUtils.BuildQueryString(sendData); - string reply = string.Empty; try { @@ -199,8 +197,6 @@ namespace OpenSim.Services.Connectors sendData["FRIEND"] = Friend; sendData["METHOD"] = "deletefriend"; - string reqString = ServerUtils.BuildQueryString(sendData); - string reply = string.Empty; try { @@ -232,10 +228,8 @@ namespace OpenSim.Services.Connectors m_log.DebugFormat("[FRIENDS CONNECTOR]: DeleteFriend received null reply"); return false; - } #endregion - } -} +} \ No newline at end of file diff --git a/OpenSim/Services/Connectors/Grid/GridServiceConnector.cs b/OpenSim/Services/Connectors/Grid/GridServiceConnector.cs index 18315337ac..80f0d2ddcb 100644 --- a/OpenSim/Services/Connectors/Grid/GridServiceConnector.cs +++ b/OpenSim/Services/Connectors/Grid/GridServiceConnector.cs @@ -556,6 +556,56 @@ namespace OpenSim.Services.Connectors return rinfos; } + public List GetHyperlinks(UUID scopeID) + { + Dictionary sendData = new Dictionary(); + + sendData["SCOPEID"] = scopeID.ToString(); + + sendData["METHOD"] = "get_hyperlinks"; + + List rinfos = new List(); + string reply = string.Empty; + try + { + reply = SynchronousRestFormsRequester.MakeRequest("POST", + m_ServerURI + "/grid", + ServerUtils.BuildQueryString(sendData)); + + //m_log.DebugFormat("[GRID CONNECTOR]: reply was {0}", reply); + } + catch (Exception e) + { + m_log.DebugFormat("[GRID CONNECTOR]: Exception when contacting grid server: {0}", e.Message); + return rinfos; + } + + if (reply != string.Empty) + { + Dictionary replyData = ServerUtils.ParseXmlResponse(reply); + + if (replyData != null) + { + Dictionary.ValueCollection rinfosList = replyData.Values; + foreach (object r in rinfosList) + { + if (r is Dictionary) + { + GridRegion rinfo = new GridRegion((Dictionary)r); + rinfos.Add(rinfo); + } + } + } + else + m_log.DebugFormat("[GRID CONNECTOR]: GetHyperlinks {0} received null response", + scopeID); + } + else + m_log.DebugFormat("[GRID CONNECTOR]: GetHyperlinks received null reply"); + + return rinfos; + } + public virtual int GetRegionFlags(UUID scopeID, UUID regionID) { Dictionary sendData = new Dictionary(); diff --git a/OpenSim/Services/Connectors/GridUser/GridUserServiceConnector.cs b/OpenSim/Services/Connectors/GridUser/GridUserServiceConnector.cs index 935ebb1be5..b3ea865996 100644 --- a/OpenSim/Services/Connectors/GridUser/GridUserServiceConnector.cs +++ b/OpenSim/Services/Connectors/GridUser/GridUserServiceConnector.cs @@ -101,7 +101,7 @@ namespace OpenSim.Services.Connectors } - public bool LoggedOut(string userID, UUID region, Vector3 position, Vector3 lookat) + public bool LoggedOut(string userID, UUID sessionID, UUID region, Vector3 position, Vector3 lookat) { Dictionary sendData = new Dictionary(); //sendData["SCOPEID"] = scopeID.ToString(); @@ -123,7 +123,7 @@ namespace OpenSim.Services.Connectors return Set(sendData, userID, regionID, position, lookAt); } - public bool SetLastPosition(string userID, UUID regionID, Vector3 position, Vector3 lookAt) + public bool SetLastPosition(string userID, UUID sessionID, UUID regionID, Vector3 position, Vector3 lookAt) { Dictionary sendData = new Dictionary(); //sendData["SCOPEID"] = scopeID.ToString(); diff --git a/OpenSim/Services/Connectors/Hypergrid/GatekeeperServiceConnector.cs b/OpenSim/Services/Connectors/Hypergrid/GatekeeperServiceConnector.cs index c426bba807..479a80e297 100644 --- a/OpenSim/Services/Connectors/Hypergrid/GatekeeperServiceConnector.cs +++ b/OpenSim/Services/Connectors/Hypergrid/GatekeeperServiceConnector.cs @@ -31,13 +31,12 @@ using System.Collections.Generic; using System.Drawing; using System.Net; using System.Reflection; - using OpenSim.Framework; using OpenSim.Services.Interfaces; using GridRegion = OpenSim.Services.Interfaces.GridRegion; - using OpenMetaverse; using OpenMetaverse.Imaging; +using OpenMetaverse.StructuredData; using Nwc.XmlRpc; using log4net; @@ -49,7 +48,7 @@ namespace OpenSim.Services.Connectors.Hypergrid { private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); - private static UUID m_HGMapImage = new UUID("00000000-0000-1111-9999-000000000013"); +// private static UUID m_HGMapImage = new UUID("00000000-0000-1111-9999-000000000013"); private IAssetService m_AssetService; @@ -87,8 +86,8 @@ namespace OpenSim.Services.Connectors.Hypergrid paramList.Add(hash); XmlRpcRequest request = new XmlRpcRequest("link_region", paramList); - string uri = "http://" + info.ExternalEndPoint.Address + ":" + info.HttpPort + "/"; - //m_log.Debug("[GATEKEEPER SERVICE CONNECTOR]: Linking to " + uri); + string uri = "http://" + ((info.ServerURI != null && info.ServerURI != string.Empty && !info.ServerURI.StartsWith("http:")) ? info.ServerURI : info.ExternalEndPoint.Address + ":" + info.HttpPort + "/"); + m_log.Debug("[GATEKEEPER SERVICE CONNECTOR]: Linking to " + uri); XmlRpcResponse response = null; try { @@ -189,7 +188,7 @@ namespace OpenSim.Services.Connectors.Hypergrid paramList.Add(hash); XmlRpcRequest request = new XmlRpcRequest("get_region", paramList); - string uri = "http://" + gatekeeper.ExternalEndPoint.Address + ":" + gatekeeper.HttpPort + "/"; + string uri = "http://" + ((gatekeeper.ServerURI != null && gatekeeper.ServerURI != string.Empty && !gatekeeper.ServerURI.StartsWith("http:")) ? gatekeeper.ServerURI : gatekeeper.ExternalEndPoint.Address + ":" + gatekeeper.HttpPort + "/"); m_log.Debug("[GATEKEEPER SERVICE CONNECTOR]: contacting " + uri); XmlRpcResponse response = null; try @@ -268,5 +267,48 @@ namespace OpenSim.Services.Connectors.Hypergrid return null; } + public bool CreateAgent(GridRegion destination, AgentCircuitData aCircuit, uint flags, out string myipaddress, out string reason) + { + HttpWebRequest AgentCreateRequest = null; + myipaddress = String.Empty; + reason = String.Empty; + + if (SendRequest(destination, aCircuit, flags, out reason, out AgentCreateRequest)) + { + string response = GetResponse(AgentCreateRequest, out reason); + bool success = true; + UnpackResponse(response, out success, out reason, out myipaddress); + return success; + } + + return false; + } + + protected void UnpackResponse(string response, out bool result, out string reason, out string ipaddress) + { + result = true; + reason = string.Empty; + ipaddress = string.Empty; + + if (!String.IsNullOrEmpty(response)) + { + try + { + // we assume we got an OSDMap back + OSDMap r = Util.GetOSDMap(response); + result = r["success"].AsBoolean(); + reason = r["reason"].AsString(); + ipaddress = r["your_ip"].AsString(); + } + catch (NullReferenceException e) + { + m_log.InfoFormat("[GATEKEEPER SERVICE CONNECTOR]: exception on UnpackResponse of DoCreateChildAgentCall {0}", e.Message); + reason = "Internal error"; + result = false; + } + } + } + + } } diff --git a/OpenSim/Framework/ThreadTracker.cs b/OpenSim/Services/Connectors/Hypergrid/HeloServiceConnector.cs similarity index 58% rename from OpenSim/Framework/ThreadTracker.cs rename to OpenSim/Services/Connectors/Hypergrid/HeloServiceConnector.cs index 069e98b378..7b166c14e3 100644 --- a/OpenSim/Framework/ThreadTracker.cs +++ b/OpenSim/Services/Connectors/Hypergrid/HeloServiceConnector.cs @@ -25,22 +25,51 @@ * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ -using System; -using System.Collections.Generic; -using System.Reflection; -using System.Diagnostics; using log4net; +using System; +using System.Net; +using System.Reflection; +using Nini.Config; -namespace OpenSim.Framework +namespace OpenSim.Services.Connectors { - public static class ThreadTracker + public class HeloServicesConnector { -// private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); + private static readonly ILog m_log = + LogManager.GetLogger( + MethodBase.GetCurrentMethod().DeclaringType); - public static ProcessThreadCollection GetThreads() + private string m_ServerURI = String.Empty; + + public HeloServicesConnector() { - Process thisProc = Process.GetCurrentProcess(); - return thisProc.Threads; } + + public HeloServicesConnector(string serverURI) + { + m_ServerURI = serverURI.TrimEnd('/'); + } + + + public virtual string Helo() + { + HttpWebRequest req = (HttpWebRequest)HttpWebRequest.Create(m_ServerURI + "/helo"); + + try + { + WebResponse response = req.GetResponse(); + if (response.Headers.Get("X-Handlers-Provided") == null) // just in case this ever returns a null + return string.Empty; + return response.Headers.Get("X-Handlers-Provided"); + } + catch (Exception e) + { + m_log.DebugFormat("[HELO SERVICE]: Unable to perform HELO request to {0}: {1}", m_ServerURI, e.Message); + } + + // fail + return string.Empty; + } + } } diff --git a/OpenSim/Services/Connectors/Hypergrid/UserAgentServiceConnector.cs b/OpenSim/Services/Connectors/Hypergrid/UserAgentServiceConnector.cs index 42eca05ec5..247dd7ed10 100644 --- a/OpenSim/Services/Connectors/Hypergrid/UserAgentServiceConnector.cs +++ b/OpenSim/Services/Connectors/Hypergrid/UserAgentServiceConnector.cs @@ -32,12 +32,10 @@ using System.IO; using System.Net; using System.Reflection; using System.Text; - using OpenSim.Framework; using OpenSim.Services.Interfaces; using OpenSim.Services.Connectors.Simulation; using GridRegion = OpenSim.Services.Interfaces.GridRegion; - using OpenMetaverse; using OpenMetaverse.StructuredData; using log4net; @@ -56,13 +54,46 @@ namespace OpenSim.Services.Connectors.Hypergrid public UserAgentServiceConnector(string url) { m_ServerURL = url; + // Doing this here, because XML-RPC or mono have some strong ideas about + // caching DNS translations. + try + { + Uri m_Uri = new Uri(m_ServerURL); + IPAddress ip = Util.GetHostFromDNS(m_Uri.Host); + m_ServerURL = m_ServerURL.Replace(m_Uri.Host, ip.ToString()); ; + } + catch (Exception e) + { + m_log.DebugFormat("[USER AGENT CONNECTOR]: Malformed Uri {0}: {1}", m_ServerURL, e.Message); + } + m_log.DebugFormat("[USER AGENT CONNECTOR]: new connector to {0} ({1})", url, m_ServerURL); } public UserAgentServiceConnector(IConfigSource config) { + IConfig serviceConfig = config.Configs["UserAgentService"]; + if (serviceConfig == null) + { + m_log.Error("[USER AGENT CONNECTOR]: UserAgentService missing from ini"); + throw new Exception("UserAgent connector init error"); + } + + string serviceURI = serviceConfig.GetString("UserAgentServerURI", + String.Empty); + + if (serviceURI == String.Empty) + { + m_log.Error("[USER AGENT CONNECTOR]: No Server URI named in section UserAgentService"); + throw new Exception("UserAgent connector init error"); + } + m_ServerURL = serviceURI; + + m_log.DebugFormat("[USER AGENT CONNECTOR]: UserAgentServiceConnector started for {0}", m_ServerURL); } - public bool LoginAgentToGrid(AgentCircuitData aCircuit, GridRegion gatekeeper, GridRegion destination, out string reason) + + // The Login service calls this interface with a non-null [client] ipaddress + public bool LoginAgentToGrid(AgentCircuitData aCircuit, GridRegion gatekeeper, GridRegion destination, IPEndPoint ipaddress, out string reason) { reason = String.Empty; @@ -73,7 +104,7 @@ namespace OpenSim.Services.Connectors.Hypergrid return false; } - string uri = m_ServerURL + "/homeagent/" + aCircuit.AgentID + "/"; + string uri = m_ServerURL + "/homeagent/" + aCircuit.AgentID + "/"; Console.WriteLine(" >>> LoginAgentToGrid <<< " + uri); @@ -85,7 +116,7 @@ namespace OpenSim.Services.Connectors.Hypergrid //AgentCreateRequest.Headers.Add("Authorization", authKey); // Fill it in - OSDMap args = PackCreateAgentArguments(aCircuit, gatekeeper, destination); + OSDMap args = PackCreateAgentArguments(aCircuit, gatekeeper, destination, ipaddress); string strBuffer = ""; byte[] buffer = new byte[1]; @@ -182,7 +213,14 @@ namespace OpenSim.Services.Connectors.Hypergrid } - protected OSDMap PackCreateAgentArguments(AgentCircuitData aCircuit, GridRegion gatekeeper, GridRegion destination) + + // The simulators call this interface + public bool LoginAgentToGrid(AgentCircuitData aCircuit, GridRegion gatekeeper, GridRegion destination, out string reason) + { + return LoginAgentToGrid(aCircuit, gatekeeper, destination, null, out reason); + } + + protected OSDMap PackCreateAgentArguments(AgentCircuitData aCircuit, GridRegion gatekeeper, GridRegion destination, IPEndPoint ipaddress) { OSDMap args = null; try @@ -201,6 +239,12 @@ namespace OpenSim.Services.Connectors.Hypergrid args["destination_name"] = OSD.FromString(destination.RegionName); args["destination_uuid"] = OSD.FromString(destination.RegionID.ToString()); + // 10/3/2010 + // I added the client_ip up to the regular AgentCircuitData, so this doesn't need to be here. + // This need cleaning elsewhere... + //if (ipaddress != null) + // args["client_ip"] = OSD.FromString(ipaddress.Address.ToString()); + return args; } @@ -225,7 +269,7 @@ namespace OpenSim.Services.Connectors.Hypergrid { response = request.Send(m_ServerURL, 10000); } - catch (Exception e) + catch (Exception) { return null; } @@ -290,13 +334,12 @@ namespace OpenSim.Services.Connectors.Hypergrid } } - catch (Exception e) + catch (Exception) { return null; } return null; - } public bool AgentIsComingHome(UUID sessionID, string thisGridExternalName) @@ -358,7 +401,7 @@ namespace OpenSim.Services.Connectors.Hypergrid private bool GetBoolResponse(XmlRpcRequest request, out string reason) { - //m_log.Debug("[HGrid]: Linking to " + uri); + //m_log.Debug("[USER AGENT CONNECTOR]: GetBoolResponse from/to " + m_ServerURL); XmlRpcResponse response = null; try { @@ -366,14 +409,14 @@ namespace OpenSim.Services.Connectors.Hypergrid } catch (Exception e) { - m_log.Debug("[USER AGENT CONNECTOR]: Unable to contact remote server "); + m_log.DebugFormat("[USER AGENT CONNECTOR]: Unable to contact remote server {0}", m_ServerURL); reason = "Exception: " + e.Message; return false; } if (response.IsFault) { - m_log.ErrorFormat("[HGrid]: remote call returned an error: {0}", response.FaultString); + m_log.ErrorFormat("[USER AGENT CONNECTOR]: remote call to {0} returned an error: {1}", m_ServerURL, response.FaultString); reason = "XMLRPC Fault"; return false; } @@ -383,15 +426,29 @@ namespace OpenSim.Services.Connectors.Hypergrid // m_log.Debug(">> " + ((DictionaryEntry)o).Key + ":" + ((DictionaryEntry)o).Value); try { + if (hash == null) + { + m_log.ErrorFormat("[USER AGENT CONNECTOR]: Got null response from {0}! THIS IS BAAAAD", m_ServerURL); + reason = "Internal error 1"; + return false; + } bool success = false; reason = string.Empty; - Boolean.TryParse((string)hash["result"], out success); + if (hash.ContainsKey("result")) + Boolean.TryParse((string)hash["result"], out success); + else + { + reason = "Internal error 2"; + m_log.WarnFormat("[USER AGENT CONNECTOR]: response from {0} does not have expected key 'result'", m_ServerURL); + } return success; } catch (Exception e) { - m_log.Error("[HGrid]: Got exception while parsing GetEndPoint response " + e.StackTrace); + m_log.ErrorFormat("[USER AGENT CONNECTOR]: Got exception on GetBoolResponse response."); + if (hash.ContainsKey("result") && hash["result"] != null) + m_log.ErrorFormat("Reply was ", (string)hash["result"]); reason = "Exception: " + e.Message; return false; } diff --git a/OpenSim/Services/Connectors/Inventory/XInventoryConnector.cs b/OpenSim/Services/Connectors/Inventory/XInventoryConnector.cs index e25e7ebd3c..b3bfcc27df 100644 --- a/OpenSim/Services/Connectors/Inventory/XInventoryConnector.cs +++ b/OpenSim/Services/Connectors/Inventory/XInventoryConnector.cs @@ -302,6 +302,8 @@ namespace OpenSim.Services.Connectors public bool AddItem(InventoryItemBase item) { + if (item.CreatorData == null) + item.CreatorData = String.Empty; Dictionary ret = MakeRequest("ADDITEM", new Dictionary { { "AssetID", item.AssetID.ToString() }, @@ -312,6 +314,7 @@ namespace OpenSim.Services.Connectors { "InvType", item.InvType.ToString() }, { "Folder", item.Folder.ToString() }, { "CreatorId", item.CreatorId.ToString() }, + { "CreatorData", item.CreatorData.ToString() }, { "Description", item.Description.ToString() }, { "NextPermissions", item.NextPermissions.ToString() }, { "CurrentPermissions", item.CurrentPermissions.ToString() }, @@ -334,6 +337,8 @@ namespace OpenSim.Services.Connectors public bool UpdateItem(InventoryItemBase item) { + if (item.CreatorData == null) + item.CreatorData = String.Empty; Dictionary ret = MakeRequest("UPDATEITEM", new Dictionary { { "AssetID", item.AssetID.ToString() }, @@ -344,6 +349,7 @@ namespace OpenSim.Services.Connectors { "InvType", item.InvType.ToString() }, { "Folder", item.Folder.ToString() }, { "CreatorId", item.CreatorId.ToString() }, + { "CreatorData", item.CreatorData.ToString() }, { "Description", item.Description.ToString() }, { "NextPermissions", item.NextPermissions.ToString() }, { "CurrentPermissions", item.CurrentPermissions.ToString() }, @@ -526,7 +532,7 @@ namespace OpenSim.Services.Connectors InventoryFolderBase folder = new InventoryFolderBase(); try - { + { folder.ParentID = new UUID(data["ParentID"].ToString()); folder.Type = short.Parse(data["Type"].ToString()); folder.Version = ushort.Parse(data["Version"].ToString()); @@ -556,6 +562,10 @@ namespace OpenSim.Services.Connectors item.InvType = int.Parse(data["InvType"].ToString()); item.Folder = new UUID(data["Folder"].ToString()); item.CreatorId = data["CreatorId"].ToString(); + if (data.ContainsKey("CreatorData")) + item.CreatorData = data["CreatorData"].ToString(); + else + item.CreatorData = String.Empty; item.Description = data["Description"].ToString(); item.NextPermissions = uint.Parse(data["NextPermissions"].ToString()); item.CurrentPermissions = uint.Parse(data["CurrentPermissions"].ToString()); diff --git a/OpenSim/Services/Connectors/Land/LandServiceConnector.cs b/OpenSim/Services/Connectors/Land/LandServiceConnector.cs index 06bc11cebe..8143b5a89f 100644 --- a/OpenSim/Services/Connectors/Land/LandServiceConnector.cs +++ b/OpenSim/Services/Connectors/Land/LandServiceConnector.cs @@ -64,7 +64,7 @@ namespace OpenSim.Services.Connectors m_GridService = gridServices; } - public virtual LandData GetLandData(ulong regionHandle, uint x, uint y) + public virtual LandData GetLandData(ulong regionHandle, uint x, uint y, out byte regionAccess) { LandData landData = null; Hashtable hash = new Hashtable(); @@ -74,6 +74,7 @@ namespace OpenSim.Services.Connectors IList paramList = new ArrayList(); paramList.Add(hash); + regionAccess = 42; // Default to adult. Better safe... try { @@ -87,7 +88,7 @@ namespace OpenSim.Services.Connectors XmlRpcResponse response = request.Send(uri, 10000); if (response.IsFault) { - m_log.ErrorFormat("[LAND CONNECTOR] remote call returned an error: {0}", response.FaultString); + m_log.ErrorFormat("[LAND CONNECTOR]: remote call returned an error: {0}", response.FaultString); } else { @@ -107,22 +108,28 @@ namespace OpenSim.Services.Connectors landData.SalePrice = Convert.ToInt32(hash["SalePrice"]); landData.SnapshotID = new UUID((string)hash["SnapshotID"]); landData.UserLocation = Vector3.Parse((string)hash["UserLocation"]); - m_log.DebugFormat("[OGS1 GRID SERVICES] Got land data for parcel {0}", landData.Name); + if (hash["RegionAccess"] != null) + regionAccess = (byte)Convert.ToInt32((string)hash["RegionAccess"]); + m_log.DebugFormat("[LAND CONNECTOR]: Got land data for parcel {0}", landData.Name); } catch (Exception e) { - m_log.Error("[LAND CONNECTOR] Got exception while parsing land-data:", e); + m_log.ErrorFormat( + "[LAND CONNECTOR]: Got exception while parsing land-data: {0} {1}", + e.Message, e.StackTrace); } } } - else m_log.WarnFormat("[LAND CONNECTOR] Couldn't find region with handle {0}", regionHandle); + else + m_log.WarnFormat("[LAND CONNECTOR]: Couldn't find region with handle {0}", regionHandle); } catch (Exception e) { - m_log.ErrorFormat("[LAND CONNECTOR] Couldn't contact region {0}: {1}", regionHandle, e); + m_log.ErrorFormat( + "[LAND CONNECTOR]: Couldn't contact region {0}: {1} {2}", regionHandle, e.Message, e.StackTrace); } return landData; } } -} +} \ No newline at end of file diff --git a/OpenSim/Services/Connectors/SimianGrid/SimianActivityDetector.cs b/OpenSim/Services/Connectors/SimianGrid/SimianActivityDetector.cs index a871d07f16..b8703c69c9 100644 --- a/OpenSim/Services/Connectors/SimianGrid/SimianActivityDetector.cs +++ b/OpenSim/Services/Connectors/SimianGrid/SimianActivityDetector.cs @@ -26,7 +26,6 @@ */ using System; -using System.Collections.Generic; using System.Reflection; using OpenSim.Framework; using OpenSim.Region.Framework.Scenes; @@ -40,12 +39,11 @@ namespace OpenSim.Services.Connectors.SimianGrid { private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); - private SimianPresenceServiceConnector m_GridUserService; - private Scene m_aScene; + private IGridUserService m_GridUserService; - public SimianActivityDetector(SimianPresenceServiceConnector guservice) + public SimianActivityDetector(IGridUserService guService) { - m_GridUserService = guservice; + m_GridUserService = guService; m_log.DebugFormat("[SIMIAN ACTIVITY DETECTOR]: Started"); } @@ -56,9 +54,6 @@ namespace OpenSim.Services.Connectors.SimianGrid scene.EventManager.OnMakeRootAgent += OnMakeRootAgent; scene.EventManager.OnNewClient += OnNewClient; scene.EventManager.OnAvatarEnteringNewParcel += OnEnteringNewParcel; - - if (m_aScene == null) - m_aScene = scene; } public void RemoveRegion(Scene scene) @@ -71,7 +66,10 @@ namespace OpenSim.Services.Connectors.SimianGrid public void OnMakeRootAgent(ScenePresence sp) { m_log.DebugFormat("[SIMIAN ACTIVITY DETECTOR]: Detected root presence {0} in {1}", sp.UUID, sp.Scene.RegionInfo.RegionName); - m_GridUserService.SetLastPosition(sp.UUID.ToString(), sp.ControllingClient.SessionId, sp.Scene.RegionInfo.RegionID, sp.AbsolutePosition, sp.Lookat); + Util.FireAndForget(delegate(object o) + { + m_GridUserService.SetLastPosition(sp.UUID.ToString(), sp.ControllingClient.SessionId, sp.Scene.RegionInfo.RegionID, sp.AbsolutePosition, sp.Lookat); + }); } public void OnNewClient(IClientAPI client) @@ -100,14 +98,17 @@ namespace OpenSim.Services.Connectors.SimianGrid } m_log.DebugFormat("[SIMIAN ACTIVITY DETECTOR]: Detected client logout {0} in {1}", client.AgentId, client.Scene.RegionInfo.RegionName); - m_GridUserService.LoggedOut(client.AgentId.ToString(), client.Scene.RegionInfo.RegionID, position, lookat); + m_GridUserService.LoggedOut(client.AgentId.ToString(), client.SessionId, client.Scene.RegionInfo.RegionID, position, lookat); } - } void OnEnteringNewParcel(ScenePresence sp, int localLandID, UUID regionID) { - m_GridUserService.SetLastPosition(sp.UUID.ToString(), sp.ControllingClient.SessionId, sp.Scene.RegionInfo.RegionID, sp.AbsolutePosition, sp.Lookat); + // Asynchronously update the position stored in the session table for this agent + Util.FireAndForget(delegate(object o) + { + m_GridUserService.SetLastPosition(sp.UUID.ToString(), sp.ControllingClient.SessionId, sp.Scene.RegionInfo.RegionID, sp.AbsolutePosition, sp.Lookat); + }); } } } diff --git a/OpenSim/Services/Connectors/SimianGrid/SimianAssetServiceConnector.cs b/OpenSim/Services/Connectors/SimianGrid/SimianAssetServiceConnector.cs index 20cddafc8b..10ba78f0ce 100644 --- a/OpenSim/Services/Connectors/SimianGrid/SimianAssetServiceConnector.cs +++ b/OpenSim/Services/Connectors/SimianGrid/SimianAssetServiceConnector.cs @@ -55,6 +55,7 @@ namespace OpenSim.Services.Connectors.SimianGrid private string m_serverUrl = String.Empty; private IImprovedAssetCache m_cache; + private bool m_Enabled = false; #region ISharedRegionModule @@ -73,45 +74,62 @@ namespace OpenSim.Services.Connectors.SimianGrid public SimianAssetServiceConnector() { } public string Name { get { return "SimianAssetServiceConnector"; } } - public void AddRegion(Scene scene) { if (!String.IsNullOrEmpty(m_serverUrl)) { scene.RegisterModuleInterface(this); } } - public void RemoveRegion(Scene scene) { if (!String.IsNullOrEmpty(m_serverUrl)) { scene.UnregisterModuleInterface(this); } } + public void AddRegion(Scene scene) { if (m_Enabled) { scene.RegisterModuleInterface(this); } } + public void RemoveRegion(Scene scene) { if (m_Enabled) { scene.UnregisterModuleInterface(this); } } #endregion ISharedRegionModule public SimianAssetServiceConnector(IConfigSource source) { - Initialise(source); + CommonInit(source); + } + + public SimianAssetServiceConnector(string url) + { + m_serverUrl = url; } public void Initialise(IConfigSource source) { - if (Simian.IsSimianEnabled(source, "AssetServices", this.Name)) + IConfig moduleConfig = source.Configs["Modules"]; + if (moduleConfig != null) { - IConfig gridConfig = source.Configs["AssetService"]; - if (gridConfig == null) - { - m_log.Error("[SIMIAN ASSET CONNECTOR]: AssetService missing from OpenSim.ini"); - throw new Exception("Asset connector init error"); - } - - string serviceUrl = gridConfig.GetString("AssetServerURI"); - if (String.IsNullOrEmpty(serviceUrl)) - { - m_log.Error("[SIMIAN ASSET CONNECTOR]: No AssetServerURI in section AssetService"); - throw new Exception("Asset connector init error"); - } - - if (!serviceUrl.EndsWith("/") && !serviceUrl.EndsWith("=")) - serviceUrl = serviceUrl + '/'; - - m_serverUrl = serviceUrl; + string name = moduleConfig.GetString("AssetServices", ""); + if (name == Name) + CommonInit(source); } } + private void CommonInit(IConfigSource source) + { + IConfig gridConfig = source.Configs["AssetService"]; + if (gridConfig != null) + { + string serviceUrl = gridConfig.GetString("AssetServerURI"); + if (!String.IsNullOrEmpty(serviceUrl)) + { + if (!serviceUrl.EndsWith("/") && !serviceUrl.EndsWith("=")) + serviceUrl = serviceUrl + '/'; + m_serverUrl = serviceUrl; + } + } + + if (String.IsNullOrEmpty(m_serverUrl)) + m_log.Info("[SIMIAN ASSET CONNECTOR]: No AssetServerURI specified, disabling connector"); + else + m_Enabled = true; + } + #region IAssetService public AssetBase Get(string id) { + if (String.IsNullOrEmpty(m_serverUrl)) + { + m_log.Error("[SIMIAN ASSET CONNECTOR]: No AssetServerURI configured"); + throw new InvalidOperationException(); + } + // Cache fetch if (m_cache != null) { @@ -138,6 +156,12 @@ namespace OpenSim.Services.Connectors.SimianGrid /// public AssetMetadata GetMetadata(string id) { + if (String.IsNullOrEmpty(m_serverUrl)) + { + m_log.Error("[SIMIAN ASSET CONNECTOR]: No AssetServerURI configured"); + throw new InvalidOperationException(); + } + AssetMetadata metadata = null; // Cache fetch @@ -184,7 +208,7 @@ namespace OpenSim.Services.Connectors.SimianGrid } catch (Exception ex) { - m_log.Warn("[SIMIAN ASSET CONNECTOR]: Asset GET from " + url + " failed: " + ex.Message); + m_log.Warn("[SIMIAN ASSET CONNECTOR]: Asset HEAD from " + url + " failed: " + ex.Message); } return metadata; @@ -209,6 +233,12 @@ namespace OpenSim.Services.Connectors.SimianGrid /// True if the id was parseable, false otherwise public bool Get(string id, Object sender, AssetRetrieved handler) { + if (String.IsNullOrEmpty(m_serverUrl)) + { + m_log.Error("[SIMIAN ASSET CONNECTOR]: No AssetServerURI configured"); + throw new InvalidOperationException(); + } + // Cache fetch if (m_cache != null) { @@ -239,6 +269,12 @@ namespace OpenSim.Services.Connectors.SimianGrid /// public string Store(AssetBase asset) { + if (String.IsNullOrEmpty(m_serverUrl)) + { + m_log.Error("[SIMIAN ASSET CONNECTOR]: No AssetServerURI configured"); + throw new InvalidOperationException(); + } + bool storedInCache = false; string errorMessage = null; @@ -371,6 +407,12 @@ namespace OpenSim.Services.Connectors.SimianGrid /// public bool Delete(string id) { + if (String.IsNullOrEmpty(m_serverUrl)) + { + m_log.Error("[SIMIAN ASSET CONNECTOR]: No AssetServerURI configured"); + throw new InvalidOperationException(); + } + //string errorMessage = String.Empty; string url = m_serverUrl + id; diff --git a/OpenSim/Services/Connectors/SimianGrid/SimianAuthenticationServiceConnector.cs b/OpenSim/Services/Connectors/SimianGrid/SimianAuthenticationServiceConnector.cs index 7a96a05dea..51a09f82da 100644 --- a/OpenSim/Services/Connectors/SimianGrid/SimianAuthenticationServiceConnector.cs +++ b/OpenSim/Services/Connectors/SimianGrid/SimianAuthenticationServiceConnector.cs @@ -1,4 +1,4 @@ -/* +/* * Copyright (c) Contributors, http://opensimulator.org/ * See CONTRIBUTORS.TXT for a full list of copyright holders. * @@ -51,6 +51,7 @@ namespace OpenSim.Services.Connectors.SimianGrid MethodBase.GetCurrentMethod().DeclaringType); private string m_serverUrl = String.Empty; + private bool m_Enabled = false; #region ISharedRegionModule @@ -61,38 +62,46 @@ namespace OpenSim.Services.Connectors.SimianGrid public SimianAuthenticationServiceConnector() { } public string Name { get { return "SimianAuthenticationServiceConnector"; } } - public void AddRegion(Scene scene) { if (!String.IsNullOrEmpty(m_serverUrl)) { scene.RegisterModuleInterface(this); } } - public void RemoveRegion(Scene scene) { if (!String.IsNullOrEmpty(m_serverUrl)) { scene.UnregisterModuleInterface(this); } } + public void AddRegion(Scene scene) { if (m_Enabled) { scene.RegisterModuleInterface(this); } } + public void RemoveRegion(Scene scene) { if (m_Enabled) { scene.UnregisterModuleInterface(this); } } #endregion ISharedRegionModule public SimianAuthenticationServiceConnector(IConfigSource source) { - Initialise(source); + CommonInit(source); } public void Initialise(IConfigSource source) { - if (Simian.IsSimianEnabled(source, "AuthenticationServices", this.Name)) + IConfig moduleConfig = source.Configs["Modules"]; + if (moduleConfig != null) { - IConfig assetConfig = source.Configs["AuthenticationService"]; - if (assetConfig == null) - { - m_log.Error("[SIMIAN AUTH CONNECTOR]: AuthenticationService missing from OpenSim.ini"); - throw new Exception("Authentication connector init error"); - } - - string serviceURI = assetConfig.GetString("AuthenticationServerURI"); - if (String.IsNullOrEmpty(serviceURI)) - { - m_log.Error("[SIMIAN AUTH CONNECTOR]: No Server URI named in section AuthenticationService"); - throw new Exception("Authentication connector init error"); - } - - m_serverUrl = serviceURI; + string name = moduleConfig.GetString("AuthenticationServices", ""); + if (name == Name) + CommonInit(source); } } + private void CommonInit(IConfigSource source) + { + IConfig gridConfig = source.Configs["AuthenticationService"]; + if (gridConfig != null) + { + string serviceUrl = gridConfig.GetString("AuthenticationServerURI"); + if (!String.IsNullOrEmpty(serviceUrl)) + { + if (!serviceUrl.EndsWith("/") && !serviceUrl.EndsWith("=")) + serviceUrl = serviceUrl + '/'; + m_serverUrl = serviceUrl; + m_Enabled = true; + } + } + + if (String.IsNullOrEmpty(m_serverUrl)) + m_log.Info("[SIMIAN AUTH CONNECTOR]: No AuthenticationServerURI specified, disabling connector"); + } + public string Authenticate(UUID principalID, string password, int lifetime) { NameValueCollection requestArgs = new NameValueCollection @@ -253,7 +262,8 @@ namespace OpenSim.Services.Connectors.SimianGrid if (password == simianGridCredential || "$1$" + password == simianGridCredential || "$1$" + Utils.MD5String(password) == simianGridCredential || - Utils.MD5String(password) == simianGridCredential) + Utils.MD5String(password) == simianGridCredential || + "$1$" + Utils.MD5String(password + ":") == simianGridCredential) { authorizeResult = Authorize(userID); return true; diff --git a/OpenSim/Services/Connectors/SimianGrid/SimianAvatarServiceConnector.cs b/OpenSim/Services/Connectors/SimianGrid/SimianAvatarServiceConnector.cs index a47f32cf7d..65a02df390 100644 --- a/OpenSim/Services/Connectors/SimianGrid/SimianAvatarServiceConnector.cs +++ b/OpenSim/Services/Connectors/SimianGrid/SimianAvatarServiceConnector.cs @@ -1,4 +1,4 @@ -/* +/* * Copyright (c) Contributors, http://opensimulator.org/ * See CONTRIBUTORS.TXT for a full list of copyright holders. * @@ -28,8 +28,9 @@ using System; using System.Collections.Generic; using System.Collections.Specialized; -using System.IO; -using System.Net; +// DEBUG ON +using System.Diagnostics; +// DEBUG OFF using System.Reflection; using log4net; using Mono.Addins; @@ -37,7 +38,6 @@ using Nini.Config; using OpenSim.Framework; using OpenSim.Region.Framework.Interfaces; using OpenSim.Region.Framework.Scenes; -using OpenSim.Server.Base; using OpenSim.Services.Interfaces; using OpenMetaverse; using OpenMetaverse.StructuredData; @@ -53,9 +53,10 @@ namespace OpenSim.Services.Connectors.SimianGrid private static readonly ILog m_log = LogManager.GetLogger( MethodBase.GetCurrentMethod().DeclaringType); - private static string ZeroID = UUID.Zero.ToString(); +// private static string ZeroID = UUID.Zero.ToString(); private string m_serverUrl = String.Empty; + private bool m_Enabled = false; #region ISharedRegionModule @@ -66,43 +67,122 @@ namespace OpenSim.Services.Connectors.SimianGrid public SimianAvatarServiceConnector() { } public string Name { get { return "SimianAvatarServiceConnector"; } } - public void AddRegion(Scene scene) { if (!String.IsNullOrEmpty(m_serverUrl)) { scene.RegisterModuleInterface(this); } } - public void RemoveRegion(Scene scene) { if (!String.IsNullOrEmpty(m_serverUrl)) { scene.UnregisterModuleInterface(this); } } + public void AddRegion(Scene scene) { if (m_Enabled) { scene.RegisterModuleInterface(this); } } + public void RemoveRegion(Scene scene) { if (m_Enabled) { scene.UnregisterModuleInterface(this); } } #endregion ISharedRegionModule public SimianAvatarServiceConnector(IConfigSource source) { - Initialise(source); + CommonInit(source); } public void Initialise(IConfigSource source) { - if (Simian.IsSimianEnabled(source, "AvatarServices", this.Name)) + IConfig moduleConfig = source.Configs["Modules"]; + if (moduleConfig != null) { - IConfig gridConfig = source.Configs["AvatarService"]; - if (gridConfig == null) - { - m_log.Error("[SIMIAN AVATAR CONNECTOR]: AvatarService missing from OpenSim.ini"); - throw new Exception("Avatar connector init error"); - } - - string serviceUrl = gridConfig.GetString("AvatarServerURI"); - if (String.IsNullOrEmpty(serviceUrl)) - { - m_log.Error("[SIMIAN AVATAR CONNECTOR]: No AvatarServerURI in section AvatarService"); - throw new Exception("Avatar connector init error"); - } - - if (!serviceUrl.EndsWith("/")) - serviceUrl = serviceUrl + '/'; - - m_serverUrl = serviceUrl; + string name = moduleConfig.GetString("AvatarServices", ""); + if (name == Name) + CommonInit(source); } } + private void CommonInit(IConfigSource source) + { + IConfig gridConfig = source.Configs["AvatarService"]; + if (gridConfig != null) + { + string serviceUrl = gridConfig.GetString("AvatarServerURI"); + if (!String.IsNullOrEmpty(serviceUrl)) + { + if (!serviceUrl.EndsWith("/") && !serviceUrl.EndsWith("=")) + serviceUrl = serviceUrl + '/'; + m_serverUrl = serviceUrl; + m_Enabled = true; + } + } + + if (String.IsNullOrEmpty(m_serverUrl)) + m_log.Info("[SIMIAN AVATAR CONNECTOR]: No AvatarServerURI specified, disabling connector"); + } + #region IAvatarService + // + // Retrieves the LLPackedAppearance field from user data and unpacks + // it into an AvatarAppearance structure + // + // + public AvatarAppearance GetAppearance(UUID userID) + { + NameValueCollection requestArgs = new NameValueCollection + { + { "RequestMethod", "GetUser" }, + { "UserID", userID.ToString() } + }; + + OSDMap response = WebUtil.PostToService(m_serverUrl, requestArgs); + if (response["Success"].AsBoolean()) + { + OSDMap map = null; + try { map = OSDParser.DeserializeJson(response["LLPackedAppearance"].AsString()) as OSDMap; } + catch { } + + if (map != null) + { + AvatarAppearance appearance = new AvatarAppearance(map); +// DEBUG ON + m_log.WarnFormat("[SIMIAN AVATAR CONNECTOR] retrieved appearance for {0}:\n{1}",userID,appearance.ToString()); +// DEBUG OFF + return appearance; + } + + m_log.WarnFormat("[SIMIAN AVATAR CONNECTOR]: Failed to decode appearance for {0}",userID); + return null; + } + + m_log.WarnFormat("[SIMIAN AVATAR CONNECTOR]: Failed to get appearance for {0}: {1}", + userID,response["Message"].AsString()); + return null; + } + + // + // + // + public bool SetAppearance(UUID userID, AvatarAppearance appearance) + { + OSDMap map = appearance.Pack(); + if (map == null) + { + m_log.WarnFormat("[SIMIAN AVATAR CONNECTOR]: Failed to encode appearance for {0}",userID); + return false; + } + +// DEBUG ON + m_log.WarnFormat("[SIMIAN AVATAR CONNECTOR] save appearance for {0}",userID); +// DEBUG OFF + + NameValueCollection requestArgs = new NameValueCollection + { + { "RequestMethod", "AddUserData" }, + { "UserID", userID.ToString() }, + { "LLPackedAppearance", OSDParser.SerializeJsonString(map) } + }; + + OSDMap response = WebUtil.PostToService(m_serverUrl, requestArgs); + bool success = response["Success"].AsBoolean(); + + if (! success) + m_log.WarnFormat("[SIMIAN AVATAR CONNECTOR]: Failed to save appearance for {0}: {1}", + userID,response["Message"].AsString()); + + return success; + } + + // + // + // public AvatarData GetAvatar(UUID userID) { NameValueCollection requestArgs = new NameValueCollection @@ -151,7 +231,7 @@ namespace OpenSim.Services.Connectors.SimianGrid foreach (KeyValuePair kvp in map) avatar.Data[kvp.Key] = kvp.Value.AsString(); } - + return avatar; } else @@ -170,6 +250,9 @@ namespace OpenSim.Services.Connectors.SimianGrid return null; } + // + // + // public bool SetAvatar(UUID userID, AvatarData avatar) { m_log.Debug("[SIMIAN AVATAR CONNECTOR]: SetAvatar called for " + userID); @@ -182,32 +265,33 @@ namespace OpenSim.Services.Connectors.SimianGrid map["Height"] = OSD.FromReal(appearance.AvatarHeight); - map["ShapeItem"] = OSD.FromUUID(appearance.BodyItem); - map["ShapeAsset"] = OSD.FromUUID(appearance.BodyAsset); - map["SkinItem"] = OSD.FromUUID(appearance.SkinItem); - map["SkinAsset"] = OSD.FromUUID(appearance.SkinAsset); - map["HairItem"] = OSD.FromUUID(appearance.HairItem); - map["HairAsset"] = OSD.FromUUID(appearance.HairAsset); - map["EyesItem"] = OSD.FromUUID(appearance.EyesItem); - map["EyesAsset"] = OSD.FromUUID(appearance.EyesAsset); - map["ShirtItem"] = OSD.FromUUID(appearance.ShirtItem); - map["ShirtAsset"] = OSD.FromUUID(appearance.ShirtAsset); - map["PantsItem"] = OSD.FromUUID(appearance.PantsItem); - map["PantsAsset"] = OSD.FromUUID(appearance.PantsAsset); - map["ShoesItem"] = OSD.FromUUID(appearance.ShoesItem); - map["ShoesAsset"] = OSD.FromUUID(appearance.ShoesAsset); - map["SocksItem"] = OSD.FromUUID(appearance.SocksItem); - map["SocksAsset"] = OSD.FromUUID(appearance.SocksAsset); - map["JacketItem"] = OSD.FromUUID(appearance.JacketItem); - map["JacketAsset"] = OSD.FromUUID(appearance.JacketAsset); - map["GlovesItem"] = OSD.FromUUID(appearance.GlovesItem); - map["GlovesAsset"] = OSD.FromUUID(appearance.GlovesAsset); - map["UndershirtItem"] = OSD.FromUUID(appearance.UnderShirtItem); - map["UndershirtAsset"] = OSD.FromUUID(appearance.UnderShirtAsset); - map["UnderpantsItem"] = OSD.FromUUID(appearance.UnderPantsItem); - map["UnderpantsAsset"] = OSD.FromUUID(appearance.UnderPantsAsset); - map["SkirtItem"] = OSD.FromUUID(appearance.SkirtItem); - map["SkirtAsset"] = OSD.FromUUID(appearance.SkirtAsset); + map["BodyItem"] = appearance.Wearables[AvatarWearable.BODY][0].ItemID.ToString(); + map["EyesItem"] = appearance.Wearables[AvatarWearable.EYES][0].ItemID.ToString(); + map["GlovesItem"] = appearance.Wearables[AvatarWearable.GLOVES][0].ItemID.ToString(); + map["HairItem"] = appearance.Wearables[AvatarWearable.HAIR][0].ItemID.ToString(); + map["JacketItem"] = appearance.Wearables[AvatarWearable.JACKET][0].ItemID.ToString(); + map["PantsItem"] = appearance.Wearables[AvatarWearable.PANTS][0].ItemID.ToString(); + map["ShirtItem"] = appearance.Wearables[AvatarWearable.SHIRT][0].ItemID.ToString(); + map["ShoesItem"] = appearance.Wearables[AvatarWearable.SHOES][0].ItemID.ToString(); + map["SkinItem"] = appearance.Wearables[AvatarWearable.SKIN][0].ItemID.ToString(); + map["SkirtItem"] = appearance.Wearables[AvatarWearable.SKIRT][0].ItemID.ToString(); + map["SocksItem"] = appearance.Wearables[AvatarWearable.SOCKS][0].ItemID.ToString(); + map["UnderPantsItem"] = appearance.Wearables[AvatarWearable.UNDERPANTS][0].ItemID.ToString(); + map["UnderShirtItem"] = appearance.Wearables[AvatarWearable.UNDERSHIRT][0].ItemID.ToString(); + map["BodyAsset"] = appearance.Wearables[AvatarWearable.BODY][0].AssetID.ToString(); + map["EyesAsset"] = appearance.Wearables[AvatarWearable.EYES][0].AssetID.ToString(); + map["GlovesAsset"] = appearance.Wearables[AvatarWearable.GLOVES][0].AssetID.ToString(); + map["HairAsset"] = appearance.Wearables[AvatarWearable.HAIR][0].AssetID.ToString(); + map["JacketAsset"] = appearance.Wearables[AvatarWearable.JACKET][0].AssetID.ToString(); + map["PantsAsset"] = appearance.Wearables[AvatarWearable.PANTS][0].AssetID.ToString(); + map["ShirtAsset"] = appearance.Wearables[AvatarWearable.SHIRT][0].AssetID.ToString(); + map["ShoesAsset"] = appearance.Wearables[AvatarWearable.SHOES][0].AssetID.ToString(); + map["SkinAsset"] = appearance.Wearables[AvatarWearable.SKIN][0].AssetID.ToString(); + map["SkirtAsset"] = appearance.Wearables[AvatarWearable.SKIRT][0].AssetID.ToString(); + map["SocksAsset"] = appearance.Wearables[AvatarWearable.SOCKS][0].AssetID.ToString(); + map["UnderPantsAsset"] = appearance.Wearables[AvatarWearable.UNDERPANTS][0].AssetID.ToString(); + map["UnderShirtAsset"] = appearance.Wearables[AvatarWearable.UNDERSHIRT][0].AssetID.ToString(); + OSDMap items = new OSDMap(); foreach (KeyValuePair kvp in avatar.Data) diff --git a/OpenSim/Services/Connectors/SimianGrid/SimianFriendsServiceConnector.cs b/OpenSim/Services/Connectors/SimianGrid/SimianFriendsServiceConnector.cs index 89f3594a94..6f2d73559b 100644 --- a/OpenSim/Services/Connectors/SimianGrid/SimianFriendsServiceConnector.cs +++ b/OpenSim/Services/Connectors/SimianGrid/SimianFriendsServiceConnector.cs @@ -30,13 +30,10 @@ using System.Collections.Generic; using System.Collections.Specialized; using System.Reflection; using log4net; -using Mono.Addins; using Nini.Config; using OpenMetaverse; using OpenMetaverse.StructuredData; using OpenSim.Framework; -using OpenSim.Region.Framework.Interfaces; -using OpenSim.Region.Framework.Scenes; using OpenSim.Services.Interfaces; using FriendInfo = OpenSim.Services.Interfaces.FriendInfo; @@ -46,8 +43,7 @@ namespace OpenSim.Services.Connectors.SimianGrid /// /// Stores and retrieves friend lists from the SimianGrid backend /// - [Extension(Path = "/OpenSim/RegionModules", NodeName = "RegionModule")] - public class SimianFriendsServiceConnector : IFriendsService, ISharedRegionModule + public class SimianFriendsServiceConnector : IFriendsService { private static readonly ILog m_log = LogManager.GetLogger( @@ -55,20 +51,6 @@ namespace OpenSim.Services.Connectors.SimianGrid private string m_serverUrl = String.Empty; - #region ISharedRegionModule - - public Type ReplaceableInterface { get { return null; } } - public void RegionLoaded(Scene scene) { } - public void PostInitialise() { } - public void Close() { } - - public SimianFriendsServiceConnector() { } - public string Name { get { return "SimianFriendsServiceConnector"; } } - public void AddRegion(Scene scene) { if (!String.IsNullOrEmpty(m_serverUrl)) { scene.RegisterModuleInterface(this); } } - public void RemoveRegion(Scene scene) { if (!String.IsNullOrEmpty(m_serverUrl)) { scene.UnregisterModuleInterface(this); } } - - #endregion ISharedRegionModule - public SimianFriendsServiceConnector(IConfigSource source) { Initialise(source); @@ -76,38 +58,29 @@ namespace OpenSim.Services.Connectors.SimianGrid public void Initialise(IConfigSource source) { - bool isSimianEnabled = false; - - if (source.Configs["Friends"] != null) + IConfig gridConfig = source.Configs["FriendsService"]; + if (gridConfig != null) { - string module = source.Configs["Friends"].GetString("Connector"); - isSimianEnabled = !String.IsNullOrEmpty(module) && module.EndsWith(this.Name); + string serviceUrl = gridConfig.GetString("FriendsServerURI"); + if (!String.IsNullOrEmpty(serviceUrl)) + { + if (!serviceUrl.EndsWith("/") && !serviceUrl.EndsWith("=")) + serviceUrl = serviceUrl + '/'; + m_serverUrl = serviceUrl; + } } - if (isSimianEnabled) - { - IConfig assetConfig = source.Configs["FriendsService"]; - if (assetConfig == null) - { - m_log.Error("[SIMIAN FRIENDS CONNECTOR]: FriendsService missing from OpenSim.ini"); - throw new Exception("Friends connector init error"); - } - - string serviceURI = assetConfig.GetString("FriendsServerURI"); - if (String.IsNullOrEmpty(serviceURI)) - { - m_log.Error("[SIMIAN FRIENDS CONNECTOR]: No Server URI named in section FriendsService"); - throw new Exception("Friends connector init error"); - } - - m_serverUrl = serviceURI; - } + if (String.IsNullOrEmpty(m_serverUrl)) + m_log.Info("[SIMIAN FRIENDS CONNECTOR]: No FriendsServerURI specified, disabling connector"); } #region IFriendsService public FriendInfo[] GetFriends(UUID principalID) { + if (String.IsNullOrEmpty(m_serverUrl)) + return new FriendInfo[0]; + Dictionary friends = new Dictionary(); OSDArray friendsArray = GetFriended(principalID); @@ -156,6 +129,9 @@ namespace OpenSim.Services.Connectors.SimianGrid public bool StoreFriend(UUID principalID, string friend, int flags) { + if (String.IsNullOrEmpty(m_serverUrl)) + return true; + NameValueCollection requestArgs = new NameValueCollection { { "RequestMethod", "AddGeneric" }, @@ -176,6 +152,9 @@ namespace OpenSim.Services.Connectors.SimianGrid public bool Delete(UUID principalID, string friend) { + if (String.IsNullOrEmpty(m_serverUrl)) + return true; + NameValueCollection requestArgs = new NameValueCollection { { "RequestMethod", "RemoveGeneric" }, diff --git a/OpenSim/Services/Connectors/SimianGrid/SimianGrid.cs b/OpenSim/Services/Connectors/SimianGrid/SimianGrid.cs index 7d97aaa3e8..847319c25a 100644 --- a/OpenSim/Services/Connectors/SimianGrid/SimianGrid.cs +++ b/OpenSim/Services/Connectors/SimianGrid/SimianGrid.cs @@ -31,17 +31,3 @@ using Nini.Config; [assembly: Addin("SimianGrid", "1.0")] [assembly: AddinDependency("OpenSim", "0.5")] - -public static class Simian -{ - public static bool IsSimianEnabled(IConfigSource config, string moduleName, string connectorName) - { - if (config.Configs["Modules"] != null) - { - string module = config.Configs["Modules"].GetString(moduleName); - return !String.IsNullOrEmpty(module) && module.EndsWith(connectorName); - } - - return false; - } -} \ No newline at end of file diff --git a/OpenSim/Services/Connectors/SimianGrid/SimianGridServiceConnector.cs b/OpenSim/Services/Connectors/SimianGrid/SimianGridServiceConnector.cs index bea81726f4..168b233893 100644 --- a/OpenSim/Services/Connectors/SimianGrid/SimianGridServiceConnector.cs +++ b/OpenSim/Services/Connectors/SimianGrid/SimianGridServiceConnector.cs @@ -60,6 +60,7 @@ namespace OpenSim.Services.Connectors.SimianGrid private string m_serverUrl = String.Empty; private Dictionary m_scenes = new Dictionary(); + private bool m_Enabled = false; #region ISharedRegionModule @@ -72,52 +73,64 @@ namespace OpenSim.Services.Connectors.SimianGrid public string Name { get { return "SimianGridServiceConnector"; } } public void AddRegion(Scene scene) { + if (!m_Enabled) + return; + // Every shared region module has to maintain an indepedent list of // currently running regions lock (m_scenes) m_scenes[scene.RegionInfo.RegionID] = scene; - if (!String.IsNullOrEmpty(m_serverUrl)) - scene.RegisterModuleInterface(this); + scene.RegisterModuleInterface(this); } public void RemoveRegion(Scene scene) { + if (!m_Enabled) + return; + lock (m_scenes) m_scenes.Remove(scene.RegionInfo.RegionID); - if (!String.IsNullOrEmpty(m_serverUrl)) - scene.UnregisterModuleInterface(this); + scene.UnregisterModuleInterface(this); } #endregion ISharedRegionModule public SimianGridServiceConnector(IConfigSource source) { - Initialise(source); + CommonInit(source); } public void Initialise(IConfigSource source) { - if (Simian.IsSimianEnabled(source, "GridServices", this.Name)) + IConfig moduleConfig = source.Configs["Modules"]; + if (moduleConfig != null) { - IConfig gridConfig = source.Configs["GridService"]; - if (gridConfig == null) - { - m_log.Error("[SIMIAN GRID CONNECTOR]: GridService missing from OpenSim.ini"); - throw new Exception("Grid connector init error"); - } - - string serviceUrl = gridConfig.GetString("GridServerURI"); - if (String.IsNullOrEmpty(serviceUrl)) - { - m_log.Error("[SIMIAN GRID CONNECTOR]: No Server URI named in section GridService"); - throw new Exception("Grid connector init error"); - } - - m_serverUrl = serviceUrl; + string name = moduleConfig.GetString("GridServices", ""); + if (name == Name) + CommonInit(source); } } + private void CommonInit(IConfigSource source) + { + IConfig gridConfig = source.Configs["GridService"]; + if (gridConfig != null) + { + string serviceUrl = gridConfig.GetString("GridServerURI"); + if (!String.IsNullOrEmpty(serviceUrl)) + { + if (!serviceUrl.EndsWith("/") && !serviceUrl.EndsWith("=")) + serviceUrl = serviceUrl + '/'; + m_serverUrl = serviceUrl; + m_Enabled = true; + } + } + + if (String.IsNullOrEmpty(m_serverUrl)) + m_log.Info("[SIMIAN GRID CONNECTOR]: No GridServerURI specified, disabling connector"); + } + #region IGridService public string RegisterRegion(UUID scopeID, GridRegion regionInfo) @@ -357,6 +370,12 @@ namespace OpenSim.Services.Connectors.SimianGrid return new List(0); } + public List GetHyperlinks(UUID scopeID) + { + // Hypergrid/linked regions are not supported + return new List(); + } + public int GetRegionFlags(UUID scopeID, UUID regionID) { const int REGION_ONLINE = 4; @@ -394,7 +413,7 @@ namespace OpenSim.Services.Connectors.SimianGrid return; } - using (Image mapTile = tileGenerator.CreateMapTile("defaultstripe.png")) + using (Image mapTile = tileGenerator.CreateMapTile()) { using (MemoryStream stream = new MemoryStream()) { diff --git a/OpenSim/Services/Connectors/SimianGrid/SimianInventoryServiceConnector.cs b/OpenSim/Services/Connectors/SimianGrid/SimianInventoryServiceConnector.cs index dc68259d93..61f3fbedf1 100644 --- a/OpenSim/Services/Connectors/SimianGrid/SimianInventoryServiceConnector.cs +++ b/OpenSim/Services/Connectors/SimianGrid/SimianInventoryServiceConnector.cs @@ -1,4 +1,4 @@ -/* +/* * Copyright (c) Contributors, http://opensimulator.org/ * See CONTRIBUTORS.TXT for a full list of copyright holders. * @@ -37,7 +37,6 @@ using OpenMetaverse.StructuredData; using OpenSim.Framework; using OpenSim.Region.Framework.Interfaces; using OpenSim.Region.Framework.Scenes; -using OpenSim.Server.Base; using OpenSim.Services.Interfaces; namespace OpenSim.Services.Connectors.SimianGrid @@ -69,7 +68,8 @@ namespace OpenSim.Services.Connectors.SimianGrid private string m_serverUrl = String.Empty; private string m_userServerUrl = String.Empty; - private object m_gestureSyncRoot = new object(); +// private object m_gestureSyncRoot = new object(); + private bool m_Enabled = false; #region ISharedRegionModule @@ -80,50 +80,61 @@ namespace OpenSim.Services.Connectors.SimianGrid public SimianInventoryServiceConnector() { } public string Name { get { return "SimianInventoryServiceConnector"; } } - public void AddRegion(Scene scene) { if (!String.IsNullOrEmpty(m_serverUrl)) { scene.RegisterModuleInterface(this); } } - public void RemoveRegion(Scene scene) { if (!String.IsNullOrEmpty(m_serverUrl)) { scene.UnregisterModuleInterface(this); } } + public void AddRegion(Scene scene) { if (m_Enabled) { scene.RegisterModuleInterface(this); } } + public void RemoveRegion(Scene scene) { if (m_Enabled) { scene.UnregisterModuleInterface(this); } } #endregion ISharedRegionModule public SimianInventoryServiceConnector(IConfigSource source) { - Initialise(source); + CommonInit(source); + } + + public SimianInventoryServiceConnector(string url) + { + m_serverUrl = url; } public void Initialise(IConfigSource source) { - if (Simian.IsSimianEnabled(source, "InventoryServices", this.Name)) + IConfig moduleConfig = source.Configs["Modules"]; + if (moduleConfig != null) { - IConfig gridConfig = source.Configs["InventoryService"]; - if (gridConfig == null) - { - m_log.Error("[SIMIAN INVENTORY CONNECTOR]: InventoryService missing from OpenSim.ini"); - throw new Exception("Inventory connector init error"); - } + string name = moduleConfig.GetString("InventoryServices", ""); + if (name == Name) + CommonInit(source); + } + } + private void CommonInit(IConfigSource source) + { + IConfig gridConfig = source.Configs["InventoryService"]; + if (gridConfig != null) + { string serviceUrl = gridConfig.GetString("InventoryServerURI"); - if (String.IsNullOrEmpty(serviceUrl)) + if (!String.IsNullOrEmpty(serviceUrl)) { - m_log.Error("[SIMIAN INVENTORY CONNECTOR]: No Server URI named in section InventoryService"); - throw new Exception("Inventory connector init error"); - } + if (!serviceUrl.EndsWith("/") && !serviceUrl.EndsWith("=")) + serviceUrl = serviceUrl + '/'; + m_serverUrl = serviceUrl; - m_serverUrl = serviceUrl; - - gridConfig = source.Configs["UserAccountService"]; - if (gridConfig != null) - { - serviceUrl = gridConfig.GetString("UserAccountServerURI"); - if (!String.IsNullOrEmpty(serviceUrl)) - m_userServerUrl = serviceUrl; - else - m_log.Info("[SIMIAN INVENTORY CONNECTOR]: No Server URI named in section UserAccountService"); - } - else - { - m_log.Warn("[SIMIAN INVENTORY CONNECTOR]: UserAccountService missing from OpenSim.ini"); + gridConfig = source.Configs["UserAccountService"]; + if (gridConfig != null) + { + serviceUrl = gridConfig.GetString("UserAccountServerURI"); + if (!String.IsNullOrEmpty(serviceUrl)) + { + m_userServerUrl = serviceUrl; + m_Enabled = true; + } + } } } + + if (String.IsNullOrEmpty(m_serverUrl)) + m_log.Info("[SIMIAN INVENTORY CONNECTOR]: No InventoryServerURI specified, disabling connector"); + else if (String.IsNullOrEmpty(m_userServerUrl)) + m_log.Info("[SIMIAN INVENTORY CONNECTOR]: No UserAccountServerURI specified, disabling connector"); } /// @@ -601,6 +612,7 @@ namespace OpenSim.Services.Connectors.SimianGrid { "Name", item.Name }, { "Description", item.Description }, { "CreatorID", item.CreatorId }, + { "CreatorData", item.CreatorData }, { "ContentType", invContentType }, { "ExtraData", OSDParser.SerializeJsonString(extraData) } }; @@ -687,12 +699,12 @@ namespace OpenSim.Services.Connectors.SimianGrid for (int i = 0; i < items.Count; i++) itemIDs[i] = items[i].AsUUID().ToString(); - NameValueCollection requestArgs = new NameValueCollection - { - { "RequestMethod", "GetInventoryNodes" }, - { "OwnerID", userID.ToString() }, - { "Items", String.Join(",", itemIDs) } - }; +// NameValueCollection requestArgs = new NameValueCollection +// { +// { "RequestMethod", "GetInventoryNodes" }, +// { "OwnerID", userID.ToString() }, +// { "Items", String.Join(",", itemIDs) } +// }; // FIXME: Implement this in SimianGrid return new List(0); @@ -708,12 +720,12 @@ namespace OpenSim.Services.Connectors.SimianGrid /// the user's inventory public int GetAssetPermissions(UUID userID, UUID assetID) { - NameValueCollection requestArgs = new NameValueCollection - { - { "RequestMethod", "GetInventoryNodes" }, - { "OwnerID", userID.ToString() }, - { "AssetID", assetID.ToString() } - }; +// NameValueCollection requestArgs = new NameValueCollection +// { +// { "RequestMethod", "GetInventoryNodes" }, +// { "OwnerID", userID.ToString() }, +// { "AssetID", assetID.ToString() } +// }; // FIXME: Implement this in SimianGrid return (int)PermissionMask.All; @@ -745,6 +757,7 @@ namespace OpenSim.Services.Connectors.SimianGrid } } + m_log.Debug("[SIMIAN INVENTORY CONNECTOR]: Parsed " + invFolders.Count + " folders from SimianGrid response"); return invFolders; } @@ -764,6 +777,7 @@ namespace OpenSim.Services.Connectors.SimianGrid invItem.AssetType = SLUtil.ContentTypeToSLAssetType(item["ContentType"].AsString()); invItem.CreationDate = item["CreationDate"].AsInteger(); invItem.CreatorId = item["CreatorID"].AsString(); + invItem.CreatorData = item["CreatorData"].AsString(); invItem.CreatorIdAsUuid = item["CreatorID"].AsUUID(); invItem.Description = item["Description"].AsString(); invItem.Folder = item["ParentID"].AsUUID(); @@ -810,6 +824,7 @@ namespace OpenSim.Services.Connectors.SimianGrid } } + m_log.Debug("[SIMIAN INVENTORY CONNECTOR]: Parsed " + invItems.Count + " items from SimianGrid response"); return invItems; } diff --git a/OpenSim/Services/Connectors/SimianGrid/SimianPresenceServiceConnector.cs b/OpenSim/Services/Connectors/SimianGrid/SimianPresenceServiceConnector.cs index 6f179317d2..8141420a1e 100644 --- a/OpenSim/Services/Connectors/SimianGrid/SimianPresenceServiceConnector.cs +++ b/OpenSim/Services/Connectors/SimianGrid/SimianPresenceServiceConnector.cs @@ -1,4 +1,4 @@ -/* +/* * Copyright (c) Contributors, http://opensimulator.org/ * See CONTRIBUTORS.TXT for a full list of copyright holders. * @@ -28,17 +28,14 @@ using System; using System.Collections.Generic; using System.Collections.Specialized; -using System.Net; using System.Reflection; using log4net; using Mono.Addins; using Nini.Config; using OpenSim.Framework; -using OpenSim.Framework.Servers.HttpServer; using OpenSim.Region.Framework.Interfaces; using OpenSim.Region.Framework.Scenes; using OpenSim.Services.Interfaces; -using OpenSim.Server.Base; using OpenMetaverse; using OpenMetaverse.StructuredData; @@ -59,6 +56,7 @@ namespace OpenSim.Services.Connectors.SimianGrid private string m_serverUrl = String.Empty; private SimianActivityDetector m_activityDetector; + private bool m_Enabled = false; #region ISharedRegionModule @@ -71,7 +69,7 @@ namespace OpenSim.Services.Connectors.SimianGrid public string Name { get { return "SimianPresenceServiceConnector"; } } public void AddRegion(Scene scene) { - if (!String.IsNullOrEmpty(m_serverUrl)) + if (m_Enabled) { scene.RegisterModuleInterface(this); scene.RegisterModuleInterface(this); @@ -83,7 +81,7 @@ namespace OpenSim.Services.Connectors.SimianGrid } public void RemoveRegion(Scene scene) { - if (!String.IsNullOrEmpty(m_serverUrl)) + if (m_Enabled) { scene.UnregisterModuleInterface(this); scene.UnregisterModuleInterface(this); @@ -98,31 +96,39 @@ namespace OpenSim.Services.Connectors.SimianGrid public SimianPresenceServiceConnector(IConfigSource source) { - Initialise(source); + CommonInit(source); } public void Initialise(IConfigSource source) { - if (Simian.IsSimianEnabled(source, "PresenceServices", this.Name)) + IConfig moduleConfig = source.Configs["Modules"]; + if (moduleConfig != null) { - IConfig gridConfig = source.Configs["PresenceService"]; - if (gridConfig == null) - { - m_log.Error("[SIMIAN PRESENCE CONNECTOR]: PresenceService missing from OpenSim.ini"); - throw new Exception("Presence connector init error"); - } - - string serviceUrl = gridConfig.GetString("PresenceServerURI"); - if (String.IsNullOrEmpty(serviceUrl)) - { - m_log.Error("[SIMIAN PRESENCE CONNECTOR]: No PresenceServerURI in section PresenceService"); - throw new Exception("Presence connector init error"); - } - - m_serverUrl = serviceUrl; + string name = moduleConfig.GetString("PresenceServices", ""); + if (name == Name) + CommonInit(source); } } + private void CommonInit(IConfigSource source) + { + IConfig gridConfig = source.Configs["PresenceService"]; + if (gridConfig != null) + { + string serviceUrl = gridConfig.GetString("PresenceServerURI"); + if (!String.IsNullOrEmpty(serviceUrl)) + { + if (!serviceUrl.EndsWith("/") && !serviceUrl.EndsWith("=")) + serviceUrl = serviceUrl + '/'; + m_serverUrl = serviceUrl; + m_Enabled = true; + } + } + + if (String.IsNullOrEmpty(m_serverUrl)) + m_log.Info("[SIMIAN PRESENCE CONNECTOR]: No PresenceServerURI specified, disabling connector"); + } + #region IPresenceService public bool LoginAgent(string userID, UUID sessionID, UUID secureSessionID) @@ -254,8 +260,14 @@ namespace OpenSim.Services.Connectors.SimianGrid return null; } - public bool LoggedOut(string userID, UUID regionID, Vector3 lastPosition, Vector3 lastLookAt) + public bool LoggedOut(string userID, UUID sessionID, UUID regionID, Vector3 lastPosition, Vector3 lastLookAt) { + m_log.DebugFormat("[SIMIAN PRESENCE CONNECTOR]: Logging out user " + userID); + + // Remove the session to mark this user offline + if (!LogoutAgent(sessionID)) + return false; + // Save our last position as user data NameValueCollection requestArgs = new NameValueCollection { @@ -298,12 +310,6 @@ namespace OpenSim.Services.Connectors.SimianGrid return UpdateSession(sessionID, regionID, lastPosition, lastLookAt); } - public bool SetLastPosition(string userID, UUID regionID, Vector3 lastPosition, Vector3 lastLookAt) - { - // Never called - return false; - } - public GridUserInfo GetGridUserInfo(string user) { m_log.DebugFormat("[SIMIAN PRESENCE CONNECTOR]: Requesting session data for agent " + user); @@ -349,25 +355,6 @@ namespace OpenSim.Services.Connectors.SimianGrid return null; } - private OSDMap GetSessionData(UUID sessionID) - { - m_log.DebugFormat("[SIMIAN PRESENCE CONNECTOR]: Requesting session data for session " + sessionID); - - NameValueCollection requestArgs = new NameValueCollection - { - { "RequestMethod", "GetSession" }, - { "SessionID", sessionID.ToString() } - }; - - OSDMap response = WebUtil.PostToService(m_serverUrl, requestArgs); - if (response["Success"].AsBoolean()) - return response; - else - m_log.Warn("[SIMIAN PRESENCE CONNECTOR]: Failed to retrieve session data for session " + sessionID); - - return null; - } - private List GetSessions(UUID userID) { List presences = new List(1); @@ -420,39 +407,6 @@ namespace OpenSim.Services.Connectors.SimianGrid return success; } - ///// - ///// Fetch the last known avatar location with GetSession and persist it - ///// as user data with AddUserData - ///// - //private bool SetLastLocation(UUID sessionID) - //{ - // NameValueCollection requestArgs = new NameValueCollection - // { - // { "RequestMethod", "GetSession" }, - // { "SessionID", sessionID.ToString() } - // }; - - // OSDMap response = WebUtil.PostToService(m_serverUrl, requestArgs); - // bool success = response["Success"].AsBoolean(); - - // if (success) - // { - // UUID userID = response["UserID"].AsUUID(); - // UUID sceneID = response["SceneID"].AsUUID(); - // Vector3 position = response["ScenePosition"].AsVector3(); - // Vector3 lookAt = response["SceneLookAt"].AsVector3(); - - // return SetLastLocation(userID, sceneID, position, lookAt); - // } - // else - // { - // m_log.Warn("[SIMIAN PRESENCE CONNECTOR]: Failed to retrieve presence information for session " + sessionID + - // " while saving last location: " + response["Message"].AsString()); - // } - - // return success; - //} - private PresenceInfo ResponseToPresenceInfo(OSDMap sessionResponse, OSDMap userResponse) { if (sessionResponse == null) diff --git a/OpenSim/Services/Connectors/SimianGrid/SimianProfiles.cs b/OpenSim/Services/Connectors/SimianGrid/SimianProfiles.cs index fbf4648155..6aefc38ed3 100644 --- a/OpenSim/Services/Connectors/SimianGrid/SimianProfiles.cs +++ b/OpenSim/Services/Connectors/SimianGrid/SimianProfiles.cs @@ -67,6 +67,7 @@ namespace OpenSim.Services.Connectors.SimianGrid MethodBase.GetCurrentMethod().DeclaringType); private string m_serverUrl = String.Empty; + private bool m_Enabled = false; #region INonSharedRegionModule @@ -76,8 +77,23 @@ namespace OpenSim.Services.Connectors.SimianGrid public SimianProfiles() { } public string Name { get { return "SimianProfiles"; } } - public void AddRegion(Scene scene) { if (!String.IsNullOrEmpty(m_serverUrl)) { CheckEstateManager(scene); scene.EventManager.OnClientConnect += ClientConnectHandler; } } - public void RemoveRegion(Scene scene) { if (!String.IsNullOrEmpty(m_serverUrl)) { scene.EventManager.OnClientConnect -= ClientConnectHandler; } } + + public void AddRegion(Scene scene) + { + if (m_Enabled) + { + CheckEstateManager(scene); + scene.EventManager.OnClientConnect += ClientConnectHandler; + } + } + + public void RemoveRegion(Scene scene) + { + if (m_Enabled) + { + scene.EventManager.OnClientConnect -= ClientConnectHandler; + } + } #endregion INonSharedRegionModule @@ -88,27 +104,30 @@ namespace OpenSim.Services.Connectors.SimianGrid public void Initialise(IConfigSource source) { - if (Simian.IsSimianEnabled(source, "UserAccountServices", this.Name)) + IConfig profileConfig = source.Configs["Profiles"]; + if (profileConfig == null) + return; + + if (profileConfig.GetString("Module", String.Empty) != Name) + return; + + m_log.DebugFormat("[SIMIAN PROFILES] module enabled"); + m_Enabled = true; + + IConfig gridConfig = source.Configs["UserAccountService"]; + if (gridConfig != null) { - IConfig gridConfig = source.Configs["UserAccountService"]; - if (gridConfig == null) - { - m_log.Error("[SIMIAN PROFILES]: UserAccountService missing from OpenSim.ini"); - throw new Exception("Profiles init error"); - } - string serviceUrl = gridConfig.GetString("UserAccountServerURI"); - if (String.IsNullOrEmpty(serviceUrl)) + if (!String.IsNullOrEmpty(serviceUrl)) { - m_log.Error("[SIMIAN PROFILES]: No UserAccountServerURI in section UserAccountService"); - throw new Exception("Profiles init error"); + if (!serviceUrl.EndsWith("/") && !serviceUrl.EndsWith("=")) + serviceUrl = serviceUrl + '/'; + m_serverUrl = serviceUrl; } - - if (!serviceUrl.EndsWith("/")) - serviceUrl = serviceUrl + '/'; - - m_serverUrl = serviceUrl; } + + if (String.IsNullOrEmpty(m_serverUrl)) + m_log.Info("[SIMIAN PROFILES]: No UserAccountServerURI specified, disabling connector"); } private void ClientConnectHandler(IClientCore clientCore) @@ -135,6 +154,7 @@ namespace OpenSim.Services.Connectors.SimianGrid // Profiles client.OnRequestAvatarProperties += RequestAvatarPropertiesHandler; + client.OnUpdateAvatarProperties += UpdateAvatarPropertiesHandler; client.OnAvatarInterestUpdate += AvatarInterestUpdateHandler; client.OnUserInfoRequest += UserInfoRequestHandler; @@ -263,6 +283,8 @@ namespace OpenSim.Services.Connectors.SimianGrid private void RequestAvatarPropertiesHandler(IClientAPI client, UUID avatarID) { + m_log.DebugFormat("[SIMIAN PROFILES]: Request avatar properties for {0}",avatarID); + OSDMap user = FetchUserData(avatarID); ProfileFlags flags = ProfileFlags.AllowPublish | ProfileFlags.MaturePublish; @@ -272,8 +294,14 @@ namespace OpenSim.Services.Connectors.SimianGrid OSDMap about = null; if (user.ContainsKey("LLAbout")) { - try { about = OSDParser.DeserializeJson(user["LLAbout"].AsString()) as OSDMap; } - catch { } + try + { + about = OSDParser.DeserializeJson(user["LLAbout"].AsString()) as OSDMap; + } + catch + { + m_log.WarnFormat("[SIMIAN PROFILES]: Unable to decode LLAbout"); + } } if (about == null) @@ -302,12 +330,25 @@ namespace OpenSim.Services.Connectors.SimianGrid System.Globalization.CultureInfo.InvariantCulture), charterMember, about["FLAbout"].AsString(), (uint)flags, about["FLImage"].AsUUID(), about["Image"].AsUUID(), about["URL"].AsString(), user["Partner"].AsUUID()); + OSDMap interests = null; + if (user.ContainsKey("LLInterests")) + { + try + { + interests = OSDParser.DeserializeJson(user["LLInterests"].AsString()) as OSDMap; + client.SendAvatarInterestsReply(avatarID, interests["WantMask"].AsUInteger(), interests["WantText"].AsString(), interests["SkillsMask"].AsUInteger(), interests["SkillsText"].AsString(), interests["Languages"].AsString()); + } + catch { } + } + + if (about == null) + about = new OSDMap(0); } else { m_log.Warn("[SIMIAN PROFILES]: Failed to fetch profile information for " + client.Name + ", returning default values"); client.SendAvatarProperties(avatarID, String.Empty, "1/1/1970", Utils.EmptyBytes, - String.Empty, (uint)flags, UUID.Zero, UUID.Zero, String.Empty, UUID.Zero); + String.Empty, (uint)flags, UUID.Zero, UUID.Zero, String.Empty, UUID.Zero); } } @@ -413,6 +454,8 @@ namespace OpenSim.Services.Connectors.SimianGrid private OSDMap FetchUserData(UUID userID) { + m_log.DebugFormat("[SIMIAN PROFILES]: Fetch information about {0}",userID); + NameValueCollection requestArgs = new NameValueCollection { { "RequestMethod", "GetUser" }, diff --git a/OpenSim/Services/Connectors/SimianGrid/SimianUserAccountServiceConnector.cs b/OpenSim/Services/Connectors/SimianGrid/SimianUserAccountServiceConnector.cs index 56c73ec7c9..9c150ee417 100644 --- a/OpenSim/Services/Connectors/SimianGrid/SimianUserAccountServiceConnector.cs +++ b/OpenSim/Services/Connectors/SimianGrid/SimianUserAccountServiceConnector.cs @@ -28,7 +28,6 @@ using System; using System.Collections.Generic; using System.Collections.Specialized; -using System.IO; using System.Reflection; using OpenSim.Framework; using OpenSim.Region.Framework.Interfaces; @@ -49,12 +48,15 @@ namespace OpenSim.Services.Connectors.SimianGrid [Extension(Path = "/OpenSim/RegionModules", NodeName = "RegionModule")] public class SimianUserAccountServiceConnector : IUserAccountService, ISharedRegionModule { + private const double CACHE_EXPIRATION_SECONDS = 120.0; + private static readonly ILog m_log = LogManager.GetLogger( MethodBase.GetCurrentMethod().DeclaringType); private string m_serverUrl = String.Empty; - private ExpiringCache m_accountCache; + private ExpiringCache m_accountCache = new ExpiringCache(); + private bool m_Enabled; #region ISharedRegionModule @@ -65,39 +67,46 @@ namespace OpenSim.Services.Connectors.SimianGrid public SimianUserAccountServiceConnector() { } public string Name { get { return "SimianUserAccountServiceConnector"; } } - public void AddRegion(Scene scene) { if (!String.IsNullOrEmpty(m_serverUrl)) { scene.RegisterModuleInterface(this); } } - public void RemoveRegion(Scene scene) { if (!String.IsNullOrEmpty(m_serverUrl)) { scene.UnregisterModuleInterface(this); } } + public void AddRegion(Scene scene) { if (m_Enabled) { scene.RegisterModuleInterface(this); } } + public void RemoveRegion(Scene scene) { if (m_Enabled) { scene.UnregisterModuleInterface(this); } } #endregion ISharedRegionModule public SimianUserAccountServiceConnector(IConfigSource source) { - Initialise(source); + CommonInit(source); } public void Initialise(IConfigSource source) { - if (Simian.IsSimianEnabled(source, "UserAccountServices", this.Name)) + IConfig moduleConfig = source.Configs["Modules"]; + if (moduleConfig != null) { - IConfig assetConfig = source.Configs["UserAccountService"]; - if (assetConfig == null) - { - m_log.Error("[SIMIAN ACCOUNT CONNECTOR]: UserAccountService missing from OpenSim.ini"); - throw new Exception("User account connector init error"); - } - - string serviceURI = assetConfig.GetString("UserAccountServerURI"); - if (String.IsNullOrEmpty(serviceURI)) - { - m_log.Error("[SIMIAN ACCOUNT CONNECTOR]: No UserAccountServerURI in section UserAccountService, skipping SimianUserAccountServiceConnector"); - throw new Exception("User account connector init error"); - } - - m_accountCache = new ExpiringCache(); - m_serverUrl = serviceURI; + string name = moduleConfig.GetString("UserAccountServices", ""); + if (name == Name) + CommonInit(source); } } + private void CommonInit(IConfigSource source) + { + IConfig gridConfig = source.Configs["UserAccountService"]; + if (gridConfig != null) + { + string serviceUrl = gridConfig.GetString("UserAccountServerURI"); + if (!String.IsNullOrEmpty(serviceUrl)) + { + if (!serviceUrl.EndsWith("/") && !serviceUrl.EndsWith("=")) + serviceUrl = serviceUrl + '/'; + m_serverUrl = serviceUrl; + m_Enabled = true; + } + } + + if (String.IsNullOrEmpty(m_serverUrl)) + m_log.Info("[SIMIAN ACCOUNT CONNECTOR]: No UserAccountServerURI specified, disabling connector"); + } + public UserAccount GetUserAccount(UUID scopeID, string firstName, string lastName) { NameValueCollection requestArgs = new NameValueCollection @@ -133,7 +142,15 @@ namespace OpenSim.Services.Connectors.SimianGrid { "UserID", userID.ToString() } }; - return GetUser(requestArgs); + account = GetUser(requestArgs); + + if (account == null) + { + // Store null responses too, to avoid repeated lookups for missing accounts + m_accountCache.AddOrUpdate(userID, null, CACHE_EXPIRATION_SECONDS); + } + + return account; } public List GetUserAccounts(UUID scopeID, string query) @@ -208,7 +225,7 @@ namespace OpenSim.Services.Connectors.SimianGrid if (success) { // Cache the user account info - m_accountCache.AddOrUpdate(data.PrincipalID, data, DateTime.Now + TimeSpan.FromMinutes(2.0d)); + m_accountCache.AddOrUpdate(data.PrincipalID, data, CACHE_EXPIRATION_SECONDS); } else { @@ -273,7 +290,7 @@ namespace OpenSim.Services.Connectors.SimianGrid GetFirstLastName(response["Name"].AsString(), out account.FirstName, out account.LastName); // Cache the user account info - m_accountCache.AddOrUpdate(account.PrincipalID, account, DateTime.Now + TimeSpan.FromMinutes(2.0d)); + m_accountCache.AddOrUpdate(account.PrincipalID, account, CACHE_EXPIRATION_SECONDS); return account; } diff --git a/OpenSim/Services/Connectors/Simulation/EstateDataService.cs b/OpenSim/Services/Connectors/Simulation/EstateDataService.cs new file mode 100644 index 0000000000..8a8b46d89b --- /dev/null +++ b/OpenSim/Services/Connectors/Simulation/EstateDataService.cs @@ -0,0 +1,119 @@ +/* + * Copyright (c) Contributors, http://opensimulator.org/ + * See CONTRIBUTORS.TXT for a full list of copyright holders. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * * Neither the name of the OpenSimulator Project nor the + * names of its contributors may be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE DEVELOPERS ``AS IS'' AND ANY + * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED + * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + * DISCLAIMED. IN NO EVENT SHALL THE CONTRIBUTORS BE LIABLE FOR ANY + * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES + * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND + * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS + * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +using System; +using System.Collections.Generic; +using OpenMetaverse; +using log4net; +using Mono.Addins; +using Nini.Config; +using System.Reflection; +using OpenSim.Services.Base; +using OpenSim.Services.Interfaces; +using OpenSim.Data; +using OpenSim.Framework; +using OpenSim.Region.Framework.Interfaces; +using OpenSim.Region.Framework.Scenes; + +namespace OpenSim.Services.Connectors +{ + public class EstateDataService : ServiceBase, IEstateDataService + { + private static readonly ILog m_log = + LogManager.GetLogger( + MethodBase.GetCurrentMethod().DeclaringType); + + protected IEstateDataStore m_database; + + public EstateDataService(IConfigSource config) + : base(config) + { + string dllName = String.Empty; + string connString = String.Empty; + + // Try reading the [DatabaseService] section, if it exists + IConfig dbConfig = config.Configs["DatabaseService"]; + if (dbConfig != null) + { + dllName = dbConfig.GetString("StorageProvider", String.Empty); + connString = dbConfig.GetString("ConnectionString", String.Empty); + connString = dbConfig.GetString("EstateConnectionString", connString); + } + + // Try reading the [EstateDataStore] section, if it exists + IConfig estConfig = config.Configs["EstateDataStore"]; + if (estConfig != null) + { + dllName = estConfig.GetString("StorageProvider", dllName); + connString = estConfig.GetString("ConnectionString", connString); + } + + // We tried, but this doesn't exist. We can't proceed + if (dllName == String.Empty) + throw new Exception("No StorageProvider configured"); + + m_database = LoadPlugin(dllName, new Object[] { connString }); + if (m_database == null) + throw new Exception("Could not find a storage interface in the given module"); + } + + public EstateSettings LoadEstateSettings(UUID regionID, bool create) + { + return m_database.LoadEstateSettings(regionID, create); + } + + public EstateSettings LoadEstateSettings(int estateID) + { + return m_database.LoadEstateSettings(estateID); + } + + public void StoreEstateSettings(EstateSettings es) + { + m_database.StoreEstateSettings(es); + } + + public List GetEstates(string search) + { + return m_database.GetEstates(search); + } + + public bool LinkRegion(UUID regionID, int estateID) + { + return m_database.LinkRegion(regionID, estateID); + } + + public List GetRegions(int estateID) + { + return m_database.GetRegions(estateID); + } + + public bool DeleteEstate(int estateID) + { + return m_database.DeleteEstate(estateID); + } + } +} diff --git a/OpenSim/Services/Connectors/Simulation/SimulationDataService.cs b/OpenSim/Services/Connectors/Simulation/SimulationDataService.cs new file mode 100644 index 0000000000..d20a3d85da --- /dev/null +++ b/OpenSim/Services/Connectors/Simulation/SimulationDataService.cs @@ -0,0 +1,160 @@ +/* + * Copyright (c) Contributors, http://opensimulator.org/ + * See CONTRIBUTORS.TXT for a full list of copyright holders. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * * Neither the name of the OpenSimulator Project nor the + * names of its contributors may be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE DEVELOPERS ``AS IS'' AND ANY + * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED + * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + * DISCLAIMED. IN NO EVENT SHALL THE CONTRIBUTORS BE LIABLE FOR ANY + * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES + * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND + * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS + * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +using System; +using System.Collections.Generic; +using OpenMetaverse; +using log4net; +using Mono.Addins; +using Nini.Config; +using System.Reflection; +using OpenSim.Services.Base; +using OpenSim.Services.Interfaces; +using OpenSim.Data; +using OpenSim.Framework; +using OpenSim.Region.Framework.Interfaces; +using OpenSim.Region.Framework.Scenes; + +namespace OpenSim.Services.Connectors +{ + public class SimulationDataService : ServiceBase, ISimulationDataService + { + private static readonly ILog m_log = + LogManager.GetLogger( + MethodBase.GetCurrentMethod().DeclaringType); + + protected ISimulationDataStore m_database; + + public SimulationDataService(IConfigSource config) + : base(config) + { + string dllName = String.Empty; + string connString = String.Empty; + + // Try reading the [DatabaseService] section, if it exists + IConfig dbConfig = config.Configs["DatabaseService"]; + if (dbConfig != null) + { + dllName = dbConfig.GetString("StorageProvider", String.Empty); + connString = dbConfig.GetString("ConnectionString", String.Empty); + } + + // Try reading the [SimulationDataStore] section + IConfig simConfig = config.Configs["SimulationDataStore"]; + if (simConfig != null) + { + dllName = simConfig.GetString("StorageProvider", dllName); + connString = simConfig.GetString("ConnectionString", connString); + } + + // We tried, but this doesn't exist. We can't proceed + if (dllName == String.Empty) + throw new Exception("No StorageProvider configured"); + + m_database = LoadPlugin(dllName, new Object[] { connString }); + if (m_database == null) + throw new Exception("Could not find a storage interface in the given module"); + } + + public void StoreObject(SceneObjectGroup obj, UUID regionUUID) + { + m_database.StoreObject(obj, regionUUID); + } + + public void RemoveObject(UUID uuid, UUID regionUUID) + { + m_database.RemoveObject(uuid, regionUUID); + } + + public void StorePrimInventory(UUID primID, ICollection items) + { + m_database.StorePrimInventory(primID, items); + } + + public List LoadObjects(UUID regionUUID) + { + return m_database.LoadObjects(regionUUID); + } + + // REGION SYNC + #region REGION SYNC + public List LoadObjectsInGivenSpace(UUID regionID, float lowerX, float lowerY, float upperX, float upperY) + { + return m_database.LoadObjectsInGivenSpace(regionID, lowerX, lowerY, upperX, upperY); + } + #endregion REGION SYNC + + public void StoreTerrain(double[,] terrain, UUID regionID) + { + m_database.StoreTerrain(terrain, regionID); + } + + public double[,] LoadTerrain(UUID regionID) + { + return m_database.LoadTerrain(regionID); + } + + public void StoreLandObject(ILandObject Parcel) + { + m_database.StoreLandObject(Parcel); + } + + public void RemoveLandObject(UUID globalID) + { + m_database.RemoveLandObject(globalID); + } + + public List LoadLandObjects(UUID regionUUID) + { + return m_database.LoadLandObjects(regionUUID); + } + + public void StoreRegionSettings(RegionSettings rs) + { + m_database.StoreRegionSettings(rs); + } + + public RegionSettings LoadRegionSettings(UUID regionUUID) + { + return m_database.LoadRegionSettings(regionUUID); + } + + public RegionLightShareData LoadRegionWindlightSettings(UUID regionUUID) + { + return m_database.LoadRegionWindlightSettings(regionUUID); + } + + public void StoreRegionWindlightSettings(RegionLightShareData wl) + { + m_database.StoreRegionWindlightSettings(wl); + } + public void RemoveRegionWindlightSettings(UUID regionID) + { + m_database.RemoveRegionWindlightSettings(regionID); + } + } +} diff --git a/OpenSim/Services/Connectors/Simulation/SimulationServiceConnector.cs b/OpenSim/Services/Connectors/Simulation/SimulationServiceConnector.cs index 32f02fbf37..67647ee2a2 100644 --- a/OpenSim/Services/Connectors/Simulation/SimulationServiceConnector.cs +++ b/OpenSim/Services/Connectors/Simulation/SimulationServiceConnector.cs @@ -1,4 +1,4 @@ -/* +/* * Copyright (c) Contributors, http://opensimulator.org/ * See CONTRIBUTORS.TXT for a full list of copyright holders. * @@ -77,8 +77,26 @@ namespace OpenSim.Services.Connectors.Simulation public bool CreateAgent(GridRegion destination, AgentCircuitData aCircuit, uint flags, out string reason) { + HttpWebRequest AgentCreateRequest = null; reason = String.Empty; + if (SendRequest(destination, aCircuit, flags, out reason, out AgentCreateRequest)) + { + string response = GetResponse(AgentCreateRequest, out reason); + bool success = true; + UnpackResponse(response, out success, out reason); + return success; + } + + return false; + } + + + protected bool SendRequest(GridRegion destination, AgentCircuitData aCircuit, uint flags, out string reason, out HttpWebRequest AgentCreateRequest) + { + reason = String.Empty; + AgentCreateRequest = null; + if (destination == null) { reason = "Destination is null"; @@ -86,22 +104,28 @@ namespace OpenSim.Services.Connectors.Simulation return false; } - // Eventually, we want to use a caps url instead of the agentID string uri = string.Empty; - try + + // HACK -- Simian grid make it work!!! + if (destination.ServerURI != null && destination.ServerURI != string.Empty && !destination.ServerURI.StartsWith("http:")) + uri = "http://" + destination.ServerURI + AgentPath() + aCircuit.AgentID + "/"; + else { - uri = "http://" + destination.ExternalEndPoint.Address + ":" + destination.HttpPort + AgentPath() + aCircuit.AgentID + "/"; - } - catch (Exception e) - { - m_log.Debug("[REMOTE SIMULATION CONNECTOR]: Unable to resolve external endpoint on agent create. Reason: " + e.Message); - reason = e.Message; - return false; + try + { + uri = "http://" + destination.ExternalEndPoint.Address + ":" + destination.HttpPort + AgentPath() + aCircuit.AgentID + "/"; + } + catch (Exception e) + { + m_log.Error("[REMOTE SIMULATION CONNECTOR]: Unable to resolve external endpoint on agent create. Reason: " + e.Message); + reason = e.Message; + return false; + } } //Console.WriteLine(" >>> DoCreateChildAgentCall <<< " + uri); - HttpWebRequest AgentCreateRequest = (HttpWebRequest)WebRequest.Create(uri); + AgentCreateRequest = (HttpWebRequest)WebRequest.Create(uri); AgentCreateRequest.Method = "POST"; AgentCreateRequest.ContentType = "application/json"; AgentCreateRequest.Timeout = 10000; @@ -134,13 +158,13 @@ namespace OpenSim.Services.Connectors.Simulation AgentCreateRequest.ContentLength = buffer.Length; //Count bytes to send os = AgentCreateRequest.GetRequestStream(); os.Write(buffer, 0, strBuffer.Length); //Send it - m_log.InfoFormat("[REMOTE SIMULATION CONNECTOR]: Posted CreateAgent request to remote sim {0}, region {1}, x={2} y={3}", + m_log.DebugFormat("[REMOTE SIMULATION CONNECTOR]: Posted CreateAgent request to remote sim {0}, region {1}, x={2} y={3}", uri, destination.RegionName, destination.RegionLocX, destination.RegionLocY); } //catch (WebException ex) catch { - //m_log.InfoFormat("[REMOTE SIMULATION CONNECTOR]: Bad send on ChildAgentUpdate {0}", ex.Message); + //m_log.ErrorFormat("[REMOTE SIMULATION CONNECTOR]: Bad send on ChildAgentUpdate {0}", ex.Message); reason = "cannot contact remote region"; return false; } @@ -150,53 +174,38 @@ namespace OpenSim.Services.Connectors.Simulation os.Close(); } + return true; + } + + protected string GetResponse(HttpWebRequest AgentCreateRequest, out string reason) + { // Let's wait for the response //m_log.Info("[REMOTE SIMULATION CONNECTOR]: Waiting for a reply after DoCreateChildAgentCall"); + reason = string.Empty; WebResponse webResponse = null; StreamReader sr = null; + string response = string.Empty; try { webResponse = AgentCreateRequest.GetResponse(); if (webResponse == null) { - m_log.Info("[REMOTE SIMULATION CONNECTOR]: Null reply on DoCreateChildAgentCall post"); + m_log.Debug("[REMOTE SIMULATION CONNECTOR]: Null reply on DoCreateChildAgentCall post"); } else { sr = new StreamReader(webResponse.GetResponseStream()); - string response = sr.ReadToEnd().Trim(); - m_log.InfoFormat("[REMOTE SIMULATION CONNECTOR]: DoCreateChildAgentCall reply was {0} ", response); - - if (!String.IsNullOrEmpty(response)) - { - try - { - // we assume we got an OSDMap back - OSDMap r = Util.GetOSDMap(response); - bool success = r["success"].AsBoolean(); - reason = r["reason"].AsString(); - return success; - } - catch (NullReferenceException e) - { - m_log.InfoFormat("[REMOTE SIMULATION CONNECTOR]: exception on reply of DoCreateChildAgentCall {0}", e.Message); - - // check for old style response - if (response.ToLower().StartsWith("true")) - return true; - - return false; - } - } + response = sr.ReadToEnd().Trim(); + m_log.DebugFormat("[REMOTE SIMULATION CONNECTOR]: DoCreateChildAgentCall reply was {0} ", response); } } catch (WebException ex) { - m_log.InfoFormat("[REMOTE SIMULATION CONNECTOR]: exception on reply of DoCreateChildAgentCall {0}", ex.Message); + m_log.WarnFormat("[REMOTE SIMULATION CONNECTOR]: exception on reply of DoCreateChildAgentCall {0}", ex.Message); reason = "Destination did not reply"; - return false; + return string.Empty; } finally { @@ -204,7 +213,33 @@ namespace OpenSim.Services.Connectors.Simulation sr.Close(); } - return true; + return response; + } + + protected void UnpackResponse(string response, out bool result, out string reason) + { + result = true; + reason = string.Empty; + if (!String.IsNullOrEmpty(response)) + { + try + { + // we assume we got an OSDMap back + OSDMap r = Util.GetOSDMap(response); + result = r["success"].AsBoolean(); + reason = r["reason"].AsString(); + } + catch (NullReferenceException e) + { + m_log.WarnFormat("[REMOTE SIMULATION CONNECTOR]: exception on reply of DoCreateChildAgentCall {0}", e.Message); + + // check for old style response + if (response.ToLower().StartsWith("true")) + result = true; + + result = false; + } + } } protected virtual OSDMap PackCreateAgentArguments(AgentCircuitData aCircuit, GridRegion destination, uint flags) @@ -216,7 +251,7 @@ namespace OpenSim.Services.Connectors.Simulation } catch (Exception e) { - m_log.Debug("[REMOTE SIMULATION CONNECTOR]: PackAgentCircuitData failed with exception: " + e.Message); + m_log.Warn("[REMOTE SIMULATION CONNECTOR]: PackAgentCircuitData failed with exception: " + e.Message); return null; } // Add the input arguments @@ -249,7 +284,7 @@ namespace OpenSim.Services.Connectors.Simulation } catch (Exception e) { - m_log.Debug("[REMOTE SIMULATION CONNECTOR]: Unable to resolve external endpoint on agent update. Reason: " + e.Message); + m_log.Warn("[REMOTE SIMULATION CONNECTOR]: Unable to resolve external endpoint on agent update. Reason: " + e.Message); return false; } //Console.WriteLine(" >>> DoAgentUpdateCall <<< " + uri); @@ -257,7 +292,7 @@ namespace OpenSim.Services.Connectors.Simulation HttpWebRequest ChildUpdateRequest = (HttpWebRequest)WebRequest.Create(uri); ChildUpdateRequest.Method = "PUT"; ChildUpdateRequest.ContentType = "application/json"; - ChildUpdateRequest.Timeout = 10000; + ChildUpdateRequest.Timeout = 30000; //ChildUpdateRequest.KeepAlive = false; // Fill it in @@ -268,7 +303,7 @@ namespace OpenSim.Services.Connectors.Simulation } catch (Exception e) { - m_log.Debug("[REMOTE SIMULATION CONNECTOR]: PackUpdateMessage failed with exception: " + e.Message); + m_log.Warn("[REMOTE SIMULATION CONNECTOR]: PackUpdateMessage failed with exception: " + e.Message); } // Add the input arguments args["destination_x"] = OSD.FromString(destination.RegionLocX.ToString()); @@ -297,12 +332,12 @@ namespace OpenSim.Services.Connectors.Simulation ChildUpdateRequest.ContentLength = buffer.Length; //Count bytes to send os = ChildUpdateRequest.GetRequestStream(); os.Write(buffer, 0, strBuffer.Length); //Send it - //m_log.InfoFormat("[REMOTE SIMULATION CONNECTOR]: Posted AgentUpdate request to remote sim {0}", uri); + //m_log.DebugFormat("[REMOTE SIMULATION CONNECTOR]: Posted AgentUpdate request to remote sim {0}", uri); } catch (WebException ex) //catch { - m_log.InfoFormat("[REMOTE SIMULATION CONNECTOR]: Bad send on AgentUpdate {0}", ex.Message); + m_log.WarnFormat("[REMOTE SIMULATION CONNECTOR]: Bad send on AgentUpdate {0}", ex.Message); return false; } @@ -313,7 +348,7 @@ namespace OpenSim.Services.Connectors.Simulation } // Let's wait for the response - //m_log.Info("[REMOTE SIMULATION CONNECTOR]: Waiting for a reply after ChildAgentUpdate"); + //m_log.Debug("[REMOTE SIMULATION CONNECTOR]: Waiting for a reply after ChildAgentUpdate"); WebResponse webResponse = null; StreamReader sr = null; @@ -322,19 +357,19 @@ namespace OpenSim.Services.Connectors.Simulation webResponse = ChildUpdateRequest.GetResponse(); if (webResponse == null) { - m_log.Info("[REMOTE SIMULATION CONNECTOR]: Null reply on ChilAgentUpdate post"); + m_log.Debug("[REMOTE SIMULATION CONNECTOR]: Null reply on ChilAgentUpdate post"); } sr = new StreamReader(webResponse.GetResponseStream()); //reply = sr.ReadToEnd().Trim(); sr.ReadToEnd().Trim(); sr.Close(); - //m_log.InfoFormat("[REMOTE SIMULATION CONNECTOR]: ChilAgentUpdate reply was {0} ", reply); + //m_log.DebugFormat("[REMOTE SIMULATION CONNECTOR]: ChilAgentUpdate reply was {0} ", reply); } catch (WebException ex) { - m_log.InfoFormat("[REMOTE SIMULATION CONNECTOR]: exception on reply of ChilAgentUpdate {0}", ex.Message); + m_log.WarnFormat("[REMOTE SIMULATION CONNECTOR]: exception on reply of ChilAgentUpdate from {0}: {1}", uri, ex.Message); // ignore, really } finally @@ -366,7 +401,7 @@ namespace OpenSim.Services.Connectors.Simulation webResponse = (HttpWebResponse)request.GetResponse(); if (webResponse == null) { - m_log.Info("[REMOTE SIMULATION CONNECTOR]: Null reply on agent get "); + m_log.Debug("[REMOTE SIMULATION CONNECTOR]: Null reply on agent get "); } sr = new StreamReader(webResponse.GetResponseStream()); @@ -377,7 +412,7 @@ namespace OpenSim.Services.Connectors.Simulation } catch (WebException ex) { - m_log.InfoFormat("[REMOTE SIMULATION CONNECTOR]: exception on reply of agent get {0}", ex.Message); + m_log.WarnFormat("[REMOTE SIMULATION CONNECTOR]: exception on reply of agent get {0}", ex.Message); // ignore, really return false; } @@ -418,7 +453,7 @@ namespace OpenSim.Services.Connectors.Simulation WebResponse webResponse = request.GetResponse(); if (webResponse == null) { - m_log.Info("[REMOTE SIMULATION CONNECTOR]: Null reply on ReleaseAgent"); + m_log.Debug("[REMOTE SIMULATION CONNECTOR]: Null reply on ReleaseAgent"); } sr = new StreamReader(webResponse.GetResponseStream()); @@ -430,7 +465,7 @@ namespace OpenSim.Services.Connectors.Simulation } catch (WebException ex) { - m_log.InfoFormat("[REMOTE SIMULATION CONNECTOR]: exception on reply of ReleaseAgent {0}", ex.Message); + m_log.WarnFormat("[REMOTE SIMULATION CONNECTOR]: exception on reply of ReleaseAgent {0}", ex.Message); return false; } finally @@ -451,7 +486,7 @@ namespace OpenSim.Services.Connectors.Simulation } catch (Exception e) { - m_log.Debug("[REMOTE SIMULATION CONNECTOR]: Unable to resolve external endpoint on agent close. Reason: " + e.Message); + m_log.Warn("[REMOTE SIMULATION CONNECTOR]: Unable to resolve external endpoint on agent close. Reason: " + e.Message); return false; } @@ -467,7 +502,7 @@ namespace OpenSim.Services.Connectors.Simulation WebResponse webResponse = request.GetResponse(); if (webResponse == null) { - m_log.Info("[REMOTE SIMULATION CONNECTOR]: Null reply on agent delete "); + m_log.Debug("[REMOTE SIMULATION CONNECTOR]: Null reply on agent delete "); } sr = new StreamReader(webResponse.GetResponseStream()); @@ -479,7 +514,7 @@ namespace OpenSim.Services.Connectors.Simulation } catch (WebException ex) { - m_log.InfoFormat("[REMOTE SIMULATION CONNECTOR]: exception on reply of agent delete from {0}: {1}", destination.RegionName, ex.Message); + m_log.WarnFormat("[REMOTE SIMULATION CONNECTOR]: exception on reply of agent delete from {0}: {1}", destination.RegionName, ex.Message); return false; } finally @@ -514,6 +549,7 @@ namespace OpenSim.Services.Connectors.Simulation OSDMap args = new OSDMap(2); args["sog"] = OSD.FromString(sog.ToXml2()); args["extra"] = OSD.FromString(sog.ExtraToXmlString()); + args["modified"] = OSD.FromBoolean(sog.HasGroupChanged); string state = sog.GetStateSnapshot(); if (state.Length > 0) args["state"] = OSD.FromString(state); @@ -544,11 +580,11 @@ namespace OpenSim.Services.Connectors.Simulation ObjectCreateRequest.ContentLength = buffer.Length; //Count bytes to send os = ObjectCreateRequest.GetRequestStream(); os.Write(buffer, 0, strBuffer.Length); //Send it - m_log.InfoFormat("[REMOTE SIMULATION CONNECTOR]: Posted CreateObject request to remote sim {0}", uri); + m_log.DebugFormat("[REMOTE SIMULATION CONNECTOR]: Posted CreateObject request to remote sim {0}", uri); } catch (WebException ex) { - m_log.InfoFormat("[REMOTE SIMULATION CONNECTOR]: Bad send on CreateObject {0}", ex.Message); + m_log.WarnFormat("[REMOTE SIMULATION CONNECTOR]: Bad send on CreateObject {0}", ex.Message); return false; } finally @@ -566,7 +602,7 @@ namespace OpenSim.Services.Connectors.Simulation WebResponse webResponse = ObjectCreateRequest.GetResponse(); if (webResponse == null) { - m_log.Info("[REMOTE SIMULATION CONNECTOR]: Null reply on CreateObject post"); + m_log.Warn("[REMOTE SIMULATION CONNECTOR]: Null reply on CreateObject post"); return false; } @@ -578,7 +614,7 @@ namespace OpenSim.Services.Connectors.Simulation } catch (WebException ex) { - m_log.InfoFormat("[REMOTE SIMULATION CONNECTOR]: exception on reply of CreateObject {0}", ex.Message); + m_log.WarnFormat("[REMOTE SIMULATION CONNECTOR]: exception on reply of CreateObject {0}", ex.Message); return false; } finally diff --git a/OpenSim/Services/Connectors/UserAccounts/UserAccountServiceConnector.cs b/OpenSim/Services/Connectors/UserAccounts/UserAccountServiceConnector.cs index 38c191a913..2a5df83193 100644 --- a/OpenSim/Services/Connectors/UserAccounts/UserAccountServiceConnector.cs +++ b/OpenSim/Services/Connectors/UserAccounts/UserAccountServiceConnector.cs @@ -113,7 +113,7 @@ namespace OpenSim.Services.Connectors public virtual UserAccount GetUserAccount(UUID scopeID, UUID userID) { - m_log.DebugFormat("[ACCOUNTS CONNECTOR]: GetUserAccount {0}", userID); + //m_log.DebugFormat("[ACCOUNTS CONNECTOR]: GetUserAccount {0}", userID); Dictionary sendData = new Dictionary(); //sendData["SCOPEID"] = scopeID.ToString(); sendData["VERSIONMIN"] = ProtocolVersions.ClientProtocolVersionMin.ToString(); diff --git a/OpenSim/Services/FreeswitchService/FreeswitchService.cs b/OpenSim/Services/FreeswitchService/FreeswitchService.cs index 0a3830060e..fe6f5cd503 100644 --- a/OpenSim/Services/FreeswitchService/FreeswitchService.cs +++ b/OpenSim/Services/FreeswitchService/FreeswitchService.cs @@ -26,6 +26,7 @@ */ using System; +using System.Text; using System.Reflection; using Nini.Config; using log4net; @@ -33,19 +34,373 @@ using OpenSim.Framework; using OpenSim.Data; using OpenSim.Services.Interfaces; using OpenMetaverse; +using OpenMetaverse.StructuredData; +using System.Collections; namespace OpenSim.Services.FreeswitchService { public class FreeswitchService : FreeswitchServiceBase, IFreeswitchService { - //private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); + private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); public FreeswitchService(IConfigSource config) : base(config) { // Perform initilialization here } + public Hashtable HandleDialplanRequest(Hashtable request) + { + m_log.DebugFormat("[FreeSwitchVoice] HandleDialplanRequest called with {0}",request.ToString()); - // Implement IFreeswitchService here + Hashtable response = new Hashtable(); + + foreach (DictionaryEntry item in request) + { + m_log.InfoFormat("[FreeSwitchDirectory] requestBody item {0} {1}",item.Key, item.Value); + } + + string requestcontext = (string) request["Hunt-Context"]; + response["content_type"] = "text/xml"; + response["keepalive"] = false; + response["int_response_code"] = 200; + + if (m_freeSwitchContext != String.Empty && m_freeSwitchContext != requestcontext) + { + m_log.Debug("[FreeSwitchDirectory] returning empty as it's for another context"); + response["str_response_string"] = ""; + } + else + { + response["str_response_string"] = String.Format(@" + +
+ " + + +/* + + + + + + */ + + @" + + + + + + + + + + + + + + + + + + + + +
+
", m_freeSwitchContext, m_freeSwitchRealm); + } + + return response; + } + + public Hashtable HandleDirectoryRequest(Hashtable request) + { + Hashtable response = new Hashtable(); + string domain = (string) request["domain"]; + if (domain != m_freeSwitchRealm) { + response["content_type"] = "text/xml"; + response["keepalive"] = false; + response["int_response_code"] = 200; + response["str_response_string"] = ""; + } else { + m_log.DebugFormat("[FreeSwitchDirectory] HandleDirectoryRequest called with {0}",request.ToString()); + + // information in the request we might be interested in + + // Request 1 sip_auth for users account + + //Event-Calling-Function=sofia_reg_parse_auth + //Event-Calling-Line-Number=1494 + //action=sip_auth + //sip_user_agent=Vivox-SDK-2.1.3010.6151-Mac%20(Feb-11-2009/16%3A42%3A41) + //sip_auth_username=xhZuXKmRpECyr2AARJYyGgg%3D%3D (==) + //sip_auth_realm=9.20.151.43 + //sip_contact_user=xhZuXKmRpECyr2AARJYyGgg%3D%3D (==) + //sip_contact_host=192.168.0.3 // this shouldnt really be a local IP, investigate STUN servers + //sip_to_user=xhZuXKmRpECyr2AARJYyGgg%3D%3D + //sip_to_host=9.20.151.43 + //sip_auth_method=REGISTER + //user=xhZuXKmRpECyr2AARJYyGgg%3D%3D + //domain=9.20.151.43 + //ip=9.167.220.137 // this is the correct IP rather than sip_contact_host above when through a vpn or NAT setup + + foreach (DictionaryEntry item in request) + { + m_log.InfoFormat("[FreeSwitchDirectory] requestBody item {0} {1}", item.Key, item.Value); + } + + string eventCallingFunction = (string) request["Event-Calling-Function"]; + if (eventCallingFunction == null) + { + eventCallingFunction = "sofia_reg_parse_auth"; + } + + if (eventCallingFunction.Length == 0) + { + eventCallingFunction = "sofia_reg_parse_auth"; + } + + if (eventCallingFunction == "sofia_reg_parse_auth") + { + string sipAuthMethod = (string)request["sip_auth_method"]; + + if (sipAuthMethod == "REGISTER") + { + response = HandleRegister(m_freeSwitchContext, m_freeSwitchRealm, request); + } + else if (sipAuthMethod == "INVITE") + { + response = HandleInvite(m_freeSwitchContext, m_freeSwitchRealm, request); + } + else + { + m_log.ErrorFormat("[FreeSwitchVoice] HandleDirectoryRequest unknown sip_auth_method {0}",sipAuthMethod); + response["int_response_code"] = 404; + response["content_type"] = "text/xml"; + response["str_response_string"] = ""; + } + } + else if (eventCallingFunction == "switch_xml_locate_user") + { + response = HandleLocateUser(m_freeSwitchRealm, request); + } + else if (eventCallingFunction == "user_data_function") // gets called when an avatar to avatar call is made + { + response = HandleLocateUser(m_freeSwitchRealm, request); + } + else if (eventCallingFunction == "user_outgoing_channel") + { + response = HandleRegister(m_freeSwitchContext, m_freeSwitchRealm, request); + } + else if (eventCallingFunction == "config_sofia") // happens once on freeswitch startup + { + response = HandleConfigSofia(m_freeSwitchContext, m_freeSwitchRealm, request); + } + else if (eventCallingFunction == "switch_load_network_lists") + { + //response = HandleLoadNetworkLists(request); + response["int_response_code"] = 404; + response["keepalive"] = false; + response["content_type"] = "text/xml"; + response["str_response_string"] = ""; + } + else + { + m_log.ErrorFormat("[FreeSwitchVoice] HandleDirectoryRequest unknown Event-Calling-Function {0}",eventCallingFunction); + response["int_response_code"] = 404; + response["keepalive"] = false; + response["content_type"] = "text/xml"; + response["str_response_string"] = ""; + } + } + return response; + } + + private Hashtable HandleRegister(string Context, string Realm, Hashtable request) + { + m_log.Info("[FreeSwitchDirectory] HandleRegister called"); + + // TODO the password we return needs to match that sent in the request, this is hard coded for now + string password = "1234"; + string domain = (string) request["domain"]; + string user = (string) request["user"]; + + Hashtable response = new Hashtable(); + response["content_type"] = "text/xml"; + response["keepalive"] = false; + response["int_response_code"] = 200; + + response["str_response_string"] = String.Format( + "\r\n" + + "\r\n" + + "
\r\n" + + "\r\n" + + "\r\n" + + "\r\n" + + "\r\n" + + "\r\n" + + "\r\n" + + "\r\n" + + "\r\n" + + ""+ + "\r\n" + + "\r\n" + + "\r\n" + + "
\r\n" + + "
\r\n", + domain , user, password, Context); + + return response; + } + + private Hashtable HandleInvite(string Context, string Realm, Hashtable request) + { + m_log.Info("[FreeSwitchDirectory] HandleInvite called"); + + // TODO the password we return needs to match that sent in the request, this is hard coded for now + string password = "1234"; + string domain = (string) request["domain"]; + string user = (string) request["user"]; + string sipRequestUser = (string) request["sip_request_user"]; + + Hashtable response = new Hashtable(); + response["content_type"] = "text/xml"; + response["keepalive"] = false; + response["int_response_code"] = 200; + response["str_response_string"] = String.Format( + "\r\n" + + "\r\n" + + "
\r\n" + + "\r\n" + + "\r\n" + + "\r\n" + + "\r\n" + + "\r\n" + + "\r\n" + + "\r\n" + + "\r\n" + + ""+ + "\r\n" + + "\r\n" + + "\r\n" + + "\r\n" + + "\r\n" + + "\r\n" + + "\r\n" + + "\r\n" + + "\r\n" + + ""+ + "\r\n" + + "\r\n" + + "\r\n" + + "
\r\n" + + "
\r\n", + domain , user, password,sipRequestUser, Context); + + return response; + } + + private Hashtable HandleLocateUser(String Realm, Hashtable request) + { + m_log.Info("[FreeSwitchDirectory] HandleLocateUser called"); + + // TODO the password we return needs to match that sent in the request, this is hard coded for now + string domain = (string) request["domain"]; + string user = (string) request["user"]; + + Hashtable response = new Hashtable(); + response["content_type"] = "text/xml"; + response["keepalive"] = false; + response["int_response_code"] = 200; + response["str_response_string"] = String.Format( + "\r\n" + + "\r\n" + + "
\r\n" + + "\r\n" + + "\r\n" + + "\r\n" + + "\r\n" + + "\r\n" + + "\r\n"+ + "\r\n"+ + ""+ + "\r\n"+ + "\r\n" + + "\r\n" + + "
\r\n" + + "
\r\n", + domain , user); + + return response; + } + + private Hashtable HandleConfigSofia(string Context, string Realm, Hashtable request) + { + m_log.Info("[FreeSwitchDirectory] HandleConfigSofia called"); + + // TODO the password we return needs to match that sent in the request, this is hard coded for now + string domain = (string) request["domain"]; + + Hashtable response = new Hashtable(); + response["content_type"] = "text/xml"; + response["keepalive"] = false; + response["int_response_code"] = 200; + response["str_response_string"] = String.Format( + "\r\n" + + "\r\n" + + "
\r\n" + + "\r\n" + + "\r\n" + + "\r\n" + + "\r\n" + + "\r\n"+ + "\r\n"+ + "\r\n"+ + "\r\n"+ + "\r\n"+ + "\r\n"+ + "\r\n"+ + "\r\n"+ + "\r\n"+ + "\r\n"+ + "\r\n"+ + "\r\n"+ + "\r\n"+ + "\r\n"+ + "\r\n"+ + "\r\n"+ + "\r\n"+ + "\r\n"+ + "\r\n"+ + "\r\n"+ + "\r\n"+ + ""+ + "\r\n" + + "\r\n"+ + "\r\n"+ + "\r\n"+ + "\r\n" + + "
\r\n" + + "
\r\n", + domain, Context); + + return response; + } + + public string GetJsonConfig() + { + OSDMap map = new OSDMap(9); + + map.Add("Realm", m_freeSwitchRealm); + map.Add("SIPProxy", m_freeSwitchSIPProxy); + map.Add("AttemptUseSTUN", m_freeSwitchAttemptUseSTUN); + map.Add("EchoServer", m_freeSwitchEchoServer); + map.Add("EchoPort", m_freeSwitchEchoPort); + map.Add("DefaultWellKnownIP", m_freeSwitchDefaultWellKnownIP); + map.Add("DefaultTimeout", m_freeSwitchDefaultTimeout); + map.Add("Context", m_freeSwitchContext); + map.Add("APIPrefix", m_freeSwitchAPIPrefix); + + return OSDParser.SerializeJsonString(map); + } } } diff --git a/OpenSim/Services/FreeswitchService/FreeswitchServiceBase.cs b/OpenSim/Services/FreeswitchService/FreeswitchServiceBase.cs index 83fecef847..ebbb1b06ec 100644 --- a/OpenSim/Services/FreeswitchService/FreeswitchServiceBase.cs +++ b/OpenSim/Services/FreeswitchService/FreeswitchServiceBase.cs @@ -31,11 +31,28 @@ using Nini.Config; using OpenSim.Framework; using OpenSim.Services.Interfaces; using OpenSim.Services.Base; +using log4net; namespace OpenSim.Services.FreeswitchService { public class FreeswitchServiceBase : ServiceBase { + private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); + + protected string m_freeSwitchRealm; + protected string m_freeSwitchSIPProxy; + protected bool m_freeSwitchAttemptUseSTUN = false; + protected string m_freeSwitchEchoServer; + protected int m_freeSwitchEchoPort = 50505; + protected string m_freeSwitchDefaultWellKnownIP; + protected int m_freeSwitchDefaultTimeout = 5000; + protected string m_freeSwitchContext = "default"; + protected string m_freeSwitchServerUser = "freeswitch"; + protected string m_freeSwitchServerPass = "password"; + protected readonly string m_freeSwitchAPIPrefix = "/fsapi"; + + protected bool m_Enabled = false; + public FreeswitchServiceBase(IConfigSource config) : base(config) { // @@ -44,7 +61,24 @@ namespace OpenSim.Services.FreeswitchService IConfig freeswitchConfig = config.Configs["FreeswitchService"]; if (freeswitchConfig != null) { - // Read config here !! + m_freeSwitchDefaultWellKnownIP = freeswitchConfig.GetString("ServerAddress", String.Empty); + if (m_freeSwitchDefaultWellKnownIP == String.Empty) + { + m_log.Error("[FREESWITCH]: No FreeswitchServerAddress given, can't continue"); + return; + } + + m_freeSwitchRealm = freeswitchConfig.GetString("Realm", m_freeSwitchDefaultWellKnownIP); + m_freeSwitchSIPProxy = freeswitchConfig.GetString("SIPProxy", m_freeSwitchDefaultWellKnownIP + ":5060"); + m_freeSwitchEchoServer = freeswitchConfig.GetString("EchoServer", m_freeSwitchDefaultWellKnownIP); + m_freeSwitchEchoPort = freeswitchConfig.GetInt("EchoPort", m_freeSwitchEchoPort); + m_freeSwitchAttemptUseSTUN = freeswitchConfig.GetBoolean("AttemptSTUN", false); // This may not work + m_freeSwitchDefaultTimeout = freeswitchConfig.GetInt("DefaultTimeout", m_freeSwitchDefaultTimeout); + m_freeSwitchContext = freeswitchConfig.GetString("Context", m_freeSwitchContext); + m_freeSwitchServerUser = freeswitchConfig.GetString("UserName", m_freeSwitchServerUser); + m_freeSwitchServerPass = freeswitchConfig.GetString("Password", m_freeSwitchServerPass); + + m_Enabled = true; } } } diff --git a/OpenSim/Services/GridService/GridService.cs b/OpenSim/Services/GridService/GridService.cs index 46d72dc458..e7988d6e93 100644 --- a/OpenSim/Services/GridService/GridService.cs +++ b/OpenSim/Services/GridService/GridService.cs @@ -50,7 +50,7 @@ namespace OpenSim.Services.GridService private bool m_DeleteOnUnregister = true; private static GridService m_RootInstance = null; protected IConfigSource m_config; - protected HypergridLinker m_HypergridLinker; + protected static HypergridLinker m_HypergridLinker; protected IAuthenticationService m_AuthenticationService = null; protected bool m_AllowDuplicateNames = false; @@ -124,7 +124,7 @@ namespace OpenSim.Services.GridService { // Regions reserved for the null key cannot be taken. if ((string)region.Data["PrincipalID"] == UUID.Zero.ToString()) - return "Region location us reserved"; + return "Region location is reserved"; // Treat it as an auth request // @@ -210,6 +210,7 @@ namespace OpenSim.Services.GridService { int newFlags = 0; string regionName = rdata.RegionName.Trim().Replace(' ', '_'); + newFlags = ParseFlags(newFlags, gridConfig.GetString("DefaultRegionFlags", String.Empty)); newFlags = ParseFlags(newFlags, gridConfig.GetString("Region_" + regionName, String.Empty)); newFlags = ParseFlags(newFlags, gridConfig.GetString("Region_" + rdata.RegionID.ToString(), String.Empty)); rdata.Data["flags"] = newFlags.ToString(); @@ -322,7 +323,7 @@ namespace OpenSim.Services.GridService { m_log.DebugFormat("[GRID SERVICE]: GetRegionsByName {0}", name); - List rdatas = m_Database.Get("%" + name + "%", scopeID); + List rdatas = m_Database.Get(name + "%", scopeID); int count = 0; List rinfos = new List(); @@ -425,6 +426,22 @@ namespace OpenSim.Services.GridService return ret; } + public List GetHyperlinks(UUID scopeID) + { + List ret = new List(); + + List regions = m_Database.GetHyperlinks(scopeID); + + foreach (RegionData r in regions) + { + if ((Convert.ToInt32(r.Data["flags"]) & (int)OpenSim.Data.RegionFlags.RegionOnline) != 0) + ret.Add(RegionData2RegionInfo(r)); + } + + m_log.DebugFormat("[GRID SERVICE]: Hyperlinks returned {0} regions", ret.Count); + return ret; + } + public int GetRegionFlags(UUID scopeID, UUID regionID) { RegionData region = m_Database.Get(regionID, scopeID); diff --git a/OpenSim/Services/GridService/HypergridLinker.cs b/OpenSim/Services/GridService/HypergridLinker.cs index ae80a8c354..a67404fe9f 100644 --- a/OpenSim/Services/GridService/HypergridLinker.cs +++ b/OpenSim/Services/GridService/HypergridLinker.cs @@ -27,6 +27,7 @@ using System; using System.Collections.Generic; +using System.Linq; using System.Net; using System.Reflection; using System.Xml; @@ -62,6 +63,7 @@ namespace OpenSim.Services.GridService protected GatekeeperServiceConnector m_GatekeeperConnector; protected UUID m_ScopeID = UUID.Zero; + protected bool m_Check4096 = true; // Hyperlink regions are hyperlinks on the map public readonly Dictionary m_HyperlinkRegions = new Dictionary(); @@ -116,6 +118,8 @@ namespace OpenSim.Services.GridService if (scope != string.Empty) UUID.TryParse(scope, out m_ScopeID); + m_Check4096 = gridConfig.GetBoolean("Check4096", true); + m_GatekeeperConnector = new GatekeeperServiceConnector(m_AssetService); m_log.DebugFormat("[HYPERGRID LINKER]: Loaded all services..."); @@ -150,12 +154,17 @@ namespace OpenSim.Services.GridService // From the command line link-region public GridRegion TryLinkRegionToCoords(UUID scopeID, string mapName, int xloc, int yloc, out string reason) + { + return TryLinkRegionToCoords(scopeID, mapName, xloc, yloc, UUID.Zero, out reason); + } + + public GridRegion TryLinkRegionToCoords(UUID scopeID, string mapName, int xloc, int yloc, UUID ownerID, out string reason) { reason = string.Empty; string host = "127.0.0.1"; string portstr; string regionName = ""; - uint port = 9000; + uint port = 0; string[] parts = mapName.Split(new char[] { ':' }); if (parts.Length >= 1) { @@ -174,21 +183,19 @@ namespace OpenSim.Services.GridService regionName = parts[2]; } - // Sanity check. - //IPAddress ipaddr = null; - try - { - //ipaddr = Util.GetHostFromDNS(host); - Util.GetHostFromDNS(host); - } - catch - { - reason = "Malformed hostname"; - return null; - } + //// Sanity check. + //try + //{ + // Util.GetHostFromDNS(host); + //} + //catch + //{ + // reason = "Malformed hostname"; + // return null; + //} GridRegion regInfo; - bool success = TryCreateLink(scopeID, xloc, yloc, regionName, port, host, out regInfo, out reason); + bool success = TryCreateLink(scopeID, xloc, yloc, regionName, port, host, ownerID, out regInfo, out reason); if (success) { regInfo.RegionName = mapName; @@ -201,7 +208,8 @@ namespace OpenSim.Services.GridService // From the command line and the 2 above public bool TryCreateLink(UUID scopeID, int xloc, int yloc, - string externalRegionName, uint externalPort, string externalHostName, out GridRegion regInfo, out string reason) + string externalRegionName, uint externalPort, string externalHostName, UUID ownerID, + out GridRegion regInfo, out string reason) { m_log.DebugFormat("[HYPERGRID LINKER]: Link to {0}:{1}:{2}, in {3}-{4}", externalHostName, externalPort, externalRegionName, xloc, yloc); @@ -213,6 +221,21 @@ namespace OpenSim.Services.GridService regInfo.RegionLocX = xloc; regInfo.RegionLocY = yloc; regInfo.ScopeID = scopeID; + regInfo.EstateOwner = ownerID; + + // Big HACK for Simian Grid !!! + // We need to clean up all URLs used in OpenSim !!! + if (externalHostName.Contains("/")) + regInfo.ServerURI = externalHostName; + + // Check for free coordinates + GridRegion region = m_GridService.GetRegionByPosition(regInfo.ScopeID, regInfo.RegionLocX, regInfo.RegionLocY); + if (region != null) + { + m_log.WarnFormat("[HYPERGRID LINKER]: Coordinates {0}-{1} are already occupied by region {2} with uuid {3}", regInfo.RegionLocX, regInfo.RegionLocY, region.RegionName, region.RegionID); + reason = "Coordinates are already in use"; + return false; + } try { @@ -235,30 +258,17 @@ namespace OpenSim.Services.GridService if (regionID != UUID.Zero) { - GridRegion r = m_GridService.GetRegionByUUID(scopeID, regionID); - if (r != null) + region = m_GridService.GetRegionByUUID(scopeID, regionID); + if (region != null) { - m_log.DebugFormat("[HYPERGRID LINKER]: Region already exists in coordinates {0} {1}", r.RegionLocX / Constants.RegionSize, r.RegionLocY / Constants.RegionSize); - regInfo = r; + m_log.DebugFormat("[HYPERGRID LINKER]: Region already exists in coordinates {0} {1}", region.RegionLocX / Constants.RegionSize, region.RegionLocY / Constants.RegionSize); + regInfo = region; return true; } regInfo.RegionID = regionID; - Uri uri = null; - try - { - uri = new Uri(externalName); - regInfo.ExternalHostName = uri.Host; - regInfo.HttpPort = (uint)uri.Port; - } - catch - { - m_log.WarnFormat("[HYPERGRID LINKER]: Remote Gatekeeper at {0} provided malformed ExternalName {1}", regInfo.ExternalHostName, externalName); - } - string name = regInfo.RegionName; - regInfo.RegionName = regInfo.ExternalHostName + ":" + regInfo.HttpPort; - if (name != string.Empty) - regInfo.RegionName += ":" + name; + if (regInfo.RegionName == string.Empty) + regInfo.RegionName = regInfo.ExternalHostName; // Try get the map image //regInfo.TerrainImage = m_GatekeeperConnector.GetMapImage(regionID, imageURL); @@ -277,7 +287,7 @@ namespace OpenSim.Services.GridService } uint x, y; - if (!Check4096(handle, out x, out y)) + if (m_Check4096 && !Check4096(handle, out x, out y)) { RemoveHyperlinkRegion(regInfo.RegionID); reason = "Region is too far (" + x + ", " + y + ")"; @@ -332,25 +342,46 @@ namespace OpenSim.Services.GridService /// public bool Check4096(ulong realHandle, out uint x, out uint y) { - GridRegion defRegion = DefaultRegion; - uint ux = 0, uy = 0; Utils.LongToUInts(realHandle, out ux, out uy); x = ux / Constants.RegionSize; y = uy / Constants.RegionSize; - if ((Math.Abs((int)defRegion.RegionLocX - ux) >= 4096 * Constants.RegionSize) || - (Math.Abs((int)defRegion.RegionLocY - uy) >= 4096 * Constants.RegionSize)) + const uint limit = (4096 - 1) * Constants.RegionSize; + uint xmin = ux - limit; + uint xmax = ux + limit; + uint ymin = uy - limit; + uint ymax = uy + limit; + // World map boundary checks + if (xmin < 0 || xmin > ux) + xmin = 0; + if (xmax > int.MaxValue || xmax < ux) + xmax = int.MaxValue; + if (ymin < 0 || ymin > uy) + ymin = 0; + if (ymax > int.MaxValue || ymax < uy) + ymax = int.MaxValue; + + // Check for any regions that are within the possible teleport range to the linked region + List regions = m_GridService.GetRegionRange(m_ScopeID, (int)xmin, (int)xmax, (int)ymin, (int)ymax); + if (regions.Count == 0) { return false; } + else + { + // Check for regions which are not linked regions + List hyperlinks = m_GridService.GetHyperlinks(m_ScopeID); + IEnumerable availableRegions = regions.Except(hyperlinks); + if (availableRegions.Count() == 0) + return false; + } + return true; } private void AddHyperlinkRegion(GridRegion regionInfo, ulong regionHandle) { - //m_HyperlinkRegions[regionInfo.RegionID] = regionInfo; - //m_HyperlinkHandles[regionInfo.RegionID] = regionHandle; RegionData rdata = m_GridService.RegionInfo2RegionData(regionInfo); int flags = (int)OpenSim.Data.RegionFlags.Hyperlink + (int)OpenSim.Data.RegionFlags.NoDirectLogin + (int)OpenSim.Data.RegionFlags.RegionOnline; @@ -362,12 +393,6 @@ namespace OpenSim.Services.GridService private void RemoveHyperlinkRegion(UUID regionID) { - //// Try the hyperlink collection - //if (m_HyperlinkRegions.ContainsKey(regionID)) - //{ - // m_HyperlinkRegions.Remove(regionID); - // m_HyperlinkHandles.Remove(regionID); - //} m_Database.Delete(regionID); } @@ -378,32 +403,31 @@ namespace OpenSim.Services.GridService public void HandleShow(string module, string[] cmd) { - MainConsole.Instance.Output("Not Implemented Yet"); - //if (cmd.Length != 2) - //{ - // MainConsole.Instance.Output("Syntax: show hyperlinks"); - // return; - //} - //List regions = new List(m_HypergridService.m_HyperlinkRegions.Values); - //if (regions == null || regions.Count < 1) - //{ - // MainConsole.Instance.Output("No hyperlinks"); - // return; - //} + if (cmd.Length != 2) + { + MainConsole.Instance.Output("Syntax: show hyperlinks"); + return; + } + List regions = m_Database.GetHyperlinks(UUID.Zero); + if (regions == null || regions.Count < 1) + { + MainConsole.Instance.Output("No hyperlinks"); + return; + } - //MainConsole.Instance.Output("Region Name Region UUID"); - //MainConsole.Instance.Output("Location URI"); - //MainConsole.Instance.Output("Owner ID "); - //MainConsole.Instance.Output("-------------------------------------------------------------------------------"); - //foreach (GridRegion r in regions) - //{ - // MainConsole.Instance.Output(String.Format("{0,-20} {1}\n{2,-20} {3}\n{4,-39} \n\n", - // r.RegionName, r.RegionID, - // String.Format("{0},{1}", r.RegionLocX, r.RegionLocY), "http://" + r.ExternalHostName + ":" + r.HttpPort.ToString(), - // r.EstateOwner.ToString())); - //} - //return; + MainConsole.Instance.Output("Region Name Region UUID"); + MainConsole.Instance.Output("Location URI"); + MainConsole.Instance.Output("-------------------------------------------------------------------------------"); + foreach (RegionData r in regions) + { + MainConsole.Instance.Output(String.Format("{0,-39} {1}\n{2,-39} {3}\n", + r.RegionName, r.RegionID, + String.Format("{0},{1} ({2},{3})", r.posX, r.posY, r.posX / 256, r.posY / 256), + "http://" + r.Data["serverIP"].ToString() + ":" + r.Data["serverHttpPort"].ToString())); + } + return; } + public void RunCommand(string module, string[] cmdparams) { List args = new List(cmdparams); @@ -513,7 +537,7 @@ namespace OpenSim.Services.GridService xloc = xloc * (int)Constants.RegionSize; yloc = yloc * (int)Constants.RegionSize; string reason = string.Empty; - if (TryCreateLink(UUID.Zero, xloc, yloc, "", externalPort, externalHostName, out regInfo, out reason)) + if (TryCreateLink(UUID.Zero, xloc, yloc, "", externalPort, externalHostName, UUID.Zero, out regInfo, out reason)) { if (cmdparams.Length >= 5) { @@ -615,8 +639,7 @@ namespace OpenSim.Services.GridService xloc = xloc * (int)Constants.RegionSize; yloc = yloc * (int)Constants.RegionSize; string reason = string.Empty; - if (TryCreateLink(UUID.Zero, xloc, yloc, "", externalPort, - externalHostName, out regInfo, out reason)) + if (TryCreateLink(UUID.Zero, xloc, yloc, "", externalPort, externalHostName, UUID.Zero, out regInfo, out reason)) { regInfo.RegionName = config.GetString("localName", ""); } diff --git a/OpenSim/Services/HypergridService/GatekeeperService.cs b/OpenSim/Services/HypergridService/GatekeeperService.cs index c5cfe75fdf..3f5c4f1400 100644 --- a/OpenSim/Services/HypergridService/GatekeeperService.cs +++ b/OpenSim/Services/HypergridService/GatekeeperService.cs @@ -49,61 +49,64 @@ namespace OpenSim.Services.HypergridService LogManager.GetLogger( MethodBase.GetCurrentMethod().DeclaringType); - IGridService m_GridService; - IPresenceService m_PresenceService; - IUserAccountService m_UserAccountService; - IUserAgentService m_UserAgentService; - ISimulationService m_SimulationService; + private static bool m_Initialized = false; - string m_AuthDll; + private static IGridService m_GridService; + private static IPresenceService m_PresenceService; + private static IUserAccountService m_UserAccountService; + private static IUserAgentService m_UserAgentService; + private static ISimulationService m_SimulationService; - UUID m_ScopeID; - bool m_AllowTeleportsToAnyRegion; - string m_ExternalName; - GridRegion m_DefaultGatewayRegion; + private static UUID m_ScopeID; + private static bool m_AllowTeleportsToAnyRegion; + private static string m_ExternalName; + private static GridRegion m_DefaultGatewayRegion; public GatekeeperService(IConfigSource config, ISimulationService simService) { - IConfig serverConfig = config.Configs["GatekeeperService"]; - if (serverConfig == null) - throw new Exception(String.Format("No section GatekeeperService in config file")); + if (!m_Initialized) + { + m_Initialized = true; - string accountService = serverConfig.GetString("UserAccountService", String.Empty); - string homeUsersService = serverConfig.GetString("HomeUsersSecurityService", string.Empty); - string gridService = serverConfig.GetString("GridService", String.Empty); - string presenceService = serverConfig.GetString("PresenceService", String.Empty); - string simulationService = serverConfig.GetString("SimulationService", String.Empty); + IConfig serverConfig = config.Configs["GatekeeperService"]; + if (serverConfig == null) + throw new Exception(String.Format("No section GatekeeperService in config file")); - //m_AuthDll = serverConfig.GetString("AuthenticationService", String.Empty); + string accountService = serverConfig.GetString("UserAccountService", String.Empty); + string homeUsersService = serverConfig.GetString("UserAgentService", string.Empty); + string gridService = serverConfig.GetString("GridService", String.Empty); + string presenceService = serverConfig.GetString("PresenceService", String.Empty); + string simulationService = serverConfig.GetString("SimulationService", String.Empty); - // These 3 are mandatory, the others aren't - if (gridService == string.Empty || presenceService == string.Empty || m_AuthDll == string.Empty) - throw new Exception("Incomplete specifications, Gatekeeper Service cannot function."); - - string scope = serverConfig.GetString("ScopeID", UUID.Zero.ToString()); - UUID.TryParse(scope, out m_ScopeID); - //m_WelcomeMessage = serverConfig.GetString("WelcomeMessage", "Welcome to OpenSim!"); - m_AllowTeleportsToAnyRegion = serverConfig.GetBoolean("AllowTeleportsToAnyRegion", true); - m_ExternalName = serverConfig.GetString("ExternalName", string.Empty); + // These 3 are mandatory, the others aren't + if (gridService == string.Empty || presenceService == string.Empty) + throw new Exception("Incomplete specifications, Gatekeeper Service cannot function."); + + string scope = serverConfig.GetString("ScopeID", UUID.Zero.ToString()); + UUID.TryParse(scope, out m_ScopeID); + //m_WelcomeMessage = serverConfig.GetString("WelcomeMessage", "Welcome to OpenSim!"); + m_AllowTeleportsToAnyRegion = serverConfig.GetBoolean("AllowTeleportsToAnyRegion", true); + m_ExternalName = serverConfig.GetString("ExternalName", string.Empty); - Object[] args = new Object[] { config }; - m_GridService = ServerUtils.LoadPlugin(gridService, args); - m_PresenceService = ServerUtils.LoadPlugin(presenceService, args); + Object[] args = new Object[] { config }; + m_GridService = ServerUtils.LoadPlugin(gridService, args); + m_PresenceService = ServerUtils.LoadPlugin(presenceService, args); - if (accountService != string.Empty) - m_UserAccountService = ServerUtils.LoadPlugin(accountService, args); - if (homeUsersService != string.Empty) - m_UserAgentService = ServerUtils.LoadPlugin(homeUsersService, args); + if (accountService != string.Empty) + m_UserAccountService = ServerUtils.LoadPlugin(accountService, args); + if (homeUsersService != string.Empty) + m_UserAgentService = ServerUtils.LoadPlugin(homeUsersService, args); - if (simService != null) - m_SimulationService = simService; - else if (simulationService != string.Empty) - m_SimulationService = ServerUtils.LoadPlugin(simulationService, args); + if (simService != null) + m_SimulationService = simService; + else if (simulationService != string.Empty) + m_SimulationService = ServerUtils.LoadPlugin(simulationService, args); - if (m_GridService == null || m_PresenceService == null || m_SimulationService == null) - throw new Exception("Unable to load a required plugin, Gatekeeper Service cannot function."); + if (m_GridService == null || m_PresenceService == null || m_SimulationService == null) + throw new Exception("Unable to load a required plugin, Gatekeeper Service cannot function."); - m_log.Debug("[GATEKEEPER SERVICE]: Starting..."); + m_log.Debug("[GATEKEEPER SERVICE]: Starting..."); + } } public GatekeeperService(IConfigSource config) @@ -222,17 +225,23 @@ namespace OpenSim.Services.HypergridService // May want to authorize + bool isFirstLogin = false; // - // Login the presence + // Login the presence, if it's not there yet (by the login service) // - if (!m_PresenceService.LoginAgent(aCircuit.AgentID.ToString(), aCircuit.SessionID, aCircuit.SecureSessionID)) - { - reason = "Unable to login presence"; - m_log.InfoFormat("[GATEKEEPER SERVICE]: Presence login failed for foreign agent {0} {1}. Refusing service.", - aCircuit.firstname, aCircuit.lastname); - return false; - } - m_log.DebugFormat("[GATEKEEPER SERVICE]: Login presence ok"); + PresenceInfo presence = m_PresenceService.GetAgent(aCircuit.SessionID); + if (presence != null) // it has been placed there by the login service + isFirstLogin = true; + + else + if (!m_PresenceService.LoginAgent(aCircuit.AgentID.ToString(), aCircuit.SessionID, aCircuit.SecureSessionID)) + { + reason = "Unable to login presence"; + m_log.InfoFormat("[GATEKEEPER SERVICE]: Presence login failed for foreign agent {0} {1}. Refusing service.", + aCircuit.firstname, aCircuit.lastname); + return false; + } + m_log.DebugFormat("[GATEKEEPER SERVICE]: Login presence ok"); // // Get the region @@ -256,13 +265,24 @@ namespace OpenSim.Services.HypergridService if (account == null && !aCircuit.lastname.StartsWith("@")) { aCircuit.firstname = aCircuit.firstname + "." + aCircuit.lastname; - aCircuit.lastname = "@" + aCircuit.ServiceURLs["HomeURI"].ToString(); + try + { + Uri uri = new Uri(aCircuit.ServiceURLs["HomeURI"].ToString()); + aCircuit.lastname = "@" + uri.Host; // + ":" + uri.Port; + } + catch + { + m_log.WarnFormat("[GATEKEEPER SERVICE]: Malformed HomeURI (this should never happen): {0}", aCircuit.ServiceURLs["HomeURI"]); + aCircuit.lastname = "@" + aCircuit.ServiceURLs["HomeURI"].ToString(); + } } // // Finally launch the agent at the destination // - return m_SimulationService.CreateAgent(destination, aCircuit, (uint)Constants.TeleportFlags.ViaLogin, out reason); + Constants.TeleportFlags loginFlag = isFirstLogin ? Constants.TeleportFlags.ViaLogin : Constants.TeleportFlags.ViaHGLogin; + m_log.DebugFormat("[GATEKEEPER SERVICE]: launching agent {0}", loginFlag); + return m_SimulationService.CreateAgent(destination, aCircuit, (uint)loginFlag, out reason); } protected bool Authenticate(AgentCircuitData aCircuit) @@ -280,18 +300,23 @@ namespace OpenSim.Services.HypergridService return false; } - Object[] args = new Object[] { userURL }; - IUserAgentService userAgentService = new UserAgentServiceConnector(userURL); //ServerUtils.LoadPlugin(m_AuthDll, args); - if (userAgentService != null) + if (userURL == m_ExternalName) + return m_UserAgentService.VerifyAgent(aCircuit.SessionID, aCircuit.ServiceSessionID); + else { - try + Object[] args = new Object[] { userURL }; + IUserAgentService userAgentService = new UserAgentServiceConnector(userURL); + if (userAgentService != null) { - return userAgentService.VerifyAgent(aCircuit.SessionID, aCircuit.ServiceSessionID); - } - catch - { - m_log.DebugFormat("[GATEKEEPER SERVICE]: Unable to contact authentication service at {0}", userURL); - return false; + try + { + return userAgentService.VerifyAgent(aCircuit.SessionID, aCircuit.ServiceSessionID); + } + catch + { + m_log.DebugFormat("[GATEKEEPER SERVICE]: Unable to contact authentication service at {0}", userURL); + return false; + } } } diff --git a/OpenSim/Services/HypergridService/UserAgentService.cs b/OpenSim/Services/HypergridService/UserAgentService.cs index 2f1fed40db..eb6433cc6f 100644 --- a/OpenSim/Services/HypergridService/UserAgentService.cs +++ b/OpenSim/Services/HypergridService/UserAgentService.cs @@ -62,11 +62,18 @@ namespace OpenSim.Services.HypergridService protected static IGridUserService m_GridUserService; protected static IGridService m_GridService; protected static GatekeeperServiceConnector m_GatekeeperConnector; + protected static IGatekeeperService m_GatekeeperService; + + protected static string m_GridName; + + protected static bool m_BypassClientVerification; public UserAgentService(IConfigSource config) { if (!m_Initialized) { + m_Initialized = true; + m_log.DebugFormat("[HOME USERS SECURITY]: Starting..."); IConfig serverConfig = config.Configs["UserAgentService"]; @@ -75,16 +82,25 @@ namespace OpenSim.Services.HypergridService string gridService = serverConfig.GetString("GridService", String.Empty); string gridUserService = serverConfig.GetString("GridUserService", String.Empty); + string gatekeeperService = serverConfig.GetString("GatekeeperService", String.Empty); - if (gridService == string.Empty || gridUserService == string.Empty) + m_BypassClientVerification = serverConfig.GetBoolean("BypassClientVerification", false); + + if (gridService == string.Empty || gridUserService == string.Empty || gatekeeperService == string.Empty) throw new Exception(String.Format("Incomplete specifications, UserAgent Service cannot function.")); Object[] args = new Object[] { config }; m_GridService = ServerUtils.LoadPlugin(gridService, args); m_GridUserService = ServerUtils.LoadPlugin(gridUserService, args); m_GatekeeperConnector = new GatekeeperServiceConnector(); + m_GatekeeperService = ServerUtils.LoadPlugin(gatekeeperService, args); - m_Initialized = true; + m_GridName = serverConfig.GetString("ExternalName", string.Empty); + if (m_GridName == string.Empty) + { + serverConfig = config.Configs["GatekeeperService"]; + m_GridName = serverConfig.GetString("ExternalName", string.Empty); + } } } @@ -115,10 +131,11 @@ namespace OpenSim.Services.HypergridService return home; } - public bool LoginAgentToGrid(AgentCircuitData agentCircuit, GridRegion gatekeeper, GridRegion finalDestination, out string reason) + public bool LoginAgentToGrid(AgentCircuitData agentCircuit, GridRegion gatekeeper, GridRegion finalDestination, IPEndPoint clientIP, out string reason) { - m_log.DebugFormat("[USER AGENT SERVICE]: Request to login user {0} {1} to grid {2}", - agentCircuit.firstname, agentCircuit.lastname, gatekeeper.ExternalHostName +":"+ gatekeeper.HttpPort); + m_log.DebugFormat("[USER AGENT SERVICE]: Request to login user {0} {1} (@{2}) to grid {3}", + agentCircuit.firstname, agentCircuit.lastname, ((clientIP == null) ? "stored IP" : clientIP.Address.ToString()), + gatekeeper.ExternalHostName +":"+ gatekeeper.HttpPort); // Take the IP address + port of the gatekeeper (reg) plus the info of finalDestination GridRegion region = new GridRegion(gatekeeper); @@ -131,7 +148,13 @@ namespace OpenSim.Services.HypergridService agentCircuit.ServiceSessionID = "http://" + region.ExternalHostName + ":" + region.HttpPort + ";" + UUID.Random(); TravelingAgentInfo old = UpdateTravelInfo(agentCircuit, region); - bool success = m_GatekeeperConnector.CreateAgent(region, agentCircuit, (uint)Constants.TeleportFlags.ViaLogin, out reason); + bool success = false; + string myExternalIP = string.Empty; + string gridName = "http://" + gatekeeper.ExternalHostName + ":" + gatekeeper.HttpPort; + if (m_GridName == gridName) + success = m_GatekeeperService.LoginAgent(agentCircuit, finalDestination, out reason); + else + success = m_GatekeeperConnector.CreateAgent(region, agentCircuit, (uint)Constants.TeleportFlags.ViaLogin, out myExternalIP, out reason); if (!success) { @@ -145,15 +168,26 @@ namespace OpenSim.Services.HypergridService return false; } + m_log.DebugFormat("[USER AGENT SERVICE]: Gatekeeper sees me as {0}", myExternalIP); + // else set the IP addresses associated with this client + if (clientIP != null) + m_TravelingAgents[agentCircuit.SessionID].ClientIPAddress = clientIP.Address.ToString(); + m_TravelingAgents[agentCircuit.SessionID].MyIpAddress = myExternalIP; return true; } - public void SetClientToken(UUID sessionID, string token) + public bool LoginAgentToGrid(AgentCircuitData agentCircuit, GridRegion gatekeeper, GridRegion finalDestination, out string reason) + { + reason = string.Empty; + return LoginAgentToGrid(agentCircuit, gatekeeper, finalDestination, null, out reason); + } + + private void SetClientIP(UUID sessionID, string ip) { if (m_TravelingAgents.ContainsKey(sessionID)) { - m_log.DebugFormat("[USER AGENT SERVICE]: Setting token {0} for session {1}", token, sessionID); - m_TravelingAgents[sessionID].ClientToken = token; + m_log.DebugFormat("[USER AGENT SERVICE]: Setting IP {0} for session {1}", ip, sessionID); + m_TravelingAgents[sessionID].ClientIPAddress = ip; } } @@ -165,16 +199,21 @@ namespace OpenSim.Services.HypergridService { if (m_TravelingAgents.ContainsKey(agentCircuit.SessionID)) { + // Very important! Override whatever this agent comes with. + // UserAgentService always sets the IP for every new agent + // with the original IP address. + agentCircuit.IPAddress = m_TravelingAgents[agentCircuit.SessionID].ClientIPAddress; + old = m_TravelingAgents[agentCircuit.SessionID]; } m_TravelingAgents[agentCircuit.SessionID] = travel; } travel.UserID = agentCircuit.AgentID; - travel.GridExternalName = region.ExternalHostName + ":" + region.HttpPort; + travel.GridExternalName = "http://" + region.ExternalHostName + ":" + region.HttpPort; travel.ServiceToken = agentCircuit.ServiceSessionID; if (old != null) - travel.ClientToken = old.ClientToken; + travel.ClientIPAddress = old.ClientIPAddress; return old; } @@ -197,7 +236,7 @@ namespace OpenSim.Services.HypergridService GridUserInfo guinfo = m_GridUserService.GetGridUserInfo(userID.ToString()); if (guinfo != null) - m_GridUserService.LoggedOut(userID.ToString(), guinfo.LastRegionID, guinfo.LastPosition, guinfo.LastLookAt); + m_GridUserService.LoggedOut(userID.ToString(), sessionID, guinfo.LastRegionID, guinfo.LastPosition, guinfo.LastLookAt); } // We need to prevent foreign users with the same UUID as a local user @@ -207,19 +246,26 @@ namespace OpenSim.Services.HypergridService return false; TravelingAgentInfo travel = m_TravelingAgents[sessionID]; + return travel.GridExternalName == thisGridExternalName; } - public bool VerifyClient(UUID sessionID, string token) + public bool VerifyClient(UUID sessionID, string reportedIP) { - m_log.DebugFormat("[USER AGENT SERVICE]: Verifying Client session {0} with token {1}", sessionID, token); - //return true; + if (m_BypassClientVerification) + return true; - // Commenting this for now until I understand better what part of a sender's - // info stays unchanged throughout a session + m_log.DebugFormat("[USER AGENT SERVICE]: Verifying Client session {0} with reported IP {1}.", + sessionID, reportedIP); if (m_TravelingAgents.ContainsKey(sessionID)) - return m_TravelingAgents[sessionID].ClientToken == token; + { + m_log.DebugFormat("[USER AGENT SERVICE]: Comparing with login IP {0} and MyIP {1}", + m_TravelingAgents[sessionID].ClientIPAddress, m_TravelingAgents[sessionID].MyIpAddress); + + return m_TravelingAgents[sessionID].ClientIPAddress == reportedIP || + m_TravelingAgents[sessionID].MyIpAddress == reportedIP; // NATed + } return false; } @@ -244,7 +290,8 @@ namespace OpenSim.Services.HypergridService public UUID UserID; public string GridExternalName = string.Empty; public string ServiceToken = string.Empty; - public string ClientToken = string.Empty; + public string ClientIPAddress = string.Empty; // as seen from this user agent service + public string MyIpAddress = string.Empty; // the user agent service's external IP, as seen from the next gatekeeper } } diff --git a/OpenSim/Services/Interfaces/IAvatarService.cs b/OpenSim/Services/Interfaces/IAvatarService.cs index de3bcf9679..d7af562b62 100644 --- a/OpenSim/Services/Interfaces/IAvatarService.cs +++ b/OpenSim/Services/Interfaces/IAvatarService.cs @@ -37,6 +37,21 @@ namespace OpenSim.Services.Interfaces { public interface IAvatarService { + /// + /// Called by the login service + /// + /// + /// + AvatarAppearance GetAppearance(UUID userID); + + /// + /// Called by everyone who can change the avatar data (so, regions) + /// + /// + /// + /// + bool SetAppearance(UUID userID, AvatarAppearance appearance); + /// /// Called by the login service /// @@ -134,106 +149,194 @@ namespace OpenSim.Services.Interfaces Data["Serial"] = appearance.Serial.ToString(); // Wearables Data["AvatarHeight"] = appearance.AvatarHeight.ToString(); - Data["BodyItem"] = appearance.BodyItem.ToString(); - Data["EyesItem"] = appearance.EyesItem.ToString(); - Data["GlovesItem"] = appearance.GlovesItem.ToString(); - Data["HairItem"] = appearance.HairItem.ToString(); - Data["JacketItem"] = appearance.JacketItem.ToString(); - Data["PantsItem"] = appearance.PantsItem.ToString(); - Data["ShirtItem"] = appearance.ShirtItem.ToString(); - Data["ShoesItem"] = appearance.ShoesItem.ToString(); - Data["SkinItem"] = appearance.SkinItem.ToString(); - Data["SkirtItem"] = appearance.SkirtItem.ToString(); - Data["SocksItem"] = appearance.SocksItem.ToString(); - Data["UnderPantsItem"] = appearance.UnderPantsItem.ToString(); - Data["UnderShirtItem"] = appearance.UnderShirtItem.ToString(); - Data["BodyAsset"] = appearance.BodyAsset.ToString(); - Data["EyesAsset"] = appearance.EyesAsset.ToString(); - Data["GlovesAsset"] = appearance.GlovesAsset.ToString(); - Data["HairAsset"] = appearance.HairAsset.ToString(); - Data["JacketAsset"] = appearance.JacketAsset.ToString(); - Data["PantsAsset"] = appearance.PantsAsset.ToString(); - Data["ShirtAsset"] = appearance.ShirtAsset.ToString(); - Data["ShoesAsset"] = appearance.ShoesAsset.ToString(); - Data["SkinAsset"] = appearance.SkinAsset.ToString(); - Data["SkirtAsset"] = appearance.SkirtAsset.ToString(); - Data["SocksAsset"] = appearance.SocksAsset.ToString(); - Data["UnderPantsAsset"] = appearance.UnderPantsAsset.ToString(); - Data["UnderShirtAsset"] = appearance.UnderShirtAsset.ToString(); + for (int i = 0 ; i < AvatarWearable.MAX_WEARABLES ; i++) + { + for (int j = 0 ; j < appearance.Wearables[i].Count ; j++) + { + string fieldName = String.Format("Wearable {0}:{1}", i, j); + Data[fieldName] = String.Format("{0}:{1}", + appearance.Wearables[i][j].ItemID.ToString(), + appearance.Wearables[i][j].AssetID.ToString()); + } + } + + // Visual Params + string[] vps = new string[AvatarAppearance.VISUALPARAM_COUNT]; + byte[] binary = appearance.VisualParams; + + for (int i = 0 ; i < AvatarAppearance.VISUALPARAM_COUNT ; i++) + { + vps[i] = binary[i].ToString(); + } + + Data["VisualParams"] = String.Join(",", vps); // Attachments - Hashtable attachs = appearance.GetAttachments(); - if (attachs != null) - foreach (DictionaryEntry dentry in attachs) - { - if (dentry.Value != null) - { - Hashtable tab = (Hashtable)dentry.Value; - if (tab.ContainsKey("item") && tab["item"] != null) - Data["_ap_" + dentry.Key] = tab["item"].ToString(); - } - } + List attachments = appearance.GetAttachments(); + foreach (AvatarAttachment attach in attachments) + { + Data["_ap_" + attach.AttachPoint] = attach.ItemID.ToString(); + } } public AvatarAppearance ToAvatarAppearance(UUID owner) { AvatarAppearance appearance = new AvatarAppearance(owner); + + if (Data.Count == 0) + return appearance; + + appearance.ClearWearables(); try { - appearance.Serial = Int32.Parse(Data["Serial"]); + if (Data.ContainsKey("Serial")) + appearance.Serial = Int32.Parse(Data["Serial"]); - // Wearables - appearance.BodyItem = UUID.Parse(Data["BodyItem"]); - appearance.EyesItem = UUID.Parse(Data["EyesItem"]); - appearance.GlovesItem = UUID.Parse(Data["GlovesItem"]); - appearance.HairItem = UUID.Parse(Data["HairItem"]); - appearance.JacketItem = UUID.Parse(Data["JacketItem"]); - appearance.PantsItem = UUID.Parse(Data["PantsItem"]); - appearance.ShirtItem = UUID.Parse(Data["ShirtItem"]); - appearance.ShoesItem = UUID.Parse(Data["ShoesItem"]); - appearance.SkinItem = UUID.Parse(Data["SkinItem"]); - appearance.SkirtItem = UUID.Parse(Data["SkirtItem"]); - appearance.SocksItem = UUID.Parse(Data["SocksItem"]); - appearance.UnderPantsItem = UUID.Parse(Data["UnderPantsItem"]); - appearance.UnderShirtItem = UUID.Parse(Data["UnderShirtItem"]); + if (Data.ContainsKey("AvatarHeight")) + appearance.AvatarHeight = float.Parse(Data["AvatarHeight"]); + + // Legacy Wearables + if (Data.ContainsKey("BodyItem")) + appearance.Wearables[AvatarWearable.BODY].Wear( + UUID.Parse(Data["BodyItem"]), + UUID.Parse(Data["BodyAsset"])); + + if (Data.ContainsKey("SkinItem")) + appearance.Wearables[AvatarWearable.SKIN].Wear( + UUID.Parse(Data["SkinItem"]), + UUID.Parse(Data["SkinAsset"])); + + if (Data.ContainsKey("HairItem")) + appearance.Wearables[AvatarWearable.HAIR].Wear( + UUID.Parse(Data["HairItem"]), + UUID.Parse(Data["HairAsset"])); + + if (Data.ContainsKey("EyesItem")) + appearance.Wearables[AvatarWearable.EYES].Wear( + UUID.Parse(Data["EyesItem"]), + UUID.Parse(Data["EyesAsset"])); + + if (Data.ContainsKey("ShirtItem")) + appearance.Wearables[AvatarWearable.SHIRT].Wear( + UUID.Parse(Data["ShirtItem"]), + UUID.Parse(Data["ShirtAsset"])); + + if (Data.ContainsKey("PantsItem")) + appearance.Wearables[AvatarWearable.PANTS].Wear( + UUID.Parse(Data["PantsItem"]), + UUID.Parse(Data["PantsAsset"])); + + if (Data.ContainsKey("ShoesItem")) + appearance.Wearables[AvatarWearable.SHOES].Wear( + UUID.Parse(Data["ShoesItem"]), + UUID.Parse(Data["ShoesAsset"])); + + if (Data.ContainsKey("SocksItem")) + appearance.Wearables[AvatarWearable.SOCKS].Wear( + UUID.Parse(Data["SocksItem"]), + UUID.Parse(Data["SocksAsset"])); + + if (Data.ContainsKey("JacketItem")) + appearance.Wearables[AvatarWearable.JACKET].Wear( + UUID.Parse(Data["JacketItem"]), + UUID.Parse(Data["JacketAsset"])); + + if (Data.ContainsKey("GlovesItem")) + appearance.Wearables[AvatarWearable.GLOVES].Wear( + UUID.Parse(Data["GlovesItem"]), + UUID.Parse(Data["GlovesAsset"])); + + if (Data.ContainsKey("UnderShirtItem")) + appearance.Wearables[AvatarWearable.UNDERSHIRT].Wear( + UUID.Parse(Data["UnderShirtItem"]), + UUID.Parse(Data["UnderShirtAsset"])); + + if (Data.ContainsKey("UnderPantsItem")) + appearance.Wearables[AvatarWearable.UNDERPANTS].Wear( + UUID.Parse(Data["UnderPantsItem"]), + UUID.Parse(Data["UnderPantsAsset"])); + + if (Data.ContainsKey("SkirtItem")) + appearance.Wearables[AvatarWearable.SKIRT].Wear( + UUID.Parse(Data["SkirtItem"]), + UUID.Parse(Data["SkirtAsset"])); + + + if (Data.ContainsKey("VisualParams")) + { + string[] vps = Data["VisualParams"].Split(new char[] {','}); + byte[] binary = new byte[AvatarAppearance.VISUALPARAM_COUNT]; + + for (int i = 0 ; i < vps.Length && i < binary.Length ; i++) + binary[i] = (byte)Convert.ToInt32(vps[i]); + + appearance.VisualParams = binary; + } + + // New style wearables + foreach (KeyValuePair _kvp in Data) + { + if (_kvp.Key.StartsWith("Wearable ")) + { + string wearIndex = _kvp.Key.Substring(9); + string[] wearIndices = wearIndex.Split(new char[] {':'}); + int index = Convert.ToInt32(wearIndices[0]); + + string[] ids = _kvp.Value.Split(new char[] {':'}); + UUID itemID = new UUID(ids[0]); + UUID assetID = new UUID(ids[1]); + + appearance.Wearables[index].Add(itemID, assetID); + } + } - appearance.BodyAsset = UUID.Parse(Data["BodyAsset"]); - appearance.EyesAsset = UUID.Parse(Data["EyesAsset"]); - appearance.GlovesAsset = UUID.Parse(Data["GlovesAsset"]); - appearance.HairAsset = UUID.Parse(Data["HairAsset"]); - appearance.JacketAsset = UUID.Parse(Data["JacketAsset"]); - appearance.PantsAsset = UUID.Parse(Data["PantsAsset"]); - appearance.ShirtAsset = UUID.Parse(Data["ShirtAsset"]); - appearance.ShoesAsset = UUID.Parse(Data["ShoesAsset"]); - appearance.SkinAsset = UUID.Parse(Data["SkinAsset"]); - appearance.SkirtAsset = UUID.Parse(Data["SkirtAsset"]); - appearance.SocksAsset = UUID.Parse(Data["SocksAsset"]); - appearance.UnderPantsAsset = UUID.Parse(Data["UnderPantsAsset"]); - appearance.UnderShirtAsset = UUID.Parse(Data["UnderShirtAsset"]); // Attachments Dictionary attchs = new Dictionary(); foreach (KeyValuePair _kvp in Data) if (_kvp.Key.StartsWith("_ap_")) attchs[_kvp.Key] = _kvp.Value; - Hashtable aaAttachs = new Hashtable(); + foreach (KeyValuePair _kvp in attchs) { string pointStr = _kvp.Key.Substring(4); int point = 0; if (!Int32.TryParse(pointStr, out point)) continue; - Hashtable tmp = new Hashtable(); + UUID uuid = UUID.Zero; UUID.TryParse(_kvp.Value, out uuid); - tmp["item"] = uuid; - tmp["asset"] = UUID.Zero.ToString(); - aaAttachs[point] = tmp; + + appearance.SetAttachment(point,uuid,UUID.Zero); } - appearance.SetAttachments(aaAttachs); + + if (appearance.Wearables[AvatarWearable.BODY].Count == 0) + appearance.Wearables[AvatarWearable.BODY].Wear( + AvatarWearable.DefaultWearables[ + AvatarWearable.BODY][0]); + + if (appearance.Wearables[AvatarWearable.SKIN].Count == 0) + appearance.Wearables[AvatarWearable.SKIN].Wear( + AvatarWearable.DefaultWearables[ + AvatarWearable.SKIN][0]); + + if (appearance.Wearables[AvatarWearable.HAIR].Count == 0) + appearance.Wearables[AvatarWearable.HAIR].Wear( + AvatarWearable.DefaultWearables[ + AvatarWearable.HAIR][0]); + + if (appearance.Wearables[AvatarWearable.EYES].Count == 0) + appearance.Wearables[AvatarWearable.EYES].Wear( + AvatarWearable.DefaultWearables[ + AvatarWearable.EYES][0]); + } + catch + { + // We really should report something here, returning null + // will at least break the wrapper + return null; } - catch { } return appearance; } diff --git a/OpenSim/Services/Interfaces/IFreeswitchService.cs b/OpenSim/Services/Interfaces/IFreeswitchService.cs index d1f635b11d..e7941d5406 100644 --- a/OpenSim/Services/Interfaces/IFreeswitchService.cs +++ b/OpenSim/Services/Interfaces/IFreeswitchService.cs @@ -27,11 +27,14 @@ using System; using OpenSim.Framework; +using System.Collections; namespace OpenSim.Services.Interfaces { public interface IFreeswitchService { - // Place anything the connector eeds to access here! + Hashtable HandleDirectoryRequest(Hashtable requestBody); + Hashtable HandleDialplanRequest(Hashtable requestBody); + string GetJsonConfig(); } } diff --git a/OpenSim/Services/Interfaces/IGatekeeperService.cs b/OpenSim/Services/Interfaces/IGatekeeperService.cs index 2d397bc03d..aac82936b0 100644 --- a/OpenSim/Services/Interfaces/IGatekeeperService.cs +++ b/OpenSim/Services/Interfaces/IGatekeeperService.cs @@ -48,13 +48,15 @@ namespace OpenSim.Services.Interfaces ///
public interface IUserAgentService { + // called by login service only + bool LoginAgentToGrid(AgentCircuitData agent, GridRegion gatekeeper, GridRegion finalDestination, IPEndPoint clientIP, out string reason); + // called by simulators bool LoginAgentToGrid(AgentCircuitData agent, GridRegion gatekeeper, GridRegion finalDestination, out string reason); - void SetClientToken(UUID sessionID, string token); void LogoutAgent(UUID userID, UUID sessionID); GridRegion GetHomeRegion(UUID userID, out Vector3 position, out Vector3 lookAt); bool AgentIsComingHome(UUID sessionID, string thisGridExternalName); bool VerifyAgent(UUID sessionID, string token); - bool VerifyClient(UUID sessionID, string token); + bool VerifyClient(UUID sessionID, string reportedIP); } } diff --git a/OpenSim/Services/Interfaces/IGridService.cs b/OpenSim/Services/Interfaces/IGridService.cs index e55b633eba..ee062256c5 100644 --- a/OpenSim/Services/Interfaces/IGridService.cs +++ b/OpenSim/Services/Interfaces/IGridService.cs @@ -92,11 +92,12 @@ namespace OpenSim.Services.Interfaces List GetDefaultRegions(UUID scopeID); List GetFallbackRegions(UUID scopeID, int x, int y); + List GetHyperlinks(UUID scopeID); int GetRegionFlags(UUID scopeID, UUID regionID); } - public class GridRegion + public class GridRegion : Object { /// @@ -224,6 +225,33 @@ namespace OpenSim.Services.Interfaces EstateOwner = ConvertFrom.EstateOwner; } + # region Definition of equality + + /// + /// Define equality as two regions having the same, non-zero UUID. + /// + public bool Equals(GridRegion region) + { + if ((object)region == null) + return false; + // Return true if the non-zero UUIDs are equal: + return (RegionID != UUID.Zero) && RegionID.Equals(region.RegionID); + } + + public override bool Equals(Object obj) + { + if (obj == null) + return false; + return Equals(obj as GridRegion); + } + + public override int GetHashCode() + { + return RegionID.GetHashCode() ^ TerrainImage.GetHashCode(); + } + + #endregion + /// /// This accessor can throw all the exceptions that Dns.GetHostAddresses can throw. /// diff --git a/OpenSim/Services/Interfaces/IGridUserService.cs b/OpenSim/Services/Interfaces/IGridUserService.cs index 95ce5e8fe7..6613ae769f 100644 --- a/OpenSim/Services/Interfaces/IGridUserService.cs +++ b/OpenSim/Services/Interfaces/IGridUserService.cs @@ -105,11 +105,31 @@ namespace OpenSim.Services.Interfaces public interface IGridUserService { GridUserInfo LoggedIn(string userID); - bool LoggedOut(string userID, UUID regionID, Vector3 lastPosition, Vector3 lastLookAt); + + /// + /// Informs the grid that a user is logged out and to remove any session data for them + /// + /// Ignore if your connector does not use userID for logouts + /// Ignore if your connector does not use sessionID for logouts + /// RegionID where the user was last located + /// Last region-relative position of the user + /// Last normalized look direction for the user + /// True if the logout request was successfully processed, otherwise false + bool LoggedOut(string userID, UUID sessionID, UUID regionID, Vector3 lastPosition, Vector3 lastLookAt); bool SetHome(string userID, UUID homeID, Vector3 homePosition, Vector3 homeLookAt); - bool SetLastPosition(string userID, UUID regionID, Vector3 lastPosition, Vector3 lastLookAt); - + + /// + /// Stores the last known user position at the grid level + /// + /// Ignore if your connector does not use userID for position updates + /// Ignore if your connector does not use sessionID for position updates + /// RegionID where the user is currently located + /// Region-relative position + /// Normalized look direction + /// True if the user's last position was successfully updated, otherwise false + bool SetLastPosition(string userID, UUID sessionID, UUID regionID, Vector3 lastPosition, Vector3 lastLookAt); + GridUserInfo GetGridUserInfo(string userID); } } \ No newline at end of file diff --git a/OpenSim/Services/Interfaces/IInventoryService.cs b/OpenSim/Services/Interfaces/IInventoryService.cs index 1b78fb3912..d19faeddf7 100644 --- a/OpenSim/Services/Interfaces/IInventoryService.cs +++ b/OpenSim/Services/Interfaces/IInventoryService.cs @@ -141,8 +141,11 @@ namespace OpenSim.Services.Interfaces /// /// Add a new item to the user's inventory /// - /// - /// true if the item was successfully added + /// + /// The item to be added. If item.FolderID == UUID.Zero then the item is added to the most suitable system + /// folder. If there is no suitable folder then the item is added to the user's root inventory folder. + /// + /// true if the item was successfully added, false if it was not bool AddItem(InventoryItemBase item); /// diff --git a/OpenSim/Services/Interfaces/ILandService.cs b/OpenSim/Services/Interfaces/ILandService.cs index e2f1d1d51a..7a12aff951 100644 --- a/OpenSim/Services/Interfaces/ILandService.cs +++ b/OpenSim/Services/Interfaces/ILandService.cs @@ -33,6 +33,6 @@ namespace OpenSim.Services.Interfaces { public interface ILandService { - LandData GetLandData(ulong regionHandle, uint x, uint y); + LandData GetLandData(ulong regionHandle, uint x, uint y, out byte regionAccess); } } diff --git a/OpenSim/Services/Interfaces/ILoginService.cs b/OpenSim/Services/Interfaces/ILoginService.cs index 9e573393d7..ee9b0b1720 100644 --- a/OpenSim/Services/Interfaces/ILoginService.cs +++ b/OpenSim/Services/Interfaces/ILoginService.cs @@ -47,7 +47,8 @@ namespace OpenSim.Services.Interfaces public interface ILoginService { - LoginResponse Login(string firstName, string lastName, string passwd, string startLocation, UUID scopeID, string clientVersion, IPEndPoint clientIP); + LoginResponse Login(string firstName, string lastName, string passwd, string startLocation, UUID scopeID, + string clientVersion, string channel, string mac, string id0, IPEndPoint clientIP); Hashtable SetLevel(string firstName, string lastName, string passwd, int level, IPEndPoint clientIP); } diff --git a/OpenSim/Services/InventoryService/HGInventoryService.cs b/OpenSim/Services/InventoryService/HGInventoryService.cs index 6e6b019f75..d62c0089a2 100644 --- a/OpenSim/Services/InventoryService/HGInventoryService.cs +++ b/OpenSim/Services/InventoryService/HGInventoryService.cs @@ -44,7 +44,7 @@ namespace OpenSim.Services.InventoryService LogManager.GetLogger( MethodBase.GetCurrentMethod().DeclaringType); - protected IXInventoryData m_Database; + protected new IXInventoryData m_Database; public HGInventoryService(IConfigSource config) : base(config) diff --git a/OpenSim/Services/InventoryService/InventoryService.cs b/OpenSim/Services/InventoryService/InventoryService.cs index fbcd6634e7..e543337c71 100644 --- a/OpenSim/Services/InventoryService/InventoryService.cs +++ b/OpenSim/Services/InventoryService/InventoryService.cs @@ -268,6 +268,8 @@ namespace OpenSim.Services.InventoryService public InventoryFolderBase GetFolderForType(UUID userID, AssetType type) { +// m_log.DebugFormat("[INVENTORY SERVICE]: Looking for folder type {0} for user {1}", type, userID); + InventoryFolderBase root = m_Database.getUserRootFolder(userID); if (root != null) { @@ -276,7 +278,12 @@ namespace OpenSim.Services.InventoryService foreach (InventoryFolderBase folder in folders) { if (folder.Type == (short)type) + { +// m_log.DebugFormat( +// "[INVENTORY SERVICE]: Found folder {0} type {1}", folder.Name, (AssetType)folder.Type); + return folder; + } } } diff --git a/OpenSim/Services/InventoryService/XInventoryService.cs b/OpenSim/Services/InventoryService/XInventoryService.cs index bb24292bf2..e602412be1 100644 --- a/OpenSim/Services/InventoryService/XInventoryService.cs +++ b/OpenSim/Services/InventoryService/XInventoryService.cs @@ -45,6 +45,7 @@ namespace OpenSim.Services.InventoryService MethodBase.GetCurrentMethod().DeclaringType); protected IXInventoryData m_Database; + protected bool m_AllowDelete = true; public XInventoryService(IConfigSource config) : base(config) { @@ -60,6 +61,7 @@ namespace OpenSim.Services.InventoryService { dllName = authConfig.GetString("StorageProvider", dllName); connString = authConfig.GetString("ConnectionString", connString); + m_AllowDelete = authConfig.GetBoolean("AllowDelete", true); // realm = authConfig.GetString("Realm", realm); } @@ -155,6 +157,8 @@ namespace OpenSim.Services.InventoryService protected virtual XInventoryFolder[] GetSystemFolders(UUID principalID) { +// m_log.DebugFormat("[XINVENTORY SERVICE]: Getting system folders for {0}", principalID); + XInventoryFolder[] allFolders = m_Database.GetFolders( new string[] { "agentID" }, new string[] { principalID.ToString() }); @@ -168,6 +172,9 @@ namespace OpenSim.Services.InventoryService return false; }); +// m_log.DebugFormat( +// "[XINVENTORY SERVICE]: Found {0} system folders for {1}", sysFolders.Length, principalID); + return sysFolders; } @@ -184,7 +191,7 @@ namespace OpenSim.Services.InventoryService foreach (XInventoryFolder x in allFolders) { - //m_log.DebugFormat("[XINVENTORY]: Adding folder {0} to skeleton", x.folderName); + //m_log.DebugFormat("[XINVENTORY SERVICE]: Adding folder {0} to skeleton", x.folderName); folders.Add(ConvertToOpenSim(x)); } @@ -212,12 +219,21 @@ namespace OpenSim.Services.InventoryService public virtual InventoryFolderBase GetFolderForType(UUID principalID, AssetType type) { +// m_log.DebugFormat("[XINVENTORY SERVICE]: Getting folder type {0} for user {1}", type, principalID); + XInventoryFolder[] folders = m_Database.GetFolders( new string[] { "agentID", "type"}, new string[] { principalID.ToString(), ((int)type).ToString() }); if (folders.Length == 0) + { +// m_log.WarnFormat("[XINVENTORY SERVICE]: Found no folder for type {0} for user {1}", type, principalID); return null; + } + +// m_log.DebugFormat( +// "[XINVENTORY SERVICE]: Found folder {0} {1} for type {2} for user {3}", +// folders[0].folderName, folders[0].folderID, type, principalID); return ConvertToOpenSim(folders[0]); } @@ -228,7 +244,7 @@ namespace OpenSim.Services.InventoryService // connector. So we disregard the principal and look // by ID. // - m_log.DebugFormat("[XINVENTORY]: Fetch contents for folder {0}", folderID.ToString()); + m_log.DebugFormat("[XINVENTORY SERVICE]: Fetch contents for folder {0}", folderID.ToString()); InventoryCollection inventory = new InventoryCollection(); inventory.UserID = principalID; inventory.Folders = new List(); @@ -277,13 +293,35 @@ namespace OpenSim.Services.InventoryService public virtual bool AddFolder(InventoryFolderBase folder) { + InventoryFolderBase check = GetFolder(folder); + if (check != null) + return false; + XInventoryFolder xFolder = ConvertFromOpenSim(folder); return m_Database.StoreFolder(xFolder); } public virtual bool UpdateFolder(InventoryFolderBase folder) { - return AddFolder(folder); + XInventoryFolder xFolder = ConvertFromOpenSim(folder); + InventoryFolderBase check = GetFolder(folder); + if (check == null) + return AddFolder(folder); + + if (check.Type != -1 || xFolder.type != -1) + { + if (xFolder.version > check.Version) + return false; + check.Version = (ushort)xFolder.version; + xFolder = ConvertFromOpenSim(check); + return m_Database.StoreFolder(xFolder); + } + + if (xFolder.version < check.Version) + xFolder.version = check.Version; + xFolder.folderID = check.ID; + + return m_Database.StoreFolder(xFolder); } public virtual bool MoveFolder(InventoryFolderBase folder) @@ -304,10 +342,15 @@ namespace OpenSim.Services.InventoryService // public virtual bool DeleteFolders(UUID principalID, List folderIDs) { + if (!m_AllowDelete) + return false; + // Ignore principal ID, it's bogus at connector level // foreach (UUID id in folderIDs) { + if (!ParentIsTrash(id)) + continue; InventoryFolderBase f = new InventoryFolderBase(); f.ID = id; PurgeFolder(f); @@ -319,6 +362,12 @@ namespace OpenSim.Services.InventoryService public virtual bool PurgeFolder(InventoryFolderBase folder) { + if (!m_AllowDelete) + return false; + + if (!ParentIsTrash(folder.ID)) + return false; + XInventoryFolder[] subFolders = m_Database.GetFolders( new string[] { "parentFolderID" }, new string[] { folder.ID.ToString() }); @@ -336,6 +385,9 @@ namespace OpenSim.Services.InventoryService public virtual bool AddItem(InventoryItemBase item) { +// m_log.DebugFormat( +// "[XINVENTORY SERVICE]: Adding item {0} to folder {1} for {2}", item.ID, item.Folder, item.Owner); + return m_Database.StoreItem(ConvertFromOpenSim(item)); } @@ -358,6 +410,9 @@ namespace OpenSim.Services.InventoryService public virtual bool DeleteItems(UUID principalID, List itemIDs) { + if (!m_AllowDelete) + return false; + // Just use the ID... *facepalms* // foreach (UUID id in itemIDs) @@ -469,7 +524,7 @@ namespace OpenSim.Services.InventoryService newItem.ID = item.inventoryID; newItem.InvType = item.invType; newItem.Folder = item.parentFolderID; - newItem.CreatorId = item.creatorID; + newItem.CreatorIdentification = item.creatorID; newItem.Description = item.inventoryDescription; newItem.NextPermissions = (uint)item.inventoryNextPermissions; newItem.CurrentPermissions = (uint)item.inventoryCurrentPermissions; @@ -500,7 +555,7 @@ namespace OpenSim.Services.InventoryService newItem.inventoryID = item.ID; newItem.invType = item.InvType; newItem.parentFolderID = item.Folder; - newItem.creatorID = item.CreatorId; + newItem.creatorID = item.CreatorIdentification; newItem.inventoryDescription = item.Description; newItem.inventoryNextPermissions = (int)item.NextPermissions; newItem.inventoryCurrentPermissions = (int)item.CurrentPermissions; @@ -519,5 +574,32 @@ namespace OpenSim.Services.InventoryService return newItem; } + + private bool ParentIsTrash(UUID folderID) + { + XInventoryFolder[] folder = m_Database.GetFolders(new string[] {"folderID"}, new string[] {folderID.ToString()}); + if (folder.Length < 1) + return false; + + if (folder[0].type == (int)AssetType.TrashFolder) + return true; + + UUID parentFolder = folder[0].parentFolderID; + + while (parentFolder != UUID.Zero) + { + XInventoryFolder[] parent = m_Database.GetFolders(new string[] {"folderID"}, new string[] {parentFolder.ToString()}); + if (parent.Length < 1) + return false; + + if (parent[0].type == (int)AssetType.TrashFolder) + return true; + if (parent[0].type == (int)AssetType.RootFolder) + return false; + + parentFolder = parent[0].parentFolderID; + } + return false; + } } } diff --git a/OpenSim/Services/LLLoginService/LLLoginResponse.cs b/OpenSim/Services/LLLoginService/LLLoginResponse.cs index 336692225d..0da1715849 100644 --- a/OpenSim/Services/LLLoginService/LLLoginResponse.cs +++ b/OpenSim/Services/LLLoginService/LLLoginResponse.cs @@ -52,7 +52,6 @@ namespace OpenSim.Services.LLLoginService protected string m_login; public static LLFailedLoginResponse UserProblem; - public static LLFailedLoginResponse AuthorizationProblem; public static LLFailedLoginResponse GridProblem; public static LLFailedLoginResponse InventoryProblem; public static LLFailedLoginResponse DeadRegionProblem; @@ -65,9 +64,6 @@ namespace OpenSim.Services.LLLoginService UserProblem = new LLFailedLoginResponse("key", "Could not authenticate your avatar. Please check your username and password, and check the grid if problems persist.", "false"); - AuthorizationProblem = new LLFailedLoginResponse("key", - "Error connecting to grid. Unable to authorize your session into the region.", - "false"); GridProblem = new LLFailedLoginResponse("key", "Error connecting to the desired location. Try connecting to another region.", "false"); @@ -173,6 +169,8 @@ namespace OpenSim.Services.LLLoginService // Web map private string mapTileURL; + private string searchURL; + // Error Flags private string errorReason; private string errorMessage; @@ -221,7 +219,7 @@ namespace OpenSim.Services.LLLoginService public LLLoginResponse(UserAccount account, AgentCircuitData aCircuit, GridUserInfo pinfo, GridRegion destination, List invSkel, FriendInfo[] friendsList, ILibraryService libService, string where, string startlocation, Vector3 position, Vector3 lookAt, List gestures, string message, - GridRegion home, IPEndPoint clientIP, string mapTileURL) + GridRegion home, IPEndPoint clientIP, string mapTileURL, string searchURL) : this() { FillOutInventoryData(invSkel, libService); @@ -238,6 +236,7 @@ namespace OpenSim.Services.LLLoginService BuddList = ConvertFriendListItem(friendsList); StartLocation = where; MapTileURL = mapTileURL; + SearchURL = searchURL; FillOutHomeData(pinfo, home); LookAt = String.Format("[r{0},r{1},r{2}]", lookAt.X, lookAt.Y, lookAt.Z); @@ -410,6 +409,7 @@ namespace OpenSim.Services.LLLoginService InitialOutfitHash["gender"] = "female"; initialOutfit.Add(InitialOutfitHash); mapTileURL = String.Empty; + searchURL = String.Empty; } @@ -473,6 +473,9 @@ namespace OpenSim.Services.LLLoginService responseData["region_x"] = (Int32)(RegionX); responseData["region_y"] = (Int32)(RegionY); + if (searchURL != String.Empty) + responseData["search"] = searchURL; + if (mapTileURL != String.Empty) responseData["map-server-url"] = mapTileURL; @@ -575,6 +578,9 @@ namespace OpenSim.Services.LLLoginService if (mapTileURL != String.Empty) map["map-server-url"] = OSD.FromString(mapTileURL); + if (searchURL != String.Empty) + map["search"] = OSD.FromString(searchURL); + if (m_buddyList != null) { map["buddy-list"] = ArrayListToOSDArray(m_buddyList.ToArray()); @@ -932,6 +938,12 @@ namespace OpenSim.Services.LLLoginService set { mapTileURL = value; } } + public string SearchURL + { + get { return searchURL; } + set { searchURL = value; } + } + public string Message { get { return welcomeMessage; } diff --git a/OpenSim/Services/LLLoginService/LLLoginService.cs b/OpenSim/Services/LLLoginService/LLLoginService.cs index f4e045ccb3..fcfdd1d6d9 100644 --- a/OpenSim/Services/LLLoginService/LLLoginService.cs +++ b/OpenSim/Services/LLLoginService/LLLoginService.cs @@ -28,6 +28,7 @@ using System; using System.Collections; using System.Collections.Generic; +using System.Linq; using System.Net; using System.Reflection; using System.Text.RegularExpressions; @@ -74,6 +75,7 @@ namespace OpenSim.Services.LLLoginService protected string m_GatekeeperURL; protected bool m_AllowRemoteSetLoginLevel; protected string m_MapTileURL; + protected string m_SearchURL; IConfig m_LoginServerConfig; @@ -102,7 +104,8 @@ namespace OpenSim.Services.LLLoginService m_MinLoginLevel = m_LoginServerConfig.GetInt("MinLoginLevel", 0); m_GatekeeperURL = m_LoginServerConfig.GetString("GatekeeperURI", string.Empty); m_MapTileURL = m_LoginServerConfig.GetString("MapTileURL", string.Empty); - + m_SearchURL = m_LoginServerConfig.GetString("SearchURL", string.Empty); + // These are required; the others aren't if (accountService == string.Empty || authService == string.Empty) throw new Exception("LoginService is missing service specifications"); @@ -206,7 +209,8 @@ namespace OpenSim.Services.LLLoginService return response; } - public LoginResponse Login(string firstName, string lastName, string passwd, string startLocation, UUID scopeID, string clientVersion, IPEndPoint clientIP) + public LoginResponse Login(string firstName, string lastName, string passwd, string startLocation, UUID scopeID, + string clientVersion, string channel, string mac, string id0, IPEndPoint clientIP) { bool success = false; UUID session = UUID.Random(); @@ -306,7 +310,7 @@ namespace OpenSim.Services.LLLoginService { // something went wrong, make something up, so that we don't have to test this anywhere else guinfo = new GridUserInfo(); - guinfo.LastPosition = guinfo.HomePosition = new Vector3(128, 128, 30); + guinfo.LastPosition = guinfo.HomePosition = new Vector3(128, 128, 30); } // @@ -327,23 +331,25 @@ namespace OpenSim.Services.LLLoginService // // Get the avatar // - AvatarData avatar = null; + AvatarAppearance avatar = null; if (m_AvatarService != null) { - avatar = m_AvatarService.GetAvatar(account.PrincipalID); + avatar = m_AvatarService.GetAppearance(account.PrincipalID); } // // Instantiate/get the simulation interface and launch an agent at the destination // string reason = string.Empty; - AgentCircuitData aCircuit = LaunchAgentAtGrid(gatekeeper, destination, account, avatar, session, secureSession, position, where, clientVersion, clientIP, out where, out reason); - + GridRegion dest; + AgentCircuitData aCircuit = LaunchAgentAtGrid(gatekeeper, destination, account, avatar, session, secureSession, position, where, + clientVersion, channel, mac, id0, clientIP, out where, out reason, out dest); + destination = dest; if (aCircuit == null) { m_PresenceService.LogoutAgent(session); m_log.InfoFormat("[LLOGIN SERVICE]: Login failed, reason: {0}", reason); - return LLFailedLoginResponse.AuthorizationProblem; + return new LLFailedLoginResponse("key", reason, "false"); } // Get Friends list @@ -358,7 +364,7 @@ namespace OpenSim.Services.LLLoginService // Finally, fill out the response and return it // LLLoginResponse response = new LLLoginResponse(account, aCircuit, guinfo, destination, inventorySkel, friendsList, m_LibraryService, - where, startLocation, position, lookAt, gestures, m_WelcomeMessage, home, clientIP, m_MapTileURL); + where, startLocation, position, lookAt, gestures, m_WelcomeMessage, home, clientIP, m_MapTileURL, m_SearchURL); m_log.DebugFormat("[LLOGIN SERVICE]: All clear. Sending login response to client."); return response; @@ -422,12 +428,9 @@ namespace OpenSim.Services.LLLoginService { m_log.WarnFormat("[LLOGIN SERVICE]: User {0} {1} does not have a valid home and this grid does not have default locations. Attempting to find random region", account.FirstName, account.LastName); - defaults = m_GridService.GetRegionsByName(scopeID, "", 1); - if (defaults != null && defaults.Count > 0) - { - region = defaults[0]; + region = FindAlternativeRegion(scopeID); + if (region != null) where = "safe"; - } } } @@ -454,12 +457,9 @@ namespace OpenSim.Services.LLLoginService else { m_log.Info("[LLOGIN SERVICE]: Last Region Not Found Attempting to find random region"); - defaults = m_GridService.GetRegionsByName(scopeID, "", 1); - if (defaults != null && defaults.Count > 0) - { - region = defaults[0]; + region = FindAlternativeRegion(scopeID); + if (region != null) where = "safe"; - } } } @@ -559,6 +559,31 @@ namespace OpenSim.Services.LLLoginService } + private GridRegion FindAlternativeRegion(UUID scopeID) + { + List hyperlinks = null; + List regions = m_GridService.GetFallbackRegions(scopeID, 1000 * (int)Constants.RegionSize, 1000 * (int)Constants.RegionSize); + if (regions != null && regions.Count > 0) + { + hyperlinks = m_GridService.GetHyperlinks(scopeID); + IEnumerable availableRegions = regions.Except(hyperlinks); + if (availableRegions.Count() > 0) + return availableRegions.ElementAt(0); + } + // No fallbacks, try to find an arbitrary region that is not a hyperlink + // maxNumber is fixed for now; maybe use some search pattern with increasing maxSize here? + regions = m_GridService.GetRegionsByName(scopeID, "", 10); + if (regions != null && regions.Count > 0) + { + if (hyperlinks == null) + hyperlinks = m_GridService.GetHyperlinks(scopeID); + IEnumerable availableRegions = regions.Except(hyperlinks); + if (availableRegions.Count() > 0) + return availableRegions.ElementAt(0); + } + return null; + } + private GridRegion FindForeignRegion(string domainName, uint port, string regionName, out GridRegion gatekeeper) { gatekeeper = new GridRegion(); @@ -596,8 +621,9 @@ namespace OpenSim.Services.LLLoginService } } - protected AgentCircuitData LaunchAgentAtGrid(GridRegion gatekeeper, GridRegion destination, UserAccount account, AvatarData avatar, - UUID session, UUID secureSession, Vector3 position, string currentWhere, string viewer, IPEndPoint clientIP, out string where, out string reason) + protected AgentCircuitData LaunchAgentAtGrid(GridRegion gatekeeper, GridRegion destination, UserAccount account, AvatarAppearance avatar, + UUID session, UUID secureSession, Vector3 position, string currentWhere, string viewer, string channel, string mac, string id0, + IPEndPoint clientIP, out string where, out string reason, out GridRegion dest) { where = currentWhere; ISimulationService simConnector = null; @@ -637,7 +663,7 @@ namespace OpenSim.Services.LLLoginService if (m_UserAgentService == null && simConnector != null) { circuitCode = (uint)Util.RandomClass.Next(); ; - aCircuit = MakeAgent(destination, account, avatar, session, secureSession, circuitCode, position, viewer); + aCircuit = MakeAgent(destination, account, avatar, session, secureSession, circuitCode, position, clientIP.Address.ToString(), viewer, channel, mac, id0); success = LaunchAgentDirectly(simConnector, destination, aCircuit, out reason); if (!success && m_GridService != null) { @@ -662,7 +688,7 @@ namespace OpenSim.Services.LLLoginService if (m_UserAgentService != null) { circuitCode = (uint)Util.RandomClass.Next(); ; - aCircuit = MakeAgent(destination, account, avatar, session, secureSession, circuitCode, position, viewer); + aCircuit = MakeAgent(destination, account, avatar, session, secureSession, circuitCode, position, clientIP.Address.ToString(), viewer, channel, mac, id0); success = LaunchAgentIndirectly(gatekeeper, destination, aCircuit, clientIP, out reason); if (!success && m_GridService != null) { @@ -683,7 +709,7 @@ namespace OpenSim.Services.LLLoginService } } } - + dest = destination; if (success) return aCircuit; else @@ -691,13 +717,14 @@ namespace OpenSim.Services.LLLoginService } private AgentCircuitData MakeAgent(GridRegion region, UserAccount account, - AvatarData avatar, UUID session, UUID secureSession, uint circuit, Vector3 position, string viewer) + AvatarAppearance avatar, UUID session, UUID secureSession, uint circuit, Vector3 position, + string ipaddress, string viewer, string channel, string mac, string id0) { AgentCircuitData aCircuit = new AgentCircuitData(); aCircuit.AgentID = account.PrincipalID; if (avatar != null) - aCircuit.Appearance = avatar.ToAvatarAppearance(account.PrincipalID); + aCircuit.Appearance = new AvatarAppearance(avatar); else aCircuit.Appearance = new AvatarAppearance(account.PrincipalID); @@ -712,7 +739,11 @@ namespace OpenSim.Services.LLLoginService aCircuit.SecureSessionID = secureSession; aCircuit.SessionID = session; aCircuit.startpos = position; + aCircuit.IPAddress = ipaddress; aCircuit.Viewer = viewer; + aCircuit.Channel = channel; + aCircuit.Mac = mac; + aCircuit.Id0 = id0; SetServiceURLs(aCircuit, account); return aCircuit; @@ -752,14 +783,8 @@ namespace OpenSim.Services.LLLoginService private bool LaunchAgentIndirectly(GridRegion gatekeeper, GridRegion destination, AgentCircuitData aCircuit, IPEndPoint clientIP, out string reason) { m_log.Debug("[LLOGIN SERVICE] Launching agent at " + destination.RegionName); - if (m_UserAgentService.LoginAgentToGrid(aCircuit, gatekeeper, destination, out reason)) - { - // We may need to do this at some point, - // so leaving it here in comments. - //IPAddress addr = NetworkUtil.GetIPFor(clientIP.Address, destination.ExternalEndPoint.Address); - m_UserAgentService.SetClientToken(aCircuit.SessionID, /*addr.Address.ToString() */ clientIP.Address.ToString()); + if (m_UserAgentService.LoginAgentToGrid(aCircuit, gatekeeper, destination, clientIP, out reason)) return true; - } return false; } diff --git a/OpenSim/Services/PresenceService/PresenceService.cs b/OpenSim/Services/PresenceService/PresenceService.cs index 976153fd56..c8ac38e63a 100644 --- a/OpenSim/Services/PresenceService/PresenceService.cs +++ b/OpenSim/Services/PresenceService/PresenceService.cs @@ -45,10 +45,20 @@ namespace OpenSim.Services.PresenceService LogManager.GetLogger( MethodBase.GetCurrentMethod().DeclaringType); + protected bool m_allowDuplicatePresences = false; + public PresenceService(IConfigSource config) : base(config) { m_log.Debug("[PRESENCE SERVICE]: Starting presence service"); + + IConfig presenceConfig = config.Configs["PresenceService"]; + if (presenceConfig != null) + { + m_allowDuplicatePresences = + presenceConfig.GetBoolean("AllowDuplicatePresences", + m_allowDuplicatePresences); + } } public bool LoginAgent(string userID, UUID sessionID, @@ -57,6 +67,9 @@ namespace OpenSim.Services.PresenceService //PresenceData[] d = m_Database.Get("UserID", userID); //m_Database.Get("UserID", userID); + if (!m_allowDuplicatePresences) + m_Database.Delete("UserID", userID.ToString()); + PresenceData data = new PresenceData(); data.UserID = userID; @@ -88,7 +101,7 @@ namespace OpenSim.Services.PresenceService public bool ReportAgent(UUID sessionID, UUID regionID) { - m_log.DebugFormat("[PRESENCE SERVICE]: ReportAgent with session {0} in region {1}", sessionID, regionID); +// m_log.DebugFormat("[PRESENCE SERVICE]: ReportAgent with session {0} in region {1}", sessionID, regionID); try { PresenceData pdata = m_Database.Get(sessionID); diff --git a/OpenSim/Services/UserAccountService/GridUserService.cs b/OpenSim/Services/UserAccountService/GridUserService.cs index 697ba639d2..9b18915255 100644 --- a/OpenSim/Services/UserAccountService/GridUserService.cs +++ b/OpenSim/Services/UserAccountService/GridUserService.cs @@ -92,7 +92,7 @@ namespace OpenSim.Services.UserAccountService return GetGridUserInfo(userID); } - public bool LoggedOut(string userID, UUID regionID, Vector3 lastPosition, Vector3 lastLookAt) + public bool LoggedOut(string userID, UUID sessionID, UUID regionID, Vector3 lastPosition, Vector3 lastLookAt) { m_log.DebugFormat("[GRID USER SERVICE]: User {0} is offline", userID); GridUserData d = m_Database.Get(userID); @@ -139,7 +139,7 @@ namespace OpenSim.Services.UserAccountService return m_Database.Store(d); } - public bool SetLastPosition(string userID, UUID regionID, Vector3 lastPosition, Vector3 lastLookAt) + public bool SetLastPosition(string userID, UUID sessionID, UUID regionID, Vector3 lastPosition, Vector3 lastLookAt) { //m_log.DebugFormat("[Grid User Service]: SetLastPosition for {0}", userID); GridUserData d = m_Database.Get(userID); diff --git a/OpenSim/Services/UserAccountService/UserAccountService.cs b/OpenSim/Services/UserAccountService/UserAccountService.cs index 326e502017..f376cf825b 100644 --- a/OpenSim/Services/UserAccountService/UserAccountService.cs +++ b/OpenSim/Services/UserAccountService/UserAccountService.cs @@ -97,10 +97,10 @@ namespace OpenSim.Services.UserAccountService public UserAccount GetUserAccount(UUID scopeID, string firstName, string lastName) { -// m_log.DebugFormat( -// "[USER ACCOUNT SERVICE]: Retrieving account by username for {0} {1}, scope {2}", -// firstName, lastName, scopeID); - +// m_log.DebugFormat( +// "[USER ACCOUNT SERVICE]: Retrieving account by username for {0} {1}, scope {2}", +// firstName, lastName, scopeID); + UserAccountData[] d; if (scopeID != UUID.Zero) @@ -235,10 +235,10 @@ namespace OpenSim.Services.UserAccountService public bool StoreUserAccount(UserAccount data) { -// m_log.DebugFormat( -// "[USER ACCOUNT SERVICE]: Storing user account for {0} {1} {2}, scope {3}", -// data.FirstName, data.LastName, data.PrincipalID, data.ScopeID); - +// m_log.DebugFormat( +// "[USER ACCOUNT SERVICE]: Storing user account for {0} {1} {2}, scope {3}", +// data.FirstName, data.LastName, data.PrincipalID, data.ScopeID); + UserAccountData d = new UserAccountData(); d.FirstName = data.FirstName; @@ -285,7 +285,7 @@ namespace OpenSim.Services.UserAccountService #endregion #region Console commands - + /// /// Handle the create user command from the console. /// @@ -297,12 +297,14 @@ namespace OpenSim.Services.UserAccountService string password; string email; + List excluded = new List(new char[]{' '}); + if (cmdparams.Length < 3) - firstName = MainConsole.Instance.CmdPrompt("First name", "Default"); + firstName = MainConsole.Instance.CmdPrompt("First name", "Default", excluded); else firstName = cmdparams[2]; if (cmdparams.Length < 4) - lastName = MainConsole.Instance.CmdPrompt("Last name", "User"); + lastName = MainConsole.Instance.CmdPrompt("Last name", "User", excluded); else lastName = cmdparams[3]; if (cmdparams.Length < 5) diff --git a/OpenSim/Tests/Common/Mock/MockInventoryService.cs b/OpenSim/Tests/Common/Mock/MockInventoryService.cs index 1ea4bc1059..4ac1078795 100644 --- a/OpenSim/Tests/Common/Mock/MockInventoryService.cs +++ b/OpenSim/Tests/Common/Mock/MockInventoryService.cs @@ -37,13 +37,9 @@ namespace OpenSim.Tests.Common.Mock { public class MockInventoryService : IInventoryService { - public MockInventoryService() - { - } + public MockInventoryService() {} - public MockInventoryService(IConfigSource config) - { - } + public MockInventoryService(IConfigSource config) {} /// /// @@ -140,7 +136,7 @@ namespace OpenSim.Tests.Common.Mock public bool AddItem(InventoryItemBase item) { - return false; + return true; } public bool UpdateItem(InventoryItemBase item) @@ -187,4 +183,4 @@ namespace OpenSim.Tests.Common.Mock return 1; } } -} +} \ No newline at end of file diff --git a/OpenSim/Tests/Common/Mock/MockRegionDataPlugin.cs b/OpenSim/Tests/Common/Mock/MockRegionDataPlugin.cs new file mode 100644 index 0000000000..c80a57b097 --- /dev/null +++ b/OpenSim/Tests/Common/Mock/MockRegionDataPlugin.cs @@ -0,0 +1,297 @@ +/* + * Copyright (c) Contributors, http://opensimulator.org/ + * See CONTRIBUTORS.TXT for a full list of copyright holders. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * * Neither the name of the OpenSimulator Project nor the + * names of its contributors may be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE DEVELOPERS ``AS IS'' AND ANY + * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED + * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + * DISCLAIMED. IN NO EVENT SHALL THE CONTRIBUTORS BE LIABLE FOR ANY + * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES + * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND + * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS + * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +using System.Reflection; +using System.Collections.Generic; +using log4net; +using OpenMetaverse; +using OpenSim.Framework; +using OpenSim.Region.Framework.Interfaces; +using OpenSim.Region.Framework.Scenes; + +namespace OpenSim.Data.Null +{ + public class NullDataService : ISimulationDataService + { + private NullDataStore m_store; + + public NullDataService() + { + m_store = new NullDataStore(); + } + + public void StoreObject(SceneObjectGroup obj, UUID regionUUID) + { + m_store.StoreObject(obj, regionUUID); + } + + public void RemoveObject(UUID uuid, UUID regionUUID) + { + m_store.RemoveObject(uuid, regionUUID); + } + + public void StorePrimInventory(UUID primID, ICollection items) + { + m_store.StorePrimInventory(primID, items); + } + + public List LoadObjects(UUID regionUUID) + { + return m_store.LoadObjects(regionUUID); + } + + // REGION SYNC + public List LoadObjectsInGivenSpace(UUID regionID, float lowerX, float lowerY, float upperX, float upperY) + { + return null; + } + + public void StoreTerrain(double[,] terrain, UUID regionID) + { + m_store.StoreTerrain(terrain, regionID); + } + + public double[,] LoadTerrain(UUID regionID) + { + return m_store.LoadTerrain(regionID); + } + + public void StoreLandObject(ILandObject Parcel) + { + m_store.StoreLandObject(Parcel); + } + + public void RemoveLandObject(UUID globalID) + { + m_store.RemoveLandObject(globalID); + } + + public List LoadLandObjects(UUID regionUUID) + { + return m_store.LoadLandObjects(regionUUID); + } + + public void StoreRegionSettings(RegionSettings rs) + { + m_store.StoreRegionSettings(rs); + } + + public RegionSettings LoadRegionSettings(UUID regionUUID) + { + return m_store.LoadRegionSettings(regionUUID); + } + + public RegionLightShareData LoadRegionWindlightSettings(UUID regionUUID) + { + return m_store.LoadRegionWindlightSettings(regionUUID); + } + + public void RemoveRegionWindlightSettings(UUID regionID) + { + } + + public void StoreRegionWindlightSettings(RegionLightShareData wl) + { + m_store.StoreRegionWindlightSettings(wl); + } + } + + /// + /// Mock region data plugin. This obeys the api contract for persistence but stores everything in memory, so that + /// tests can check correct persistence. + /// + public class NullDataStore : ISimulationDataStore + { + private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); + + protected Dictionary m_regionSettings = new Dictionary(); + protected Dictionary m_sceneObjectParts = new Dictionary(); + protected Dictionary> m_primItems + = new Dictionary>(); + protected Dictionary m_terrains = new Dictionary(); + protected Dictionary m_landData = new Dictionary(); + + public void Initialise(string dbfile) + { + return; + } + + public void Dispose() + { + } + + public void StoreRegionSettings(RegionSettings rs) + { + m_regionSettings[rs.RegionUUID] = rs; + } + + public RegionLightShareData LoadRegionWindlightSettings(UUID regionUUID) + { + //This connector doesn't support the windlight module yet + //Return default LL windlight settings + return new RegionLightShareData(); + } + + public void RemoveRegionWindlightSettings(UUID regionID) + { + } + + public void StoreRegionWindlightSettings(RegionLightShareData wl) + { + //This connector doesn't support the windlight module yet + } + + public RegionSettings LoadRegionSettings(UUID regionUUID) + { + RegionSettings rs = null; + m_regionSettings.TryGetValue(regionUUID, out rs); + return rs; + } + + public void StoreObject(SceneObjectGroup obj, UUID regionUUID) + { + // We can't simply store groups here because on delinking, OpenSim will not update the original group + // directly. Rather, the newly delinked parts will be updated to be in their own scene object group + // Therefore, we need to store parts rather than groups. + foreach (SceneObjectPart prim in obj.Parts) + { + m_log.DebugFormat( + "[MOCK REGION DATA PLUGIN]: Storing part {0} {1} in object {2} {3} in region {4}", + prim.Name, prim.UUID, obj.Name, obj.UUID, regionUUID); + + m_sceneObjectParts[prim.UUID] = prim; + } + } + + public void RemoveObject(UUID obj, UUID regionUUID) + { + // All parts belonging to the object with the uuid are removed. + List parts = new List(m_sceneObjectParts.Values); + foreach (SceneObjectPart part in parts) + { + if (part.ParentGroup.UUID == obj) + { + m_log.DebugFormat( + "[MOCK REGION DATA PLUGIN]: Removing part {0} {1} as part of object {2} from {3}", + part.Name, part.UUID, obj, regionUUID); + m_sceneObjectParts.Remove(part.UUID); + } + } + } + + public void StorePrimInventory(UUID primID, ICollection items) + { + m_primItems[primID] = items; + } + + public List LoadObjects(UUID regionUUID) + { + Dictionary objects = new Dictionary(); + + // Create all of the SOGs from the root prims first + foreach (SceneObjectPart prim in m_sceneObjectParts.Values) + { + if (prim.IsRoot) + { + m_log.DebugFormat( + "[MOCK REGION DATA PLUGIN]: Loading root part {0} {1} in {2}", prim.Name, prim.UUID, regionUUID); + objects[prim.UUID] = new SceneObjectGroup(prim); + } + } + + // Add all of the children objects to the SOGs + foreach (SceneObjectPart prim in m_sceneObjectParts.Values) + { + SceneObjectGroup sog; + if (prim.UUID != prim.ParentUUID) + { + if (objects.TryGetValue(prim.ParentUUID, out sog)) + { + int originalLinkNum = prim.LinkNum; + + sog.AddPart(prim); + + // SceneObjectGroup.AddPart() tries to be smart and automatically set the LinkNum. + // We override that here + if (originalLinkNum != 0) + prim.LinkNum = originalLinkNum; + } + else + { + m_log.WarnFormat( + "[MOCK REGION DATA PLUGIN]: Database contains an orphan child prim {0} {1} in region {2} pointing to missing parent {3}. This prim will not be loaded.", + prim.Name, prim.UUID, regionUUID, prim.ParentUUID); + } + } + } + + // TODO: Load items. This is assymetric - we store items as a separate method but don't retrieve them that + // way! + + return new List(objects.Values); + } + + // REGION SYNC + public List LoadObjectsInGivenSpace(UUID regionID, float lowerX, float lowerY, float upperX, float upperY) + { + return null; + } + + public void StoreTerrain(double[,] ter, UUID regionID) + { + m_terrains[regionID] = ter; + } + + public double[,] LoadTerrain(UUID regionID) + { + if (m_terrains.ContainsKey(regionID)) + return m_terrains[regionID]; + else + return null; + } + + public void RemoveLandObject(UUID globalID) + { + if (m_landData.ContainsKey(globalID)) + m_landData.Remove(globalID); + } + + public void StoreLandObject(ILandObject land) + { + m_landData[land.LandData.GlobalID] = land.LandData; + } + + public List LoadLandObjects(UUID regionUUID) + { + return new List(m_landData.Values); + } + + public void Shutdown() + { + } + } +} diff --git a/OpenSim/Tests/Common/Mock/TestClient.cs b/OpenSim/Tests/Common/Mock/TestClient.cs index ccdf280dff..03ff659bb1 100644 --- a/OpenSim/Tests/Common/Mock/TestClient.cs +++ b/OpenSim/Tests/Common/Mock/TestClient.cs @@ -96,7 +96,7 @@ namespace OpenSim.Tests.Common.Mock public event DeRezObject OnDeRezObject; public event Action OnRegionHandShakeReply; - public event GenericCall2 OnRequestWearables; + public event GenericCall1 OnRequestWearables; public event GenericCall1 OnCompleteMovementToRegion; public event UpdateAgent OnPreAgentUpdate; public event UpdateAgentRaw OnAgentUpdateRaw; @@ -622,7 +622,11 @@ namespace OpenSim.Tests.Common.Mock { } - public virtual void SendTeleportLocationStart() + public virtual void SendTeleportStart(uint flags) + { + } + + public void SendTeleportProgress(uint flags, string message) { } diff --git a/OpenSim/Tests/Common/Mock/TestInventoryDataPlugin.cs b/OpenSim/Tests/Common/Mock/TestInventoryDataPlugin.cs index fecb73f351..fc44358b69 100644 --- a/OpenSim/Tests/Common/Mock/TestInventoryDataPlugin.cs +++ b/OpenSim/Tests/Common/Mock/TestInventoryDataPlugin.cs @@ -42,7 +42,7 @@ namespace OpenSim.Tests.Common.Mock /// public class TestInventoryDataPlugin : IInventoryDataPlugin { - private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); +// private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); /// /// Inventory folders @@ -84,14 +84,19 @@ namespace OpenSim.Tests.Common.Mock public List getInventoryInFolder(UUID folderID) { -// m_log.DebugFormat("[MOCK INV DB]: Getting items in folder {0}", folderID); +// InventoryFolderBase folder = m_folders[folderID]; + +// m_log.DebugFormat("[MOCK INV DB]: Getting items in folder {0} {1}", folder.Name, folder.ID); List items = new List(); foreach (InventoryItemBase item in m_items.Values) { if (item.Folder == folderID) + { +// m_log.DebugFormat("[MOCK INV DB]: getInventoryInFolder() adding item {0}", item.Name); items.Add(item); + } } return items; @@ -111,12 +116,22 @@ namespace OpenSim.Tests.Common.Mock public List getInventoryFolders(UUID parentID) { +// InventoryFolderBase parentFolder = m_folders[parentID]; + +// m_log.DebugFormat("[MOCK INV DB]: Getting folders in folder {0} {1}", parentFolder.Name, parentFolder.ID); + List folders = new List(); foreach (InventoryFolderBase folder in m_folders.Values) { if (folder.ParentID == parentID) + { +// m_log.DebugFormat( +// "[MOCK INV DB]: Found folder {0} {1} in {2} {3}", +// folder.Name, folder.ID, parentFolder.Name, parentFolder.ID); + folders.Add(folder); + } } return folders; @@ -137,6 +152,10 @@ namespace OpenSim.Tests.Common.Mock public void addInventoryFolder(InventoryFolderBase folder) { +// m_log.DebugFormat( +// "[MOCK INV DB]: Adding inventory folder {0} {1} type {2}", +// folder.Name, folder.ID, (AssetType)folder.Type); + m_folders[folder.ID] = folder; if (folder.ParentID == UUID.Zero) @@ -166,8 +185,10 @@ namespace OpenSim.Tests.Common.Mock public void addInventoryItem(InventoryItemBase item) { +// InventoryFolderBase folder = m_folders[item.Folder]; + // m_log.DebugFormat( -// "[MOCK INV DB]: Adding inventory item {0} {1} in {2}", item.Name, item.ID, item.Folder); +// "[MOCK INV DB]: Adding inventory item {0} {1} in {2} {3}", item.Name, item.ID, folder.Name, folder.ID); m_items[item.ID] = item; } diff --git a/OpenSim/Tests/Common/Mock/TestScene.cs b/OpenSim/Tests/Common/Mock/TestScene.cs index 01f2c146e8..0e1433a62b 100644 --- a/OpenSim/Tests/Common/Mock/TestScene.cs +++ b/OpenSim/Tests/Common/Mock/TestScene.cs @@ -1,4 +1,4 @@ -/* +/* * Copyright (c) Contributors, http://opensimulator.org/ * See CONTRIBUTORS.TXT for a full list of copyright holders. * @@ -29,9 +29,9 @@ using System; using Nini.Config; using OpenSim.Framework; using OpenSim.Framework.Communications; - using OpenSim.Framework.Servers; using OpenSim.Region.Framework; +using OpenSim.Region.Framework.Interfaces; using OpenSim.Region.Framework.Scenes; namespace OpenSim.Tests.Common.Mock @@ -40,10 +40,10 @@ namespace OpenSim.Tests.Common.Mock { public TestScene( RegionInfo regInfo, AgentCircuitManager authen, - SceneCommunicationService sceneGridService, StorageManager storeManager, + SceneCommunicationService sceneGridService, ISimulationDataService simDataService, IEstateDataService estateDataService, ModuleLoader moduleLoader, bool dumpAssetsToFile, bool physicalPrim, bool SeeIntoRegionFromNeighbor, IConfigSource config, string simulatorVersion) - : base(regInfo, authen, sceneGridService, storeManager, moduleLoader, + : base(regInfo, authen, sceneGridService, simDataService, estateDataService, moduleLoader, dumpAssetsToFile, physicalPrim, SeeIntoRegionFromNeighbor, config, simulatorVersion) { } @@ -65,6 +65,6 @@ namespace OpenSim.Tests.Common.Mock public AsyncSceneObjectGroupDeleter SceneObjectGroupDeleter { get { return m_asyncSceneObjectDeleter; } - } + } } } \ No newline at end of file diff --git a/OpenSim/Tests/Common/Setup/AssetHelpers.cs b/OpenSim/Tests/Common/Setup/AssetHelpers.cs index f9a80b05b2..8647cfed51 100644 --- a/OpenSim/Tests/Common/Setup/AssetHelpers.cs +++ b/OpenSim/Tests/Common/Setup/AssetHelpers.cs @@ -54,8 +54,8 @@ namespace OpenSim.Tests.Common { AssetBase asset = CreateAsset(UUID.Random(), AssetType.Notecard, "hello", creatorId); scene.AssetService.Store(asset); - return asset; - } + return asset; + } /// /// Create an asset from the given scene object. diff --git a/OpenSim/Tests/Common/Setup/SceneSetupHelpers.cs b/OpenSim/Tests/Common/Setup/SceneSetupHelpers.cs index 4a356e2943..9d7733e465 100644 --- a/OpenSim/Tests/Common/Setup/SceneSetupHelpers.cs +++ b/OpenSim/Tests/Common/Setup/SceneSetupHelpers.cs @@ -46,6 +46,7 @@ using OpenSim.Region.CoreModules.ServiceConnectorsOut.Authentication; using OpenSim.Region.CoreModules.ServiceConnectorsOut.Inventory; using OpenSim.Region.CoreModules.ServiceConnectorsOut.Grid; using OpenSim.Region.CoreModules.ServiceConnectorsOut.UserAccounts; +using OpenSim.Region.CoreModules.ServiceConnectorsOut.Presence; using OpenSim.Services.Interfaces; using OpenSim.Tests.Common.Mock; @@ -57,29 +58,30 @@ namespace OpenSim.Tests.Common.Setup public class SceneSetupHelpers { // These static variables in order to allow regions to be linked by shared modules and same - // CommunicationsManager. + // CommunicationsManager. private static ISharedRegionModule m_assetService = null; // private static ISharedRegionModule m_authenticationService = null; private static ISharedRegionModule m_inventoryService = null; private static ISharedRegionModule m_gridService = null; private static ISharedRegionModule m_userAccountService = null; + private static ISharedRegionModule m_presenceService = null; /// /// Set up a test scene /// - /// + /// /// Automatically starts service threads, as would the normal runtime. - /// + /// /// public static TestScene SetupScene() { return SetupScene(""); } - + /// /// Set up a test scene /// - /// + /// /// Starts real inventory and asset services, as opposed to mock ones, if true /// public static TestScene SetupScene(String realServices) @@ -92,7 +94,7 @@ namespace OpenSim.Tests.Common.Setup ///// ///// Set up a test scene ///// - ///// + ///// ///// Starts real inventory and asset services, as opposed to mock ones, if true ///// This should be the same if simulating two scenes within a standalone ///// @@ -155,23 +157,24 @@ namespace OpenSim.Tests.Common.Setup AgentCircuitManager acm = new AgentCircuitManager(); SceneCommunicationService scs = new SceneCommunicationService(); - StorageManager sm = new StorageManager("OpenSim.Data.Null.dll", "", ""); + ISimulationDataService simDataService = OpenSim.Server.Base.ServerUtils.LoadPlugin("OpenSim.Tests.Common.dll", null); + IEstateDataService estateDataService = null; IConfigSource configSource = new IniConfigSource(); TestScene testScene = new TestScene( - regInfo, acm, scs, sm, null, false, false, false, configSource, null); + regInfo, acm, scs, simDataService, estateDataService, null, false, false, false, configSource, null); INonSharedRegionModule capsModule = new CapabilitiesModule(); capsModule.Initialise(new IniConfigSource()); testScene.AddRegionModule(capsModule.Name, capsModule); capsModule.AddRegion(testScene); - + IRegionModule godsModule = new GodsModule(); godsModule.Initialise(testScene, new IniConfigSource()); testScene.AddModule(godsModule.Name, godsModule); realServices = realServices.ToLower(); // IConfigSource config = new IniConfigSource(); - + // If we have a brand new scene, need to initialize shared region modules if ((m_assetService == null && m_inventoryService == null) || newScene) { @@ -180,18 +183,17 @@ namespace OpenSim.Tests.Common.Setup else StartAssetService(testScene, false); - // For now, always started a 'real' authenication service + // For now, always started a 'real' authentication service StartAuthenticationService(testScene, true); - + if (realServices.Contains("inventory")) StartInventoryService(testScene, true); else StartInventoryService(testScene, false); - - if (realServices.Contains("grid")) - StartGridService(testScene, true); - + + StartGridService(testScene, true); StartUserAccountService(testScene); + StartPresenceService(testScene); } // If not, make sure the shared module gets references to this new scene else @@ -202,11 +204,15 @@ namespace OpenSim.Tests.Common.Setup m_inventoryService.RegionLoaded(testScene); m_userAccountService.AddRegion(testScene); m_userAccountService.RegionLoaded(testScene); + m_presenceService.AddRegion(testScene); + m_presenceService.RegionLoaded(testScene); + } - + m_inventoryService.PostInitialise(); m_assetService.PostInitialise(); m_userAccountService.PostInitialise(); + m_presenceService.PostInitialise(); testScene.RegionInfo.EstateSettings.EstateOwner = UUID.Random(); testScene.SetModuleInterfaces(); @@ -225,7 +231,11 @@ namespace OpenSim.Tests.Common.Setup m_inventoryService = null; m_gridService = null; m_userAccountService = null; - + m_presenceService = null; + + testScene.RegionInfo.EstateSettings = new EstateSettings(); + testScene.LoginsDisabled = false; + return testScene; } @@ -241,7 +251,7 @@ namespace OpenSim.Tests.Common.Setup else config.Configs["AssetService"].Set("LocalServiceModule", "OpenSim.Tests.Common.dll:MockAssetService"); config.Configs["AssetService"].Set("StorageProvider", "OpenSim.Tests.Common.dll"); - assetService.Initialise(config); + assetService.Initialise(config); assetService.AddRegion(testScene); assetService.RegionLoaded(testScene); testScene.AddRegionModule(assetService.Name, assetService); @@ -268,7 +278,7 @@ namespace OpenSim.Tests.Common.Setup testScene.AddRegionModule(service.Name, service); //m_authenticationService = service; } - + private static void StartInventoryService(Scene testScene, bool real) { ISharedRegionModule inventoryService = new LocalInventoryServicesConnector(); @@ -276,10 +286,16 @@ namespace OpenSim.Tests.Common.Setup config.AddConfig("Modules"); config.AddConfig("InventoryService"); config.Configs["Modules"].Set("InventoryServices", "LocalInventoryServicesConnector"); + if (real) + { config.Configs["InventoryService"].Set("LocalServiceModule", "OpenSim.Services.InventoryService.dll:InventoryService"); + } else + { config.Configs["InventoryService"].Set("LocalServiceModule", "OpenSim.Tests.Common.dll:MockInventoryService"); + } + config.Configs["InventoryService"].Set("StorageProvider", "OpenSim.Tests.Common.dll"); inventoryService.Initialise(config); inventoryService.AddRegion(testScene); @@ -323,19 +339,45 @@ namespace OpenSim.Tests.Common.Setup config.Configs["UserAccountService"].Set("StorageProvider", "OpenSim.Data.Null.dll"); config.Configs["UserAccountService"].Set( "LocalServiceModule", "OpenSim.Services.UserAccountService.dll:UserAccountService"); - + if (m_userAccountService == null) { ISharedRegionModule userAccountService = new LocalUserAccountServicesConnector(); userAccountService.Initialise(config); m_userAccountService = userAccountService; } - + m_userAccountService.AddRegion(testScene); m_userAccountService.RegionLoaded(testScene); testScene.AddRegionModule(m_userAccountService.Name, m_userAccountService); } + /// + /// Start a presence service + /// + /// + private static void StartPresenceService(Scene testScene) + { + IConfigSource config = new IniConfigSource(); + config.AddConfig("Modules"); + config.AddConfig("PresenceService"); + config.Configs["Modules"].Set("PresenceServices", "LocalPresenceServicesConnector"); + config.Configs["PresenceService"].Set("StorageProvider", "OpenSim.Data.Null.dll"); + config.Configs["PresenceService"].Set( + "LocalServiceModule", "OpenSim.Services.PresenceService.dll:PresenceService"); + + if (m_presenceService == null) + { + ISharedRegionModule presenceService = new LocalPresenceServicesConnector(); + presenceService.Initialise(config); + m_presenceService = presenceService; + } + + m_presenceService.AddRegion(testScene); + m_presenceService.RegionLoaded(testScene); + testScene.AddRegionModule(m_presenceService.Name, m_presenceService); + } + /// /// Setup modules for a scene using their default settings. /// @@ -446,9 +488,14 @@ namespace OpenSim.Tests.Common.Setup { string reason; - // We emulate the proper login sequence here by doing things in three stages + // We emulate the proper login sequence here by doing things in four stages + + // Stage 0: log the presence + scene.PresenceService.LoginAgent(agentData.AgentID.ToString(), agentData.SessionID, agentData.SecureSessionID); + // Stage 1: simulate login by telling the scene to expect a new user connection - scene.NewUserConnection(agentData, (uint)TeleportFlags.ViaLogin, out reason); + if (!scene.NewUserConnection(agentData, (uint)TeleportFlags.ViaLogin, out reason)) + Console.WriteLine("NewUserConnection failed: " + reason); // Stage 2: add the new client as a child agent to the scene TestClient client = new TestClient(agentData, scene); @@ -459,7 +506,7 @@ namespace OpenSim.Tests.Common.Setup //scene.AgentCrossing(agentData.AgentID, new Vector3(90, 90, 90), false); OBSOLETE ScenePresence scp = scene.GetScenePresence(agentData.AgentID); - scp.MakeRootAgent(new Vector3(90,90,90), true); + scp.MakeRootAgent(new Vector3(90, 90, 90), true); return client; } @@ -509,9 +556,8 @@ namespace OpenSim.Tests.Common.Setup AsyncSceneObjectGroupDeleter sogd = scene.SceneObjectGroupDeleter; sogd.Enabled = false; - scene.DeRezObject(client, part.LocalId, UUID.Zero, action, destinationId); + scene.DeRezObjects(client, new List() { part.LocalId }, UUID.Zero, action, destinationId); sogd.InventoryDeQueueAndDelete(); } } - } diff --git a/OpenSim/Tests/Common/Setup/UserInventoryTestUtils.cs b/OpenSim/Tests/Common/Setup/UserInventoryTestUtils.cs index c57363aa94..135c50eb74 100644 --- a/OpenSim/Tests/Common/Setup/UserInventoryTestUtils.cs +++ b/OpenSim/Tests/Common/Setup/UserInventoryTestUtils.cs @@ -42,7 +42,7 @@ namespace OpenSim.Tests.Common public static InventoryItemBase CreateInventoryItem( Scene scene, string itemName, UUID itemId, string folderPath, UUID userId) - { + { InventoryItemBase item = new InventoryItemBase(); item.Name = itemName; item.AssetID = AssetHelpers.CreateAsset(scene, userId).FullID; @@ -52,7 +52,7 @@ namespace OpenSim.Tests.Common InventoryFolderBase objsFolder = scene.InventoryService.GetFolderForType(userId, AssetType.Object); item.Folder = objsFolder.ID; - scene.AddInventoryItem(userId, item); + scene.AddInventoryItem(item); return item; } diff --git a/OpenSim/Tests/Common/Setup/UserProfileTestUtils.cs b/OpenSim/Tests/Common/Setup/UserProfileTestUtils.cs index 380f258606..d01521dbdb 100644 --- a/OpenSim/Tests/Common/Setup/UserProfileTestUtils.cs +++ b/OpenSim/Tests/Common/Setup/UserProfileTestUtils.cs @@ -53,7 +53,7 @@ namespace OpenSim.Tests.Common.Setup // UUID userId = UUID.Parse("00000000-0000-0000-0000-000000000099"); // return CreateUserWithInventory(commsManager, userId, callback); // } -// +// // /// // /// Create a test user with a standard inventory // /// @@ -108,11 +108,11 @@ namespace OpenSim.Tests.Common.Setup // { // LocalUserServices lus = (LocalUserServices)commsManager.UserService; // lus.AddUser(firstName, lastName, password, "bill@bailey.com", 1000, 1000, userId); -// +// // CachedUserInfo userInfo = commsManager.UserProfileCacheService.GetUserDetails(userId); // userInfo.OnInventoryReceived += callback; // userInfo.FetchInventory(); -// +// // return userInfo; // } @@ -127,12 +127,19 @@ namespace OpenSim.Tests.Common.Setup { UserAccount ua = new UserAccount(userId) - { FirstName = firstName, LastName = lastName, ServiceURLs = new Dictionary() }; + { FirstName = firstName, LastName = lastName }; + CreateUserWithInventory(scene, ua, pw); + return ua; + } + + public static void CreateUserWithInventory(Scene scene, UserAccount ua, string pw) + { + // FIXME: This should really be set up by UserAccount itself + ua.ServiceURLs = new Dictionary(); + scene.UserAccountService.StoreUserAccount(ua); scene.InventoryService.CreateUserInventory(ua.PrincipalID); scene.AuthenticationService.SetPassword(ua.PrincipalID, pw); - - return ua; - } + } } } \ No newline at end of file diff --git a/OpenSim/Tests/ConfigurationLoaderTest.cs b/OpenSim/Tests/ConfigurationLoaderTest.cs new file mode 100644 index 0000000000..c777acc0f1 --- /dev/null +++ b/OpenSim/Tests/ConfigurationLoaderTest.cs @@ -0,0 +1,143 @@ +/* + * Copyright (c) Contributors, http://opensimulator.org/ + * See CONTRIBUTORS.TXT for a full list of copyright holders. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * * Neither the name of the OpenSimulator Project nor the + * names of its contributors may be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE DEVELOPERS ``AS IS'' AND ANY + * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED + * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + * DISCLAIMED. IN NO EVENT SHALL THE CONTRIBUTORS BE LIABLE FOR ANY + * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES + * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND + * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS + * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +using System.IO; +using Nini.Config; +using NUnit.Framework; +using OpenSim.Framework; + +namespace OpenSim.Tests +{ + [TestFixture] + public class ConfigurationLoaderTests + { + private const string m_testSubdirectory = "test"; + private string m_basePath; + private string m_workingDirectory; + private IConfigSource m_config; + + /// + /// Set up a test directory. + /// + [SetUp] + public void SetUp() + { + m_basePath = Path.Combine(Path.GetTempPath(), Path.GetRandomFileName()); + string path = Path.Combine(m_basePath, m_testSubdirectory); + Directory.CreateDirectory(path); + m_workingDirectory = Directory.GetCurrentDirectory(); + Directory.SetCurrentDirectory(path); + } + + /// + /// Remove the test directory. + /// + [TearDown] + public void TearDown() + { + Directory.SetCurrentDirectory(m_workingDirectory); + Directory.Delete(m_basePath, true); + } + + /// + /// Test the including of ini files with absolute and relative paths. + /// + [Test] + public void IncludeTests() + { + const string mainIniFile = "OpenSimDefaults.ini"; + m_config = new IniConfigSource(); + + // Create ini files in a directory structure + IniConfigSource ini; + IConfig config; + + ini = new IniConfigSource(); + config = ini.AddConfig("IncludeTest"); + config.Set("Include-absolute", "absolute/*/config/*.ini"); + config.Set("Include-relative", "../" + m_testSubdirectory + "/relative/*/config/*.ini"); + CreateIni(mainIniFile, ini); + + ini = new IniConfigSource(); + ini.AddConfig("Absolute1").Set("name1", "value1"); + CreateIni("absolute/one/config/setting.ini", ini); + + ini = new IniConfigSource(); + ini.AddConfig("Absolute2").Set("name2", 2.3); + CreateIni("absolute/two/config/setting1.ini", ini); + + ini = new IniConfigSource(); + ini.AddConfig("Absolute2").Set("name3", "value3"); + CreateIni("absolute/two/config/setting2.ini", ini); + + ini = new IniConfigSource(); + ini.AddConfig("Relative1").Set("name4", "value4"); + CreateIni("relative/one/config/setting.ini", ini); + + ini = new IniConfigSource(); + ini.AddConfig("Relative2").Set("name5", true); + CreateIni("relative/two/config/setting1.ini", ini); + + ini = new IniConfigSource(); + ini.AddConfig("Relative2").Set("name6", 6); + CreateIni("relative/two/config/setting2.ini", ini); + + // Prepare call to ConfigurationLoader.LoadConfigSettings() + ConfigurationLoader cl = new ConfigurationLoader(); + IConfigSource argvSource = new IniConfigSource(); + argvSource.AddConfig("Startup").Set("inifile", mainIniFile); + ConfigSettings configSettings; + NetworkServersInfo networkInfo; + + OpenSimConfigSource source = cl.LoadConfigSettings(argvSource, out configSettings, out networkInfo); + + // Remove default config + config = source.Source.Configs["Startup"]; + source.Source.Configs.Remove(config); + config = source.Source.Configs["Network"]; + source.Source.Configs.Remove(config); + + // Finally, we are able to check the result + Assert.AreEqual(m_config.ToString(), source.Source.ToString(), + "Configuration with includes does not contain all settings."); + // The following would be preferable but fails due to a type mismatch which I am not able to resolve + //CollectionAssert.AreEquivalent(m_config.Configs, source.Source.Configs, + // String.Format("Configuration with includes does not contain all settings.\nAll settings:\n{0}\nSettings read:\n{1}", m_config, source.Source)); + } + + private void CreateIni(string filepath, IniConfigSource source) + { + string path = Path.GetDirectoryName(filepath); + if (path != string.Empty) + { + Directory.CreateDirectory(path); + } + source.Save(filepath); + m_config.Merge(source); + } + } +} diff --git a/OpenSim/Tools/Configger/ConfigurationLoader.cs b/OpenSim/Tools/Configger/ConfigurationLoader.cs index 1619a22fe3..8e71b42bca 100644 --- a/OpenSim/Tools/Configger/ConfigurationLoader.cs +++ b/OpenSim/Tools/Configger/ConfigurationLoader.cs @@ -141,7 +141,17 @@ namespace OpenSim.Tools.Configger else { string basepath = Path.GetFullPath("."); - string path = Path.Combine(basepath, file); + // Resolve relative paths with wildcards + string chunkWithoutWildcards = file; + string chunkWithWildcards = string.Empty; + int wildcardIndex = file.IndexOfAny(new char[] { '*', '?' }); + if (wildcardIndex != -1) + { + chunkWithoutWildcards = file.Substring(0, wildcardIndex); + chunkWithWildcards = file.Substring(wildcardIndex); + } + string path = Path.Combine(basepath, chunkWithoutWildcards); + path = Path.GetFullPath(path) + chunkWithWildcards; string[] paths = Util.Glob(path); foreach (string p in paths) { @@ -241,36 +251,6 @@ namespace OpenSim.Tools.Configger config.Set("EventQueue", true); } - { - IConfig config = defaultConfig.Configs["StandAlone"]; - - if (null == config) - config = defaultConfig.AddConfig("StandAlone"); - - config.Set("accounts_authenticate", true); - config.Set("welcome_message", "Welcome to OpenSimulator"); - config.Set("inventory_plugin", "OpenSim.Data.SQLite.dll"); - config.Set("inventory_source", ""); - config.Set("userDatabase_plugin", "OpenSim.Data.SQLite.dll"); - config.Set("user_source", ""); - config.Set("LibrariesXMLFile", string.Format(".{0}inventory{0}Libraries.xml", Path.DirectorySeparatorChar)); - } - - { - IConfig config = defaultConfig.Configs["Network"]; - - if (null == config) - config = defaultConfig.AddConfig("Network"); - - config.Set("default_location_x", 1000); - config.Set("default_location_y", 1000); - config.Set("grid_send_key", "null"); - config.Set("grid_recv_key", "null"); - config.Set("user_send_key", "null"); - config.Set("user_recv_key", "null"); - config.Set("secure_inventory_server", "true"); - } - return defaultConfig; } diff --git a/OpenSim/Tools/OpenSim.GridLaunch/App.config b/OpenSim/Tools/OpenSim.GridLaunch/App.config deleted file mode 100644 index 1e53319b3b..0000000000 --- a/OpenSim/Tools/OpenSim.GridLaunch/App.config +++ /dev/null @@ -1,40 +0,0 @@ - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/OpenSim/Tools/OpenSim.GridLaunch/AppExecutor.cs b/OpenSim/Tools/OpenSim.GridLaunch/AppExecutor.cs deleted file mode 100644 index 638956ee9c..0000000000 --- a/OpenSim/Tools/OpenSim.GridLaunch/AppExecutor.cs +++ /dev/null @@ -1,247 +0,0 @@ -/* - * Copyright (c) Contributors, http://opensimulator.org/ - * See CONTRIBUTORS.TXT for a full list of copyright holders. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * * Neither the name of the OpenSimulator Project nor the - * names of its contributors may be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE DEVELOPERS ``AS IS'' AND ANY - * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED - * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL THE CONTRIBUTORS BE LIABLE FOR ANY - * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES - * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; - * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ -using System; -using System.Collections; -using System.Diagnostics; -using System.IO; -using System.Reflection; -using System.Text; -using System.Threading; -using log4net; - -namespace OpenSim.GridLaunch -{ - internal partial class AppExecutor : IDisposable - { - // How long to wait for process to shut down by itself - private static readonly int shutdownWaitSeconds = 10; - - private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); - - //private StreamWriter Input { get { return process.StandardInput; } } - //private StreamReader Output { get { return process.StandardOutput; } } - //private StreamReader Error { get { return process.StandardError; } } - - private StreamWriter Input { get; set; } - private StreamReader Output { get; set; } - private StreamReader Error { get; set; } - - private object processLock = new object(); - - private bool isRunning = false; - public bool IsRunning { get { return isRunning; } } - - private string file; - public string File { get { return file; } } - - Process process; - - public AppExecutor(string File) - { - file = File; - } - - #region Dispose of unmanaged resources - ~AppExecutor() - { - Dispose(); - } - private bool isDisposed = false; - public void Dispose() - { - if (!isDisposed) - { - isDisposed = true; - Stop(); - } - } - #endregion - - #region Start / Stop process - public void Start() - { - if (isDisposed) - throw new ApplicationException("Attempt to start process in Disposed instance of AppExecutor."); - // Stop before starting - Stop(); - - lock (processLock) - { - isRunning = true; - - m_log.InfoFormat("Starting \"{0}\".", file); - - // Start the process - process = new Process(); - process.StartInfo.FileName = file; - process.StartInfo.Arguments = ""; - process.StartInfo.CreateNoWindow = true; - process.StartInfo.UseShellExecute = false; - process.StartInfo.ErrorDialog = false; - process.EnableRaisingEvents = true; - - - // Redirect all standard input/output/errors - process.StartInfo.RedirectStandardInput = true; - process.StartInfo.RedirectStandardOutput = true; - process.StartInfo.RedirectStandardError = true; - - // Start process - process.Start(); - - Input = process.StandardInput; - Output = process.StandardOutput; - Error = process.StandardError; - - // Start data copying - timer_Start(); - - // We will flush manually - //Input.AutoFlush = false; - - } - } - - public void Stop() - { - // Shut down process - // We will ignore some exceptions here, against good programming practice... :) - - lock (processLock) - { - // Running? - if (!isRunning) - return; - isRunning = false; - - timer_Stop(); - - m_log.InfoFormat("Stopping \"{0}\".", file); - - // Send exit command to console - try - { - if (Input != null) - { - _writeLine(""); - _writeLine("exit"); - _writeLine("quit"); - // Wait for process to exit - process.WaitForExit(1000 * shutdownWaitSeconds); - } - } - catch (Exception ex) - { - m_log.ErrorFormat("Exeption asking \"{0}\" to shut down: {1}", file, ex.ToString()); - } - - try - { - // Forcefully kill it - if (process.HasExited != true) - process.Kill(); - } - catch (Exception ex) - { - m_log.ErrorFormat("Exeption killing \"{0}\": {1}", file, ex.ToString()); - } - - try - { - // Free resources - process.Close(); - } - catch (Exception ex) - { - m_log.ErrorFormat("Exeption freeing resources for \"{0}\": {1}", file, ex.ToString()); - } - - // Dispose of stream and process object - //SafeDisposeOf(Input); - //SafeDisposeOf(Output); - //SafeDisposeOf(Error); - Program.SafeDisposeOf(process); - } - - // Done stopping process - } - - #endregion - - #region Write to stdInput - public void Write(string Text) - { - // Lock so process won't shut down while we write, and that we won't write while proc is shutting down - lock (processLock) - { - _write(Text); - } - } - public void _write(string Text) - { - if (Input != null) - { - try - { - Input.Write(Text); - Input.Flush(); - } - catch (Exception ex) - { - m_log.ErrorFormat("Exeption sending text \"{0}\" to \"{1}\": {2}", file, Text, ex.ToString()); - } - - } - } - public void WriteLine(string Text) - { - // Lock so process won't shut down while we write, and that we won't write while proc is shutting down - lock (processLock) - { - _writeLine(Text); - } - } - public void _writeLine(string Text) - { - if (Input != null) - { - try - { - m_log.DebugFormat("\"{0}\": Sending: \"{1}\"", file, Text); - Input.WriteLine(Text); - Input.Flush(); - } - catch (Exception ex) - { - m_log.ErrorFormat("Exeption sending text \"{0}\" to \"{1}\": {2}", file, Text, ex.ToString()); - } - } - } - #endregion - - } -} diff --git a/OpenSim/Tools/OpenSim.GridLaunch/AppExecutor_AsyncIO.cs b/OpenSim/Tools/OpenSim.GridLaunch/AppExecutor_AsyncIO.cs deleted file mode 100644 index 8daef1b1ba..0000000000 --- a/OpenSim/Tools/OpenSim.GridLaunch/AppExecutor_AsyncIO.cs +++ /dev/null @@ -1,85 +0,0 @@ -/* - * Copyright (c) Contributors, http://opensimulator.org/ - * See CONTRIBUTORS.TXT for a full list of copyright holders. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * * Neither the name of the OpenSimulator Project nor the - * names of its contributors may be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE DEVELOPERS ``AS IS'' AND ANY - * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED - * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL THE CONTRIBUTORS BE LIABLE FOR ANY - * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES - * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; - * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ -using System; -using System.Collections.Generic; -using System.IO; -using System.Text; - -namespace OpenSim.GridLaunch -{ - internal partial class AppExecutor - { - - - #region Start / Stop timer thread - private void timer_Start() - { - asyncReadOutput(); - asyncReadError(); - } - - private bool running = true; - private void timer_Stop() - { - running = false; - } - #endregion - - private byte[] readBufferOutput = new byte[4096]; - private byte[] readBufferError = new byte[4096]; - - private void asyncReadOutput() - { - if (running) - Output.BaseStream.BeginRead(readBufferOutput, 0, readBufferOutput.Length, asyncReadCallBackOutput, null); - } - private void asyncReadError() - { - if (running) - Error.BaseStream.BeginRead(readBufferError, 0, readBufferError.Length, asyncReadCallBackError, null); - } - - private void asyncReadCallBackOutput(IAsyncResult ar) - { - int len = Output.BaseStream.EndRead(ar); - Program.FireAppConsoleOutput(file, - System.Text.Encoding.ASCII.GetString(readBufferOutput, 0, len) - ); - - asyncReadOutput(); - } - private void asyncReadCallBackError(IAsyncResult ar) - { - int len = Error.BaseStream.EndRead(ar); - Program.FireAppConsoleError(file, - System.Text.Encoding.ASCII.GetString(readBufferError, 0, len) - ); - - asyncReadError(); - } - } -} diff --git a/OpenSim/Tools/OpenSim.GridLaunch/AppExecutor_Thread.cs b/OpenSim/Tools/OpenSim.GridLaunch/AppExecutor_Thread.cs deleted file mode 100644 index f395aa4c66..0000000000 --- a/OpenSim/Tools/OpenSim.GridLaunch/AppExecutor_Thread.cs +++ /dev/null @@ -1,187 +0,0 @@ -/* - * Copyright (c) Contributors, http://opensimulator.org/ - * See CONTRIBUTORS.TXT for a full list of copyright holders. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * * Neither the name of the OpenSimulator Project nor the - * names of its contributors may be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE DEVELOPERS ``AS IS'' AND ANY - * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED - * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL THE CONTRIBUTORS BE LIABLE FOR ANY - * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES - * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; - * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ -//using System; -//using System.Collections; -//using System.Collections.Generic; -//using System.Reflection; -//using System.Text; -//using System.Threading; -//using log4net; - -//namespace OpenSim.GridLaunch -//{ -// internal class AppExecutor2 -// { -// private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); -// private static readonly int consoleReadIntervalMilliseconds = 50; -// //private static readonly Timer readTimer = new Timer(readConsole, null, Timeout.Infinite, Timeout.Infinite); -// private static Thread timerThread; -// private static object timerThreadLock = new object(); - -// #region Start / Stop timer thread -// private static void timer_Start() -// { -// //readTimer.Change(0, consoleReadIntervalMilliseconds); -// lock (timerThreadLock) -// { -// if (timerThread == null) -// { -// m_log.Debug("Starting timer thread."); -// timerThread = new Thread(timerThreadLoop); -// timerThread.Name = "StdOutputStdErrorReadThread"; -// timerThread.IsBackground = true; -// timerThread.Start(); -// } -// } -// } -// private static void timer_Stop() -// { -// //readTimer.Change(Timeout.Infinite, Timeout.Infinite); -// lock (timerThreadLock) -// { -// if (timerThread != null) -// { -// m_log.Debug("Stopping timer thread."); -// try -// { -// if (timerThread.IsAlive) -// timerThread.Abort(); -// timerThread.Join(2000); -// timerThread = null; -// } -// catch (Exception ex) -// { -// m_log.Error("Exception stopping timer thread: " + ex.ToString()); -// } -// } -// } -// } -// #endregion - -// #region Timer read from consoles and fire event - -// private static void timerThreadLoop() -// { -// try -// { -// while (true) -// { -// readConsole(); -// Thread.Sleep(consoleReadIntervalMilliseconds); -// } -// } -// catch (ThreadAbortException) { } // Expected on thread shutdown -// } - -// private static void readConsole() -// { -// try -// { - -// // Lock so we don't collide with any startup or shutdown -// lock (Program.AppList) -// { -// foreach (AppExecutor app in new ArrayList(Program.AppList.Values)) -// { -// try -// { -// string txt = app.GetStdOutput(); -// // Fire event with received text -// if (!string.IsNullOrEmpty(txt)) -// Program.FireAppConsoleOutput(app.File, txt); -// } -// catch (Exception ex) -// { -// m_log.ErrorFormat("Exception reading standard output from \"{0}\": {1}", app.File, ex.ToString()); -// } -// try -// { -// string txt = app.GetStdError(); -// // Fire event with received text -// if (!string.IsNullOrEmpty(txt)) -// Program.FireAppConsoleOutput(app.File, txt); -// } -// catch (Exception ex) -// { -// m_log.ErrorFormat("Exception reading standard error from \"{0}\": {1}", app.File, ex.ToString()); -// } -// } -// } -// } -// finally -// { -// } -// } -// #endregion - - -// #region Read stdOutput and stdError -// public string GetStdOutput() -// { -// return GetStreamData(Output); -// } -// public string GetStdError() -// { -// return GetStreamData(Error); -// } - -// private static int num = 0; -// // Gets any data from StreamReader object, non-blocking -// private static string GetStreamData(StreamReader sr) -// { -// // Can't read? -// if (!sr.BaseStream.CanRead) -// return ""; - -// // Read a chunk -// //sr.BaseStream.ReadTimeout = 100; -// byte[] buffer = new byte[4096]; -// num++; -// Trace.WriteLine("Start read " + num); -// int len = sr.BaseStream.Read(buffer, 0, buffer.Length); -// Trace.WriteLine("End read " + num + ": " + len); - -// // Nothing? -// if (len <= 0) -// return ""; - -// // Return data -// StringBuilder sb = new StringBuilder(); -// sb.Append(System.Text.Encoding.ASCII.GetString(buffer, 0, len)); - -// //while (sr.Peek() >= 0) -// //{ -// // sb.Append(Convert.ToChar(sr.Read())); -// //} - -// return sb.ToString(); -// } -// #endregion - - -// } -//} diff --git a/OpenSim/Tools/OpenSim.GridLaunch/CommandProcessor.cs b/OpenSim/Tools/OpenSim.GridLaunch/CommandProcessor.cs deleted file mode 100644 index 77c50630bc..0000000000 --- a/OpenSim/Tools/OpenSim.GridLaunch/CommandProcessor.cs +++ /dev/null @@ -1,76 +0,0 @@ -/* - * Copyright (c) Contributors, http://opensimulator.org/ - * See CONTRIBUTORS.TXT for a full list of copyright holders. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * * Neither the name of the OpenSimulator Project nor the - * names of its contributors may be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE DEVELOPERS ``AS IS'' AND ANY - * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED - * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL THE CONTRIBUTORS BE LIABLE FOR ANY - * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES - * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; - * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ -using System; -using System.Collections.Generic; -using System.Text; - -namespace OpenSim.GridLaunch -{ - internal class CommandProcessor - { - public delegate void CommandLineDelegate(string application, string command, string arguments); - public event CommandLineDelegate CommandLine; - - public bool IsCommand(string cmd) - { - if (cmd.Trim().StartsWith("/")) - return true; - return false; - } - - public static readonly char[] cmdSplit = new char[] { ' ' }; - public bool Process(string app, string command) - { - // Only process commands - if (!IsCommand(command)) - return false; - - // Remove first / - command = command.Trim().Remove(0, 1); - - // Split cmd and args - string[] carg = command.Split(cmdSplit, 2); - if (carg.Length == 0) - return true; - - string cmd = carg[0]; // Command - string arg = ""; - if (carg.Length > 1) - arg = carg[1]; // Arguments - - // Do we have a command? - if (string.IsNullOrEmpty(cmd)) - return true; - - // All is fine - if (CommandLine != null) - CommandLine(app, cmd, arg); - return true; - } - - } -} diff --git a/OpenSim/Tools/OpenSim.GridLaunch/GUI/Console/Console.cs b/OpenSim/Tools/OpenSim.GridLaunch/GUI/Console/Console.cs deleted file mode 100644 index 596b6506f2..0000000000 --- a/OpenSim/Tools/OpenSim.GridLaunch/GUI/Console/Console.cs +++ /dev/null @@ -1,122 +0,0 @@ -/* - * Copyright (c) Contributors, http://opensimulator.org/ - * See CONTRIBUTORS.TXT for a full list of copyright holders. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * * Neither the name of the OpenSimulator Project nor the - * names of its contributors may be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE DEVELOPERS ``AS IS'' AND ANY - * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED - * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL THE CONTRIBUTORS BE LIABLE FOR ANY - * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES - * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; - * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ -using System; -using System.Collections.Generic; -using System.Text; - -namespace OpenSim.GridLaunch.GUI.Console -{ - internal class Console: IGUI - { - private List Apps = new List(); - public Console () - { - Program.AppCreated += Program_AppCreated; - Program.AppRemoved += Program_AppRemoved; - Program.AppConsoleOutput += Program_AppConsoleOutput; - Program.Command.CommandLine += Command_CommandLine; - } - - private string currentApp = ""; - private bool quitTyped = false; - void Command_CommandLine(string application, string command, string arguments) - { - - // If command is a number then someone might be trying to change console: /1, /2, etc. - int currentAppNum = 0; - if (int.TryParse(command, out currentAppNum)) - if (currentAppNum <= Apps.Count) - { - currentApp = Apps[currentAppNum - 1]; - System.Console.WriteLine("Changed console to app: " + currentApp); - } else - System.Console.WriteLine("Unable to change to app number: " + currentAppNum); - - // Has user typed quit? - if (command.ToLower() == "quit") - quitTyped = true; - - // Has user typed /list? - if (command.ToLower() == "list") - { - System.Console.WriteLine("/0 Log console"); - for (int i = 1; i <= Apps.Count; i++) - { - System.Console.WriteLine(string.Format("/{0} {1}", i, Apps[i - 1])); - } - } - } - #region Module Start / Stop - public void StartGUI() - { - // Console start - System.Console.WriteLine("Console GUI"); - System.Console.WriteLine("Use commands /0, /1, /2, etc to switch between applications."); - System.Console.WriteLine("Type /list for list of applications."); - System.Console.WriteLine("Anything that doesn't start with a / will be sent to selected application"); - System.Console.WriteLine("type /quit to exit"); - - - while (quitTyped == false) - { - string line = System.Console.ReadLine().TrimEnd("\r\n".ToCharArray()); - Program.Write(currentApp, line); - } - // We are done - System.Console.WriteLine("Console exit."); - } - - public void StopGUI() - { - // Console stop - } - #endregion - - #region GridLaunch Events - void Program_AppCreated(string App) - { - System.Console.WriteLine("Started: " + App); - if (!Apps.Contains(App)) - Apps.Add(App); - } - - void Program_AppRemoved(string App) - { - System.Console.WriteLine("Stopped: " + App); - if (Apps.Contains(App)) - Apps.Remove(App); - } - - void Program_AppConsoleOutput(string App, string Text) - { - System.Console.Write(App + ": " + Text); - } - #endregion - - - } -} diff --git a/OpenSim/Tools/OpenSim.GridLaunch/GUI/IGUI.cs b/OpenSim/Tools/OpenSim.GridLaunch/GUI/IGUI.cs deleted file mode 100644 index ca1bb30ef6..0000000000 --- a/OpenSim/Tools/OpenSim.GridLaunch/GUI/IGUI.cs +++ /dev/null @@ -1,39 +0,0 @@ -/* - * Copyright (c) Contributors, http://opensimulator.org/ - * See CONTRIBUTORS.TXT for a full list of copyright holders. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * * Neither the name of the OpenSimulator Project nor the - * names of its contributors may be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE DEVELOPERS ``AS IS'' AND ANY - * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED - * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL THE CONTRIBUTORS BE LIABLE FOR ANY - * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES - * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; - * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ - -using System; -using System.Collections.Generic; -using System.Text; - -namespace OpenSim.GridLaunch.GUI -{ - public interface IGUI - { - void StartGUI(); - void StopGUI(); - } -} diff --git a/OpenSim/Tools/OpenSim.GridLaunch/GUI/Network/Client.cs b/OpenSim/Tools/OpenSim.GridLaunch/GUI/Network/Client.cs deleted file mode 100644 index 7fae830d75..0000000000 --- a/OpenSim/Tools/OpenSim.GridLaunch/GUI/Network/Client.cs +++ /dev/null @@ -1,113 +0,0 @@ -/* - * Copyright (c) Contributors, http://opensimulator.org/ - * See CONTRIBUTORS.TXT for a full list of copyright holders. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * * Neither the name of the OpenSimulator Project nor the - * names of its contributors may be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE DEVELOPERS ``AS IS'' AND ANY - * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED - * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL THE CONTRIBUTORS BE LIABLE FOR ANY - * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES - * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; - * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ -using System; -using System.Collections.Generic; -using System.Net.Sockets; -using System.Text; -using System.Text.RegularExpressions; - -namespace OpenSim.GridLaunch.GUI.Network -{ - internal class Client - { - public TcpClient tcpClient; - private byte[] readBuffer = new byte[4096]; - private byte[] writeBuffer; - private TCPD tcp; - private string inputData = ""; - private object inputDataLock = new object(); - public Client(TCPD _tcp, TcpClient Client) - { - tcp = _tcp; - tcpClient = Client; - asyncReadStart(); - Write("OpenSim TCP Console GUI"); - Write("Use commands /0, /1, /2, etc to switch between applications."); - Write("Type /list for list of applications."); - Write("Anything that doesn't start with a / will be sent to selected application"); - Write("type /quit to exit"); - - } - - private void asyncReadStart() - { - tcpClient.GetStream().BeginRead(readBuffer, 0, readBuffer.Length, asyncReadCallBack, null); - } - - //private Regex LineExtractor = new Regex("^(.*)$") - private void asyncReadCallBack(IAsyncResult ar) - { - try - { - // Read data - int len = tcpClient.GetStream().EndRead(ar); - - // Send it to app - string newData = System.Text.Encoding.ASCII.GetString(readBuffer, 0, len); - //lock (inputDataLock) - //{ - inputData += newData; - if (newData.Contains("\n")) - SendInputLines(); - //} - - // Start it again - asyncReadStart(); - } - catch - { - // TODO: Remove client when we get exception - // Temp patch: if exception we don't call asyncReadStart() - } - } - - private void SendInputLines() - { - StringBuilder line = new StringBuilder(); - foreach (char c in inputData) - { - if (c == 13) - continue; - if (c == 10) - { - Program.WriteLine(tcp.currentApp, line.ToString()); - line = new StringBuilder(); - continue; - } - line.Append(c); - } - // We'll keep whatever is left over - inputData = line.ToString(); - } - - public void Write(string Text) - { - writeBuffer = Encoding.ASCII.GetBytes(Text); - tcpClient.GetStream().Write(writeBuffer, 0, writeBuffer.Length); - } - } -} diff --git a/OpenSim/Tools/OpenSim.GridLaunch/GUI/Network/TCPD.cs b/OpenSim/Tools/OpenSim.GridLaunch/GUI/Network/TCPD.cs deleted file mode 100644 index b48cfeab88..0000000000 --- a/OpenSim/Tools/OpenSim.GridLaunch/GUI/Network/TCPD.cs +++ /dev/null @@ -1,231 +0,0 @@ -/* - * Copyright (c) Contributors, http://opensimulator.org/ - * See CONTRIBUTORS.TXT for a full list of copyright holders. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * * Neither the name of the OpenSimulator Project nor the - * names of its contributors may be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE DEVELOPERS ``AS IS'' AND ANY - * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED - * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL THE CONTRIBUTORS BE LIABLE FOR ANY - * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES - * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; - * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ -using System; -using System.Collections; -using System.Collections.Generic; -using System.Net; -using System.Net.Sockets; -using System.Reflection; -using System.Text; -using System.Threading; -using log4net; - -namespace OpenSim.GridLaunch.GUI.Network -{ - public class TCPD : IGUI, IDisposable - { - private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); - private List Clients = new List(); - - private readonly int defaultPort = 7998; - private TcpListener tcpListener; - private Thread listenThread; - private Thread clientThread; - - - private List Apps = new List(); - internal string currentApp = ""; - private bool quitTyped = false; - - public TCPD() - { - Program.AppCreated += Program_AppCreated; - Program.AppRemoved += Program_AppRemoved; - Program.AppConsoleOutput += Program_AppConsoleOutput; - Program.Command.CommandLine += Command_CommandLine; - - } - - ~TCPD() - { - Dispose(); - } - private bool isDisposed = false; - /// - ///Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources. - /// - ///2 - public void Dispose() - { - if (isDisposed) - return; - isDisposed = true; - tcpd_Stop(); - } - - public void StartGUI() - { - // We are starting - tcpd_Start(); - } - - public void StopGUI() - { - // We are stopping - tcpd_Stop(); - } - - - #region GridLaunch Events - private void Command_CommandLine(string application, string command, string arguments) - { - // If command is a number then someone might be trying to change console: /1, /2, etc. - int currentAppNum = 0; - if (int.TryParse(command, out currentAppNum)) - if (currentAppNum <= Apps.Count) - { - currentApp = Apps[currentAppNum - 1]; - TCPWriteToAll("Changed console to app: " + currentApp + Environment.NewLine); - } - else - TCPWriteToAll("Unable to change to app number: " + currentAppNum + Environment.NewLine); - - // Has user typed quit? - if (command.ToLower() == "quit") - quitTyped = true; - - // Has user typed /list? - if (command.ToLower() == "list") - { - TCPWriteToAll("/0 Log console"); - for (int i = 1; i <= Apps.Count; i++) - { - TCPWriteToAll(string.Format("/{0} {1}", i, Apps[i - 1])); - } - } - - } - - void Program_AppCreated(string App) - { - TCPWriteToAll("Started: " + App); - if (!Apps.Contains(App)) - Apps.Add(App); - } - - void Program_AppRemoved(string App) - { - TCPWriteToAll("Stopped: " + App); - if (Apps.Contains(App)) - Apps.Remove(App); - } - - private void Program_AppConsoleOutput(string App, string Text) - { - TCPWriteToAll(App, Text); - } - - #endregion - - private void tcpd_Start() - { - listenThread = new Thread(new ThreadStart(ListenForClients)); - listenThread.Name = "TCPDThread"; - listenThread.IsBackground = true; - listenThread.Start(); - - while (!quitTyped) - { - Thread.Sleep(500); - } - - //clientThread = new Thread(new ThreadStart(ProcessClients)); - //clientThread.Name = "TCPClientThread"; - //clientThread.IsBackground = true; - ////clientThread.Start(); - - } - private void tcpd_Stop() - { - StopThread(listenThread); - StopThread(clientThread); - } - private void ListenForClients() - { - int Port = 0; - int.TryParse(Program.Settings["TCPPort"], out Port); - if (Port < 1) - Port = defaultPort; - - m_log.Info("Starting TCP Server on port " + Port); - this.tcpListener = new TcpListener(IPAddress.Any, Port); - - this.tcpListener.Start(); - - while (true) - { - // Blocks until a client has connected to the server - TcpClient tcpClient = this.tcpListener.AcceptTcpClient(); - Client client = new Client(this, tcpClient); - - lock (Clients) - { - Clients.Add(client); - } - System.Threading.Thread.Sleep(500); - } - } - - private static void StopThread(Thread t) - { - if (t != null) - { - m_log.Debug("Stopping thread " + t.Name); - try - { - if (t.IsAlive) - t.Abort(); - t.Join(2000); - t = null; - } - catch (Exception ex) - { - m_log.Error("Exception stopping thread: " + ex.ToString()); - } - } - } - - private void TCPWriteToAll(string app, string text) - { - TCPWriteToAll(text); - } - private void TCPWriteToAll(string text) - { - foreach (Client c in new ArrayList(Clients)) - { - try - { - c.Write(text); - } catch (Exception ex) - { - m_log.Error("Exception writing to TCP: " + ex.ToString()); - } - } - } - - } -} diff --git a/OpenSim/Tools/OpenSim.GridLaunch/GUI/WinForm/OpenSim Bottom Border.png b/OpenSim/Tools/OpenSim.GridLaunch/GUI/WinForm/OpenSim Bottom Border.png deleted file mode 100644 index b3594b6800..0000000000 Binary files a/OpenSim/Tools/OpenSim.GridLaunch/GUI/WinForm/OpenSim Bottom Border.png and /dev/null differ diff --git a/OpenSim/Tools/OpenSim.GridLaunch/GUI/WinForm/OpenSim Right Border.png b/OpenSim/Tools/OpenSim.GridLaunch/GUI/WinForm/OpenSim Right Border.png deleted file mode 100644 index 8b03281feb..0000000000 Binary files a/OpenSim/Tools/OpenSim.GridLaunch/GUI/WinForm/OpenSim Right Border.png and /dev/null differ diff --git a/OpenSim/Tools/OpenSim.GridLaunch/GUI/WinForm/OpenSim.png b/OpenSim/Tools/OpenSim.GridLaunch/GUI/WinForm/OpenSim.png deleted file mode 100644 index 38108420ab..0000000000 Binary files a/OpenSim/Tools/OpenSim.GridLaunch/GUI/WinForm/OpenSim.png and /dev/null differ diff --git a/OpenSim/Tools/OpenSim.GridLaunch/GUI/WinForm/ProcessPanel.Designer.cs b/OpenSim/Tools/OpenSim.GridLaunch/GUI/WinForm/ProcessPanel.Designer.cs deleted file mode 100644 index 14987917fc..0000000000 --- a/OpenSim/Tools/OpenSim.GridLaunch/GUI/WinForm/ProcessPanel.Designer.cs +++ /dev/null @@ -1,224 +0,0 @@ -namespace OpenSim.GridLaunch.GUI.WinForm -{ - partial class ProcessPanel - { - /// - /// Required designer variable. - /// - private System.ComponentModel.IContainer components = null; - - /// - /// Clean up any resources being used. - /// - /// true if managed resources should be disposed; otherwise, false. - protected override void Dispose(bool disposing) - { - if (disposing && (components != null)) - { - components.Dispose(); - } - base.Dispose(disposing); - } - - #region Windows Form Designer generated code - - /// - /// Required method for Designer support - do not modify - /// the contents of this method with the code editor. - /// - private void InitializeComponent() - { - System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(ProcessPanel)); - this.tabControl1 = new System.Windows.Forms.TabControl(); - this.tabLogs = new System.Windows.Forms.TabPage(); - this.btnShutdown = new System.Windows.Forms.Button(); - this.pictureBox2 = new System.Windows.Forms.PictureBox(); - this.pictureBox1 = new System.Windows.Forms.PictureBox(); - this.pictureBox3 = new System.Windows.Forms.PictureBox(); - this.tabSettings = new System.Windows.Forms.TabPage(); - this.cblStartupComponents = new System.Windows.Forms.CheckedListBox(); - this.gbStartupComponents = new System.Windows.Forms.GroupBox(); - this.btnSave = new System.Windows.Forms.Button(); - this.ucLogWindow1 = new OpenSim.GridLaunch.GUI.WinForm.ucLogWindow(); - this.label1 = new System.Windows.Forms.Label(); - this.tabControl1.SuspendLayout(); - this.tabLogs.SuspendLayout(); - ((System.ComponentModel.ISupportInitialize)(this.pictureBox2)).BeginInit(); - ((System.ComponentModel.ISupportInitialize)(this.pictureBox1)).BeginInit(); - ((System.ComponentModel.ISupportInitialize)(this.pictureBox3)).BeginInit(); - this.tabSettings.SuspendLayout(); - this.gbStartupComponents.SuspendLayout(); - this.SuspendLayout(); - // - // tabControl1 - // - this.tabControl1.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom) - | System.Windows.Forms.AnchorStyles.Left) - | System.Windows.Forms.AnchorStyles.Right))); - this.tabControl1.Controls.Add(this.tabSettings); - this.tabControl1.Controls.Add(this.tabLogs); - this.tabControl1.Location = new System.Drawing.Point(-1, 123); - this.tabControl1.Name = "tabControl1"; - this.tabControl1.SelectedIndex = 0; - this.tabControl1.Size = new System.Drawing.Size(632, 275); - this.tabControl1.TabIndex = 0; - // - // tabLogs - // - this.tabLogs.Controls.Add(this.ucLogWindow1); - this.tabLogs.Location = new System.Drawing.Point(4, 22); - this.tabLogs.Name = "tabLogs"; - this.tabLogs.Padding = new System.Windows.Forms.Padding(3); - this.tabLogs.Size = new System.Drawing.Size(624, 249); - this.tabLogs.TabIndex = 0; - this.tabLogs.Text = "Logs"; - this.tabLogs.UseVisualStyleBackColor = true; - // - // btnShutdown - // - this.btnShutdown.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right))); - this.btnShutdown.Location = new System.Drawing.Point(542, 400); - this.btnShutdown.Name = "btnShutdown"; - this.btnShutdown.Size = new System.Drawing.Size(75, 23); - this.btnShutdown.TabIndex = 1; - this.btnShutdown.Text = "Shutdown"; - this.btnShutdown.UseVisualStyleBackColor = true; - this.btnShutdown.Click += new System.EventHandler(this.btnShutdown_Click); - // - // pictureBox2 - // - this.pictureBox2.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) - | System.Windows.Forms.AnchorStyles.Right))); - this.pictureBox2.Image = ((System.Drawing.Image)(resources.GetObject("pictureBox2.Image"))); - this.pictureBox2.Location = new System.Drawing.Point(585, -1); - this.pictureBox2.Name = "pictureBox2"; - this.pictureBox2.Size = new System.Drawing.Size(46, 124); - this.pictureBox2.SizeMode = System.Windows.Forms.PictureBoxSizeMode.StretchImage; - this.pictureBox2.TabIndex = 3; - this.pictureBox2.TabStop = false; - // - // pictureBox1 - // - this.pictureBox1.Image = ((System.Drawing.Image)(resources.GetObject("pictureBox1.Image"))); - this.pictureBox1.Location = new System.Drawing.Point(-1, -1); - this.pictureBox1.Name = "pictureBox1"; - this.pictureBox1.Size = new System.Drawing.Size(586, 124); - this.pictureBox1.SizeMode = System.Windows.Forms.PictureBoxSizeMode.AutoSize; - this.pictureBox1.TabIndex = 2; - this.pictureBox1.TabStop = false; - // - // pictureBox3 - // - this.pictureBox3.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom) - | System.Windows.Forms.AnchorStyles.Left) - | System.Windows.Forms.AnchorStyles.Right))); - this.pictureBox3.Image = global::OpenSim.GridLaunch.Properties.Resources.OpenSim_Bottom_Border; - this.pictureBox3.Location = new System.Drawing.Point(-1, 120); - this.pictureBox3.Name = "pictureBox3"; - this.pictureBox3.Size = new System.Drawing.Size(632, 310); - this.pictureBox3.SizeMode = System.Windows.Forms.PictureBoxSizeMode.StretchImage; - this.pictureBox3.TabIndex = 4; - this.pictureBox3.TabStop = false; - // - // tabSettings - // - this.tabSettings.Controls.Add(this.label1); - this.tabSettings.Controls.Add(this.btnSave); - this.tabSettings.Controls.Add(this.gbStartupComponents); - this.tabSettings.Location = new System.Drawing.Point(4, 22); - this.tabSettings.Name = "tabSettings"; - this.tabSettings.Padding = new System.Windows.Forms.Padding(3); - this.tabSettings.Size = new System.Drawing.Size(624, 249); - this.tabSettings.TabIndex = 1; - this.tabSettings.Text = "Settings"; - this.tabSettings.UseVisualStyleBackColor = true; - // - // cblStartupComponents - // - this.cblStartupComponents.CheckOnClick = true; - this.cblStartupComponents.FormattingEnabled = true; - this.cblStartupComponents.Location = new System.Drawing.Point(6, 19); - this.cblStartupComponents.Name = "cblStartupComponents"; - this.cblStartupComponents.Size = new System.Drawing.Size(202, 109); - this.cblStartupComponents.TabIndex = 0; - // - // gbStartupComponents - // - this.gbStartupComponents.Controls.Add(this.cblStartupComponents); - this.gbStartupComponents.Location = new System.Drawing.Point(9, 6); - this.gbStartupComponents.Name = "gbStartupComponents"; - this.gbStartupComponents.Size = new System.Drawing.Size(214, 136); - this.gbStartupComponents.TabIndex = 1; - this.gbStartupComponents.TabStop = false; - this.gbStartupComponents.Text = "Startup components"; - // - // btnSave - // - this.btnSave.Location = new System.Drawing.Point(9, 148); - this.btnSave.Name = "btnSave"; - this.btnSave.Size = new System.Drawing.Size(92, 23); - this.btnSave.TabIndex = 2; - this.btnSave.Text = "Save settings"; - this.btnSave.UseVisualStyleBackColor = true; - this.btnSave.Click += new System.EventHandler(this.btnSave_Click); - // - // ucLogWindow1 - // - this.ucLogWindow1.Dock = System.Windows.Forms.DockStyle.Fill; - this.ucLogWindow1.Location = new System.Drawing.Point(3, 3); - this.ucLogWindow1.Name = "ucLogWindow1"; - this.ucLogWindow1.Size = new System.Drawing.Size(618, 243); - this.ucLogWindow1.TabIndex = 0; - // - // label1 - // - this.label1.AutoSize = true; - this.label1.Location = new System.Drawing.Point(108, 149); - this.label1.Name = "label1"; - this.label1.Size = new System.Drawing.Size(259, 13); - this.label1.TabIndex = 3; - this.label1.Text = "* You have to restart app before changes take effect."; - // - // ProcessPanel - // - this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); - this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; - this.ClientSize = new System.Drawing.Size(629, 428); - this.Controls.Add(this.pictureBox2); - this.Controls.Add(this.pictureBox1); - this.Controls.Add(this.btnShutdown); - this.Controls.Add(this.tabControl1); - this.Controls.Add(this.pictureBox3); - this.Name = "ProcessPanel"; - this.Text = "OpenSim GUI alpha"; - this.Load += new System.EventHandler(this.ProcessPanel_Load); - this.tabControl1.ResumeLayout(false); - this.tabLogs.ResumeLayout(false); - ((System.ComponentModel.ISupportInitialize)(this.pictureBox2)).EndInit(); - ((System.ComponentModel.ISupportInitialize)(this.pictureBox1)).EndInit(); - ((System.ComponentModel.ISupportInitialize)(this.pictureBox3)).EndInit(); - this.tabSettings.ResumeLayout(false); - this.tabSettings.PerformLayout(); - this.gbStartupComponents.ResumeLayout(false); - this.ResumeLayout(false); - this.PerformLayout(); - - } - - #endregion - - private System.Windows.Forms.TabControl tabControl1; - private System.Windows.Forms.TabPage tabLogs; - private System.Windows.Forms.Button btnShutdown; - private ucLogWindow ucLogWindow1; - private System.Windows.Forms.PictureBox pictureBox1; - private System.Windows.Forms.PictureBox pictureBox2; - private System.Windows.Forms.PictureBox pictureBox3; - private System.Windows.Forms.TabPage tabSettings; - private System.Windows.Forms.GroupBox gbStartupComponents; - private System.Windows.Forms.CheckedListBox cblStartupComponents; - private System.Windows.Forms.Button btnSave; - private System.Windows.Forms.Label label1; - - } -} \ No newline at end of file diff --git a/OpenSim/Tools/OpenSim.GridLaunch/GUI/WinForm/ProcessPanel.cs b/OpenSim/Tools/OpenSim.GridLaunch/GUI/WinForm/ProcessPanel.cs deleted file mode 100644 index f0ed2ca7b6..0000000000 --- a/OpenSim/Tools/OpenSim.GridLaunch/GUI/WinForm/ProcessPanel.cs +++ /dev/null @@ -1,288 +0,0 @@ -/* - * Copyright (c) Contributors, http://opensimulator.org/ - * See CONTRIBUTORS.TXT for a full list of copyright holders. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * * Neither the name of the OpenSimulator Project nor the - * names of its contributors may be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE DEVELOPERS ``AS IS'' AND ANY - * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED - * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL THE CONTRIBUTORS BE LIABLE FOR ANY - * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES - * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; - * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ -using System; -using System.Collections.Generic; -using System.ComponentModel; -using System.Data; -using System.Diagnostics; -using System.Drawing; -using System.Text; -using System.Windows.Forms; - -namespace OpenSim.GridLaunch.GUI.WinForm -{ - public partial class ProcessPanel : Form, IGUI - { - public ProcessPanel() - { - Application.EnableVisualStyles(); - //Application.SetCompatibleTextRenderingDefault(false); - - InitializeComponent(); - Program.AppCreated += Program_AppCreated; - Program.AppRemoved += Program_AppRemoved; - Program.AppConsoleOutput += Program_AppConsoleOutput; - Program.AppConsoleError += Program_AppConsoleError; - log4netAppender.LogLine += log4netAppender_LogLine; - } - - #region Module Start / Stop - public void StartGUI() - { - Application.Run(this); - } - - public void StopGUI() - { - this.Close(); - } - #endregion - - #region Main log tab - void log4netAppender_LogLine(Color color, string LogText) - { - ucLogWindow1.Write(color, LogText); - } - #endregion - - #region Form events - private void btnShutdown_Click(object sender, EventArgs e) - { - Program.Shutdown(); - } - #endregion - - #region GridLaunch Events - public delegate void Program_AppCreatedDelegate(string App); - public void Program_AppCreated(string App) - { - if (this.InvokeRequired) { - this.Invoke(new Program_AppCreatedDelegate(Program_AppCreated), App); - return; - } - - Trace.WriteLine("Start: " + App); - - // Do we already have app window for that app? - if (AppWindow_Get(App) != null) - return; - - // New log window - ucAppWindow aw = new ucAppWindow(); - // New tab page - TabPage tp = new TabPage(App); - // Add log window into tab page - tp.Controls.Add(aw); - // Add tab page into tab control - tabControl1.TabPages.Add(tp); - // Add it all to our internal list - AppWindow_Add(App, aw); - // Hook up events - aw.LineEntered += AppWindow_LineEntered; - - // Fill log window fully inside tab page - aw.Dock = DockStyle.Fill; - } - - - public delegate void Program_AppRemovedDelegate(string App); - public void Program_AppRemoved(string App) - { - if (this.InvokeRequired) { - this.Invoke(new Program_AppRemovedDelegate(Program_AppRemoved), App); - return; - } - - Trace.WriteLine("Stop: " + App); - - // Get app window - ucAppWindow aw = AppWindow_Get(App); - if (aw == null) - return; - - // Get its tab page - TabPage tp = aw.Parent as TabPage; - - if (tp != null) - { - // Remove tab page from tab control - tabControl1.TabPages.Remove(tp); - // Remove app window from tab - tp.Controls.Remove(aw); - } - - // Dispose of app window - aw.Dispose(); - - // Dispose of tab page - if (tp != null) - tp.Dispose(); - - // Remove from our internal list - AppWindow_Remove(App); - } - - - public delegate void Program_AppConsoleOutputDelegate(string App, string LogText); - void Program_AppConsoleOutput(string App, string LogText) - { - if (this.InvokeRequired) - { - this.Invoke(new Program_AppConsoleOutputDelegate(Program_AppConsoleOutput), App, LogText); - return; - } - - // Get app window - ucAppWindow aw = AppWindow_Get(App); - // Write text to it - if (aw != null) - aw.Write(System.Drawing.Color.Black, LogText); - } - - public delegate void Program_AppConsoleErrorDelegate(string App, string LogText); - void Program_AppConsoleError(string App, string LogText) - { - if (this.InvokeRequired) { - this.Invoke(new Program_AppConsoleErrorDelegate(Program_AppConsoleError), App, LogText); - return; - } - - // Get app window - ucAppWindow aw = AppWindow_Get(App); - // Write text to it - if (aw != null) - aw.Write(System.Drawing.Color.Red, LogText); - - } - #endregion - - #region App Window events - private void AppWindow_LineEntered(ucAppWindow AppWindow, string LogText) - { - Program.WriteLine(AppWindow_Get(AppWindow), LogText); - } - #endregion - - private void ProcessPanel_Load(object sender, EventArgs e) - { - string[] arr = new string[Program.Settings.Components.Keys.Count]; - Program.Settings.Components.Keys.CopyTo(arr, 0); - cblStartupComponents.Items.AddRange(arr); - - // Now correct all check states - for (int i = 0; i < cblStartupComponents.Items.Count; i++) - { - string _name = cblStartupComponents.Items[i] as string; - bool _checked = Program.Settings.Components[_name]; - - cblStartupComponents.SetItemChecked(i, _checked); - } - - - } - - - - - #region Internal App Window list and functions - private Dictionary _appWindows = new Dictionary(); - private Dictionary _appWindows_rev = new Dictionary(); - private void AppWindow_Add(string AppWindowName, ucAppWindow AppWindow) - { - lock (_appWindows) - { - _appWindows.Add(AppWindowName, AppWindow); - _appWindows_rev.Add(AppWindow, AppWindowName); - // Hook events - AppWindow.LineEntered += AppWindow_LineEntered; - } - } - private void AppWindow_Remove(ucAppWindow AppWindow) - { - lock (_appWindows) - { - if (_appWindows_rev.ContainsKey(AppWindow)) - { - // Unhook events - AppWindow.LineEntered -= AppWindow_LineEntered; - // Delete from list - string name = _appWindows_rev[AppWindow]; - _appWindows.Remove(name); - _appWindows_rev.Remove(AppWindow); - } - } - } - private void AppWindow_Remove(string AppWindowName) - { - lock (_appWindows) - { - if (_appWindows.ContainsKey(AppWindowName)) - { - ucAppWindow AppWindow = _appWindows[AppWindowName]; - // Unhook events - AppWindow.LineEntered -= AppWindow_LineEntered; - // Delete from list - _appWindows.Remove(AppWindowName); - _appWindows_rev.Remove(AppWindow); - } - } - } - private string AppWindow_Get(ucAppWindow AppWindow) - { - lock (_appWindows) - { - if (_appWindows_rev.ContainsKey(AppWindow)) - return _appWindows_rev[AppWindow]; - } - return null; - } - private ucAppWindow AppWindow_Get(string AppWindowName) - { - lock (_appWindows) - { - if (_appWindows.ContainsKey(AppWindowName)) - return _appWindows[AppWindowName]; - } - return null; - } - #endregion - - private void btnSave_Click(object sender, EventArgs e) - { - Program.Settings.Components.Clear(); - for (int i = 0; i < cblStartupComponents.Items.Count; i++) - { - string _name = cblStartupComponents.Items[i] as string; - bool _checked = cblStartupComponents.GetItemChecked(i); - - Program.Settings.Components.Add(_name, _checked); - Program.Settings.SaveConfig(); - } - } - - } -} diff --git a/OpenSim/Tools/OpenSim.GridLaunch/GUI/WinForm/ProcessPanel.resx b/OpenSim/Tools/OpenSim.GridLaunch/GUI/WinForm/ProcessPanel.resx deleted file mode 100644 index 361d658d48..0000000000 --- a/OpenSim/Tools/OpenSim.GridLaunch/GUI/WinForm/ProcessPanel.resx +++ /dev/null @@ -1,882 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - text/microsoft-resx - - - 2.0 - - - System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - - - iVBORw0KGgoAAAANSUhEUgAAAAEAAAB8CAIAAAAny03BAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8 - YQUAAAAgY0hSTQAAeiYAAICEAAD6AAAAgOgAAHUwAADqYAAAOpgAABdwnLpRPAAAAAlwSFlzAAAOpgAA - DqYBh9ypbwAAAYpJREFUKFOV0fkrH3AYwPG3Y84NW2xzj76btomJHE20NUcpi9DKUlt+0i6EjbnmiOWY - ZTKSo69YtolNRHOEYWsIK8sksiZZU5Ompo8n379gP7x63s/z+fEDdz7w3+4Oondv6JD+/WH0H4xgkDx6 - yDBlDMPUcY6kfcQofQKjjEmMH05h8ugTppmfMc36gtnjacyzZziaM8uxvDks8uexfLKAVcFXjhctcqL4 - G9YlS9iUfufk02VOla9wumIV28o17KvWcXj+A8fqnzi92MC5ZhOX2i1cX/5CU/8bTcM25xr/4Na0w/mW - XS5q/+LeuodH2z882ve51KHweq3wfqvw6VT4din83ykC3isu9yoC+xRB/Qq7bHDIBfs8sJPpWABOxXIr - lFsRuJaJCtA8gzPibDVcqAE34VknXStv0n7N0rJ7N0m3QIAWrrZBYCtcewVXRLAIeQMRnXKTGdmtE9YF - 0T0QLh0lM6YProu4fgjthRsDcFO+79YQJIhY6fhBSByB26M6SeM6idIJwxwAjlSW4/2by3sAAAAASUVO - RK5CYII= - - - - - iVBORw0KGgoAAAANSUhEUgAAAkoAAAB8CAIAAAAZ/QhXAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8 - YQUAAAAgY0hSTQAAeiYAAICEAAD6AAAAgOgAAHUwAADqYAAAOpgAABdwnLpRPAAArZlJREFUeF7tfQdQ - VMnz/+6yLCzLAruwS845C4qgqIiKOeecAyYULXMAAygUSBAFoZCc/qgYy0gqgqlMp5ZeUEvPO63LV5ev - 7n78PzOzrBy7IN558fu2ul7Nm9fT09Mz05/peWH5vBXVPO7HWYCzAGcBzgKcBf5rFgC8ccRZgLMAZwHO - ApwF/mMW4LCNswBnAc4CnAU4C/wHLfAfbNJ/bAHCNYezAGcBzgKcBX6HBTh44yzAWYCzAGcBzgL/QQv8 - B5v0O0CeK8JZgLMAZwHOAv8xC3DwxlmAswBnAc4CnAX+gxb4DzbpP7YA4ZrDWYCzAGcBzgK/wwIcvHEW - 4CzAWYCzAGeB/6AF/oNN+h0gzxXhLMBZgLMAZ4H/mAU4eOMswFmAswBnAc4C/0EL/EVNWlnN++fTf2zl - wjWHswBnAc4C/8sWeAvw9jZwi7+y+i+mN4bb/+VRwrWdswBnAc4C/zoL8FbWvBHxo2o6J0FUTXtaVSt4 - E9JZVftnU4f6/Fb5jlr6RhbjmDkLcBbgLMBZ4G+wAD+qtivUFXzSWV2rJuHqutdQdJ3wTyPd6Lp21Fld - 2lRVN6TzhnfFdBwPZwHOApwFOAv89RbgvbbKTvx7h2DWiltqjBGtqfvnE9NWBYRtMO+1UPdaG3IMnAU4 - C3AW4CzwF1uAJ1hV1xmtrhO0ks7qOkatkVC9MFpFumvqQSJGa1+R3tp6RvrrVCRe1/Cn0/oGsVbqoGq1 - bkzVV/rTRoHUzWQNZ0ZQm0WV6NyM3FXOApwFOAtwFvhrLcATrK7viHSi69VEXDwcPXH3DWoSrW1gpLdO - RfrrGkAUXRoZGWwgJGklw42Nb0TSjY1tqfOy7Zi1nmpKYLpBSbXO0B+tUDeKtVHdamYHhnltTdSJJblL - nAU4C3AW4CzwF1uApxPdoJWEaxraki5x8Y0qWteoR0l/PSEVKhCEaAJJNjYZUpJuekVGm5uMNzdrJZMt - zR2RbEtzW+qEk11qxy/b2kyoTb5aQltNoBtIrS00RxNYW8QU81gz0V4RqNUIMEg7E+G0I2Ny+ZwFOAtw - FuAs8BdbQDu8dYhtmsD2W1RjIKEGs1eow5Bma7O8lUy3NWuS2bbmrlPb4r+jFDRR4R+FQKjKME8NdWqc - 6wjkNBHuL+48rjrOApwFOAtwFujIAjzhmsb2tLZRSEmXEglZ1jWB9NY36a9HQEPIgIQ4zSDDTc1SEEGF - ZmMWQm29DJJvu2y67bLZdhUpYq6AlKBY7WQee0UrWey4AtJ6qa2otgysiCYxnt8oQLVSKwmFoTaUZ6iM - FqFdaB1rKZrM2g4jwBTMJjAOsxKzGCFNe3I5nAU4C3AW4Czwl1uAJ1zb1I501zWBVO6buPJmkP6GZjGI - eHlA2mWQdPNloy2ETCieybZdkYO2XzHdTjCDgFnsVfMdVy12XLXcedWqlax3XbXZdY3Q7j+RbHdfa0e/ - qW7XNagBYlpBPSgJVaEwQbsY0gQ0BC1Cu4xpG9FYNFmyiTQfRoApYBBmGRGFOmY0kKY9uRzOApwFOAtw - FvjrLcDTXdfclkTrmlWkQrXL+hsuizdcNthIiKGadPMV4y2EZFspBmy7arr9qlkMgQeQxY5rIKudgBAC - Y7a7r4Ps4q47xKvIMf660x4VOe+58ftILaETUS57b4DaymfMUIApYx9HFIN6BPwI5l2z3EmUZw1Bi+Tb - r1KQI4012nKlFeSIKcSgDcQ4IApyKru1syd3ylmAswBnAc4Cf4sFeKL1lzVJj3pt8cYrjCSbCAHVpMTL - XzXZCqd/VbadeH+zmGuK2GvKHdfMdwAbrlvvAlRct6Ww4RB/wxHoRTHGJeGma8JNt0RC7ok3PZL+NkLt - TA3oA60I/u294bSHqGoffwNqQ3+0Am1Bi5Sx19BAAnLbSauNt16FBUCGm4lBDDap7EMQboMWM2q1LZfJ - WYCzAGcBzgJ/gQV4og1X2pLehisgfQZsm64abLoq2XzVcDPc+lWjrVdNtl0DybZfkxNUu67ccd1853WL - ndetdt2w2X3DNo4ghOOem057CXK4Jt5yS7rlnnTLM5mQ977bPimEfFNu+6X+6eSfdltNbatD7UwN6MMU - g4bQE9pCZ+e9N6E/WmETd8N69w3LXaSBaKlZ7HU0GQ1H82EHWAMEs8A+sBKhjcRozHrtTMqdchbgLMBZ - gLPAX28Bnt7Gq2rS33gVxPy1weZrIMMt16SgrdeMAWzbr8u2w8sTX6/cccN8J7w/MOCmTdxNu/ibDgTV - bjkn3HJJBGDc9ki+7bXvdt+sexNL3ptz5IMZFe+PLHgYmH6n+/47Pfa/E5ShhXpmvNOOppa9F1/30bH7 - X1x4/ytQ5b3Pd9Q8n1Dyrro4RDFqK5AJCT5AaHr5+9Fnnsw/+ijs0D3GA2boAE0C0u/4pxFlppa9v/TE - 4wkl7/mk3IHm0B+tcNx7y37PTdv4m2igxa4byp03FDtumMZel8Vchx1gDaOtxDKwj4QaihmNGbCtSbk0 - ZwHOApwFOAv8LRbg6W+6pibxJrjpa2LqryVbrhtuuS7det1oG3HoJttvyGLg34mXV+68abn7pnXcTZv4 - W3Z7bjnsIWDgknjbVYVqdzac/7Dy7uePv/ix5be/T7/7+cIHXyU1fjw070GfrHtqAgqqqX/2/X2NL5qe - ffPdT7+2K64+/fKHX2off72n/qPQzLttiQkcmvcw8+rLZkj4+TcS3v3sh/K7n2+58Gxm5ftrzj4tuPXp - nRfft6vixkffZV37ZGHVY7TFOeE22oUGAr/RXvNdNwFyZjuIHUCwCSwD+4BgKxDsxgzY1qRcmrMAZwHO - ApwF/hYL8MSb4Zd/QwYAtq03QNJtN4y2wY/fMIm5IY+9abbjpmInvPwtqzh4/Fu28bcc9t52TEC4c8ct - +Y7HvjuDD7+be+PT738LKh1B1JUPv42pfj4w935byrz28sW3P3dURDP/0Rc/Jjd+HJ5zf0AuoaH5D048 - /KLrxTvhrHn8db/sB2gaGmi/5zaAHK222H1LuYsYAdYgCBdzw3g7MZGUmgsIB9Np2pPL4SzAWYCzAGeB - v94CPPGWG2oy2HIDRIHtJsho+02TmJuy2JvyHbdMd8Czw7/ftoqDr79tt+e2Q8Id58Q7LknvuO97xyvl - neSmlz/88n9vCi23X3y3qOrR8IKHK049efDpD29anPHfefHd4uOPN1549vzrn36fBK2lvvnx15Wnn7km - v+OUeMd+7x3bPbet427DArCDYicxCCwji7lpvJ0YCuYiCLeVGBDU1qpcmrMAZwHOApwF/noL8Ay23lST - ZOtNQwps0u23jLbfMomBB78l23HLbCd8OvHsVnF3bPbcsdt7xzHxHQCbW/Jdz5S7wwreu/zht78bV375 - 9f9Sml/87uKs4K9vDKxdrXBPwwv3fXfRWIeEd9Bwm/g7lnG3zQnI3YZZYByYCIaCuWA0AnLbbsKMoLaG - 5dKcBTgLcBbgLPAXW4An2XaLkSEl4qOBbTG3TWJvy2Jvy3feNtt1R7n7jvnuO1bxwLZ37BLecUyEu78L - p++Vem/WkSc//3nY0lUM+nP5Fp146pFyzyX5rlPSXTQfRoApLOKIWRS77sBEsh3EVsYxt2E3ZkAQs2fn - pDb+vyCx5bLB+gLxugLx2gLxyq3iqLWEVszXWzBMf/Ew/UXkKJoXpj/PUTTDUTTbUX+Oo2gWOerNkAvH - 80RTeDpjeHpTebqTeHrTCelOIGnhWJIQTeaJppKr4BFOIFdJEWRO4QnHqS6RgrOMIJnQrFdViKa/qkt3 - mqMe6p3tIppP9NGjWhHdFg1Djhg5C6DkMP1lUSr9o9bqL18rXom2bGWtUx+RMNh0/l/QL63zl1OVswBn - gXYW4Bluv81IyijmtjE8NbBtxx3ZzjumBNveMY+DQ3/HZi+cO3HxLsn33FPueaXdH1H0AWKvPxdb/gHS - v/7x1wGH3wOWu+0DyN1zSLxrm3CXghyxDOyDFYB85x1isR13TGLvMAMC6hjBpO1JbW2NhLo7/uKEwYZi - ybqD4pXrxCvW6S8ZR1BhQU/RLCe9WfZqQNIZS7AHqIMcHBlKgVgaQAU0AkoxxCKXKJgxlEKaHVVgNoUm - cJykymEMBMwmU4TDKRVLijOiOaQIg0MmE9W1AiFjVp1Sflb7W9Rff469aIaT3mwnvTlOolneKuxcSEBU - vHy+OGqdePk6ZkPJ+hwApGRDgWTLpb+4K7nqOAtwFmAW4Elj32FkRMlkxzuynaC78l13zXbfVcbdNY+/ - Z7Xnnk3CPbvE+07J911THnikPvBOf+CX8fDq8+/+AejzV6hQ++Rb/4yHPumk7W4pD5yT7zsk3bdNJGaB - cWAiGEoRd9d0N7EbCAakxIz5imBeRsZtiFm+Han75W0mYm4YbiySrN0nWbVevGSMeGF/uGnhJKkKSBj8 - AG8YKrTCDwCDBFXjVTlqaGEIBChinIAT4B+DHxKctUILAa1WBCIQRQGJxG3IpJAGfshnYtURmwo1aUhH - MJWyvYI9BnXq8I4B4T9bf9FkA9FMJ/FcJ725nuLI4eLFhAzQESvX42i4IRtdA5Juq3+bPd46uzmZnAX+ - By3AM9pxl5ExJeKUd8FN3wMp44njttp73ybhPsW2By4pD9xTH/rsf+iX8W7Wjc9fCyyffvrZ7TvvNDVf - vnbjxuMnT17L347h0eMnhwsK127ctGT5CtCGzVuKSks/fP78TeW8Ff6VZ58HHHgXoO6V/hBGgClgEPuk - B7aJxD6wksUeYjGQIo5Yrx3Jd90DwbavSAWBd012qoh1QVtS986bJqRbqiTR8eIVGwyWDtdf2Fsf0cYk - EQOqdlEOgw1ABcEwBE8ACYRiDKJwaRxFL4oxDJNeQReNsRgz235k0RgLs5hYFCdRHQv1KFapxFJpLMBS - QR3dvSQA2Rq9QYJglAq3VPD2v6S//mwjwKFoOiJFP8Ch/qLh4iWjDKI2SKI3GKzaIN1YIN1YLI1petOB - wfFzFvjfsQDPeOc9RiY74XwJyXffM4u7r4i/r4y/b0mwDR78gWMyHPpD97SH3vvf9T/w7sSKp51jRn1j - Y+SKqOA+/dx8/Fy8fEC+gT3GTpqcm5f/7bevj/mAi5u2bffr0ZOVbUvde4Xu3rP3m2++eSug1XUh+be/ - CD70XvfM99B834x3PdPfpSD3EJahIPcAhrLa+wAWs9hDTKcmWBIEk6rJdPd9EOzMiJldTeiItqTuoE4S - RttrDNdnSKJWiZcMRUCmN12g3kJk0RK7m8VAS7UNSAEJ2KPaYKThEQu5SGZrePRqr49tJLbGZASTgHw4 - stCNYpJ665KhFCOk1RCoQk11KRa9UdRkZRkxAFZtbHL6t8apHdlfb4YR6XSg4KIR4shRklUbDFYC/3Kl - m0qMttd1ZfxwPJwF/pMW4Jnsus9IBoLbJV74gSL+gXLPA4u9D6wTHtomPXQg2PauW9q7Xvvf8zvwXmDm - +3VPO4QooNf6TVs0YUmdM2zUmKvXrnWCK+/cvTtgyLBOJODSqPETnz579lpw+uzzzy9V17z3/vudcD59 - +uzCpeoPP/ywc2l3Xv7QN/eD3jkfBGW9H5D5Puzgvf89j/R33VLfhXEc9z20Tya2skkkZAWoSwDUEYIZ - zfcQgklBsC0jM1DcAxhcTfLdpAsIse5oJXUfqRI7bsBzGURtlCwfqz/PRzRNCghR3w9TgwoLqlQ7e3gu - o/XelfqGGQMSgmqtG4yqe11t7mmxWE0dtzGBrDr1HqbqIRGKc+rwi2Bqa6ymvoXG4jkWFDLYYzDG6c82 - eP8k++vPkurPcdbHpujiEfqLRkhWrZNEbZSuzzLaUmIcU9N+dLU6BC6fs8C/3QI8WdxDRvK4h6bxDxV7 - Hir3vKvc+65lwrs2Se/aJr/nsO8959T33NLf99r/vt/BDwIyP4g61+Fz/N98++20WXM6RyZc9eseVFNb - pxVOnjx92jus/2slgGHwiFGfffZZJ5h04+atnqF9rRycXDy9Dx7KYZwvXr588PDdJ0+f/fwzeX/8xKnT - nn7+4PHuFnjy9JnOES6i6HF4/uM+hx+F5DwKOkRM4X/wA5+M9z33vw/7uKa9D0M5phCL2SW/B9MxghlB - 1onvWiUSq4IsEt4130uMrKI978LsjMziCaEjQOgRRrLdt4w25RquWi5eGCqaYq5yhTT0YQ9TkBtU46hz - bH0ig8HSq0czWu9yMSRTPeLRerOKxV7qu2KqUIzeMCOPk7AnSqjzBQmGt7nvxUJAGh2qaqeQxmLEV49E - sltxLFBjj0q2PmzC6a+KmP9W++vPEItmOIsXekmWjZSsmCldu8loU5rx1jLZrhtq/8AlOAv86yzAk8e/ - CzKlpKDApkx4zyLhPavE92yS37Pb975TKnHcHvs/8D3wQbfMR0HZj/Juf9kRDKxcvaYryASe7iG9Hz1+ - 3E7Or7/+On323C5KAFvUmrUdaQJR46dMNbe1B5u9i5u7r19C8r4pM2b59+jp4ecPMBs0bMTW2B1Qw9bZ - BTzWjs69w8K//bazF/imH/twSPGTAQVPwvIfhx5+HJzzuMehR7AJUN/nwAeeGR+47/8AOOdCcI7YzTHl - fYeU9+33vQ8zMsCDSW2SiG1BlonEzuaUYHM12qEXQLLYs0brYiTLxujPticxE247UZhRP47Ioh910MZ2 - Eds+1sEetVft+LHHQOhziSxgYnjz6gENWpwhk+rRD/VuIWVT3bHDvTSqDCurqr21FpWnpk+OkDBOfWuN - luL0/5faH293iOe7GywdabB0pnTNZqON6SZby+Vxd5nr4IizwD/WAjyzve+DFJSUCe+bJ75vmfSBdfIH - Nvs+sE/5wCntkWv6I4+MR74HH/tnPe6R/aRX7pPbL9t/TJJhzPmLF7uOTOBcGLmsHTidOXf+jSS4evte - vX5dK8L9+NNPvfqFAdiYQGcPLyt7RxsnF0d3T6Sd3D3tXFyRgwSEgAEJwN6LF529YL7o1Mejyz8cXvps - cPGz8MKn/fKfhh5+Gpz7BGYJOPTYL/MxrOR94LHXgcfuGY/c9hPTgVzSHjmnPYIlHVIJwap2KR/Y7vvA - BkZOJqaGwUEWSR8od56SrV0nXRomninTm8QnSDaRJ5pIjuodRYYu6i1HFmCxgIwhHMEhGmmR6I1uM7Kw - SbXN2OYxkFd7hq0PhpBQjKIau0lGwI8+EqkKCtlzjIyZQhd7KU21t9la0avH/ak01ROPra8QcPqrH8P5 - t9tff5ZYPNfFYHE/g8ixRuu2GG/aJ9teYRr/DnMpHHEW+NstwFMkfABSghI/ME8kTtYq+ZHNvkd2KcQX - u6Q/dst47H3wiV/mk8DsJ8G5T/sVaH+o5P/+7/8mT5/5RuCEiAq32dqCEwDvjSSAecOWrR0FcHg4xdTS - GjuTXZGpsLaZPX/BL7/80sn+5MLTH08++nxc5fNR5R8OK/1wUBFA7lm//Ge9Ccg9Dcp5ChP5ZxFb+WY+ - gdGAcx4ZgLrHbvsfu+5/DGM6pz92pDhnn0LINuWR9Z56xaatsmX9DGcbG84WSGYJROMFepMF4ul8AJto - Ak9/BqVprx5TZO+HsccgVQhEn1pUP1ivfpRD9VpY6yXVk5Bt4jb2KD+Jq1pvhuFhRTU6vnpSvxXzVNDF - 3mZjt+jYoyWUGAazV7PZJfW+pfqxScbP6a++Rfrfs7/eND3xAsBemOHKqYA92bZC0121zM9wxFngr7QA - T5n4iJF50iPLZELW+x7bpjx2SH3slA6n/MTjAJz1026HiPvunfdsetXHWgHgg0ePvPwDugIkbXn2paWr - pX399dehYeFvKmHoqNHsLprmDzcCN2+PIcHZ6xDO0c1j8bLln3zyaSfY9uzrnxec+njWiY+mVX008ehH - Yyqejyh7PqTkw0HFH/Yv/LBv/rPQvGchh58F5T7tnv00IPup/6GnfllP/TKf+mQ+8Tr4xPPAE7cMQi77 - nzinvWezM8di/Tz5YnvpdF3pNKFkmtBwplAyXcdgukA8FdgmIIlpfPEMGsCxV8fYS9P0ThsBJPXLZK2v - PKsfA2G3wQhi0Q+FsMf9VXuJrUJUzyi2efOaPamv3p9kNares26zq8mQjO09smhP9WpB61anSg57j5u+ - NqDaF+X0ZwsL9avoCLX/l+xPQ70w6cppxuu3yrYVme2uUzsfLsFZ4M+wAM88+QnIIvmJ5b4n1imEbFKf - 2qc9dUx/6pLx1P3gM+/MZ36HnnXP+TAk78O+Bc+31Gl/3e1N9xUZjC1YEqlGFNyK+x0AifcEOnnABJfw - GAs2JDtHTWxaQv/Onyup//D75edfLj7zct6pFzNPvJha9fGEox+Pqfx4RPlHQ0s/GlTyUXjR87DC530K - nvfOfx58+MOg3A975H4YmPNht+wPYUC/rGeeaY1OMdutVg00nWNiOk8sm6Mvm61nMltkOFUknSmUzhJK - Z+qIJ1KEmyYwmCkQTeDrtYnJ2Ptn6kcWyb231m9csRtpqmfr2XvT7DF9+gQHO1XfZnuVaH0Fm2xpUmBT - bWOyj2PRPU/1SwJMAtlabH2Vra0mLJgjdbFXAhiwtQVF9p44p3+b+53E2q2bwP+j9scuxTwX8YIwadQ0 - 2cZtprElivgm5pE44izwxy3As9j3FGS576lVylPr1KfANru0Z47pz5wznrkdeOaZCdf8YbecD4MOPw/N - fx5W9FHyVe3PlRQWl7xp4AX+cZOmqEHlwcOH2K58UyF4NuSTTzuMusqPHLFxdH6tTGsHp5XRazqHt9J7 - X6+t/jTq4idLz32y8MzLOadezjjxYnLVi/FHX1CQ+3hI6ccE5Io/gpX6Fn4Ec/UiOPfUP6XQc+di+5Ue - dstMLBcYmc+XWiyRmM01MFtAEM5kpp5srsholq7xbMCbUDxJRzKTBHD6UwiJZ/KxPwmcwP6k6iWztp+q - ao2uWGTGsIdgEr0/x95vUz0Vyd7abn0kRL2RyPBMtQnZ5ttX6nfgmBD26RCGlGy/kT39yFRiD7CoPmLC - 7sbRR1fYDT9SpPUpGAbAr57n5PTn7K85fqYJEOdJlgDzpss2bTeNLVcmvMPcFEecBd7IAjzLlGcgq5Rn - 1qnPbNKe2aY9c9j/odP+D10OfOiR+aF31nO/7Ofdc5+H5BOXHV78cdLVr7TCQGl5xWtRRJNh4rTpamnP - PvwQr36/qZDgvmFffqldJUiOT0iwtHN4rUw8PDlmwqTO4W1X02fb6j/bWPtp9KVPV1z4ZMm5T+af+WT2 - qZfTT7ycVPUSIDe68sXw8hdDyj6OKP14QPGHoQdLA+PmeK1zcV1p7hqtcFph6hQlt400sYk0tlgoVS6Q - KBcbyOeITefrG88UmQDhZusC3gxnCMWTW7cop6oCOGCb6jHI1q+HvIq31G9P08+RqCMq9WOQqpiJvrJN - qPUtbAZaLP5ThXrs84ytOWzvse1jJuqHTV5BF8M8GpapMVK1a0oVYwGc6mmX1nt16uctX+EcRV9Of87+ - bIdAtcHQZvzozTQxXNxNGjVetmG72Y4K88TbzHFxxFmgEwvwrNOeg2zSntumP7fd/9wh47nTgY9cDn7k - nvmRZ9ZHftkfB+R+HJT3cWjhi7DiFxFlLzfXa/+/0Nr6hteiiCYDXiRQg8qPP/44aNjwNxUyadoMPNXS - ETLF7e0qvI2eMLFzeDv8zldZt7/af+OrlGtfJlz9Mq75yx2NX25r+GJT3Rfra76Irv486tLny89/Mv/I - uenZ2yakDx+TGDYqqe/IpNAhcb0i4oIj4oIGxPUYuDsoZLOf1SJjy8VSs9kSxQID+WyCcLI5IqMZIsNp - QqM5BN4MEcBNJw+Y6E0h0RvgB4+WsBCNvVKmurumRhf24ho7su0v9rA++z4WexKEffi4dZdSlWZbmq3v - zzGcYx9HVr9oTO6uUdhjKKX6sDL94olqe63NV7hYuMZiPlZQHUqqQZHT/1VfcPZvjd7UT9h2cfzozzIR - z/czXjVBtjFWuavcMvkd5so44iygtgDPJv0jRnb7P7LL+MiRYNvHrpkfe2R97J39sV/ui+55L4ILXvQp - ehle+nJI+SezTml/kxo7hIHBvd4UnLCl2RZUNm+LeVMJqfszOoGlssojuK/2Wpld2ZzsHPze6OqLLz+u - ul6xviTKYqGxcqFYPhe7lHrSqbgJRx4zkQLhJurg9hvZn5zKJ/fA8HSJ+g221u83snhOFY1R1GHwwzYe - 1XuS7CMjr7Yf2z7uQV/ZJvjHnmZkyNcKdeq331S7jvRLJeTl8ak8wQjVtqR6ZxIF2eOX7GaSSiyFVdWD - lGwXrhVl2RsLnP6c/dnoeivjRzxbKlnkZxQ1znQLATyr5Ntq58Yl/jctwLPNeGFHyeHAC8eDL5wzX7hm - vXQ/9NIr+6Vf7stueZ8EFXzSu+iTsJJPB5V/Orzys7HHPvvo21+1evPV69a/FkjaMnTrGfLxb98zu3f/ - gadft64LgQRsaXYCLTdv3cJbbq99chIvwKWk738jiHorzA8/vj8yqb/ZfLFsnj7uwGGL0nguecZEMoME - cHhDgDxFOY2+IQAQmqj6eNWr96Vanx9RIweJvVrviqlum6lfgGvdLWTfN2Evq7EAS/USG71pp3pbjv0V - gPpzXK2fIGEvurGIkD1s8ur1OPpM4CuIpc+nMLxkd/IY0LIAlHm0ttpq5nD6c/b/g+NHf6ZUGulvvGqK - Yutuiz2nsDsFd8fR/44FeHYHXtofeOlw8KXjwZdOmS9dsl66HvrEI/sT75xP/A9/Epj/ac/CT0OLP+1f - 9tngis9GHv1sfNXn1c+0v9b97nvv+wR07zo4JaWkaoIEPpfcdQnZh/M6h5kVq6O78miJg6s73knAd5zf - Cmi9qZBh8WHyWWLZTH3ZAiAcuQOHNwSkc8jzk3gNzmAWX5/d2aKfAiG7lOxRjmnkeRMSdbV+r+Q3j0e2 - /rkMe+2axEkTKac6EKTvG0Aae64SCcbG4j/yJAvQC6+TT+PpICajr5aze2nkORdWdeuTJmBjO5DIBD8D - KsJAj0xJkknhmdNfFYhz9v87xo94joPRyiHyjWvNd+bbpNyG9+PoP2wBnv3BTxwOfuKY+YlT5ifOWZ+4 - HPrELftTr5xPfQ9/2i3v0x4Fn/Yq+qxf6WcDyj8bWvn56GOfTzzxReadDr+nnJtf0EVwmjB12g8//KCJ - BHiJDW8LdEXIxq3bOgcSwC1eenNC9KbxtwOaOfh814GsQ2+KTG+FHzGc1TKp2UJ93H5DAIfozXA6XoPT - MZgh0Kfvd+tPb0UO4ArSiL0YSmGnETkzWx/KoCCEJT/hmUljsokkQQAJPAAeeklVsHUnk72dTYg+QkkK - gpNtcuJdcoamNMHewCM5rZ/5Vz14OZWUgmQCn6ws+1sc9tUVVpzVy+nP2f+fNH5oeBckWztbGZNklXAe - zpCj/5IFeI5ZnzllfeZ86DOXQ5+5Zn/mnvOZZ+7nPoc/98//PLDg855Fn4eWfBFW/sWgyi+GH/1y3PEv - p576avbZr775qcOnObDL91o4GT9l2osXLzvChh9++HFdp/85gD/Z2b0noZMnSpjkrJzcrjw2ybRFkNf2 - Mc63gltdF7K2eDnehJPP1yOPUOIdODxCiQButgAIpzeZL57JI0RjIxxVsRG9laWCOhqH6eNIgRDMSDBm - AlHUpYpnEdRR4Q3dIQQPGAjNomEWTikP2whlFeHIYjJcYl/qUmFe6xObyFdHbCosVF+iBQnE0lrUKrXV - Hwzq1/VYSIoqVGr/yfqzdwrFsynks5iVto5Fn6ztbE0AexpQ+4unkwQKIkd1H/Hv01+l5O+2P6xNm0xi - dDp+2CnrLNbL/4PjRzLfzThqtNnmLVZ7y+z3vwv3yNG/1wI8p0OfOx/63CWbkFvO5x65n3sd/sI374tu - BV/0KPoiuPiLPqVf9i//cvCRL0dVfTXhxFfTTn+1oeHbn7XffVP581NnzuKDxVpBDo/+x+7a/d13r//L - t/Pnq6dOm+/l18PZzVdNvt16zpm7tKHhcleQA/cCreydXou1jAH7k73C+n/zTWefVO5Kpb+P59j1MsUC - sXyBvsk8+g7cXKHBVB18owsvd4Pgd4jTh4edrQrUyMOHU/i4hD1MsBnO0jGcATjUMZqjg/1MZErnCiSz - yVvh4AQCoSCKsy+SsBtmKhShnp2JVV2lvrttdQxZiTOFv5utCsXUOQQGaHGCEAADCg9kb7P1O5mqO210 - P5NxCmkUyG7CsbpYzMdUIrXQlqoghOrzFvUnuD6DwtVUat7pAuP5xHSSGeRUjIh5KllPkEiXQjtBtalk - l9hortBkAX3wZ6oOea51CvmmDEH3v1Z/Fgr/Efuzu62a4wcDCSsq8Qy+ZBbPYM7bsz+ksTXBDL7hXBiN - vM0pmUUHZ5vh988cPwbzFCZR/RSbV1ruzrVLvwlvydG/yAI8l5wvQa65X7rlfulx+EuvvC9987/0L/wq - sOir4JKvQsu+Civ/atCRr4cd+3r08a8nn/5m5tlv7n3e2YcZmX/Hv74drTqO5/5HjhsfNmgwnvifNW9B - +oGD+HbXGwHARy8+ulh3ofJExZETlTUNNS8/7TDm0xSLP/gm/4bThZ1J8OC7XN16Bnfyhvgbqf2mzC++ - +tg80gABnGKRSDYf78AJTebRt9/wZvc0Am8SBBnT+AazeYZzecQNzRXIFgrli3Rxu042S89skT6eT1Eu - FuMon6cPIaYLRSbziBDitWer4j8CbCyMa/0mMnH01JEZ0EzV9y1pJnuRnO18EoCBH6dPjrBLSLOy6iPZ - 1ZxC5LDbckQgELH1nXEmH0JYdWBGQlULDe+IYqiL7riCmcnBkVQEfnYP7w/rDyHSeXxiwJk6sI/pYhhK - TxmpDwOaLtIzmSOSL9AFjOHNeiwRCM5NEcCACKbNYNJ5YvNIscVSsRk4F+jC/tJ58NQqIPxr9H879od5 - Z/ON55MhhMHGxo98nh4ZM3N0yTqJrJlUo+IP2p8srWbyIdB4no7RLCHWbRi0sDz5Rg8WYdSAkrm0f/8N - 40c8x0i2qqdi0yLL3Qfs05uZ8+ToH2sBnkvuV665X7kd/sr98FdeeV9553/lV/BVt6Kvuxd/HVz6dZ/y - r/tXfh1x9JvhVd+MO/nNlDPfpt3ScsOsc2/+008/4e9pOuf57KcnH/9w/8UPDwn9+PDlTw9f/vzwk5/f - Rf6XPz//6uePQUjgFJm4BAYVMyvSSh//8ODTHx89//4OqluzfgMeiewivOG/BUL7h3/33fc//9+PL398 - D3K0yv+DmR/9cA/CtZqi5zZP5RKxYomenCITnKx0FnM05PYbXfkKqNuFm9CVzRPhdQKrpRLbFVLbZcYO - USZOq2TOa2RI2K8wsV9pZLNcarnMAIBnuohIwyYnYJLA2GyewVwVXLE0OSU+iGxPIU1AiO2FqmMmGk4R - TuryCPMsinwU/4BkBIeYzNYiDI3I7hbNJDx0e1P1OAzdhERZFWrSSwT5qBASMNFTFrEx3dQPvKjZSOJN - 9JfM4xnOISsDo3k6MoDTHH3zJQbmC6U2kUawmGM0jGZsu1xqvVyCXiDP+MAFk0WGEGl8X8Z6iRS2dVwh - c1wps15iZL5Ygq+pGYMHTwDRTd0/W/+3ZX9i4al8Q4T4M4SKRfrWyyQ2S6VoO8aMbZTUnLV9PmkXW4j8 - EftDArYQUBcEKpfqWS4VW0ZKLJeCDMgX6eaLJNOFiIPZ6PqHjx+t9hdN1ZNG+pltmGUVl2yfWg1fytE/ - ygI8t7xv3PO+8cj/xjP/G5+Cb/wKv+lW9E1g8bc9S7/tVf5tv8pvBxz9dkjVt6NOfDfh9HfTz313+7PO - QjfcD0PcpiZsQuL5kR9+/BGH77//vm1+Wxf/8Jvq1bdtl99UrLilXHVfueyq+bRc+wlpjhP3O0464DAp - 4zc0IZ1kLrxgteqBcsVtJYq0pVV3lYvv6536gvyNQM7hvK7fe8P/vU2bNRulnv3avPSu0fJbRJm3Tstu - ml35/Dev+qntMO/QVOUisfkyfcUS1esBJgt0jOaTbTHJbGygCbAzBtejXKJvs1Jit9zIZY3Mc4Ni0N7A - OZnjks/FJJ2NST4Xu+98zLZjUXNzx3iuV7quNbVdamKzUmq1XGy6QIQXxrFYls7nAzawXiauZx5xK+QI - R9aKKAztVBuV9LkS7IOBR4U36ich6UYlIwKK7D226YQTwtndPhafEVEsRsTOJN2fJNIgk1ZNdjunkjST - z3JUiDuHYi30xFWAJVCk9dKb6m84n2AhQl4SPcCGCyU2y4xd1sgH7gnYdjQq6VxMwumYvae2z8ocA5PC - sNZL8aSP2HwpIXxBzX6lyYqime88v4nO+ur7L0qv5PhvsrddaahcKsLGJhYfhq32+ZP0f4v2R0cYLRCY - zBWaL9WflDE47uSm+JPbEs9uTzi9bc+pLbtObsSqyHSJCEMFRv6D9qc3dwVYImBUY73ltFrmstrUZbWZ - w3K5zVIjUtFiYkCMSbI7/Q8eP121Pxq70l25abLlrj32qeddD38G78rR32gBnnv+tx7533oWfOtV8K1v - 4bd+Rd8GFH/bo/TbkLLvQiu+Czvy3aBj3w07/t2YU99NOvP9rPPfdxSEAb3whvXoCZP6hA/oGz6wEwJD - vwGDxk+emldQDGlf//zJ5nueS26YgJbdM55+ROHX393RyY+Qcwfk6Ofm5z1sl82ye0asoKr4faPZZ0z7 - bzFdtZ98YQvfaMZDKPgjt64EcHhyMicvH6XK6w6MKTJYft848uYryW1r+SPpkmcrOjJgj23OWDuTbcYl - ItlCXdki3OnRkS3SMZonQFq+WFcZifWvod1KY88NZhF7umfXpTz7vP3/wbYV3vxBzb4LMSG7XFzWyuFc - 4Knx3ApkSucLsMPJ4iT4ZWCJ4QJyxO4QgZzWdTT8IMsHqBD3jeMC1XMrqiIUseCYVDDZKpMhGUMgVpDF - iGwrErWQzNbNSZJJ0+yWGEQRgVQUqmOkWtrTughkqkV1WX/pfIJt8kjsMerbLJO6rpOvKp197/ktzb74 - 6vsvYdjg7S6ua+WOq02c15gABbceW9mO850Pb3bbame13ABbbVh8MET/8/R/i/bHMsJkoQDrJJsVkrhT - mzQtAOAB8iEwNVrE/4P2ly5EXTrYkLBbJdWsaNeJjdjpNZ6ra7xQwFZFbEz+A8fP77a/bIWT2fpRVrti - HFKPu+Y8h7Pl6K+0AM+z8Huvwu+9i773Kfrer/j7biXfB5Z+37P8+94VP/Q78kP4sR8GH/9h5Mkfxp3+ - Yeq5H3Zf/0mrd0ZwNnPe/K6gSFsePDCyfc+Wg+9Oi7xlDMyIvG28oF7m3dvT0fH1H1ZGWeDf+EyLZfdV - CIfEqEQrVx8fWxsfF/du73/wAVRdvXa9uY2dqzd5eKQTwjcnQ/sP+Oor8u3KUWMmW9u5DNpot/Su8ZK3 - inB7Hob9/H/at3afff7EZqWh5XID5VJ9rJ1N5hN4I6i2RKhYSm782KwSO64x8txoOi93LHCr6/f24K8R - 1QXHujhFm1ivkGBHyGShkDyNMo8nBXhQeAPBE6lCkFk8gAFJ070ppAnS0CM8Iym1ULVXybbjVNubbH+J - Yg+ObLuSoCBwBfyQCfk0zeJFEMMDcpXGjuyU1DWvdbeTbksyBlUtiOcQELCbhdCZ6vl6/WfxjBby4a/N - FuvZr5IG73Qqv3K4cwPCaDHHV/tutvDbYh4YY4VTTf74k1uBlOYrRIiw2SMzf5b+b9X+sBjgTblMD8rv - OaXl1Rq3dXJs28oWCw3nkFu2f8T+2Jk0XSLEos1lnUyLAU9twXaoIlJkvECg2tr9Z46ft2d/2Qprs/UR - VjvXOaSUu+Z8AN/L0Z9qAZ538Y8+xT/6lvzoV/pjt9IfA8t+DKr4MaTyx9AjP4Yd+3HQ8Z+Gnfxp9Omf - Jp37afqFnyo+0L4zebig8E2xjfB7Aod8J+UpGUQtf2g0It7awf712MbqArwFjXVZ+g4BoWV3jaeVKyHN - 2dXXxdsHe5LrNm3GjHr5yScIFvHNLdeO4Q0Pldi6uJ49fwH8F6tr8C/ezm4+Do5+Y9Mtl7di5x+J2FjZ - 6Nt2L3540JFXrbhWaLtKarXMwGK52Hy5SLFUV75EV7FcqFyuC8CzjTLEfTWEFIdqU7oObG054aBXFc91 - xjedV0ixmjaLBHYKjBjkLCJgozrilEZLOLLtSjCQnT1EJ0AsBHA0TfgBjWAG7NFMtq8IBnYJxGSCVPuf - NAoEOLWVAPkM6lilSJCnSPCACWAPQmhxAo1UPoMQcv8P24y0CnUtnesPNjhQEq8sN0Tge5fuMXbld7gx - NXin7eI87R8jbXq/GresgBOIsI1bYfvP0P/t2h/WQESF3UKXtSaJZ7Zr2sF1jcIiUqJcqitbIviD9jec - IzCL1LWJkrivN9OsKOncduc1xthsly3WkbCt8n/k+Hm79v/NDFpoaraun9WOFY4pBW459+CKOXq7FuD5 - lvwE8iv9yb/sp4Cyn7qX/9Sz4qfeR37qe/Sn/lU/RZz4efipn8ee+XnSuZ9nXvz5zufaX3ebPX/h74E3 - PI7v4Nd/pT2AjcFb2FIH5HRRFAI4nz4ei5plkbdMlj8w6rf4VVl8iAt7knUNDZhUd+/dD+kXhr1H8nWu - diDnSV53c3D1OJxfAM4vv/qqf8QQRHIEO51fYecfxzZIuPpFWScudVRKmOMaqfVKA8USAm9yPNG3RGQR - JTJfJnZYI/XcLJ+YMeDDLzrbiuyKv85tSPHeorCLklqu0DeNFBotFBgvJrt/2BfCIl0yn2cERFlIaRHJ - J/hBAQ9HnKpwZSFhI8hHCxotoeEU7ugAJufz9IFG4KTLcFwikhepeCAWOUR4KziR6hbQSml1uIq0Wgci - GUgGxeidObViDH1VutGCneiPqyaLBLIlQusosVO0LKd+X1cMpeapvJYXWdghvLmsN7ZYrme6VIeZ8c/Q - /63bH+bFJq31SrHrelnqxVhNa/htVTpES5XLRbKlJCr9I/aH5c2WiuxWG3pvUmpWhJ1z3Oa0WS3GdgIZ - SP/I8fPW7d/J+DdZLlWu72m9Y6FDcrprVpNPyU8c/UEL8PzKfgH5l/8SUPFL94pfelb+0uvoL32O/RJW - 9cvAE78MOfXLyDO/jD/3y9QLv8yu/vXBl9rhbcrMWV3EpHZsiMDCIh0ATgTeHhiFLXHoys4kE8LgbWGT - DLuaiOGCxrk4ufiq5SMIwz+dvvf++5hXH330Ef6MG1GahZ0D8AwAhu8sI8JDVDd4xKi6eoKC+FrK3IWL - LVuftIQov4FuS66bvJU7cKXPojrxqnGnN8JROq6V2kYbWEbpIyAwXymyWqVnvVrsuE7qtdV0atZArftj - b+SpGXPFtTyfLQqItVipZ7wQCMeXLuYRAk5QhCOPcuA4l2ccyTNazDNeQuIt5ICQxtFkKbnE2JAwYFHa - YsKskgNEpAVZJnhYHEY8BXBxDpFAOOl9NXK1DQ9hoIhImIEZtAjLJHEkw+DWiiBKxUD1ZxgJzrb6m0QS - eFMsFdmulg7ZF/A7LLb7dLRW4yec3Wq3Wmq5SiRfKiAtogpo138xtRLa26n+avuT243YQoSdl/zG/mg4 - 8mGxP2J/AIlihdB6ldh1nSzlghZ4895kbr9GCliSRQo07U+6DKsQ2rnt7K85fiABSzRYyWezuablUbvH - Zhm2K+RLhURmB+NHNVroAoKNHzai2LBkmqjH2B8ZP68d/2/F/m+kvyzK1WL7BLuEWJeMU96Fz5mv5qjr - FuD5l//areLXgIpfAyt/7VH5a/CRX3sf+7Vv1a/9j/866OSvw07/OvrsrxPO/zrt4q9zajqEt2mz5vx+ - eFvaBt4ify+83WkPb/gcFzCsZ2jfpmbVO+A3b9/ek5g0c+68keMm4G90Nmzecub8efbpk08++WTmvAVt - 3yIAvPlHuJE7gn/49lsnt9xQdcN7F903yxzXGttHS+3WGFit0rdcpWcZpWe3ToxFtPc2+VvENuZiKm/k - eW0xc1hnaL1aJF+mA+/MFulwMbKlfOZSmQuDZ2ExnEkkX75MAG+FFT0hJCIF8mV84pJoTCahbCpIox7H - ZBktiCPlAckiebJlfOkCFBSYLiNH40UIH/Ewp0C6kI+r8C+ypSooJQVp2EeiInpfEEBlvIgPBpWGkEbT - KCiewzdCiLaUyGTqQWFcIp4RkhG6rRK7bzLJaXiz0E1trp0no9t553sf3ey5y95mlUSxDPcydRAHQw3S - RmoxkGw58ddQg1xaLMDDitANQAujMdvCI6NFbB2gh1C41f7MtszOKILiaIKqLWwZwYqTziJV4AEQIge9 - gOc4sCJpxR61/VURM7M/iuDG2wohRprnFrlWeAMUYSlguVpkgs1JBirU/hgbJBpb/ko3dCIaCLH62KCm - w4D0ETlCJUJmK3SUy/Ucoo26xVhowlt6dazHJrlNlAH0kS7ik+dQWtc6EAUDortNV5DqTBYTYmNGugBj - gFQKA5JVF9vWxqqrdfywyJ7ZnwxIOn7wcCbTn+lMhhC1htr+ZABT26pWexRrVVWw5RpbpTEMpkS0bd11 - 6Hz8syHBKsUChXUfmTVt9CdrRzLRfjP+UQsLH9leiMkyM4vNfWziljunZXsevulX/itHnVuAF1DZEnik - pfuRlqCjLT2PtoQca+lT1RJ2omXAyZbBp1tGnG0Ze75l0sWWmdUt8+taHnypffn7D4Q3wC0QDjEcEjG7 - dj//6COtquOhGPwRa6+wsHbfN3lb8Lb6ts1HP9zvKGj44efvB+8LALzZrzEG3tivF9tEiy1W6itXiB3W - GnptkYcluH31QwdGx0OnP3yZ15y6/sj80Qd6+MdYBsZa9thpteDwhPSa2Hsf3+okUkm9FOO9VW63VkL2 - oCKFpst1ZEt1lCuFZsuFOJVF6sCLmUQKFCuIO1Cs0JEvE8qW6FqtFoEQryhWiMyjdJVRyGTOjm9A4zDi - UwBIeBiEzWHqQajz5UOUbIkO4gblCl2rVSKbaJHNGkKAWOVKXfPVQigA5wXvj/BLtoI6ggU8+QpIIJqg - LNSjxYm2UA8CCZhBgUiSCZUgClEv8MZsmS6YIRBs4DFfKbRZbeCyTn5fm03SLsUOSvLqHms7KyfiwoOq - dkY7ejMveJdN9xibjcfm3/uImBSRHDL77XXx2GritFFiE61njj1kor9KMcP5AkUUsZvxYh3ko3XKFUQr - oh44VxI20+UC0+UUlmjAR1GBtAj2N12Ke66I3UUoRY6kOHoEbl0gW0bsSUEdxQWKlTpoO2yCUqgLLTVb - CVvREKe9/Ylw2NB0GbG/TbS+y0apX6wC40RzkHhuNHfZJIWqUoAxsT/0JGXNo0hboBIGAIh1HAIvjBaK - GaxHiErIpM0Uopcxxjw3ywJjrbXCm9dmspEAaXR1wkd1BKEXA+rQQNLjFlG6iP9gPYjCUYn+pWOA2Gql - wHQlHzYhw2wFwRsMFfS40UKhchWxickSJGBqjG0yqi2o/lCMWoxwqvCJArPhIhXaAWMwgAlY0hyG2UjD - pGzfAoRTsjrBUoaWJbvoNI7UHP9swWEwn67bKIIyXCT9uJwSrQIJyGR16c9RyYFMlUBsZgCwW5VRzywj - LDGjPa1ipzvu2+t+6JJf6afdKls4amsBHsG2oy09gG3HWoKPtfQ+3tL3REvYyZaBp1qGnmkZea5l3IWW - KZdaZta0LKhvefivgjcWUOImHLYc/XoELVmxMq+gEMHc3Xv3rt+8WXXi5LbYHfiiCt54wzvd7aLPtwVv - lz8v6gRmlpZM8tmmcN0oc91s5LRB4kDhzWEjjhJ4z26x5lce1WotDmBLvRQbHG/lF6Pw2ip322zittnI - ZZORxzZjr20yn21mPXabLy+bwDyy1t+UrHCPrTKH9RKbNfoWq/RwtFkjtlsrtloltlytb72GIJkySmQd - LbJdp2+/zsB5g6HTBqnbVqnzBincn8tmCeJL62g9ZZQunBpW2fLlBI2kS3jyldQ1wDMSd8xXrIQjFtqs - E9muEVuvMrBdY+i2Req+1chpvRGkwc86rTe0W2eAWizgN9cIlVEC2XK+WRRPsQorbgFA1Gw5vBvZqjVf - LoaSypX6tusIVFgRjITmyDRwXE/UgzR77PGuJbrhEnFnUUKAKKqAoTTtcOF+VUicbWCsVbdYJajHLoud - p1ar2VKrYwNiLZDvF6PsGWcZEmcTtNM2aKcNzN5tp8Jlowka4rhBAuPYrhWTpckaohgshoYgYbde3yaa - 2M1uDVHMYR3urRrarjWA/jZrRfD+xEFjAUFMp4NmImCCHNtoCCQWdt1Eijiul0AylSk0RTC0mgCb+Soh - JKCBhB9WXU0ai/5CPnHxUdTXLyehM9ylGZBgBeWPxq6AGEgPs/vGyLvFWO6v1QJvgTvNnTdK0V/m0QCG - VvtjeESLoT+MbLeWDAPH9aTt1M76GCdoMkhVBcbwegnGM3g8tsggsHe8rVZ4C9xpibUdrIS2K6NgBLIc - sYgmixWMB2LVtRKYDkOODRXbaJDEYYPYbr2eYoUuOGFD+XK+fDn0JKqSYbaOjGTw2G8QW65CWs8iigxs - UssKidr+sDkJDREjIobDUgzgwRALCw4SJ5HRSxIUh8hxGWHA2MYROUgQZKWl2F4FGe3L24x/KplAV2tB - CJEgDsa9z5WEUApH0kdATVoLjkRsa4LxoDhKsR1arPxQncFCWpwqCWqrv+kqmWJDD+tds1zSUrxya/3L - vgg40vK/TLwex1qCqlp6VrWEHG/pfaKlD7DtVEv46ZaIMy3DzrWMvtAy4VLLtJqWOXUtixpaHpIn57X8 - /pnRW1vEwo033GlTI5mjuwe2LhGxaQKbChTfxuZkJ2+5wYj7qrf4xZj7bDdz3ypz2UwAw3ETvDwclgHQ - znur2caqBVqtjShk7MGe8NduW0ycNxnarhdbRROPCbJdR2DAfj2cgpHHVnnPeEuEGtqFvLjVfbe5T4wM - vgzO1H2bsdtmmXeMDO4GYl23SJ2Qv1mKxbXrJhO/HXI49AX5YxYUjFlYOGZkRoD/ToVvrMx5gxHqsl6j - R8KU1QKzVXwTBHB0NY1ZZwaPQ8IXkd0GsQuBNMgxDdylnJLdf3HxmEVFYyFq+P5AhBFQFVdRHVwScEsR - hbU/3JbAYo3Qao3IeRPxyIATph443bYaAVqQ6bHNCNbziTHtm+gM3RYVj5mfPwaW8d4ud9ls5LARm70E - Ed23SaG/ph2wROgVb+sfq/TYJsPKwHO7idc2ecL5LeDccnw5xEKO2yaZX6wZbBUcb9MngVBQnFXgLnPv - 7aae2+Re22Ve2+XQCgmi2BaCSTAdXQQQu6F1pLFQLG8MlPTcYkp6DYsDgB+wcK3QYjU6Tg9dD+RAA723 - KSYf6r+oiNh5cnaY1xYF+oXAyUYsO0jAZBGta7dBz2mTARrlutEEaxT3LcR0yIFAmI7E01hn0F5AFyDy - tl4rgnzweMeoVArabYmGp1Vre7QkhkRv1tEALV3rdbo26/QxMjE8PDbL0emTMolui0vGTMvp322Xwi9W - juaQ5Q4avh49YoTRArP4xpr6xii67VQGxFoFx9n2TdQCbwDX4N3E+JBgvwEjXwT90d0YwE4bDV02GsOw - /jsUQ1ICYT3UCIOEJbmgHz23YYgaOWyQ2KzVt1yji1jNdIUQCZt1es6bJBiTMAgZxptl6FC3LcZotU+M - HPrPLRg+M3c4G2bWa3WV0QLFKp4xQAJRFAADFqNH5JABTI8k3orkmUapgI2AynJ6GkWOBBcBMFQCQaaV - JM14UIqIZWEllnpAMloQxPJZQSQYM+GhxGQS1ASaUmYUIYpBDkM1qi3BSCqtc/1lK83Mt/R22DvLNQOA - d96v9Gn3Yy3/O8Qj2Ha8Jfh4S68TLaEnW/qebAk73TLwTMvgsy3Dz7eMudAy8VLL9NqWufUtixv/xfD2 - Cuo8vbvyB6d/PHqLexD6068dfjn6yuMaeMmAXUqfWFPMRvgv162YrmLHzdQNxcp6xFs+//KJpke+/+LW - wBR3jy1yOBRMb5sNurJlQvM12KgRGGOtvQaLd7I5Y7dB5ES8konPVnNsYGpFuF1nonvuMfffpcisT2x6 - dKn5UfXlRzVXntRcflyd25zUbZeye5wycLf5rrOrkN9OAsLHIzfz4HSgP7wbIk7bDSIZ9nxW8zHlcITv - QChmt5EAm88OWb8kl7SaGAjXqsnFh1Wxp6OC45zRcIcNhtZo13qR1Tpd+GWrVZIDdXuJeo+rmx9Btxro - mdOUHBin9I81H5DimlYbo7kTe/HhsUUlY/x2yuFwoQCQxme7UvPR0w+/fNx7r60f4G27MbW/AYAH/NMP - D3YBoG5BpxDg33ZqGWqH8mqCJkHxVjmN+2ArpJGPY9MH1TnNSZAGCoqH3aKgbbv2osZ9l7bDa3vGmDis - N3TZiuokThuNfGLlCwrHVN7Mg2HbFqF2PjwkNcB1M1mIYPXjvIWY9GA9sQlqZwZBOrNhD/S3XiciEd4q - noz6PvQCbOi02eBg/Z5mys+aAG3zLqdqhbduO81dNhs7bzZA39lvNLBfa4zlwq4zUZo7t9ATHRdZOg6r - NP+dpNVNj35jJdbd0FBz/CAfpsAswNWmDy6Ny+ztvl1qt94QBgcmAUd30hrbWQOlnn/5+OitPCxl/HaY - uW42hgHNV+nbbdSzwbpwrbTx0UXVSKaSc5v2+W2zGpDkgSJtrRpZMhlFzFYKlWv48lUqYDNCsIU12WoK - G9SASANIGOYRuALqLHuVacJAiwIVioCZoBSFInJUJ4BDrDtaj2AGSjEsRCnJYnIJkpEAJxIgxgzhYnoD - m+AcW7JEkasE3sDJtH1D/ZVr9c03e9rFT3FO2ep5qMS3oLnHsV96VLX8J4kXfKIl+GRLr5MtvU+19D3V - EnamJfxMS8S5lqHnW0ZdbBl3qWVKTcvMupb5jS2RzS3vfv1vjd7e9MmXPwhv+MZYJ7fcfvz5h6mHewfv - sfKNUWKp67QBq1cghMRlG3EontuNsPLdc6H94wwwPWZ7+D4PeG34RPuNIgus/YFndCaw6WRMV3aKaIIu - 1uuxzBe7bDYBhh27rSWGg6fol2QbEm+jiTrICU20XVE+ETzau7w1F04kIiUQ+EFc4SaR2Wodi7VQScd2 - g67jJrH7duM+SU4pl2I0/ZSmWPCA03eHwn27EbDZYZPYcZME+jc/vtSOGer1TrDdcmJ+52IvPDgWluSM - IAAW67FH2c7HMZkAab8YS4AH6nLeKrZep+ewSQ8xBMxrt0EfQQ+akHCBxHPtfjCdpt1gjV57becWRMB3 - d2I3rFGm5YYH7lb47zL126EYkOJy4eGxzu2cd2Wfb6yZM8K17Yhi5QCqdvxw616xUuhvtU4HQYBiNQ8D - Q7kGHaHnuFGKq5o21L45udsSyxG3bVL0AioC6L52DMAOEw+F9NqjJUTrvFHqq/MJXCkC48z8dio3Hp/b - lXdgUGlk6Vj/nXIsTYD3WMdA23bVoTsG7PN68OJWu/zwFG/bDWKb9QTemK0AEmTuIBiiM4hNKIZzwBUw - KNaQBBCITTTlGoorQEQKS4YAvxUk05gyQwiRyWYlwAx7jytVZRkDxLJKVWwURCEB0sDA4JAcgaxLVfwk - 4EMkRytlOpAuBgC/Df1NomTAPKfEKY7JqzwyU/wKGwIrHvU80fJvJ16vUy29TreEnm7pe6Yl7GxL+NmW - QedbhlxoGXGxZUx1y8Salml1LbMbWhY2tSy/wsFbVz/T1fktt/VVs/ok2YQkWPjtVGDZDgcKbwJsA3nE - Snx3mvTYY17z3nFN17D5xHy4APcYQ9uNIrNogcU6vlk0z3Q1z2QlDwkTOpdwirTFep5yrQD457pd7Ldb - Fr7PXavDnVcY0S/Z9urT9kEG/EJGg5adK63eChgTWTbWb5fMbbvEcavIbpMu1HPdZuCzw2Rabn+48i76 - OMYG/lEHA/3jZJ4xxu7bTbrvMbuioR4UrrqjBbA1K4I0BI6IULvHK5eWTdCqydHbeUF7zGF26O+0VQ/6 - W60X2mwQ2mzUBcRCh8QLWr7u0TtRm92e1MSf17Iu0Yrlow+G9E2ynVcU8Vr8UCHxrbygveYYM9BW24qk - Gl3gsl0MzeG14WqVa/kYACSA3iTThMPLT2oy6rV0ce9Em4A4RWC8KY6pNTFd7DuMgS2n5neRWZNtZcXE - fsk2wzK8utitagnou/77XCg0oost28Pbk5pL71a1y7z/4ib6GnNNjn2ONXxFNIElzBrlOkJs+hgtJ2kG - M5hcbFohQUBuJUkTfpomSLOKnOISsTmEMGlriBwmQbJEVYTlMwbMVpbQnL9MGRxRlmlFgjYKn0xbVpEU - QR7q/TP1t9zqZr2jr03cdI/MJJ/DJd1KmoNP/hhyquXfQrzewLYzLX3OtPQ72xJ2rmXAOQJvQy+2jLzU - MramZVJdy/T6lrmNLYuaW1ZcbXmPi97afOKyo9e9i58t72SeZzfFhSU79E2xCU4wx7T0Jahg5Lpd4rLd - wDVG4hEr7RYvH5LhoSkBi9CAOAv3WCPsqyiidZTr+GQarCWzywzzJJokyJzEcF/LM11D1nfm6wX2m0Uu - 2yQAiV1ntbjdgqupcNMd7Rm+kbeKLB8LHHWLNXSLMXCPNUR6VkF4V4I2ra5/Zv4ALOQD4xW9Ei3/oHrY - 8euVaAF4C0220gRyVvvFd6sGpLr47TJBFzhsEdlsElpuENhuEgIt0BDsf2oq2W+fFru9UXvRrmEHvDqP - 89rVm3Axum+yDRBIsyFYBHSLk2MUQW2L9XzFWixx+LQJBn675JpLBORojd76JNuGJlkFJ1ilaXuu8o2G - RNeZoyonwhQPXr7ZSki9HkJZrBcxktvVqLU7Ys+u9NlphHWM+VodMn0AXdFkBoHM16vCJiUSmE3raYhG - oQ48OAUDm3FII0GWlZhodAKCkAOzM0AiCZpGAlMSRzAYY1ORYh4riERH8xdsCOOYTFI1wAzwtl4ljVWB - 4qT2v1x/5Tpj8y2ejokTHROne2bt9chK8S++FFAK5PsOkdI/inh9zrb0PdfS71xL2PmW8AstAy+0DLnU - Mry6ZXRNy4S6lin1LTMbW+Y3t0ReaYm61vLeN9pH7D//0ZK/bHNy94PeP/7a4X+i3vywcehBl7BUu97J - ViFJSv94U784E6+dUo+dgDex41YDl+1G3eIVG49reagk4VJ04F5T+F+bzULFGgGZOVjWYbbQiWeKuYQp - hwTmEr3ETm236Dhs1XeLMQlOstKc7XAo/dO0RCFdd0xqTggfldnDZ6epz26Z9055eKrrG/l6Tcc0LNMr - NNk6PN1W0zW/qXrjcoKCEpSgWfkDO9KKmCLF1SNW5hIjsdogstwgtNqoi07x3S072KglyumX8hYU62Lc - pm4vsBAG0Vo1rOS3y8xhi8R6k1AezceoMFvLx1BBc3okaomAwa81QO+bTOT/kVDsTXsH/NtOz/992Mbq - QtmhB73CUru0OxqWZg+b2G4WKdeRSWS+QTVrLDbCYqq0DAtHOpUwrTCV2JFMt9U8sLG0mp/A3gbVVRNE - coC9VWRWYm6ysqwIqYiyMTmqRKfzV10LEwuCEEhDAqoS1Pzn6W+51c5mB8BvhEsKwC/GNxfgdzKgvDn4 - xIvQsy1/MfEItp0n2Nb/QsuAiy0Rl1qGVbeMrGkZU9sysb5lWkPL7KaWBZdbll5tWX295X0O3jqN3lbd - sv6Q/tWc1t/Pv/64pHzgoAynsHTbvqmWvfYp/ffIfeKMPXZJPXYZuOwQ228Re+407pGoPNi4Q1PC5Lyg - gL0m9lv1bbfqmGMqAr028JDAEbPFajNPuVF1yjItNpEJZr1F4Bwrct9p2CNBWfVOnqbYAfu75KavPasB - de6DsN8VmmzTa59l31Qt4YVqrf3y1sGm2KhjE1cenYAjkKMjmaiud5Jt+H5bJDr3mPDUqLoTNM2/mtor - WdkzySwkWRl/8dWj/+3EAjxmFQ5Ap7jtlDjF6Dts03ONlfjFyzO0wlvq65cF2BqF8s+/6urX1NAEtKXz - 9kYdnYjxo8lz9VmN7y4z4ri3Ci028snY2MC32SJ0iZUEJphp8hN409ausDTbkYe8Ol+aoCxCzy4CEqrW - ukCBWRCDMuq8yYyhc56i66kwS0fjBBK2nJ6/+0JUUs0m7zhDuy165uuFVpv48jVk4gAqjFfzLDeRWYMc - TBzMIEAIWTuu4Vlu5snXkqvgxFGBebeRpMmMo4gFImU38kywsQmAbM0EJ4jNU1KWFiFoRyvq0vwFmtJ6 - CS5SOTgSfRC0RRMlcfx36W+5TekQjwdbwpySp7umTXc7sMkvL8U7J6Vbyfkelc2g0DM/9jnX8raIF3ah - pf/FlvCLLQMvtURUtwytaRlR2zK6rmV8fcuUxpYZTS1zL7csvtqy4nrL2pstH3Dw1im8NX2mBT/UU27X - hSUI3QZmOPRJAQaYByUq/PbI3HYY+cRLnLaLXXeIveMN/PcY905VnrpPvoHZ9gd3E5Js4bdX6hgjstwk - YBPGdB3PaisZ7sSXbeJZb+WZ0rmHcc+mEHKsN/OtNgnddhp02ys/oM2dTTwc0kl4BB+0tzq6T4p1zySL - kGRzQNewLC+s+jtyfwnV0QMP2CbWaNkIhTdcc2IikK9nknmPRAXAJmCvIjTNPCzdBjinVSDkAN46Ua/g - WuqQg16991n3SbWGd0vXdjMJZoR3w6LBf6/ML16GquM6RjiosbB8YFCyHKZGv3jHSRH6ZDZpid46XxbA - 2w7P8grbb9U31apvii1s2DlgwM5bz8wPTrLpk2oVlmaNyLXqrvaxhE7sB2TVgHzkBO8z89wtcd4htN3G - R9fjaLdN6LFLAlNr2hBosV/b7VWYsfC69kdtoeSeS9FQr0+qRXCyeXCy5eCDXhDSSdNgOggEZGoCD1Y2 - uBS6zxajQissfUTHXj9aXVCiOcZ///3WyOloudCRnPsvb6GioCSl3x4Ttx0Slx0ix+1CNokwXwBdBGmw - IgQ+YX9yE5lQQBEk2Cwjlxga0QSOSOMqWUQCYNbQeYcoaiNJoCyZdK0EBoZPDMyQrxLS5fmL4hCurpqp - xAAPMv/D+lvHmNnu9nQEFuKYGOaSNt01nSCiZ+Yq38MpfvkpwEUCjbkpgaUlQUeaex79DYVU3e53oYVn - s51nvU1gs11gvVVos1XktlvfM87AY7e0R7IsOEXRJ80iPMM2ItNpZLbH5AK/ey+uaB2Ib21z8k2/ORna - +s1JjY9yvelu5B9/rbvw6ZJOgozCG4njDnsMz3YecMCub7pV8D5lYKLcP8HEL0HqESdx2y12itV3jpV0 - SzDplaq8+mFtO1FwXiEpSp89UsdYkfVWgfU20nHANqttPMVGkjbb0JqzlWexRUW4hHloFyOE/MAkWdQx - Lc9WAFo0fSWr/eJ7VUMzPXvuU3RLlPntNYKq/olGkNMrxXxheYRWLwOnOeCAreYlYNuobK/+GTas4d2T - ZN2TTSAqaJ9pULL5oIM2QE24s3atRimtkQpjy2yO7Z1iFZBo5rfXxD8BohT90q21RiRghvUCkkwAWn4J - Rj2STfdUdxjDgRkRXq9URfdkGfREwQPa4G1QZodhJcLTPmlWPZLNfPeYwKUigdMEbZDPGgJzjcz2Ihom - yrzjTDx3k0r7ptloxfWDzbGYkppdduVZjf9eMy8slXYIzTfxMSRstvORxujqnmSmyX/twxoYUHPEjs7x - +vrHLzXz0bNDs7zgE7Amgw39Eslg8NsrQ/ctKI/oKJJDd0BbkBZ4ayKXBh60ffDJLc2rDz+5NTLHq1eK - EmPPO17quVvqu0cakCTruU85/JAXrmrR8EPtUf62s/MxYv0TTbBB4rRTZLVFB+7ONoZnQ+cOSLmZZ75Z - NWUwj2TreJZbyYQCEXxqnU2YdCBcQg74WRHkMAbIAdiQKblVNSUxN5HGJchnclCWFez6/FUrgLKoQn2k - fpvT/zX25yk38RWbBFZbdZx2Cl3jRJ579N13S/yTMJhkvdMUfdKtIrLshue4jMn1nFni/+DlNa0e/A99 - UnmJ6puTK941Cl9l/wb/GODq6xfmvvga+ceApYC3sb/5pPJbgLdBb/DNyV0PQn74tYPYtqXl3svL4/K8 - x+a5Dct27H/Qps9+i54piu77ZP5Jxm67pQ6xYscd+u5x+t57DQL3GYekmF/XBm+h6UrvvYZWW3XtdwjM - gFt0qsiwJNzOs9zGs43l2cTwTLG4206mE3JAyMFVu1gd553iHvtk0Se0wNvaUxPh6TS7FU5nRLZnrzRT - t11S771ip10i93iRR7yexx6xX6JRcKpi0ZEIrX4QAVw7aWCbUhASkWkblmETkKTslQZAkndLkgUkyv0S - zELTzfsfsInIso08EqGpxqLKCK3qARL6H7Tuniz3TzR0ixNDQzjcnqlmo3K9tA7R4FRlYLIR2Dzixb4J - 0h77TBNqOkW4S6vDMixCUqGbVeZlLTDQ/4AWjEHV0BZgBsXQWZ57xFQ3w26J8vCDNpr4zVRdfWJin/3K - gGRj2NYtTh+lYOGeKcpt57U8iwj5A4CsGl2GnJA0M99EiX2M0C6WjxFiH8u33yH0TZDALFqjPcCwpq0S - 67RH3qNyPYNTTX32SqGee5wIOOGOwRAvhlUxGCKPah8MWZdj+6bZonM1K4JV0ZB5ZVo6HYYakuWFceK9 - V+q1R+yyW+SADfY4kNh1lzQk1XRwpqdWUNTa9WEZ1n4JMq+9kKMLYINx7GIJTmB2sImjnj6YOyA2oTC/ - WD7mFI44ZVOM8eASS8DOmIMK7J1gPQHIBOdmkkA+jijFimBKsurAzK52cf6yicyKgyyoQHWC079z+6M/ - +HY7BQ47dVzihM67Re6YWkkSrM6675P33q/smWI14KD9sGyXcfleU4sCmp+e0TqAVqyO/n1wgn93i9hk - w/4QB//6NiHbgvxjAP4HrtN/H2VXAYR95jmRP+zG/73dM+o1zRn/P9CVgl3hwXtv3Qa74XvKXfmk8qrb - Ns+/v6vVMsj85defoo6PGJPnOeSQS1iGXZ/9Vn0ylAggAveZ+CVJvRMknnvFbgQ29N3jYXzjvhlKTXiD - 8wpKUbrHG7rvETnsEljF8JRYM27lmWCfZCvPbifPElMOSLaTkHUMz3YHDzyYbFhC2sQKfRLFPVNla05p - g7fT2uEt+uTEkDSFe5zUY4/ILlZoEyuw2i6w2CqwjRV67tXHCAndb67V72ti3gEEHATbCA3Ksul/EBYA - cliEpln0SLYC5g3OtgUDqOZRVTszIljRGlwiGApOUwDSoJ7jLjh0oXeCfvcU49D9FlrhMCRd6bVX6rBD - 3wF+eY/Iew+w0HTr+blaEZrpAEffO80WMAb9NTsXbdF6Nyi5Php2808ydAEG7CaKOe3SC9gnRbeW3NKy - 6ffw01thB6z8Ek3QR67xQtsdOs5xQqed4sB9MuC3Zr2wRsQhLVWTEZJq5pUggRDrbXwMBtsdfIutQvd4 - Sfd9Zpo2gRzYVlP+yQd5mpnrTk/svV/hnyxFo+AorGPIfg/8htMuoddeff8kI6wDDl3RIi2jKRbahh/o - EN6KbmqxCfCedG6S1Ga7HsYbBh6GnyU2mWIw9kRQA1ejjmvf0mynPPooONUc9mcTBzPCbgdPiaAKYRYW - f3Sm4MgmEdIWgLdYnhl2FOlVxWaaCX5AFEI67FgCYGgOroKHsMWSNCTD5jhl/EgjH2AGyaQ6FEcYt0VV - S9fnL0ShONMN9TL5nP5dtD/PcbfAcZfAdY+O/S4hVkkee8WYmYEpxn5J8t7pSjijYTkO4wvdppf6TC8J - LLm1R6sTb2hs6gpmaG4Auvl6zzptSv6SFPe0gCW3jXvPdHKwez3C4W9LPYM8Z59RlcWf6YzY8wZ/hfpa - be3t/Aastmf/1PNaavyss39/TqyNmlLkMzbfbXiu44Asm74HLHqlK4LT5UFpxpiofkkGcBDeiXCFWA4D - 3qSh+5W1H7R/6e2jrx/3pLPUJV4Et0LWj3QuYdwTDGudZhj6yDGnl3DEKchhp9A3EQGBPEHbwnzDGS3w - htgoPNMKAOwSp2+5XcdhJ5+JQl1wmvDa8MW99stnlAR3BOpvKx9+WStcjc7zCEo18UoQu+0F9JIlmtMu - Xb9kSWiGouaD9hgJZfpmmMParvEix91CkMdeUbcUw+A0+aIjAzpBOGAVvPOhq1ocN8BYq2Jj8jz8kk2w - TLTZQexmt4MP+6OXYf+D2qLA0tupgEO/REMMAIfdAoddPHssN3eJAlOAiOaa27yodGCW7fXn7QPuq23g - zX4n32wLWbkC6vwSJaEHzDT5yeakNn00Odlg8NxLBoPDLmAbrE0XUjugKt99L4wpDkqVTy3WMhjQ5H64 - u3FIC7zBqsjXrA5DPeyglXcCsaFLvBA2dNgNN0V8uuMuPvrOfQ8A1aRvhlVXntnBYOiZCqSUWMUIrWL4 - mBdAGlugRStgQDhbCJIFAW0X0sptqgSYYUkGLSCCZJTAab+b5DPggRBMNzW8gROl2PTEVXCCgaEUK84W - o12Zv0wxFJRjV5MW4fTvuv15trsEFrEC+91CzwSRyx4970Rx93Sp/z6THmlmYZkW4Vk2gw45TSp2n1ri - t+hYj/jaGR25rcxD2d7dAl8LGyoGT/Jf227+3uMOWLC/6mYEeMMxfLW9iwf9L++OYjh3X49Ar5nHzdT/ - po39ycXXTXpOcAEskX99Q/EuxH/aedx97W39/Ae6LWgg/yT3WmzLe6L9y5DMUEfupk8u9htf6DE012VY - nl3/LKu+B5XdU0wDUkx6pEu9EiWeiWL73XpO8SLPBF0XLIT3SfscNM28rOXJyUHZVj33G7vE6znHC5zi - eY7xPEtMM3hDTLNdPJudJEediUvWdELa7RZ4Jul67JUEpytKbmtZKcNNa7qYUw/yemcou6VIPRJE1jsE - mMwWMTyHeFKLHeragfWQXs/9Rn0OWMIZvS0k0yoH8m981N6Vf/Pjl2GZ5n7JUre9IihjDyPsIn7WJ8kA - 1tOKRr32mwemSV33ipziBdYY8Lt0vJNFnomSHqmyAYdcO9rpAvJNKg7JvqYF3oYd1gJvUCw0wzwgVeqM - VQhiBawJdvHcE4Qu2MRLka05rSV6BgBgoYB5B/3RCvQgNPRIAFQb9j2g1Owa5PTXhqzIx5z1TZK4Jwqt - Y/kWsXCpfOd4oeseSd9MLdEbrKoVbjV74dTDvJ5pSt8kqesekXIbsTacNdqFMYbxYLNT4JWoF5BiNCBL - y2BAX2CARWRrgTdYNTzLVnNtgeqCsQ+fRDoXNgTSwCYYzNQySAjc94q6p0nDspTH72sJNNvpn3UlNvSg - 3H2PAXAR5pUjfvqt/hjYZEjvJI1ik4ihERvqSIMBafX4R8MJzMSq5hoUM8PtN2JtciRy4gkz0uDEVUUb - /SGcVdd2qnYyf8kUpiqxGpHm9H8j+/NcEgQuCTqeyUKXvSLPJH3/VElwhjRovyzskKJ/tiU88uBcl6ll - ntNK/SKP91x5qu8PP3f4Ute9ew9SUg72HzjcxbtTdPHEX9X4DNpoO/eCaVtsI0By3WTF+0Zj0izb/jGp - FhAC8nn4TMw1bxtd4fbb4qsyiPUf4O7ezbuLO5zthXv4eHT36r/Cfn6dbNnd12PbjvtB3//awXemW1oe - fnptdmW3yaVeYwtdRxc4DMuzCT1g0XO/onuaLBChW6qhV7LYN0XfI1nktU/XKV7XLVEE+/fJlCc1aLkt - tKtmfsgBuW+KGJ3lGM/HLLLG2jCOZ4OpuJvnvJfnuIdnF0cSyLcD1O1B5/Ls4wR+KSK/fUbh2RaaUPT8 - 68eD4aY1QoFD12LDssz8UiWuiULHPXzUArEgS2yPwGXvFkDVbmnSPpnmmtjz1tFOswoo3DdTCQUc40SO - ewVW1Ke4JQo9EsU90uUHtAUlA7LNe2ZInfeIoLzNLr59vMB5r44raYVBUIbJ6EKX49o25dCWqnt5Ode1 - wNsQbXYj2JOt9E02dE8SYWbBYnBJHkk6rnv1gw+YRJ8er2mctWcnBKbJvJPFrok6Nrt4aItlLN89Sbd7 - uiQ0U3FdA9rJvbdsLSsS2KT3AQXGj1ey0D6OT8cD5AjdEiToSs0uhuRMbduJmhqi+UHpZt3SJK4JZDBg - sJEBFkfGGBAO9ofrCADeZJtrHUgYYBG5WuAt61rsoBwt+aiu1wGzwHQy9pz38pUxqiGNFtFRzUcD/VJg - HLOu6A8eTCgMDAwP+3gioa3+ACHkwOZojsMekgChRnCy6hi1Hf9kCgDUAfB06pFJB9zdq8pkBdl8RD5k - ttMfmeRSHKnitfOXzWU27yAKNXL6v5H9eW7JgDehd4rQJ0XkkST23ifpnmHUPV3e64Cy/yGrUYX2owpd - ppZ7zT7SbfHx4NVnwuqfVHTuv9bHr8DOYWfBk4ePu7/3gjqZ5tZf5G2ThY0y7xDP10jA39zgi/4D3UnA - d+vV5iGCLcik//rt+Pvuw5F/D1/ssOqJFGD52rgt6pbl0+9udGSNX/7v580Xxsys9JlS5jay0CnisN2A - HKu+h5QBaXL4U79UqVeyxD9d7Juq55Ykgv09kjCZRe5J4h4HTCaV9NByU+RhXhiK75c67RG5JAkIkiXw - 7DC7MO6x5NzDs9zJc0ogaQfMB6T38lwSBe7JQs9kA3TohnNaQoeax1UDcrTBGzzafrOA/RLPfULXJD6q - sKFVIKHEOposiUR+KdLwnL8C3rS45uc1fbIUvikS1yRdm918691EMee9QiwXgg/KsrWhUb9D5j0yjLxT - 9G1xZytBYBdPyCMZI1/kkyLunWmCtnSEcFoFRuTYauIucoBJ3dIlTnt0XRL4jsAY4uYErgkE3tae0wJv - q06PD0w38dyn77RHx5Y2xCWR75Yk9EyS9MtWaFaBTcjBeVq6DJzBGQrMX7dkXeC31S74UD7GFdYokKMJ - k0Bire3SHHiZV+lgSJd47BPC2hhdcN9kSMDFAy3iyGDwT5P2zTTXjDVRxYgCWyisVeywfG2blnTsYXa4 - 7CVjDwPPsXWcYwQ67sXSRAgLAwK7oj94uqfL3BEcY34l8mCWdvojB+MHtbBlItqF6thsQgITyiWRNrbN - +McpiqAgrrIZBx50NHKI2WlZJCAN+e30x1VzYBW1Icp2Mn/Z4AEnRBFlcJrA6U/8T9ftz3NJ0vFOE3ru - E8HPOieK/dMMQzKNw3Lkg/LM++fYDC9wmFTmBh8992jgspO9N5wPT7u86P9ayD9ca/09+enykOW+5PGQ - TvYGKbzNOWeqCSF4xmTwFpsuPjwJKBq9z4o9ltKW8ARm2HKH3w1v/RapnuR8Lbw1fJbTCdIfuBI9ucxv - cpnniAIXYNvgPGssb8NyTPtkyYBtmJ/ANv90fU+41zQh3BlwyDpO6LFPr8cBafhhxXuf3dIUvvxkRO9M - uX+6xHGvLqDLOk4192z38OwxYbDMpL7AJZnMCtt4vhMWLqn6gfuN0ZuaDg7y9zVFDy+w1bxUcic1LFvh - uc/QY5+uTbzAJo5MRciEZDrbBV4pop4HjAYdtnhXm55vN4DTVO/q8xqoB/SF0VySiMN1TeJ5p6Kx4r7Z - MoQFmgpEHLaC6XoeNITNnRNEbsnE4J77dDD+fdN0/dLEvTJlIQettFop54YWgUPztWAMigNLgg4CY4Sw - P3oEumE10C1DPwjwdnacpmLrz4/vecCEjgQBwTb03R4+Ahe0rkeGmaY+gDGsSLTmd89QYv56p+q6pwgg - x3aPwH2fbo8DhmE52uANm5Pa7ilqaojBEJ6r6LbfEF7COVGAkaBESAGHnkB8rnuyAEuEkINGEfkWDzUG - A9AF2g7UFr0x5NOsruwdUh16yjlR1ylRgPGGumAZjHCkkeOxD7sdhv0OKYq0bba3E3gIYHlAFpghdk3C - soZ1xyv9cQrhZGAnEstjHpFj6zwyp1hohWj1t+MfOVCGTLREqhWdbjg1w8YGgjMqCoRSuIrTtvojB2RB - JVtS/CPLU435Cx4UJ5hK5zWkIYEinP6wWNftz/NM0/HdL/RJE7mn6PumG4QckvY+ZBKcaTa4wGJogc2E - MqcpFe6zj/ouPNEj6kzopkvhT758pyPn9d0vX+x85B86x+k10NIBvJHQrUnm3cvT2a3T4K8VOEkAh2f3 - r/8mgAMmkeht2Z8Ob/lPFnbixI8/PDD3mP/YEq/xZS4jix1GFtsMzLOAl+mTLfNJNwo8YOidLvZI1fdL - F/mk6/rsF7qn6NjDcSQL/DJEAQcMgg7Kcm7GaMp/7/Nb/XMt++TI0FMeqbqOyQK3FL5bCs88jueYxHPA - ZMNqEfNtH7pV4J4i9E3XC86SBmUq0q5o+/8BPK9f4TWs0PbGx+1vbgG0oLBfujEkuKXoeKTynJN4Tklk - mlnG8yHZK13c46BsYrmnppKagDevKgS1DC+yHVZkHZZrMSjfvF+OeViued8cc6RBIVnmA/IsBhy2DD9s - 2S8HDBZDCnC0QqmRxbYAs3a1QOH+h81ckiQ+6UKXZD60ghGwSuuWIe6bI8vWhkYQFX7YvG+2HPYPy7H0 - STdwT9EjC7s0He90HYx/33TD3tmKBcdDuojNQ7UtC4A6IVlmgQclfvuJYrCY6z6e9V5BwAF0hMm6C1rg - be35cZhxwD/PVIJJ6DuXfcTCAQckPQ6aaXYNrIG2lLzT/jYqdp5hVcxf33SRXQIGBqoGrIqCM6UD88w1 - 5ZS+k5qlLczVhKgHn95Cd/TMMvbbTwYDG2AgxU6YnaqaIcaY1DoY0BfQdlSxts1JwFuR9rHXN9siNJuM - PZ90HRgQZsHwxtE9FUcd/wy97geNww9rQVMtO6s3Y/0zZD0OiqEndIYca2AY1d9sJzkyySzHmSZwxFRC - 37FpBYIxccrGv5Jm2iTQiUb5XelViLVNIGkUR5ploiCDOhRBPjLtAIr7CCeqgBBWL5Opnr/gREHkkBrp - VXaKfE7/N7I/zwlr2HR4K1GPLLE3Qv5saUi2LDRHMazIclix7egS50kVHvOP+y0+FbTibN/qx/mdTP7c - x3MALb8b3hCHkacfHd7g4X4g3PhMi3abnH8BvO2837OTW27vfnZ9/vGAmcd8pla6DS92jCi0GVRgGXZY - EXZY3jfX2P+gNCjLoHum2CNd5L1f5LJP6J6m45Ii8NovsE0UAOp89usFHjQaX+7yzU9falr7xLt5/XIt - QoFwGRLfDJFvBrpPxzVV4JEuwBFyPNIEXulC11TSoX4Z0vB8xfIzEXjkQVPUmffzhqOLS7W4GDDPOx7S - P8/UL0PijqUPNEwVeKYLvPejCmHAQT2Mkz65yuybXfpXAYArxlJ4vlV4nllQlkm3A0bBh6T+B6Q9sZbK - MeqVbdwr26TfYVnfXHloDkwkh68MypKF55uGZpuPKtGiHpx1v8NmwYckaKlnOt9pH889jQdTBGWJe2TK - srTCW7EtRA0vtsq4Rj7/P6XSLyBT2u2g2DVFxMY/pPXIlI8ssbmuAfZax3xEgXbFwg6bdc+UwEpQzHov - zy0VJPDdr4eGb7ykBd6QGZJt0u2gns9+9B1xeY7JfKgEITCXlk3Fj2vQkNxb2t5VyLXqk2vii0gFgSyk - pWMsiXseMhlWZKXZBFhJa/fVPa3Ssm1wJqJ3tmlItgTm8kjTcU8TYDygCs80YWAmmiYdmK9Mv6plCYVa - Bhfaove1KoB8jGfNS7OOhaD3AzMlHmkiDGkMPJcUvuM+zA5ULfLdL+mXaxp5SssLc5qiYChMFr8MMe0R - Yl5nIAqwh44ZpHFE2jWVJEBgsAOuUB70nQ2iK3oKwikYbAFapE9JApngx9EB0JvGs8IuQipJowgTaw/Q - AlalkjQyWSmmAySzepkySCDTEVgIREwhVyEB4wf5uIp8JpPT/43sz/PKEHqk6/Y4pNctUxycI+mXZ9wv - Tx6WrxxZajWq1G7yEZdZxz3nnfCPPB18+LaWf71Sj6faTzNZ5PT74I29YdYtwu01D5X8ds/TydkPT0uS - Z0Buvtqf/LPhDbfcnn1/syOY//X/ft1WM276Ud+xZe5jy51GlNpFFFqFFyj7HJb3y4MXk8LIQYfE3hl6 - /gdF3hlCr/1CVwTQBwSu6QLP/QKfAyDdgEyDAfnybG0BHOqtf1o1udI9LM80MAsO2qB7lj5EdcsU+R0U - eewX+R4Q+R0Q98w27Jltgn5cf2miVphE5qyqkOEl1kOLbW++0PJa97WPaiKKrEIPywKzJH4H9bwzUIWu - W5ooMEu/V4409LDZ5EovrZLTNNzcR988JvBWYAkjBOdIgw5JemaLAzLFvgfE0L9XjiEEwjj98mQhObLe - wLZDxiFgyzbpe9h0YKGVZuQB3QYWmvkhSDoodEYAkc4D+R4QQiYUztHm+qHA1tqJ0IR13MPPbg4qVIbm - mgQdMoS5grNB0gEFijHltgiRuxLAjSix1QRC5AB3ux2U+BwQOqXwnVJ4DnCg6YLuh/SCDpls0AZvay+M - 63vYpFumnk8GMIPnnMpzTeO7pgm9MyRheVqiN3TW6DLbQ9oWFlHnIyKKFLCw30FxYJbI/6B+r1zpoELF - vBNaQtLUK9FahaRoC/RR6YACq755ZDB47ddzSiGDwT2dDAYMwgEFHQ4G9AUsP7xEC7wBeGDD3Q1aXl1H - j48osepzWIbJAtN5Z+h67hdibGMcBmXDLHJ4J81RobXX0EYMiaBssUuq0C2dhx6xww5EAs9jP0kgh3YQ - bE6OzP444pI1NhXpKYqwI4oQ30oHmz0AKY1wgiDBcz/hwSXwuADYUkgOLrEcVhxFiPA0UpBdRS2ObWpH - PnjYmAEbS7NSTFsmmdO/6/bnue0Xds8WdT+kH5wDeJP2yTMeUCgfUqwcVWY9osxhQqXL1KPe808G7Kyf - 9Ov//dLRtH/63XU4/T8Cb8vuGU8uVJInSrr2Trf6BQM8pTnzhFnbpxz/bHir/fRgJ+4v59a6Raf9Zp/w - nHbMZXS5Hcw4rMS8f4FZWL4MvqZblgR27pmj74nA66DQL1Pokq7jlynwOiDwPsB328/zzOD7HdTBlA49 - LB1e6qx2x+1q/Pjbx5uqJwwsNB9YJO+OzeQcaWA2hAPSpEE5RvALEcWKyUfctfovJir7Vmx4ofmAQnS0 - lVZ4Aw/CuxGlVoOKTHvlGvXKNeyZIwk4JA3LN4HwsRWeWmEAmTOOaYG90+/nDSm2CS9Q9DhkHASAzzHo - fkgceMgg9LCkW5YUCofmmW6umbnwVL8+eWY4DSsw7pdv3CtXPqDQQhNFoHDfPLOALIn3AaHPQb4rPM5+ - nn+WMChHHF4gy7ujJbKpf9Y+KCHBaynw2yy8UIbeGVRkNrTEKupCl2ICGGdkme0NjWUBcqB/90MwlBAd - ao+FOVwbYmtEbzkmG6u1RG+ba8b1Abxl6WEYeGZgAPDQIhTvfViCYXNLowrkjKuwxapFcxDWPasaUWqD - hsB0ffIwEozD8s0GFVnXagvINtdM1LoOmFCp/bMvJ9/LG1ZiFVZgGkIHQ8AhSfdsae9cMhgmHdE+GKBh - 3u1YaAtbaYmrbsdiMTGk2FbrIunsB3kDi6z65Zv2yDbqfsiwRzZwzjD0sHHvXFN005kPtMR8WicLxnnP - HJkXIloE+hk8F2AYkGw/zzGVENJeB3gYPyAkPKj9kWCETHaKUiiCU3Qoy0ECp+BHAqe4yoTTKawiB6Aj - UIqOAYJMWLik8+wAXZQNR1xFWRuKW2AGJ0swrSAHOVDSFqEe7r2lkFo4/d/I/ryAbGG3QyLvg/o9cg36 - 5kv75Jv0LzIbVmY+otxmXKXjlGNuM4/7zD8d+N4X1zvy6d//8mXs/e7sQYzfHb0RTIp0eM0zKdoeV0GR - iE22bR8w+VPh7fCTuZ1g2+kPDs4+6T/3lNe0KpexlQ6w4eASiz75ioHFsj75xsGHDf2yxD1z9QOyRQHZ - uh4HhH6HdPyyBJ4HBY7pAvcDfJ9MjHu+xwFBt0PCwGwx+mLpufBOqrv1smb/9eiJR9xHlJkPKlb2y1cO - LFIOK7OMujAo53asVq/BpL37+a3hZcrQfPnAYvmgYvOO4I1Eis+qZp0IHlluMbBIEV6kCCtQjiy32lI3 - 8b0vtIc4adeiR5XbVj7U8oLdKSBciTW8YQj2IQtMAGDhRSb9C2UQC/k5t2OYbjdeVK+vHt03X963QNa/ - SA4DakWRwSVmAdkSjF63DL5bBs8DvumAMCRP3CtPlq8N3rSaEQZcciZkeJn1gCKrkeU22+q0R7rZt7Xg - 5bhKWxRvJxaqDiw265Un8TooRIe6H+BBN090aLYeenODNnhDZt98k4BsPbcMAQaAA3ZZs/jdsoVBuRLM - RM2uQaWjK2zHVmpHhdMf5MH+w8ssMB5gOjQKI0Gz7Rgb0D//HS2XxlTYnn2kBTzYYFhwOjiixCKsUDGk - VBFWSAbD5tqJncS7ubdjh5TYjj+i7b2327GjK2xA4NHaO6hu/qngQcWkOjL2ChVILzod0tHu8T5tcSeE - 982Xdc8R+2QKMUjQIy77eU7pPJjaEZB2kJyij0DI9Kb2x9HzIM81Q0X2qYQZDMjBVRSBEDCgOI44xSU7 - QBdgj0pjCXVx53TCiVMckYYOEAgJ4IFYnOISEjgiH8WRA7HgRA7YcGQyQaiI0/+N7M/zP6TbPUcUclgc - mCPplScdUCTrX6jA9BhVbjP5mNOck27zTvmeeG9/J04278l89UOGvw/e8HD/ossy374er30fQPOBTGxm - BgxzjbxlrP561p8Hb7H3A/H4TEemeP+L64vPBMw56TPrhNuko47DymzCCi0HFWNOygcUGffIkXbPMeiV - J/Y4KOqZK4L/8s7UgePzyoRTE/hl8dk0YxMJmOeXpdvrsMHgEnnqtVWdGJ9dQjAHP8ioK8xjKlxCDpuE - 5ksHFJsA5157t+n2yxq4eHiKIw9TH3a8dwc3N67SZlip9czj2vctsb6Gt11zKWJMpdWYCiscN9dOABZC - /3Zqf/TNo+Qry4eWYmVgpRVF+uabBR+W9MgVwnTwC35ZPL9DgARxWKFMq9fuBOwB1aiio0AZih3WhpcT - j2qBN7KJR+HNNwv9S9YrjmmYYgTeYOp12uBtS904BHbBh/XQ6cz/+h0i8Ib52DtPC7yhs1A14E1rBMMG - A0yKzsLxhYZhmZ3PPcqDkIK72j6pXGG7+ExIJ+ZCG9GJiIoqHqS+38EqR92bMB2wDXVpDktoOLjEcnAJ - VtJWnchBdRACZgTlWJZ1NLzJnm2FttcMbsUOKCbwFpgjdKFQgfmFI/oFpvbNIjOOARhABTkskwAMtiIp - DuESRhfAD6VwCZk4ZfiHHAZ14AEDcgCNyGSYhyM4mUy2AkOlEItMyGFHsvo5SIhBFyMmnIllcItTMKMs - p/8b2Z8Xkifqna/Xr1AcViQZUGIUmi8bXKpABDD+qN2kY85zT3lk3IjqxGPWfZrV9gH63wdv2JmcWqp0 - wQOTb7QzyYI5Dx9XXx/117n+vCcnV96yePzd1Y5MgVtuu5vGzT/tO6XKHcuCsZV2Q0qtBpYoI0rkEaUm - PXKlMG9Ivrhbjl5wnqjHYWG3HKFfto5ftiAwR9Athx+Qw+uWzfPPJiOYLB4z+f7ZgoAcUVihYf8i031X - O/v472vxrC0D3FbUxfA+BSbdcyV9CgzCCqWhBQpN/HgjmYwZkqMvDcASe2CJfFCJIr65szC3K/Iffn4D - I3DsESuAazt++LKwIrM+hZLuuUKHdL4X5v8BXtBhYc88cZ8ONicLtbnyrqiBurRGbyPKbW9qKAZVw4vN - +hZK0L+uB/h+h4BVPHSxf45e73yTzXVaNidXXxoXVmTil63XIxdrHR5csE8Wel+IDupfbKbZNahi/FGb - UZVWi84EdwJCnTQNpZaeC4H+WndxR1UQNNp/Q8tzIl0xVzue/Luxk47ZDtO2OZn3TuywcuXQMvmwcrPo - S+G/ry3qsbfkXMhYbTEiIDyiVBaYK/bKFPoe4jngHu0hMlpgZyR8AFcIyKjZMfs8aQKnHojDgF7AtiyS - j8ALR+8sUhAdioJIgxlH5PvRmcsSTsC2TJ77QXIJRzC7HSCZjBNiIYEJgXxWC6pAQSaQ8ePINGHjhzBT - hcHD6f9G9oftRL3y9fsWivsWGIYXG/ctlA8qVQ4rt5pw1G7mCZc11cPguDsa1k++uwan/8fhbcVDo6Gx - Ng6dvy3X8Yt0eA9hTLql+vnJPyl6w7MznUzvvDtr5532m4VbblUuY45gZWA9osJ8cKnZ4FJZRIm0d74k - 6LAYdu5xGIsJYUCO0CNTxytL4JMlIE6Qzg2yoDvEc8YWBFaRZGLwe+TqoHf6FBgOKTPNuLHqdziXdkWw - RsY+c0i+SViR2D9bhIihfxHgU9GVmO+1tadfjxpcKu+ZJw3Ok/QukALXO18YdS7w3S9ujj/iNLxcMabS - 4rpGSHrnkxqgfmi+QXCe0O0AH/4C6wMf3HvLFYcXyXLuxGgKH11pi5Dlta1ox0AwuzpCa5Qz7ogt1GjH - DzQaWW7av8gA8AaUQs9i1eJyQBCYC3gz3lw3VlOBddVjQwuMQ/P1EMeTzS741kw+BgkWHxGlprc1qkCl - Iyss+xcrI0rNc7W19LVtBFqPO2IzptKm6J6W6G1qFeDNamSFVUdblK+V35YBqwoI1Ao8uXdiB5aYhuQZ - hRVJMU1WXvidCPftT1+ur4mYcNR2cpWW6K3gbkxIvqxHrtibwhvIMQMLDoIxDLoAG0gjgSPwBvbHBAQD - wzDkIw2wwZRkOTjFkc1TBkLIR0dDGhIsH6QWDmYGUai3Ww5JONEiqAii2BHFkYOrTD6rEZeYZ3BAjEiB - EFc5/d/I/rx+haJeBfphxQaDy6TDyk3CS+QjK5XjjllPPW4/7bjLw8+1/8EbRvAPv36N5+Pbvfv8+6I3 - fDqyzzzH33HjTf3XAQPW2uFtbvX9v7f+3hveeehkVp99dCjyvP/8M17TTrhMP+Ew4ZjNuKMWQ8sV4SWy - QaXGg0oNEbf1KdIPOAxT6/plC30O6fQ4LEDoFpwn6JnH98/hBeQi+OD1OMzzwGTAcEcwRyaYIPCwsE+h - KLzEcHiFHGv/P7LCbXxeNf2Ey8ASk35F4t6FukF5wqA8Uf8SyZByLSHCB1/euqXhWDuxQMbNqJEVWBhJ - uh/WCykQ9S7U719sOKBEnn4jCt7njRwimN//8ubYI05YdMOAY44oNV08cgaXyXoXiIPzhX45fC9qtIBc - naA8/Ygy47y72zVrnHzcdvpJL7TrjZQ5cDN6ynHbQm0wMOGYFniDYmHFsrBiMXrZnyrW/TBI0KsAppZu - rR+jWfumujF9C6XB+aJuiN6yyEjolssPyReGForRfM22I2QcWKJA8wcQ4yguPOnsc96a1Z1/kjei0nz0 - EcXwCmWxtnYNLbcYWWkWXmIKhoqHKV0317nHWlYPMN2045gO2jYn72wfXm4ysETSp1CMcTi8Qra25o0R - DruvKy4MCC8xH1JuPvGYlj9YyL+7HXMQA7L7YR30BQEM4AcSWA8BUXJ5vtk8mB1HkCe1Px1LqnwwY1aC - AZyYm8h3p/iHfBTHJRBZxOSq0ur5CwYmlnYoqdGboiASyGRHlMURAgF4TDiTz45ghgRwQhTzCUQ3Tv83 - sT8Pe2X9i8X9CiWAt75FJmOOmI4/ao4RObnKofRBUieDG+81a37XA/DWe3bXXuu+0PrVkpsm+MeAHuTf - 2t7gjbe2N+EQveFtBPXnlUn0tvRtvtYdcy8Aj890ZIpHX95cdiFg8VmfhWfdJh93hOkmHLOE3xlSjm1J - 4/BiKZYOQJTQAlFIPgJlYWiBDlDNIwvAJgjIJQt8ABvWaBjrbpm8nnkkgSOWaS4HkRD45uiEFYngBUZU - mEw45nLkTTwO0xkuIPnqXPgsLJMRtwUe1gW4ds8FuOpGlEqQrzVEmFRle+xdLU+ItLMDIkJ4Jay+gW3d - ckV9CoW98nVwJHuweZJhFbKlF/prRjmdjKvCezFDy82GlhtHlEqDC6ShRbJbL6vb8d98eWlgiXHvAn1U - xPwLordeBQIANkrlvaPlDZYJx6zHHbWac8rj4hMtXlhTH6wkdjXPn1hlNazCqvi+ligH9tFsFxSD5lgv - 9i7ATinPBav7g+hQAXowvESyrmaEZkWb60b0K5L0wtgoEDCPGZSHtgDe9DF+ILBdkdufVA8rlwXnGw4s - xd0ExD3ywnta4FyrhXPf2Y6dQLKKLTYeUiYruEteAWz3G1VpGl5iBDMOKTMKK5HHNs197QIFtgKMTT+h - BcPy78ZgqTf+qKVmReim8BIp3ToiU2NAiQH8z6yTzhe61kEQePy9lCnHnQeRsWc8sNRk3FGFZi0Hbm2h - c1BEphI2inN5XocoYNC9RPQRcgg+5RCzA4Fgf7oiITzIZEtPAlGtaVbENVPFA5lsBGqdv5DjnkUks0mN - qhknSkEycnBkaaYMQ1PGA8L4cT5IqsYl6IDhwen/Rvbn9S7QC8wTDyqTDCqTDq2QDa9QjD9mgfgj+dq8 - TnwQvkel9ZtVgJYBq+0632bE8yPevT3xLInqc5EU3rqP+UPw1nvWb+Bt8FYbxzd5PVwNlvT/537zHOaK - W8pH33YYwra0/N+ey+OXnPOZcdJ92gmn6SftJlRZTaxSDq+UDywzCS/FvCKLUxi5R76oJ3acihBt6Pjl - CHrmC4Ly+UH5ZEBjqmACBBwmhDUaW1riGFxAlpMhBfzQQh0UB0YOKJWOrJQvOR+Y+07si+9e/6n+5o+q - Dt6KGnNUEVZsggVyWLFeKPAAIWMB5AugDDK1whsAb2KV7aTjttj2QdindSRAAQjHgOldaDyg1CC0EA3U - CcgV9Mjj4xicrxNWghzxsAqjsUfNNjeMbepAjhqD4QoXng0YeQTRjyECoPAS/QGl4oGl0hsvL2rA28Uw - 0hzIR3VkdUzW3aRFumEl4tx3NmoqPKhMHlEmG3VENrDUbGPdmM7DOAQii88Fjj1milAMRfLvasHLScet - NJcF119cxFQKLhAF5wvQfT3ziROEkn45wr5F4g11QzQVW1c7BJfAgOiNDYNehaQIhKCNENiuyLWPL4YW - GqKZ/YpFYcXYd5H0KZItOR+AsKwjHEL+2cd5sO2QctmgMsP+JWL0y8Ayw+w7mzT1GVIh7VMk7lukB/tH - lEmGlpvMOOmMXVCt4w2SgUaR54OG40Gho1peHs+5swXrvKHlppoVZd/ZCE0QtnpnC3sV6PQq1EWnI8Yd - USlfdak/xHbUHGiCsBKzYFiFHDNiYKkYBfvg0YFSIy213Ca1dMvVxbAnMENHC5l39AhrY6KxyAyTDleR - E1KgmongYWETyBtwCJjJJ5xAqe55KkImQIgV1Jy/YEYRkA/AkoZx4ERZ5OMIfuTgKhJgIHs2VCs2/VlB - JBg/K8vp/0b25/Ur1htSjrEuGXnEaGi5DCugYZUWUZdCf/71p47gDS814w88tcIb/lZ0SonSGX9J0/FD - IoAQvAPQ9lMj7K0A/A3N7/sXGxQEnqnfDcA7cDOOKch/4rzp3+KA3913+hFF27foqj9J7wTmi+5vWHnJ - b/4Zj3lnXKadsJt+0npClfmISrOBZbLQImnfYgncUP8S/eBC7E0Ju+cJexfqBOQJsFvVk2IbG6+hhWQE - w6mxse5B9y4wtbyyeb1xicw3Pvwd0BEQMrTCoH+pdOwx2ZByRVR1//03o/LvxcLPIpLAdiIS557kFd2P - Sbk+d9YplzFHTUcfNRlcbgicCC/FniH2ZwSoyA031XP4iDAGl0vGHNUSvUHUqKM22MUC+IFh0gnnnc1j - sOkHyQChvVfmwJ+OPGI6tMIEXjKiTD+0SLdvMbZS+cH5PM9sonPAYb5frgCthqOElxxcbjy0Qj7qiBJy - oHPJA8iJzb8Xk3c3ZkvD2EVnA0cdIUZD0/oUw1sRc4UWCfsV6w4qI8VHVJqMOyaHJvBoI4+Y9CyUBOVj - FxT2hFmoUyBeg9+vWAdlES73LzXqXyofUmE2stIUeAmxQyskvQuxPhD3K5FgA3PUEdPomv6IFOFG3/mU - WA/Ho++mZN6KGlfljKATfrN3IXZuxehBGHBIuQn0R89OqDIbUmEKZQbgrmq5bHA5qQX5I48gxwTCexXq - QfO+RUQxEHoQOAc9+5fqhlO0HnNU1r/MdFCZKWoZVilFZkiBLkI3NgaIz81F7wt8c4UhBXoDSiXDK02G - VMhRL+pCGlX0KdQjUXIhmo8FkwhKRpRLxxyTjaxUxDSOSb0RhXYV3Is5fDcm+07UtoYx444pUBddbMEC - op4F0ES3Z74I4xOGiign7UJvwv5huE8MbCvWhf2x+oExB5eLh5QDckzGV5mtremPXeji+zHZ78QgEITk - 8VWKUUfkg8tgHOOIcmM0DaeQBpvA/jAIFs0R5QBjw1FHjAeVyUYfNR1aaQZLDik3Ci9FuCYKKdCBrbDU - w/jBVjOWRMGFBhFlUjR5cIUCowVLKIw6tAgDL+HK3I11/YdVKjD+w4rJUMEioEe+EHu5sEMvbHKWSgeV - k1pgLmiCpRXmC1qBBWJoESYRGSpAL1fc+qKzDF0DgzPkYAsLduqbw3PHjToKMwRvckk/4pSl1SjFQI5M - 0o7nLwMqNqNREMxMmg/wklYEQj4kIIEcEGoBA45s/LCBpNaN07/r9uf1KdbHBBtWaTigzHjEEcw3xYTj - Fu98WteRT8fHqHbeD+7wc8Pkj7ON+y2hWKUNXXCDzaun59yLrX9hSt+Ww7eV55w39e3ngX9r6+IHJxkQ - IhBEkYChru3+m23ZfeMB0XZEB/cu//Gbuw9EhUfZQ39167Ifz+wE26qfZkVV+0Ve8FpwzmXqSYfpp2wm - HbcYe0wxrko2CHtrFTCpOKQQrl8UVqobiHtdWKIWCUIKBZjJfYr5IUW80CJeABAOY7eIDGskfOmxez4v - qIAcWRojG8woiOJ9iokLGFSOLpOMOiodd8xkQpVs4nH5KCDZMdNRR5GQD6uUDa80HlwhjcDcLtEfWC7q - WyLsUSAILQYAkIpCClEvf2CZcFC5ZPRRszuftn9EgkRvxy0wHuDvwsskQyrhoSDNZPgRQqOOGo04Ih1c - IYko1+9VJOoNb14i8KeOQK0/AkQ0IbgA7dVB88PL9GAN2GRIpXRYJSSYwEONrZJB/zHHjEYflWKBFV4G - LBGhgSjVq5AYKrRYAOHQfyBgptRgSCV8vQH8L6C6Z4Gwf6mgJ/MCBTzUDhOhVGgx4Q8tRqsN0Dos6oFP - qB3hbwjAoFjYr0QEtYdWSgAtwP6hlcQjj6uCMwV4yMLL4Kal/REQlEKILlw8jqgOCjCBIKg6uMJgcIV4 - aKUY+ow4IgENKDNQ69+zQBAMr4Tmw/HlY4rxesODF+j0L9MdUqEPpwzTITIbXgl3jFPd0CKdwDy0lxSB - 0cCPUcH6OqhA1K8EdjMgDSlVVdG/FK2AZchACiogUfgANLmI7MGEESA3hoXpXCaog2EwpEJCDUhsy0Zg - n2JBWCkxFPRhTUCj0EFhpXod2b9/mWT4EayrjLEtge7DCB9zFFgigfdAwdAi9K8+ErDSsCOkdUjAIMEF - ECjqXwbjk4UCM+DQSgN0AfSBDt2xbgP8F5EeRL8H5OmgOegjKsoQoeSQCmNUN/IoGXjDKo2RQ7aaSHeI - wsvIGGDUq1CHTI1SMszCSzEyiQJQidYuhK0C6Szr2zr+UR3SsDamGBs/rMuQE1pMTpEAIahCX+ASCb/y - VJnQFoRMHJH52vmLngUzE8hqRA7KoiLowAiZaobAPJUmbPyADQlUxOnPTNR1+/OGVeoPJCMJTgfwJp90 - XFH6IKYTn17wdFHnn9LHl5Hxiayw5fYI4ABmvyFnX3x2a8Zxs7YQwqQhYMJf5OCP1jyDvHATDqXwwS1E - gQTt3F8RTvGiGy4RBhdffH950Hpb7HOq/u9b/beot8g/ow5cY4dvmrTXoZ1KracAy/BV9iil/oed7fe6 - ffvL5x2Z4slXN6JrukVe8I686Db/nOOcMzZTTlgC24ZhW7LcGPaELx5UIR5UIepfCg8lhJdnngW+L6iA - j1GLIQ7cCishQxlzj+EZG/SYXfBxGNN+NIEJBjYGcvBoYaUCCOxXoju0Al5AH754xBFx/zKDYZUAABzh - c9GheoPKRcEFwoFlOvCAqDGslKxVIRMCUXX/Uj6EwKlNPGGGwEXjBk/NpBNKuDM4cegPTwSPA98Bdwy8 - 7FeCAIU0CjSgDI3i98BGnIb+qAX69yvh98gXQI2wEngf4ARxqXBPcEPQE/pD2pAKgpHwVoDJMFApsUPf - EoLB4cCwAh1cjSgnTUaNhK1YB/m9ikgEDHNh2rNGQQfUBY8ZXIi6hIATMKPePsU6wRQvQTSBrTB4RtHA - Mn2YDuM/jPpoHAeV60FDip06ANduecTa6LJB5UQOxWndAVRm32KmEsG/weW6TP9+JWgmvC0f+kMl9CM6 - Dt4KnUszBVhnkOKlpAjKohTkY9mBxkJ/+Dj0NYyGIsikIETsxmqB+wZBeejTPZ8sj8j4KSWgjkbhEnig - fESFHtB9SAWxbS+EzhWiXkW60B/SoABxqSUwLx+l0HfQB7Hmb/QnaMHvTX0ulEEa1fWiPFh8YKGA7oPd - hlXqAbSAzcTCMHUp0IV0EwwbXKiLGpFJSQedhUuQwPSHkqgRHQTzhhaRvsawZOMfzYd6QG50IhWrG1Ik - Glyh17cYGIxu0qeLJAwhZjoBxgCMgIIQ0oOMcMwLHRREv6DrYeegAjI+IY3w0ImmHv84RZrVyMYPO2X2 - p8sLQrjKwImtONkkBTHMw6Wuz18mhw0MNlaZDpBGBgldBjFNyGRvM35QF+Ph9H9T+2Nk6A+oMBhxVDrq - mPGkE/LUG7N+xy23doAHhMP/lM44qhiy3WbAGruB6+wGrsXRdlymxZJrJLzTCpCI4bBLif8RHX/QArFX - 8CQXv4FuuEuH/xclFEiOOMW/BIRMdQaq4e9M8edw2JPU+p/aQCk8bILvdeGVA5UOUEMb4erQGJuZVQrw - q7FtxS3zR99e7sgU+EugvVfHrar2AbbNOes05ZTdpBNWk08qp56UDzuCcAQ7RYh4sLrXg0MnE5XMVZ1g - MpnhU/i9S8i0gQcJwuDGrMagp6f9SshEZQkce9FE/1JeNyw8aRrMcDpI9y/jAyz7l8EL6PSDE4FjZd4E - rp/6lH6lgt6IEUv4IVQyZgvKItZB2QAEhQQp+VBsyBHJmCqz2xrwdu8zwJti1FFJP4JtkEM0D4FDKdOJ - KNfpCz9CM3sWwa2QVnSif3gpqRFNDoOjLCRyUHBgOcADnogQTiEQ2kI3yIHDYtKgLXEuOCXW4AcVkiaH - lvC7Y6uWrp2JO6A2hH3QOhRBXdAHNoSR+5bwsagPLiIJSOhTQi7BhuDBKXAUlfaC24XDLYE3JDSwHGEQ - aRpUDaVdAJ8C/kCs6EvgPan+CJuK+bA/DIgcwknsDFGABFIRCcpb9YeEYHhJan/UjjTTHyMBbYFiOEVb - SI9Q/dHXaAjrdObmcJWxwenDAqguvIxwEqeMJT8dP7AAtEVfo71M/wFYTJAxAPMCmAXdEbgT/UktxLcW - ERPBgP1KSadA7d/oT4Uz+6u6g9ofbUcfwWg9sTgAktFlFgrCwrAP0wFmZ0oOJMBJLQY3jeLE4K8uQRlo - i0yUgkrtxj9qh3pggHCmf1AhaQsahRFIVwMY+bAhMRRZFtABQ8AeagMYSHPQ6RiuJNHR+Gejq934aWt/ - CrS0XZQNRzL7aNewgaq2/xvNX7X9oQCkMf0hCs1RJ9TjXz1+cKnd/OX074r9eRFkj8Vg/HHp6CrjqOqe - nfyX24ff3+nolpt2uLprDOzBO22MkAbmtf33Ua2lyF+S3qfM9M+yFzTK5lXL1YRThIYASJW026/501FE - dW11UCvTLgGedvFf9Sedfail6P761TU+iy96LLngvOi83YwzVuNPmI8/YTb2uGzkUenIoxJYNQIxChbO - xcRvhsHdlAkiylV+E+4AnkuNCsSvlRHvgEQA9W6Y3tRZUA9L3SvSxG+iFA1rkBhYRhwHmJFGcd98/oBy - uF2SRhHIBxt19KQIOxJApcWJayjl9ykVQtVpp8zuftY+ekM8N+GE2fCjEuhPHQ2pCzVCLOY50189q7uu - P4TA30FnIq2c16eU6k/dujcCBaY5zWQ8neiPq2gLQQJqOihDfBC1odrlgQf2JGBArQQjsHUDMpn9WT4o - nCqDBGsa9Hmt/SENPCQSon30F+uPhmjaX901BB1LSX8xqIBn1Bw/b6o/Og7SWPeRXQTalcRWv8v+WvVv - N/7b6o80CWhaxw/rnX+a/d9o/nL6/5H525XxAwvzBlSIR1dJRldJJ5wwuftZQ0fxyo+/frv7Qe/X/sPn - 22UgfyNw2xhRnZrI5mGbPwd4u9WppWU9mtZJCFv7YfbqWr+oGo8V1S7zztlPO20z+6z5pJOKKadkQ44Y - jz1uOPyoOAy7N0fJLkpEJQICnf7lguBiwaAKQUgJPwB7FMVYVfD6l/MGVfB6wgGV8frCrZeRfOQQd1lG - HS51u0gzHr8CcoopDZ4BlA0M3ekSG8UhDVfBAy+PqyjCZGIMsUusIBbsIIKI5fyhR4TDjkrGnjBDrNau - vbgbN+00gbfBlcBmPkT1KCJCINYfUSDV8+/Vn5kIDYEyLIEjrAGtoC1LEIAEpJWSHE7/tzt+OPtz4/+P - +J+/Zvzwxh0n8DblpDT1ZmRnjwg+jfyTsOSfJnbbPb9vf/msI1M8/frmmjq/1bWewLZllxwWXbCZetpi - xhnF1FPyaaeMx52QDjkqGXFMDGwbcUw0qFIYUakTXiEYekQw7IigJ8IgRFflvH70OLiSUEQlL4ymgwBL - 5byBFSSBpTdyCBohoCkn+QTS6BGXUBZpJODQ+yKGozmMAQAJ/t6l5JSJxSVGkMxEMf6BFfzhR4Vjj4vH - Hpdrwhtypp+WoyGDjwjDyvlQEqJ6IAwCZNJKmfC/UX+0HW1Eo3oRqCamgDLQCqc4gnCJ2RlHTv+3Pn44 - +3Pj/4/4n79m/PCGHhWPrJJMPCl98vXtjnx68+cF/zQQ+pP0WX5T8f63jZ3AfPqtcdF1nqtrXSIvOQLb - 5p23nHRKOe20fMYZk0knpZNOSkZUiYcd02PYNuyocFClTliFIAh3esr58LnwswitiLc9Qii8gkAF/O9A - 4NwRXk8EWJXkdOhR4qBxFUfkhJaRUkiAB4RT5OOINOPvjgiGMrBjr1IiAWlWCzCVsSHBKsVxQCUP0dsY - LG6OI2pv/940csafMAH4IfrsU84LBLBRPdVV/O36oxWwCeyGxiKN9kI3aMWwDZeYtsxQnP5vffxw9v97 - 5y9n/67YnzfplHjkcYPJp8078unPv39ndQdvuf1JGPM3ir34MqUTbCt+uG5Jjee6etdl1Y5zz9vMv2A1 - 57xy6hnTCadMJp+WDsLjJMfE407oTzgpGnRUOOaEcNARnX4VggGVgmHH+GHAHmBMOW/EMZIYCEdMnfLw - YyTRF8EHA7xK3pCjqqvI741bDgC/I4QNzGr+ftgbpJzgRwLFAXU9SnkhlBlXCUBW8AJKSEFcIn6f1gIe - 5Kh4jumMOi4ad1J659P27w4jZ/oZ6bBjorAKHVYRirOKUPyfoD80QSuYGUGDaPNhLrQUGsICw6hhkYMj - p/9bHz+c/f/e+cvZvyv25w0/rj/plMHuq8O1unX8/8uO+0F/I978lVVnPZraCbbV4JZbvef6BtfVtY5L - q23nnLeaf0E54bTp3POy2eeMppw2HH1CPOqE/pgTogFHdMeeEA6v0hleJQivFAw9BuLD28IFwx1HUPQa - cIRABfHOiKKOkkyAB9KD6dUQwBXNBPUCIlbRqxRgkGal4LIhE2Uhirh4WpYVAQ+TgzTz8iOrVDxIwNMR - d1+JhACqTj0tzr23pOzdzWXvbit/b3vFe9sKHmzOubtk3EnxqOO6A44IBh8j0lARU/ufoj8FrdBy0jQQ - Q3qoB1WRSUD9KEmj7SzB6f+Wxw9n/793/nL274L9eaNP6I89KT7y/m6tnv3o8834G+7o23b/bVp92zbu - Qeg3P3/ayS23TY2eq+tdomodV9XaLquxmndBOfu82dwLssmnjSeeko47aTDxlHjKadHoE4iHELrpDDwm - GFYlGHdCMOQYP+IYr/8R3qjj5AgX3Iv63EFwuzSQAiGNS0OP8UKxc0iZw44QlBp9nFzFcQgw6RgFRRr5 - 9cOOZYUqH2WRZtIYJxKogglBESCcCvMAh5RnJGUbWsUfd1JnxHHRmBPiCacMZ5w1mnveeOpZo2lnDCef - Fg85LhpxXGfsCT6wAcIhCqWYwH+C/gR0jxGVmAFBaCaahszhgHDAOaCO5jBTc/q/3fHD2f/vnb+c/bti - f97E03qjT4oTbwzrJHDhLqXdHrm2wWVZjeOSatuFF62WVCtnnSPYNueC8aQz0slnJLDh5DN6w0+IRp4Q - jjohHFKlM+iYYORxQdgRPhzrQERUx3njTvLGnuT548ZYFaHhx3nh2JykR+SDRp4ghMTok7xRJ4hTHobQ - hOYQr019N4AN+ZAGBhwhB8WRRi1MAnJQHARMRQ5OmRAwoyAj8MPpU8mC4cd1xpwUjjghgv4jT+qPOak3 - 7pRo2HHh4Cod6N+PRooDqJ5MyX+I/mojoJloIzREc2AK9SnSaDhWA7AYp/9bHz+c/f/e+cvZvyv25008 - I5p+TjzvopaPbXOoxixQ9l70+iaXqHqHhdU2S2usFlUr51w0m3VBNvuC8Yzz0qnnJNPOikef0p9wRjT5 - rHDyGeHQ4zojELQdF4w8yR8JpAG0nOBNOMUbTv3vQERsCDtOkNMhx8mlMSfJETT0OMnEVeSHHSUQhRwQ - K9UXvruKMLNSOB1/iqRRBAkwIDG46lUmioMZmWBGmtXOKkIpEEAO6kFJgBy0HXNKZ+IZQkhD/8HH+SMo - XoKNVfFP059gNtUNGrLmjz1FCGkYbRAWEJSB0/9PGj+c/f/e+cvZ/7X25009K5pwWn/SGfHTb25xeKZp - gfqPstY1OkfV20c32CypsVpwSTn7otmCS7J5F40XXpJOPy+Zek489rT+lLOiSWd0J50WjjipM/a0YNgJ - weQzgtGn+PC24ygBSFgi4jhBHeQPg1OuIgmGYUgwEMIRl5CDxGB6CceJpwlBCIqD0K+MDTlh1JszyaNO - EjZcwhFXkakWO57mgBNsDPmYQBSBfIRlYyjzEOABRdBJ9CpTFfSP1Z/ZBHqyRqEtyGEW4/T/C8YPZ/+/ - d/5y9u/E/rzxZ0TTzunNPC/Ovb+Ig7d2Fnj6zfWVDY6rG+yi6m2W1Vogbpt10WzuRdn8i8azL0pnXJCM - PC2edk5/6CnRyFO6g08Kp53TCasSTDgtmHJWMArYdlqFGUOBGRQ5ACEkJAKoAOpOEwLkMFzBccIZ3qQz - vL7HKDKdJvyDEfbRTIATCAkmZCAwDxuSuLfUWpYJgVgmh5WFEByRAwInsHMQ9f4E8yhzGMJBekQ+jpDf - Bzulp0gCerJSOBLM4/Tn7M+NH27+/qv8D1yhaNJZ0cSz+rMuihs+zuMQrq0FdtyIWNdku6jWakW9RWSt - clG16aIa2aIa42kXpLMuSmZcEM++qD/lnIjQeeGEM8Ip53WmnhdMOy8Yfoo/7BSWDgQYVBgDqENcBVQ7 - Q2ggcOssYWBoNwyx3Rke4BAEHlyaSK9OOUcuITMC24NnSP5QRF1nSXEkIBCZOCIfPJPOqUALCeSgSBiC - mLMU5ygbq50JwSkIVwmAAWjPqOpFWVQKBhAyURaSCUZy+nP258YPN3//Vf6HN/W87oizohkX9OdWi5fW - mdZ+xCEcAbivf3qZfX/OmkabNY1WC2vNF9UoltTKF1Nsm3dJOueSZM4lgm2Tz4nmXiLYNuOCcMZFncnn - BOPOCKae5w/A/h62yxDxnORNPkdACNEPjsA85Aw+qYIlhitgxhG4Ak52Cagz7bwKYBiAMQngYTAD/kFU - MtLgZEA1nM498KAWMI+kMAkedopLTDLDV4agyEdxnIJtynmSOfo0SYcj+KMhJo6c/pz9ufHDzd9/o//h - TTgnnHNJNOOiaF61/uxL4qkXJAXvLv7w23f+l8O4W5+d2HjZd22T1apGixX1ykU1ZsC2qRdNZl0yWlgj - nXtJgqXA/Br9+dWimRcJtk2/IJx8XmfKecGkc4KpF3Dkj22FEGDGRIocgA0cR5wmNP0CBaRzBFdG0vzx - Z1VHQNHk8zwUZxLACf4hp3hTL5AcCAECIQ1+gk8IsyiGkegNgeBpcgrJrBZWNUMs8A/EAyw0wmMFIQTC - cYpacMoE4ojakYAQCGRacfpz9ufGDzd//43+hzfnElyz7txq0ZxqPUQkcNzTL0kW15ok3BpY9Xjrnc/P - 4mPK3/38eSt98d3PlH754nsVffn9L4S+++XLH2iCEdI//PIV6Ht6/CupbY1t0kylVxqqVUVDoN7Tb283 - v8jKf3f+9mv+a5psVjVarms2X9OkWFwrX94gm19tPB/AVm2IPcl51eI5l/QRtBGjXRJOPS+ceE5nwjkB - g7cZF/kTKGZMu6DChjFAqYsESGZeVEHFOAokyMQlsOEIsAGuAEhAIyneMAIg4YiCuApOsI0C7FF8wikT - CILwAafIKS6xq6wUCIOSQSO7hAREkR1IKhAETZAJHZCJtDpHrRKnP2d/bvxw8/ff6H/g+4TzqoWzqkUz - LommXdJfWieeUW0QWSdZUiedV2u8pF62oE6+qN5sTZMyqtF8VZPVpis2m6/Ybr9qt+2q44YrTrHXXTZd - dY257rbtmseOG57br3vH3/SJu+mbcMsv/qZf4m3/vbe6xd/qlnArIOF2QMqdgLhbgQm3CaXeCYy/FZh8 - OxA5OCbeDtx9K3DPLXK640Zg0m2SxhFsyEF63x2SBmfMDVIQl9RsuASBrCx4dt0MSL4dkHgrYNdNUvWO - m/6xN/ygz64bvjtv+MTf9Iq76Rl/02PnDbfNV12h/7orTpuuOq5ttlt/2WZlk/W6ZstVTebRTcoVjWZR - jfLIepNFdUaL66QLayXL6g1mVIvn1ujPrhYtqhVNuSicfUk48YLOrIuC6RcF484LJp7nj0WIRkELIAeE - mH2JNwYB03nejIskjfwhQBp6aTgFnvHnyKXJNAFO8IymObiE04kI+3BHjeYgDTkzL6lEAR0hB/lgQ3Gk - cUQaVSCBq+ojCk6hmUwZJFgaRQi40iMYUAvTQa0Ypz9nfwwVbvxw8/df6n9482qAbcLZNboTLogmXxLN - rtZfWi+edslgYZ1kUZ00ssF4Wo0JQC6q0XRFo2J1szK62WLLVQpyV222XrXbcMVh61XHbdec1lx22XXD - Jfa6647rbvE33Xfc8Nh23XPnTc/Y616brgFRvHfd9N59E+jik3jbZ8cNH6S3XScUd9Nn1w2fPTd9Ym+Q - NEVHkgaBB8e9t0gOOHfd9Nl+nZxGX1FdAlyxq6At1wgPchJueW+5huq8dt7wggJrrwJ0AWbu26+7xV53 - 236d6em8/Zrj9msO6y/bbbpiu/GKTWSj1eYrlmuaCbCtazZb0QhQl6H5C2ql06oNF9dJFtSJ59WKF9Tq - LakjSwEYbfx54bjzOjMuCaZcEMy8JJhwgT/1IsGVaQAebDCep6hDAQn5I8/yJlEIwWk/7EDSSwyuplwk - NBx3wiiezakmzMgBD44RuE+GSAvxH6I3ygkGAnKXyBH8uARCceQjAQWQABvk44iyuIR8Vgu7ikykUQur - CEIIWNJMcKIWKM/pz9mfGz/c/P1X+x/e/DodeOq5NcL5tboL60RL6vUW1ukvqhMvbTCYVC1ZUi9d3mC0 - pM5kaYNsSb18Xj0CGsXGK8o1zRZrL1tGN1mtabbZeNVm4xWAhN3mq/ZAuw1XHLdfd9py1WkHQRGXXTdd - tl1z2XnDJeY6AT+EehuvusbddN12jdDWa67br7nuvEmOSG++5hpzzXXXTYSDrltoGoRM5IAZxVEWzLgK - fpazm57uuOG6E3STnMai3hukxlVXSNUx1503XyH6rL/iGHXZYdMV+5jrdhuv2G64YgPl0YR1pCHmQO6o - JsWyBlM0c2WjLLLeeEWjdGmDdHmjZH6tQWS9eH6t/rwaRGyiSRd1F9cJp18UTruogztt0y4KZtcIpl7k - T8IttPM0YqsmCIE0QiIQZsisah6uAjkIvNGrcJ0sZ3YNOZ3O4KqanCINQpHBuM12keSDk4R353nDsKl4 - gTeXFgEBlggyASAp8rEcsLEcSEBZCERZpHEV1SE4gw6QAJkg8OMq6mWLdIJwrcyc/pz9ufHDzd9/tf/h - TbyoM/2SzuSLwkkXhZH1uovrRXDi82r1VzSKF9aJVzVJVjYZwssvbTDGNt2sOtnay/LoZlMgwforys1X - lWsvmy9vAtRZrWq2Wt1sDcxYf8Vm01XEdgiJAHh2W6/Zrb1it/0akM9+7RWgi8P26w6br5LE1msOsTcc - kLn+CkngiEvIBO2gp+CJueEQdcVhIyWUWn2FEJh33iDMa66Q4mDDEWlkgh8ou+mq/Y4bBHFxjLkBNQiY - rbtsE9lkg9Bz4xWrNZctN1612HzVfE2zMrJBsbLJbEmDfHGDbFmDCSK2ZQ0IW6WIXxfXGyypF8+s0V9c - p4f926mXRDMvYR1A4l0YbXa1YH4tgjbBpIuCebX8CRTYMBpAc2t549keYA1vOIAEYEZDsZHnCc2p4c2v - JaAypjVIQqiENDIZ2oETaSRwhCjAFUPEoedIWRQEAzhxFZdQFqeoDsTKMoBkCTAjn+Ar7sC1ghmThquQ - hkwwIMHYWFlOf87+3Pjh5u+/3f/wpl0SzKnViWwQLqoXTrgkXFCvO7dWNLdGtKhef3G9eG6dOLJBsqwR - ICdd1ihd2WQc3Wyy5rIsslG2ulm+ssl07WWzDVcVG64qo5qVKxEANSMMsth8zWLLdcv1VyxXX7baet1q - aZPV9utWm69aAQW3XrPadNV6/RXrLdfJEbTxqorWXSan265bb76muoQECPwsEU0Z2NW1l62jmklizWVS - POa6NSQva4Zwq3VXSEUbKIytumy54YrlhqsWm64Bg80ByRuvKjdcUSxvUkQ3m0H/NZfla6/Ioi/LljSY - LKo3WlgvBa1skqxoMkDz59SKlzXpT7wkWtYoWlivC1SDlebW6syq0ZlfJ5hZLZheLZhVwwexmAzAML+O - N6sGVuVNpZETCJeQg8REBFg0E1cnYwMQaITIDPFZNW9BHUGUkQAYwBtFJmSiIIqw4nNqSQ4SYAOxfCZt - Xh25CjnIBCEBBmSCH6dIjDhP5IMTYnEJBaEAijAlwcaI7ExeIvyc/pz9ufHDzd//gP/hLakXzK0VTKvR - Ac2rg+8WzqnVnQmEqxUta9Bb3KA/u1a8vFFMPH4jcE66qlm6qEG6utl4UaPxskaTVc2yhY2ypU3yKIJ2 - 8ujLFPCuKNZcVqy9jG1MxborSoBK9GXllmsE/5Y3K9dcJglkbrii3HSVEC5R1FFupjxAyhXNJB8JHHEJ - QsCzlJZCGoS9RNCqZpKPU3CCkEBFyIeQVc2kduiwjASaig1XzNZeNl19Wb7usnxpkwwIvaRRBv0B2HOB - ag3SJY3SRfWSyEbJ0gbS3kUN+mj70gbAPAE2mGVpg3BajXBytQ62IqdUE6PNqxUsqOODFtXx5gF1agiK - TARiXeJNAK4AcoAWFI1m1vAW1vHG0JALaRAmD4GxSyQfp+AEITGdghbSOKIskAaiCFzV0rgNYEbFEoSj - PGCAWORMowXBQACP1ohLTALZ8KwmFaHIeGAwYI/iIgSCAYRLEEhiSk5/zv7c+OHm73/F//Cm1giWNAgQ - i8yu1ZlTRxBuZq1wcb1wWq3u4gYRaEmD3lxEctTpr2o2WN4kmVkvWdJgOL9BGtUsjb6MoxFAYnmj8SoS - 2JmsbDZZf0W2/qps3RXZsibZyiaS2HRVvuEKwE+OaGlZsyoBpMHp8mY5riKBqyCcMk4ckY/E+isEk1Bq - 1WWSA4hCpjoH+RtpceArGHAVlQK9FjfJVl9WUWQT0Qpx57orUNJ4ToPR0kbpggZEaUBrQ7QIqLaoXry0 - UQVsyxv1ljeJljaKZtURYFvSIFzWiKPO/HoStE2rEcytE8yrI9gGVJhajSUChQdsLdbyptBQDAkcF9eT - BDADEDIZEVINySEIREGF5eC4sJ6UBergFFeRQ/YGgUBUIAg5yEcm4xxNwWwCjcAgHAwMF5lYCEHV4MQl - FEQ+EqiXaYUiyGQJAplUYVxlynP6c/bnxg83f/8z/oc3r16wtFEwv16wsF4wo1YQ2aizsEE4q4449Bm1 - wul1unPq4eVFK5pE8xr0VzTpr76MSE68okm85rLB2suSFc2S6fXkuLTRcHWzdFmTdHGTdM1lQlGXpWuv - kJzVl40YLW40Wt5ktOaKUWST0bImo/mNRqsuG224ahR92WgtzWRsyFx3lRzBgNMVzYQBpVB2ZTPhRybS - rKz6iExIgBzUG9lEql4IDGsk+iABGF4EDS8brr0iWdUsWdksgf7Rl7H3KJ6K52iaSLgGVFtQL0J7gW3L - GnUXNQiXNgrn1gkXNcAmOgvqBVgKzKoVLGoQTKsVzKzljwcO1fEiGwhyLKrnTQECIQzCViFOG8hxXDXZ - 65tJQWhBPQGeWbW8JQ2EB2kwIK0+ghMSCIDVYc1BEpOAYdgzRGxHIRAJCEERgpe0LCs+EjhHBSIfRyaE - ycEROWBmikEOcV5U1PQaoh6rHQWZfE5/zv7c+OHm73/G//Cm1/Ln1AmWNQngvkFLGgVw5SRMwU2mOuHi - BhK7zKnXhd9f2iTCEfHcrDo9gMG0On3cl1rZLF7YIF7RLI5qFq+5Il7ehBjIIKqZ0OrLBEVWUQhc0CBZ - 2CBBnITTdVdV+dFXJGuuklNkRhGAJGmwoRSj1VdIPkIrgkZXJeBnAkEz6iXLmiSz6iWLsGXaRAqCkxSh - 1SFnaZNkSaMBbqGBoOGSBjFURQyKEG1OPQEzpv/yJr15tGnLmkSrmtE6tFQY2chIB8C2pFEFbMA2BG3A - tmVNfAAGQGIxAKaRt7SRYAOBsRpeZCONvVrhZGEDvQdGYWNxI8E8JOYjkKrnjcK+Yi1vDDYBKOahIAMh - FMERURQyWUHkgwfCURA5uDSRohTKMjWm0UtIQAj4URBpEKsdCQZsLGhTs6EI9IFWKIVMTn/O/tz44ebv - f8z/EM+4pJE/oZY/sVYwo06wtIkEc7PqBFNoJAeaXQ94o7tzCGXqcdQFDCxsEK1sFq2+TIBhdr0oqlkU - 2ai3rEkv+jK29fSjmvWXNJFQb3o9Oa5q1l/cqL+gkcAJu4SclU36ay6TUxyRjqTEGJAAM2hug/4s3ANr - JDwoBclIL2okYnEJpyBWZEYDIRRZfZkIRwIFIRZERDXorWjSg6rzG0SRTUTtRVR/NCSyUXdGnXBFE0I0 - 4eJG4cpmHHWWNurMb9BZ3CCYUEPwLLJRgBUAjLOggQ9bsYgH4dqyRoJwOLIlP2gexQwkpuHBDWwD4s4Z - RS9A4GwKbEgjmBsLsKGYBGJFxiGWwiMniO2oTCRQkAVhSE+n25LgRAJHSIMcsCEBCZOw50krZZcYbqE6 - gBYqYjAMfshhdeESciAQzDhl8Mzpz9mfGz/c/P2P+R/eJOpS4ebguOfW82fWCxZhr7KBhHFIIKpDmuEc - 4pg5DcL5DcIVzcIFDcLIJuHSJnJkaUR48xp0VzTrzmgQrWgWLWokKLKK0nJERY2iJU2i6Q2ipc3kFMf5 - jYSi6NXoK+SIIigIAjMIPCwfBcGG46orpAgusSLL6KWZACoqhBWc16jKxykkAHcXNeouayIEbec2EG2h - PzZgl1DlcUSLAGkz63VmN+gA3afWETybWy9Y0SxYRmkxtQyG/gREPwA27EY28GYgLMPOJLABCNdEjrPo - niTDDwJmrflzyQKCNwfRVRNvOr3EikAIMicCqKgQVhAMyEcRnEICK4irIOTjKmpBJpOPHByRg+NUoCCN - ESGQiUIVqBGEsjiFzPHYJqWicAQzCKI4/Tn7c+OHm7//Sf+j8pvw1GQvC5taxPfxp9fxF2KXslEQ2US8 - PHz9ymYS2C0nvp4gH9Buej2BhKhmnYUE9nRm1AtnIc7D/aomkgBsAEhwuvKycCEiP4olixqF0+vJKfKR - A5hZRgEGBDak1fCDNJjBBh4cl9MjriJ/1WVVccASZDKIwlUmH2kcmQKgZc3CqMtEE+i5rElnRTMBaYbW - RP860q4FDYLZ9YJpdYLpeNafbs8isVAF9vylTQQYYBZmH6wGcApzIYctC+AaQEARpJEPIGH5YGP4wVAH - R1xFPlAHaQZLEMIgSo1qSKMgsIqJRUHwM6wiG4kUFBnaTcZTLbUkn+nDTiEHVbDiDCxRBADJsBCcAD+c - MgU4/Tn7c+OHm7//Yf9DnCAc4kzqasnDCNTrgXC6vIm3rJkPtIOvn9cgmFUvGF9L4A3xHAI7IB/AAKcg - cuuOZmIHD4QACDnAQoAHkAPBEB5gmVMvmFRLnmFBAldBwEsUARuO4CQyW0XhKgqCADYgCIdMlEUatbMa - KcoSyUhAJgk6qT5kf5VKhkwIZ4qhFKRp6o9LIPCzZgLXsYkHDENYBmCDBYAc2MqDlWCi8fR5EOQwEwFv - GLCxQA1HGgQTFGGoBmJQxHCFxW1AFwaNLGIDyCEBmQyQcAlimWQWfqEs0igFnjHYsaTSGBsDRSaNsQHY - QKgLOSjLoJTVguLYf0MVnP6c/bnxw83f/wX/o/KAbJ+N7b8xbws/COdO7jNRR8+8PHLgK4ldGvmgpU2q - Y2QTwYYVzSQHhH1OwAzCPoRBwB4EfwAnBoQARcAkAxVAJk4RI4KB4RZgRhUd0nwGS+yIU0hDmgEYBLKC - qAUoC6IQJZhEeXA6p57og01F6AaQnllPtEIOdhqhOUMdtrWIoxrOkQahpWgmGguoY7e1EBuxIgAVFrqx - rUWGQ2yJwFCNDRqWzwImdmTYw2IvsEEgK8gQiMV5bP9QvQnJ4jYWtDGUYrugrHbmo9lRDYcMd1kfgRk1 - sj0HTn/O/tz44ebv/5r/UUUAzCkz18mCDOYlyfMLrS6VRXhTaonfZ6GeeiOO5TDbMScOZvaQBcsETiAN - 982ea2B1AUpZvMjuZgFcUQqZOIIfMsEJsAEPckA4BbQgHyohwGIAzLZVmapMLHuuFwV/n/5oIFwhE6u+ - xYVGIQ08YzfYmKEARSzewinbVEQpZOLItg1ZMMcCJrYzCZRiMRkCLIhi2MYkaNqfZbINSaYSjgAqFilC - LCSw+0YshwEqpz9nfzZ/ufHDzd//cf/zanOMhSBwkcxZq2/5wGPCjTK3DmcKx632xex+Ehwuiy3YrheL - RdS7auxhChY9MDhkzprNQLahNxRPulPfzapWE9t/YzeKkGYxkJpYuKPe3OP0fyP7/1zt/A8n1t1tx8// - +9/7/cHx/79nsN+0uN34gYv4txiE85/M5//B8f//ATQlyz6+IFQfAAAAAElFTkSuQmCC - - - \ No newline at end of file diff --git a/OpenSim/Tools/OpenSim.GridLaunch/GUI/WinForm/ucAppWindow.Designer.cs b/OpenSim/Tools/OpenSim.GridLaunch/GUI/WinForm/ucAppWindow.Designer.cs deleted file mode 100644 index 1ff7d434bd..0000000000 --- a/OpenSim/Tools/OpenSim.GridLaunch/GUI/WinForm/ucAppWindow.Designer.cs +++ /dev/null @@ -1,72 +0,0 @@ -namespace OpenSim.GridLaunch.GUI.WinForm -{ - partial class ucAppWindow - { - /// - /// Required designer variable. - /// - private System.ComponentModel.IContainer components = null; - - /// - /// Clean up any resources being used. - /// - /// true if managed resources should be disposed; otherwise, false. - protected override void Dispose(bool disposing) - { - if (disposing && (components != null)) - { - components.Dispose(); - } - base.Dispose(disposing); - } - - #region Component Designer generated code - - /// - /// Required method for Designer support - do not modify - /// the contents of this method with the code editor. - /// - private void InitializeComponent() - { - this.ucLogWindow1 = new OpenSim.GridLaunch.GUI.WinForm.ucLogWindow(); - this.ucInputField1 = new OpenSim.GridLaunch.GUI.WinForm.ucInputField(); - this.SuspendLayout(); - // - // ucLogWindow1 - // - this.ucLogWindow1.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom) - | System.Windows.Forms.AnchorStyles.Left) - | System.Windows.Forms.AnchorStyles.Right))); - this.ucLogWindow1.Location = new System.Drawing.Point(3, 3); - this.ucLogWindow1.Name = "ucLogWindow1"; - this.ucLogWindow1.Size = new System.Drawing.Size(232, 132); - this.ucLogWindow1.TabIndex = 0; - // - // ucInputField1 - // - this.ucInputField1.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left) - | System.Windows.Forms.AnchorStyles.Right))); - this.ucInputField1.Location = new System.Drawing.Point(0, 141); - this.ucInputField1.Name = "ucInputField1"; - this.ucInputField1.Size = new System.Drawing.Size(234, 30); - this.ucInputField1.TabIndex = 1; - // - // ucAppWindow - // - this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); - this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; - this.Controls.Add(this.ucInputField1); - this.Controls.Add(this.ucLogWindow1); - this.DoubleBuffered = true; - this.Name = "ucAppWindow"; - this.Size = new System.Drawing.Size(235, 166); - this.ResumeLayout(false); - - } - - #endregion - - private ucLogWindow ucLogWindow1; - private ucInputField ucInputField1; - } -} diff --git a/OpenSim/Tools/OpenSim.GridLaunch/GUI/WinForm/ucAppWindow.cs b/OpenSim/Tools/OpenSim.GridLaunch/GUI/WinForm/ucAppWindow.cs deleted file mode 100644 index 487faeca49..0000000000 --- a/OpenSim/Tools/OpenSim.GridLaunch/GUI/WinForm/ucAppWindow.cs +++ /dev/null @@ -1,63 +0,0 @@ -/* - * Copyright (c) Contributors, http://opensimulator.org/ - * See CONTRIBUTORS.TXT for a full list of copyright holders. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * * Neither the name of the OpenSimulator Project nor the - * names of its contributors may be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE DEVELOPERS ``AS IS'' AND ANY - * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED - * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL THE CONTRIBUTORS BE LIABLE FOR ANY - * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES - * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; - * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ -using System; -using System.Collections.Generic; -using System.ComponentModel; -using System.Drawing; -using System.Data; -using System.Text; -using System.Windows.Forms; - -namespace OpenSim.GridLaunch.GUI.WinForm -{ - public partial class ucAppWindow : UserControl - { - // Just forwarding from ucInputField1 - public delegate void LineEnteredDelegate(ucAppWindow AppWindow, string Text); - public event LineEnteredDelegate LineEntered; - - public ucAppWindow() - { - InitializeComponent(); - ucInputField1.LineEntered += ucInputField1_LineEntered; - } - - #region Forward Text Input Event and Log Write Function - void ucInputField1_LineEntered(string Text) - { - if (LineEntered != null) - LineEntered(this, Text); - } - - public void Write(Color color, string LogText) - { - ucLogWindow1.Write(color, LogText); - } - #endregion - - } -} diff --git a/OpenSim/Tools/OpenSim.GridLaunch/GUI/WinForm/ucAppWindow.resx b/OpenSim/Tools/OpenSim.GridLaunch/GUI/WinForm/ucAppWindow.resx deleted file mode 100644 index 19dc0dd8b3..0000000000 --- a/OpenSim/Tools/OpenSim.GridLaunch/GUI/WinForm/ucAppWindow.resx +++ /dev/null @@ -1,120 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - text/microsoft-resx - - - 2.0 - - - System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - \ No newline at end of file diff --git a/OpenSim/Tools/OpenSim.GridLaunch/GUI/WinForm/ucInputField.Designer.cs b/OpenSim/Tools/OpenSim.GridLaunch/GUI/WinForm/ucInputField.Designer.cs deleted file mode 100644 index 1eaec69429..0000000000 --- a/OpenSim/Tools/OpenSim.GridLaunch/GUI/WinForm/ucInputField.Designer.cs +++ /dev/null @@ -1,77 +0,0 @@ -namespace OpenSim.GridLaunch.GUI.WinForm -{ - partial class ucInputField - { - /// - /// Required designer variable. - /// - private System.ComponentModel.IContainer components = null; - - /// - /// Clean up any resources being used. - /// - /// true if managed resources should be disposed; otherwise, false. - protected override void Dispose(bool disposing) - { - if (disposing && (components != null)) - { - components.Dispose(); - } - base.Dispose(disposing); - } - - #region Component Designer generated code - - /// - /// Required method for Designer support - do not modify - /// the contents of this method with the code editor. - /// - private void InitializeComponent() - { - this.txtInput = new System.Windows.Forms.TextBox(); - this.btnSend = new System.Windows.Forms.Button(); - this.SuspendLayout(); - // - // txtInput - // - this.txtInput.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom) - | System.Windows.Forms.AnchorStyles.Left) - | System.Windows.Forms.AnchorStyles.Right))); - this.txtInput.Location = new System.Drawing.Point(3, 2); - this.txtInput.Name = "txtInput"; - this.txtInput.Size = new System.Drawing.Size(289, 20); - this.txtInput.TabIndex = 0; - this.txtInput.KeyPress += new System.Windows.Forms.KeyPressEventHandler(this.txtInput_KeyPress); - // - // btnSend - // - this.btnSend.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right))); - this.btnSend.Location = new System.Drawing.Point(295, 0); - this.btnSend.Name = "btnSend"; - this.btnSend.Size = new System.Drawing.Size(75, 23); - this.btnSend.TabIndex = 3; - this.btnSend.Text = "&Send"; - this.btnSend.UseVisualStyleBackColor = true; - this.btnSend.Click += new System.EventHandler(this.btnSend_Click); - // - // ucInputField - // - this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); - this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; - this.Controls.Add(this.btnSend); - this.Controls.Add(this.txtInput); - this.Name = "ucInputField"; - this.Size = new System.Drawing.Size(373, 25); - this.Load += new System.EventHandler(this.ucInputField_Load); - this.Resize += new System.EventHandler(this.ucInputField_Resize); - this.ResumeLayout(false); - this.PerformLayout(); - - } - - #endregion - - private System.Windows.Forms.TextBox txtInput; - private System.Windows.Forms.Button btnSend; - } -} diff --git a/OpenSim/Tools/OpenSim.GridLaunch/GUI/WinForm/ucInputField.cs b/OpenSim/Tools/OpenSim.GridLaunch/GUI/WinForm/ucInputField.cs deleted file mode 100644 index f6c02b523b..0000000000 --- a/OpenSim/Tools/OpenSim.GridLaunch/GUI/WinForm/ucInputField.cs +++ /dev/null @@ -1,97 +0,0 @@ -/* - * Copyright (c) Contributors, http://opensimulator.org/ - * See CONTRIBUTORS.TXT for a full list of copyright holders. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * * Neither the name of the OpenSimulator Project nor the - * names of its contributors may be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE DEVELOPERS ``AS IS'' AND ANY - * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED - * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL THE CONTRIBUTORS BE LIABLE FOR ANY - * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES - * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; - * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ -using System; -using System.Collections.Generic; -using System.ComponentModel; -using System.Diagnostics; -using System.Drawing; -using System.Data; -using System.Text; -using System.Windows.Forms; - -namespace OpenSim.GridLaunch.GUI.WinForm -{ - public partial class ucInputField : UserControl - { - public delegate void LineEnteredDelegate(string Text); - public event LineEnteredDelegate LineEntered; - - public List History = new List(); - - public ucInputField() - { - InitializeComponent(); - } - - private void ucInputField_Load(object sender, EventArgs e) - { - _resize(); - } - - private void ucInputField_Resize(object sender, EventArgs e) - { - _resize(); - } - - private void _resize() - { - Height = txtInput.Height + 10; - } - - private void btnSend_Click(object sender, EventArgs e) - { - Send(); - } - - private void txtInput_KeyPress(object sender, KeyPressEventArgs e) - { - //Trace.WriteLine("KeyChar: " + ((int)e.KeyChar).ToString()); - if (e.KeyChar == 13) - { - e.Handled = true; - Send(); - } - - // TODO: Add arrow up/down history functions - } - - private void Send() - { - // Remove \r\n at end - string txt = txtInput.Text.TrimEnd("\r\n".ToCharArray()); - - // Fire event - if (LineEntered != null) - LineEntered(txt); - - // Add to history - History.Add(txtInput.Text); - - txtInput.Text = ""; - } - } -} diff --git a/OpenSim/Tools/OpenSim.GridLaunch/GUI/WinForm/ucInputField.resx b/OpenSim/Tools/OpenSim.GridLaunch/GUI/WinForm/ucInputField.resx deleted file mode 100644 index 19dc0dd8b3..0000000000 --- a/OpenSim/Tools/OpenSim.GridLaunch/GUI/WinForm/ucInputField.resx +++ /dev/null @@ -1,120 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - text/microsoft-resx - - - 2.0 - - - System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - \ No newline at end of file diff --git a/OpenSim/Tools/OpenSim.GridLaunch/GUI/WinForm/ucLogWindow.Designer.cs b/OpenSim/Tools/OpenSim.GridLaunch/GUI/WinForm/ucLogWindow.Designer.cs deleted file mode 100644 index 839fe9905f..0000000000 --- a/OpenSim/Tools/OpenSim.GridLaunch/GUI/WinForm/ucLogWindow.Designer.cs +++ /dev/null @@ -1,62 +0,0 @@ -namespace OpenSim.GridLaunch.GUI.WinForm -{ - partial class ucLogWindow - { - /// - /// Required designer variable. - /// - private System.ComponentModel.IContainer components = null; - - /// - /// Clean up any resources being used. - /// - /// true if managed resources should be disposed; otherwise, false. - protected override void Dispose(bool disposing) - { - if (disposing && (components != null)) - { - components.Dispose(); - } - base.Dispose(disposing); - } - - #region Component Designer generated code - - /// - /// Required method for Designer support - do not modify - /// the contents of this method with the code editor. - /// - private void InitializeComponent() - { - this.txtLog = new System.Windows.Forms.TextBox(); - this.SuspendLayout(); - // - // txtLog - // - this.txtLog.BackColor = System.Drawing.SystemColors.Window; - this.txtLog.Dock = System.Windows.Forms.DockStyle.Fill; - this.txtLog.Location = new System.Drawing.Point(0, 0); - this.txtLog.Multiline = true; - this.txtLog.Name = "txtLog"; - this.txtLog.ReadOnly = true; - this.txtLog.ScrollBars = System.Windows.Forms.ScrollBars.Vertical; - this.txtLog.Size = new System.Drawing.Size(150, 150); - this.txtLog.TabIndex = 0; - this.txtLog.TextChanged += new System.EventHandler(this.txtLog_TextChanged); - // - // ucLogWindow - // - this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); - this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; - this.Controls.Add(this.txtLog); - this.Name = "ucLogWindow"; - this.ResumeLayout(false); - this.PerformLayout(); - - } - - #endregion - - private System.Windows.Forms.TextBox txtLog; - } -} diff --git a/OpenSim/Tools/OpenSim.GridLaunch/GUI/WinForm/ucLogWindow.cs b/OpenSim/Tools/OpenSim.GridLaunch/GUI/WinForm/ucLogWindow.cs deleted file mode 100644 index 84c0a14777..0000000000 --- a/OpenSim/Tools/OpenSim.GridLaunch/GUI/WinForm/ucLogWindow.cs +++ /dev/null @@ -1,80 +0,0 @@ -/* - * Copyright (c) Contributors, http://opensimulator.org/ - * See CONTRIBUTORS.TXT for a full list of copyright holders. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * * Neither the name of the OpenSimulator Project nor the - * names of its contributors may be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE DEVELOPERS ``AS IS'' AND ANY - * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED - * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL THE CONTRIBUTORS BE LIABLE FOR ANY - * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES - * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; - * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ - -using System; -using System.Collections.Generic; -using System.ComponentModel; -using System.Drawing; -using System.Data; -using System.Text; -using System.Windows.Forms; - -namespace OpenSim.GridLaunch.GUI.WinForm -{ - public partial class ucLogWindow : UserControl - { - // If text in window is more than this - private static readonly int logWindowMaxTextLength = 20000; - // Remove this much from start of it - private static int logWindowTrunlTextLength = 10000; - - public ucLogWindow() - { - if (logWindowMaxTextLength < logWindowTrunlTextLength) - logWindowTrunlTextLength = logWindowMaxTextLength / 2; - - InitializeComponent(); - } - - public delegate void textWriteDelegate(Color color, string LogText); - public void Write(Color color, string LogText) - { - // Check if we to pass task on to GUI thread - if (this.InvokeRequired) - { - this.Invoke(new textWriteDelegate(Write), color, LogText); - return; - } - // Append to window - try - { - if (!txtLog.IsDisposed) - txtLog.AppendText(LogText); - } catch { } - } - - private void txtLog_TextChanged(object sender, EventArgs e) - { - // Go to bottom of window - txtLog.ScrollToCaret(); - - // Make sure amount of text in window doesn't grow too big - if (txtLog.Text.Length > logWindowMaxTextLength) - txtLog.Text = txtLog.Text.Remove(0, logWindowTrunlTextLength); - } - } -} diff --git a/OpenSim/Tools/OpenSim.GridLaunch/GUI/WinForm/ucLogWindow.resx b/OpenSim/Tools/OpenSim.GridLaunch/GUI/WinForm/ucLogWindow.resx deleted file mode 100644 index 19dc0dd8b3..0000000000 --- a/OpenSim/Tools/OpenSim.GridLaunch/GUI/WinForm/ucLogWindow.resx +++ /dev/null @@ -1,120 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - text/microsoft-resx - - - 2.0 - - - System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - \ No newline at end of file diff --git a/OpenSim/Tools/OpenSim.GridLaunch/OpenSim.GridLaunch.csproj b/OpenSim/Tools/OpenSim.GridLaunch/OpenSim.GridLaunch.csproj deleted file mode 100644 index b262dd152c..0000000000 --- a/OpenSim/Tools/OpenSim.GridLaunch/OpenSim.GridLaunch.csproj +++ /dev/null @@ -1,126 +0,0 @@ - - - - Debug - AnyCPU - 9.0.30729 - 2.0 - {595D67F3-B413-4A43-8568-5B5930E3B31D} - Exe - Properties - OpenSim.GridLaunch - OpenSim.GridLaunch - v2.0 - 512 - - - true - full - false - ..\..\..\bin\ - DEBUG;TRACE - prompt - 4 - x86 - - - pdbonly - true - bin\Release\ - TRACE - prompt - 4 - - - - - - - - - - - - - - - - - - - - - Component - - - Form - - - ProcessPanel.cs - - - UserControl - - - ucAppWindow.cs - - - UserControl - - - ucInputField.cs - - - UserControl - - - ucLogWindow.cs - - - - - - True - True - Resources.resx - - - - - - ProcessPanel.cs - - - ucAppWindow.cs - - - ucInputField.cs - - - ucLogWindow.cs - - - - - - - - - - - PreserveNewest - - - ResXFileCodeGenerator - Resources.Designer.cs - - - - - \ No newline at end of file diff --git a/OpenSim/Tools/OpenSim.GridLaunch/OpenSim.GridLaunch.ini b/OpenSim/Tools/OpenSim.GridLaunch/OpenSim.GridLaunch.ini deleted file mode 100644 index c065898b1d..0000000000 --- a/OpenSim/Tools/OpenSim.GridLaunch/OpenSim.GridLaunch.ini +++ /dev/null @@ -1,3 +0,0 @@ -GUI=WinForm -;GUI=TCPD -;Components=c:\temp\test.bat;true \ No newline at end of file diff --git a/OpenSim/Tools/OpenSim.GridLaunch/OpenSim.GridLaunch.sln b/OpenSim/Tools/OpenSim.GridLaunch/OpenSim.GridLaunch.sln deleted file mode 100644 index 8f745e11ba..0000000000 --- a/OpenSim/Tools/OpenSim.GridLaunch/OpenSim.GridLaunch.sln +++ /dev/null @@ -1,20 +0,0 @@ - -Microsoft Visual Studio Solution File, Format Version 10.00 -# Visual Studio 2008 -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "OpenSim.GridLaunch", "OpenSim.GridLaunch.csproj", "{595D67F3-B413-4A43-8568-5B5930E3B31D}" -EndProject -Global - GlobalSection(SolutionConfigurationPlatforms) = preSolution - Debug|Any CPU = Debug|Any CPU - Release|Any CPU = Release|Any CPU - EndGlobalSection - GlobalSection(ProjectConfigurationPlatforms) = postSolution - {595D67F3-B413-4A43-8568-5B5930E3B31D}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {595D67F3-B413-4A43-8568-5B5930E3B31D}.Debug|Any CPU.Build.0 = Debug|Any CPU - {595D67F3-B413-4A43-8568-5B5930E3B31D}.Release|Any CPU.ActiveCfg = Release|Any CPU - {595D67F3-B413-4A43-8568-5B5930E3B31D}.Release|Any CPU.Build.0 = Release|Any CPU - EndGlobalSection - GlobalSection(SolutionProperties) = preSolution - HideSolutionNode = FALSE - EndGlobalSection -EndGlobal diff --git a/OpenSim/Tools/OpenSim.GridLaunch/Program.cs b/OpenSim/Tools/OpenSim.GridLaunch/Program.cs deleted file mode 100644 index ecfb0af381..0000000000 --- a/OpenSim/Tools/OpenSim.GridLaunch/Program.cs +++ /dev/null @@ -1,245 +0,0 @@ -/* - * Copyright (c) Contributors, http://opensimulator.org/ - * See CONTRIBUTORS.TXT for a full list of copyright holders. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * * Neither the name of the OpenSimulator Project nor the - * names of its contributors may be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE DEVELOPERS ``AS IS'' AND ANY - * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED - * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL THE CONTRIBUTORS BE LIABLE FOR ANY - * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES - * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; - * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ - -using System; -using System.Collections; -using System.Collections.Generic; -using System.Reflection; -using System.Threading; -using log4net; -using log4net.Appender; -using log4net.Repository.Hierarchy; -using OpenSim.GridLaunch.GUI; -using OpenSim.GridLaunch.GUI.Network; - -namespace OpenSim.GridLaunch -{ - class Program - { - public static readonly string ConfigFile = "OpenSim.GridLaunch.ini"; - internal static Dictionary AppList = new Dictionary(); - private static readonly int delayBetweenExecuteSeconds = 10; - //private static readonly int consoleReadIntervalMilliseconds = 50; - ////private static readonly Timer readTimer = new Timer(readConsole, null, Timeout.Infinite, Timeout.Infinite); - //private static Thread timerThread; - //private static object timerThreadLock = new object(); - private static IGUI GUIModule; - private static string GUIModuleName = ""; - public static readonly CommandProcessor Command = new CommandProcessor(); - public static readonly Settings Settings = new Settings(); - - private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); - - public delegate void AppConsoleOutputDelegate(string App, string Text); - public static event AppConsoleOutputDelegate AppConsoleOutput; - public delegate void AppConsoleErrorDelegate(string App, string Text); - public static event AppConsoleErrorDelegate AppConsoleError; - public delegate void AppCreatedDelegate(string App); - public static event AppCreatedDelegate AppCreated; - public delegate void AppRemovedDelegate(string App); - public static event AppRemovedDelegate AppRemoved; - - internal static void FireAppConsoleOutput(string App, string Text) - { - if (AppConsoleOutput != null) - AppConsoleOutput(App, Text); - } - internal static void FireAppConsoleError(string App, string Text) - { - if (AppConsoleError != null) - AppConsoleError(App, Text); - } - - - private static readonly object startStopLock = new object(); - - public static string Name { get { return "OpenSim Grid executor"; } } - - #region Start/Shutdown - static void Main(string[] args) - { - log4net.Config.XmlConfigurator.Configure(); - - // Startup - m_log.Info(Name); - m_log.Info(new string('-', Name.Length)); - - // Read settings - Settings.LoadConfig(ConfigFile); - // Command line arguments override settings - Settings.ParseCommandArguments(args); - - // Start GUI module - StartGUIModule(); - - // Start the processes - ThreadPool.QueueUserWorkItem(startProcesses); - - // Hand over thread control to whatever GUI module - GUIModule.StartGUI(); - - // GUI module returned, we are done - Shutdown(); - - } - - private static void StartGUIModule() - { - // Create GUI module - GUIModuleName = Settings["GUI"]; - - switch (GUIModuleName.ToLower()) - { - case "winform": - GUIModuleName = "WinForm"; - GUIModule = new GUI.WinForm.ProcessPanel(); - break; - case "service": - GUIModuleName = "Service"; - GUIModule = new Service(); - break; - case "tcpd": - GUIModuleName = "TCPD"; - GUIModule = new TCPD(); - break; - case "console": - default: - GUIModuleName = "Console"; - GUIModule = new GUI.Console.Console(); - break; - } - m_log.Info("GUI type: " + GUIModuleName); - - } - - internal static void Shutdown() - { - // Stop the processes - stopProcesses(); - - lock (startStopLock) - { - // Stop GUI module - if (GUIModule != null) - { - GUIModule.StopGUI(); - GUIModule = null; - } - } - } - - internal static void SafeDisposeOf(object obj) - { - IDisposable o = obj as IDisposable; - try - { - if (o != null) - o.Dispose(); - } - catch { } - } - #endregion - - #region Start / Stop applications - private static void startProcesses(Object stateInfo) - { - // Stop before starting - stopProcesses(); - - // Start console read timer - //timer_Start(); - - // Start the applications - foreach (string file in new ArrayList(Settings.Components.Keys)) - { - // Is this file marked for startup? - if (Settings.Components[file]) - { - AppExecutor app = new AppExecutor(file); - app.Start(); - AppList.Add(file, app); - if (AppCreated != null) - AppCreated(app.File); - System.Threading.Thread.Sleep(1000*delayBetweenExecuteSeconds); - } - } - } - - private static void stopProcesses() - { - // Stop timer - //timer_Stop(); - - // Lock so we don't collide with any timer still executing on AppList - lock (AppList) - { - // Start the applications - foreach (AppExecutor app in AppList.Values) - { - try - { - m_log.Info("Stopping: " + app.File); - app.Stop(); - } - catch (Exception ex) - { - m_log.ErrorFormat("Exception while stopping \"{0}\": {1}", app.File, ex.ToString()); - } - finally - { - if (AppRemoved != null) - AppRemoved(app.File); - app.Dispose(); - } - - } - AppList.Clear(); - } - } - #endregion - - public static void Write(string App, string Text) - { - // Check if it is a commands - bool isCommand = Command.Process(App, Text); - - // Write to stdInput of app - if (!isCommand && AppList.ContainsKey(App)) - AppList[App].Write(Text); - } - - public static void WriteLine(string App, string Text) - { - // Check if it is a commands - bool isCommand = Command.Process(App, Text); - - // Write to stdInput of app - if (!isCommand && AppList.ContainsKey(App)) - AppList[App].WriteLine(Text); - } - } -} diff --git a/OpenSim/Tools/OpenSim.GridLaunch/Properties/AssemblyInfo.cs b/OpenSim/Tools/OpenSim.GridLaunch/Properties/AssemblyInfo.cs deleted file mode 100644 index 60fc664401..0000000000 --- a/OpenSim/Tools/OpenSim.GridLaunch/Properties/AssemblyInfo.cs +++ /dev/null @@ -1,63 +0,0 @@ -/* - * Copyright (c) Contributors, http://opensimulator.org/ - * See CONTRIBUTORS.TXT for a full list of copyright holders. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * * Neither the name of the OpenSimulator Project nor the - * names of its contributors may be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE DEVELOPERS ``AS IS'' AND ANY - * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED - * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL THE CONTRIBUTORS BE LIABLE FOR ANY - * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES - * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; - * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ - -using System.Reflection; -using System.Runtime.CompilerServices; -using System.Runtime.InteropServices; - -// 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. -[assembly: AssemblyTitle("OpenSim.GridLaunch")] -[assembly: AssemblyDescription("")] -[assembly: AssemblyConfiguration("")] -[assembly: AssemblyCompany("http://opensimulator.org")] -[assembly: AssemblyProduct("OpenSim.GridLaunch")] -[assembly: AssemblyCopyright("Copyright (c) 2008")] -[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 -// COM, set the ComVisible attribute to true on that type. -[assembly: ComVisible(false)] - -// The following GUID is for the ID of the typelib if this project is exposed to COM -[assembly: Guid("5072e919-46ab-47e6-8a63-08108324ccdf")] - -// Version information for an assembly consists of the following four values: -// -// Major Version -// Minor Version -// Build Number -// Revision -// -// You can specify all the values or you can default the Build and Revision Numbers -// by using the '*' as shown below: -// [assembly: AssemblyVersion("0.6.3.*")] -[assembly: AssemblyVersion("0.6.3.*")] -[assembly: AssemblyFileVersion("1.0.0.0")] diff --git a/OpenSim/Tools/OpenSim.GridLaunch/Properties/Resources.Designer.cs b/OpenSim/Tools/OpenSim.GridLaunch/Properties/Resources.Designer.cs deleted file mode 100644 index 88b0cebdd9..0000000000 --- a/OpenSim/Tools/OpenSim.GridLaunch/Properties/Resources.Designer.cs +++ /dev/null @@ -1,84 +0,0 @@ -//------------------------------------------------------------------------------ -// -// This code was generated by a tool. -// Runtime Version:2.0.50727.3053 -// -// Changes to this file may cause incorrect behavior and will be lost if -// the code is regenerated. -// -//------------------------------------------------------------------------------ - -namespace OpenSim.GridLaunch.Properties { - using System; - - - /// - /// A strongly-typed resource class, for looking up localized strings, etc. - /// - // This class was auto-generated by the StronglyTypedResourceBuilder - // class via a tool like ResGen or Visual Studio. - // To add or remove a member, edit your .ResX file then rerun ResGen - // with the /str option, or rebuild your VS project. - [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "2.0.0.0")] - [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] - internal class Resources { - - private static global::System.Resources.ResourceManager resourceMan; - - private static global::System.Globalization.CultureInfo resourceCulture; - - [global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")] - internal Resources() { - } - - /// - /// Returns the cached ResourceManager instance used by this class. - /// - [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] - internal static global::System.Resources.ResourceManager ResourceManager { - get { - if (object.ReferenceEquals(resourceMan, null)) { - global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("OpenSim.GridLaunch.Properties.Resources", typeof(Resources).Assembly); - resourceMan = temp; - } - return resourceMan; - } - } - - /// - /// Overrides the current thread's CurrentUICulture property for all - /// resource lookups using this strongly typed resource class. - /// - [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] - internal static global::System.Globalization.CultureInfo Culture { - get { - return resourceCulture; - } - set { - resourceCulture = value; - } - } - - internal static System.Drawing.Bitmap OpenSim { - get { - object obj = ResourceManager.GetObject("OpenSim", resourceCulture); - return ((System.Drawing.Bitmap)(obj)); - } - } - - internal static System.Drawing.Bitmap OpenSim_Bottom_Border { - get { - object obj = ResourceManager.GetObject("OpenSim_Bottom_Border", resourceCulture); - return ((System.Drawing.Bitmap)(obj)); - } - } - - internal static System.Drawing.Bitmap OpenSim_Right_Border { - get { - object obj = ResourceManager.GetObject("OpenSim_Right_Border", resourceCulture); - return ((System.Drawing.Bitmap)(obj)); - } - } - } -} diff --git a/OpenSim/Tools/OpenSim.GridLaunch/Properties/Resources.resx b/OpenSim/Tools/OpenSim.GridLaunch/Properties/Resources.resx deleted file mode 100644 index b82a1fced2..0000000000 --- a/OpenSim/Tools/OpenSim.GridLaunch/Properties/Resources.resx +++ /dev/null @@ -1,130 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - text/microsoft-resx - - - 2.0 - - - System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - - ..\gui\winform\opensim.png;System.Drawing.Bitmap, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a - - - ..\gui\winform\opensim bottom border.png;System.Drawing.Bitmap, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a - - - ..\gui\winform\opensim right border.png;System.Drawing.Bitmap, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a - - \ No newline at end of file diff --git a/OpenSim/Tools/OpenSim.GridLaunch/Settings.cs b/OpenSim/Tools/OpenSim.GridLaunch/Settings.cs deleted file mode 100644 index 1f02928b4d..0000000000 --- a/OpenSim/Tools/OpenSim.GridLaunch/Settings.cs +++ /dev/null @@ -1,181 +0,0 @@ -/* - * Copyright (c) Contributors, http://opensimulator.org/ - * See CONTRIBUTORS.TXT for a full list of copyright holders. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * * Neither the name of the OpenSimulator Project nor the - * names of its contributors may be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE DEVELOPERS ``AS IS'' AND ANY - * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED - * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL THE CONTRIBUTORS BE LIABLE FOR ANY - * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES - * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; - * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ -using System; -using System.Collections.Generic; -using System.Reflection; -using System.Text; -using log4net; - -namespace OpenSim.GridLaunch -{ - internal class Settings - { - private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); - private Dictionary Config = new Dictionary(); - public Dictionary Components = new Dictionary(); - - public static string[] defaultComponents = new string[] - { - "OpenSim.Grid.UserServer.exe", - "OpenSim.Grid.GridServer.exe", - "OpenSim.Grid.AssetServer.exe", - "OpenSim.Grid.InventoryServer.exe", - "OpenSim.Grid.MessagingServer.exe", - "OpenSim.32BitLaunch.exe" - }; - - - private static readonly char[] confSplit = new char[] { '=' }; - private static readonly char[] comaSplit = new char[] { ',' }; - private static readonly char[] colonSplit = new char[] { ';' }; - - private string configFile = ""; - - public Settings() - { - } - public Settings(string ConfigFile) - { - LoadConfig(ConfigFile); - } - - - public void LoadConfig(string ConfigFile) - { - configFile = ConfigFile; - m_log.Info("Reading config file: " + ConfigFile); - try - { - // Read config file - foreach (string line in System.IO.File.ReadAllLines(ConfigFile)) - { - string[] s = line.Split(confSplit, 2); - if (s.Length >= 2) - Config.Add(s[0], s[1]); - } - - // Process Components section - string cmp = Config["Components"]; - Config.Remove("Components"); - foreach (string c in cmp.Split(comaSplit)) - { - string[] cs = c.Split(colonSplit); - if (cs.Length >= 2) - { - bool status = false; - bool.TryParse(cs[1], out status); - Components.Add(cs[0], status); - } - } - } - catch (Exception ex) - { - m_log.Error("Exception reading config file: " + ex.ToString()); - } - // No components? Add default components - if (Components.Count == 0) - foreach (string c in defaultComponents) - { - Components.Add(c, true); - } - } - - public void SaveConfig(string ConfigFile) - { - configFile = ConfigFile; - SaveConfig(); - } - - public void SaveConfig() - { - m_log.Info("Writing config file: " + configFile); - try - { - System.IO.File.WriteAllText(configFile, ToString()); - } - catch (Exception ex) - { - m_log.Error("Exception writing config file: " + ex.ToString()); - } - - } - - public new string ToString() - { - StringBuilder ret = new StringBuilder(); - - Dictionary config = new Dictionary(Config); - - // Add Components key - StringBuilder _Components = new StringBuilder(); - foreach (string c in Components.Keys) - { - if (_Components.Length > 0) - _Components.Append(","); - _Components.Append(c + ";" + Components[c].ToString()); - } - config["Components"] = _Components.ToString(); - - // Make return string - foreach (string key in config.Keys) - { - ret.AppendLine(key + "=" + config[key]); - } - - // Return it - return ret.ToString(); - } - - public string this[string Key] - { - get - { - if (Config.ContainsKey(Key)) - return Config[Key]; - return ""; - } - set { Config[Key] = value; } - } - - public void ParseCommandArguments(string[] args) - { - string key = null; - foreach (string a in args) - { - if (a.StartsWith("--")) - key = a.Remove(0, 2); - else - { - if (key != null) - Config[key] = a; - key = null; - } - } - - } - } -} diff --git a/OpenSim/Tools/OpenSim.GridLaunch/log4netAppender.cs b/OpenSim/Tools/OpenSim.GridLaunch/log4netAppender.cs deleted file mode 100644 index d0e7f95d1a..0000000000 --- a/OpenSim/Tools/OpenSim.GridLaunch/log4netAppender.cs +++ /dev/null @@ -1,65 +0,0 @@ -/* - * Copyright (c) Contributors, http://opensimulator.org/ - * See CONTRIBUTORS.TXT for a full list of copyright holders. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * * Neither the name of the OpenSimulator Project nor the - * names of its contributors may be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE DEVELOPERS ``AS IS'' AND ANY - * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED - * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL THE CONTRIBUTORS BE LIABLE FOR ANY - * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES - * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; - * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ -using System; -using System.Collections.Generic; -using System.Drawing; -using System.Text; -using System.Windows.Forms; -using log4net.Appender; -using log4net.Core; - -namespace OpenSim.GridLaunch -{ - internal class log4netAppender : log4net.Appender.AppenderSkeleton - { - public delegate void LogLineDelegate(Color color, string Text); - public static event LogLineDelegate LogLine; - public static readonly Dictionary Level2Color = new Dictionary(); - - static log4netAppender() - { - Level2Color.Add("INFO", Color.Black); - Level2Color.Add("DEBUG", Color.Gray); - Level2Color.Add("WARN", Color.OrangeRed); - Level2Color.Add("ERROR", Color.Red); - } - - - protected override void Append(LoggingEvent loggingEvent) - { - // Find appropriate color - Color color = Color.Black; - if (Level2Color.ContainsKey(loggingEvent.Level.Name)) - color = Level2Color[loggingEvent.Level.Name]; - - // Fire event with new log message - if (LogLine != null) - LogLine(color, loggingEvent.RenderedMessage + System.Environment.NewLine); - } - - } -} diff --git a/Prebuild/AUTHORS b/Prebuild/AUTHORS new file mode 100644 index 0000000000..9e86ac018f --- /dev/null +++ b/Prebuild/AUTHORS @@ -0,0 +1,10 @@ +Dave Hudson (jendave@yahoo.com), +Matthew Holmes (matthew@wildfiregames.com) +Dan Moorehead (dan05a@gmail.com) +Rob Loach (http://www.robloach.net) +C.J. Adams-Collier (cjac@colliertech.org) + +Patch Contributers +lbsa71 +chi11ken +sdague diff --git a/Prebuild/COPYING b/Prebuild/COPYING new file mode 100644 index 0000000000..c57c080b15 --- /dev/null +++ b/Prebuild/COPYING @@ -0,0 +1,65 @@ +BSD License +Copyright (c)2004-2008 + +See AUTHORS file for list of copyright holders + +Dave Hudson (jendave@yahoo.com), +Matthew Holmes (matthew@wildfiregames.com) +Dan Moorehead (dan05a@gmail.com) +Rob Loach (http://www.robloach.net) +C.J. Adams-Collier (cjac@colliertech.org) + +http://dnpb.sourceforge.net +All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions +are met: + +1. Redistributions of source code must retain the above copyright notice, + this list of conditions and the following disclaimer. + +2. Redistributions in binary form must reproduce the above copyright notice, + this list of conditions and the following disclaimer in the documentation + and/or other materials provided with the distribution. + +3. The names of the authors may not be used to endorse or promote + products derived from this software without specific prior written + permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS + FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE + COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, + INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, + BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER + CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN + ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + POSSIBILITY OF SUCH DAMAGE. + +--- + +Portions of src/Core/Targets/AutotoolsTarget.cs +// Copyright (C) 2006 Novell, Inc (http://www.novell.com) +// +// Permission is hereby granted, free of charge, to any person obtaining +// a copy of this software and associated documentation files (the +// "Software"), to deal in the Software without restriction, including +// without limitation the rights to use, copy, modify, merge, publish, +// distribute, sublicense, and/or sell copies of the Software, and to +// permit persons to whom the Software is furnished to do so, subject to +// the following conditions: +// +// The above copyright notice and this permission notice shall be +// included in all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND +// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE +// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION +// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION +// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. diff --git a/Prebuild/ChangeLog b/Prebuild/ChangeLog new file mode 100644 index 0000000000..bb8e7b09d8 --- /dev/null +++ b/Prebuild/ChangeLog @@ -0,0 +1,461 @@ +2008-12-09T02:15 D. Moonfire + * src/Core/Kernel.cs + - Added a /ppi target to get the results of processing but before + processing the actual results. + * src/Core/Preprocessor.cs + - Applied the patch from kanato with formatting changes. + - Uses the format. + * tests/ + - Added some lightweight tests to test the functionality of the + include patch. + +2008-06-19T09:37 John Anderson + * src/Core/Kernel.cs + - Only Loop through targets that are not abstract. + * src/Core/Targets/VSGenericTarget.cs + - Marked abstract and removed the Target attribute. + +2008-06-16T17:37 John Anderson + * src/Core/Nodes/ProjectNode.cs,data/prebuild-1.7.xsd + - Added the ability to hardcode guid's in the projects + +2008-05-21T0737 C.J. Adams-Collier + * src/Core/Targets/AutotoolsTarget.cs + - catch exception when unable to compile AssemblyInfo.cs + +2008-05-07T17:29 John Anderson + * src/Core/Targets/VSGenericTarget.cs + - Generate asp.net output in bin\ folder (asp.net requires it there) + +2008-04-30T17:29 John Anderson + * src/Core/Nodes/DatabaseReferenceNode.cs, + src/Core/Nodes/Datanode.cs, + src/Core/Nodes/FileNode.cs, + src/Core/Nodes/FileNodes.cs, + src/Core/Nodes/MatchNode.cs, + src/Core/Targets/VS2008Target.cs, + src/data/prebuild-1.7.xsd + - Refactored the project generation code to handle web projects and more + logically handle embedded resources and designer files. + +2008-04-30T17:29 Joseph Lombrozo + * src/Core/Nodes/SolutionNode.cs + - Had solutions inherit Configurations in the same way that Projects do. + +2008-04-29T06:35 Joseph Lombrozo + * src/Core/Targets/VS2008Target.cs, + src/Core/Nodes/DatabaseProjectNode.cs, + src/Core/Nodes/DatabaseReferenceNode.cs, + src/data/prebuild-1.7.xsd + - Added database references to database projects. + - Prevented nested solutions from being written to disk. + +2008-04-29T05:43 Joseph Lombrozo + * src/Core/Targets/VS2008Target.cs + - Enabled embedded solutions to contain Files. + +2008-04-29T04:13 Joseph Lombrozo + * src/Core/VSVersion.cs + - Fixed spelling mistake in enum comment. + * src/Core/Attributes/DataNodeAttribute.cs + - Allowed the DataNodeAttribute to be attached to a single class + more than once, allowing one class to be used to parse more than + one node at a time. + * src/Core/Kernel.cs + - Changed CacheNodeTypes() to allow for multiple DataNodeAttribute + instances in one class. Refactored ProcessFile(...) to return Solutions, + rather than adding them to the Kernel. + * src/Core/Nodes/SolutionNode.cs + - Added Guid (for embedded folders) + - Added DatabaseProjects, Solutions and Processes to the SolutionNode + when parsing. + * src/Core/Nodes/ProjectNode.cs + - Added FrameworkVersion property to allow for 2.0/3.0/3.5 differentiation. + * src/Core/Targets/VS2008Target.cs, src/data/prebuild-1.7.xsd + - Added ability to have embedded solutions, and externally referenced + prebuild scripts. + +2008-04-24T04:33 John M. Anderson + * src/Core/Targets/VS2003Target.cs, src/Core/Targets/VSVersion.cs + - Moved the VSVersion enum into its own file. + * src/Core/Targets/VS2008Target.cs + - added support for VS2008 + * src/Core/Nodes/ProjectNode.cs + - Added initial support for ASP.NET projects + * src/Core/Nodes/DatabaseProjectNode.cs + - Added support for Visual Studio database projects + +2008-02-19T07:08 C.J. Adams-Collier + * TODO + - added some tasks from Sam Hocevar + * src/Core/Targets/AutotoolsTarget.cs + - added a missing end paren + * COPYING + - Removed Randy Ridge's name from the copyright. Looks to me like + his name was present only because the file was nabbed from Tao + +2008-02-09T20:29 C.J. Adams-Collier + * COPYING + - added MIT/X11 license due to inclusion of code from Monodevelop + * THANKS + - added Lluis Sanchez Gual and Todd Berman - I yoinked code from + their pkg-config .pc file parser to build AutotoolsTarget.cs. + Sorry it took me so long to remember to add mention of you guys! + * src/Core/Targets/AutotoolsTarget.cs + - added MIT/X11 license. see above. + +2008-02-07T08:27 C.J. Adams-Collier + * AUTHORS + - consolidated names and contact info found laying around the + source + * src/Core/Kernel.cs + - updated copyright date + - re-formatted license for 80-column editor + - updated log banner to indicate new date, new authors + * src/Core/Targets/AutotoolsTarget.cs + - clarified reasoning behind use of constants in + AutotoolsTarget.ParsePCFile + - reduced length of some long lines using newline/indent + - added log messages for parsing .pc files, emitting solutions, + projects + - robustified the inter-package dependency resolution target + - log warning when we can't find assembly for + - clarified code for case of inability to find embedded + autotools.xml + * src/data/autotools.xml + - adding system lookup of resgen2 to configure.ac + - fixed .resource -> .resources typo + - added a rule to create .response file containing all sources + - using @.response on $(CSC) command line instead of listing + all source files + * src/Properties/AssemblyInfo.cs + - re-formatted license for an 80-column editor + - added more authors to the AssemblyCopyright attribute + - bumped version to 2.0.3 + * prebuild.xml + - bumped version to 2.0.3 + * scripts/autotools.sh + - if 'mono' is in the path, run Prebuild.exe with it + - using dirname to capture correct path to prebuild.xml &c + +2008-02-06T17:18 C.J. Adams-Collier + * src/Core/Targets/NAntTarget.cs + - re-formatted the license for an 80-column editor + - added myself to the copyright + - added a fix submitted by Gryc Ueusp + * src/Core/Targets/AutotoolsTarget.cs + - updated copyright to include 2008 + * THANKS + - created file, added Gryc Ueusp + +2008-01-01T14:50 C.J. Adams-Collier + * src/data/autotools.xml + - fixed .resx -> .resource compilation + - fixed failing edge case where Project is an unsigned Library + - added $(RESOURCE_SRC) to list of extra dist files + * src/Core/Targets/AutotoolsTarget.cs + - removed embeddedResources from extraDistFiles list + +2007-04-18T07:49 C.J. Adams-Collier + * src/data/prebuild-1.7.xsd + - removed default version from references + +2007-04-06T12:42 C.J. Adams-Collier + * src/data/autotools.xml + - added support for /doc: output when XmlDocFile is not empty + - not printing \t \\n on lines that have no content + - gacutil now installs the root assembly instead of the one under + bin/Debug or whatever + +2007-04-04T22:12 C.J. Adams-Collier + * src/Core/Targets/AutotoolsTarget.cs + - removed debugging Console.WriteLine() + * src/data/autotools.xml + - ensuring that install-sh and missing get distributed + - explicitly stating that the sources, snk, resources and binary + references live under $(srcdir) + - corrected uninstall target + - verified distcheck completes successfully + +2007-04-03T21:56 C.J. Adams-Collier + * src/Core/Targets/AutotoolsTarget.cs + - added a using for System.Diagnostics + - added enum ClrVersion for use with the pkg-config parser + - added class SystemPackage for use with the pkg-config parser + - removed explicit "private" property of members since it is implied + - flushing the stream-writer before it's closed + - removed excess braces around an if statement + ! NormalizeAsmName(), AddAssembly(), GetAssembliesWithLibInfo(), + GetAssembliesWithoutLibInfo(), ProcessPiece(), + GetVariableFromPkgConfig(), ParsePCFile(), + RegisterSystemAssemblies(), RunInitialization() + - pulled the above from MonoDevelop to parse the system pkgconfig + files and determine /pkg: arguments. Original sources are here: + http://svn.myrealbox.com/source/trunk/monodevelop/Core/src/MonoDevelop.Core/MonoDevelop.Core/SystemAssemblyService.cs + http://svn.myrealbox.com/source/trunk/monodevelop/Core/src/MonoDevelop.Core/MonoDevelop.Core/ClrVersion.cs + ! WriteProject() + - now gathering project version from AssemblyInfo.cs if it is part + of the project + - changed the declaration of the ArrayList's in the method + - now copying assembly .config files to the project, distributing, + installing + - making sure all needed files live under the Project directory + - copying strongname keys to project directory + - parsing AssemblyInfo.cs to determine assembly version + - removing all references to ".." + - removed superfluous if(project.References.Count > 0) around + for(int refNum = 0; refNum < project.References.Count; refNum++) + - removed use of runtimeLibs + - adding hook to copy sibling project's generated assemblies to + this project during Make time + - added extra dist target to ensure all files required to build + get distributed during "make dist" + - added new xslt processing args: + -- assemblyName + -- extraDistFiles + -- pkgLibs (/pkg:foo) + -- localCopyTargets (to copy sibling assemblies at Make time) + -- projectVersion (if determined from AssemblyInfo.cs) + -- hasAssemblyConfig (if there's a assembly.exe.config present) + ! Write() + - calling RunInitialization() to gather pkg-config data + * src/data/autotools.xml + - accepting new args passed from AutotoolsTarget.cs + - modernized configure.ac a bit + - using a version of tar that allows >99-char filenames + - added ASSEMBLY_NAME variable + - using assembly name rather than project name for gac installation + - generated assembly is now assembly name and not project name + - accepting /pkg: flags gathered from AutotoolsTarget.cs + - adding Makefile targets to copy sibling project assemblies to . + - fixed Debug, Release targets + - adding support for strongname key signing + - adding /unsafe support + - adding a clean make target + - only running gacutil /u if the assembly being uninstalled is in gac + - added some templates to determine each Configuration's .snk + - added explanation as to why .exe assemblies live in $prefix/lib + * src/Properties/AssemblyInfo.cs + - bumped assembly version + * prebuild.xml + - bumped assembly version + +2007-03-29T18:03 C.J. Adams-Collier + * src/Core/Targets/AutotoolsTarget.cs + ! WriteProject() + - re-named incorrectly-named variable gacLibs to systemLibs + - added another reference list, runtimeLibs which contains the + libs we will need at runtime. we use this to build a MONO_PATH + - added monoPath to the xslt args list + * src/data/autotools.xml + ! + - renamed gacLibs to systemLibs + - added the sources to the dist list + - added logic to install libs that aren't strongnamed + ! + - accepting a param to update the MONO_PATH + +2007-03-28T19:46 C.J. Adams-Collier + * src/Core/Targets/MonoDevelopTarget.cs + ! CleanProject() + - using Assembly.LoadWithPartialName to locate the assembly + * src/Core/Targets/AutotoolsTarget.cs + ! WriteCombine() + - no longer using $PWD to determine a project's source dir; this + doesn't work with elements + - passing the solution name to all templates - fixes + multi-solution prebuild systems + ! WriteProject() + - no longer using $PWD to determine a project's source dir; this + doesn't work with elements + - passing the solution name to all templates - fixes + multi-solution prebuild systems + - copying strongname key to the autotools directory + - using Assembly.LoadWithPartialName to locate assemblies + * src/data/autotools.xml + ! + - fixed the .pc AC_CONFIG_FILES macro + ! + - added solution name param + - wrapping if type=exe check around script install macro + - added type=lib check and .pc file install macro + - added support for Configuration-specific builds (Debug, Release, etc) + - added strongname keyfile code + - TODO: support non-strongnamed library installation + ! + - added space preservation attribute to stylesheet element + - added a lower-case project name variable + - added solution name param + - made for-each template more specific + ! + - added solution name param + ! + - added solution name param + ! + - added solution name param + ! + - added solution name param + +2007-03-27T09:33 C.J. Adams-Collier + * src/Core/Targets/AutotoolsTarget.cs + - now processing the wrapper script if type is "Exe" or "WinExe" + * src/data/autotools.xml + ! + - being more exact about where text escaping is used + - using the correct variable name for the GACUTIL_FLAGS template + - using correct test="" for the AC_CONFIG_FILES macros + ! + - uncommented the bin_SCRIPTS section now that the script is being + generated correctly + ! + - fixed whitespace at beginning of file, before #! + - using lower-case packageName to indicate installation location + +2007-03-27T09:33 C.J. Adams-Collier + * src/data/autotools.xml + ! + * added a lcProjectName which is $projectName lower-cased + * moved autoconf template specifier near AC_OUTPUT + * AC_OUTPUT with args is deprecated. now using AC_CONFIG_FILES + * placed AC_CONFIG_FILES() calls for wrapper script or pkg-config + file in xslt project type checks + ! + * commented out bin_SCRIPTS + * added a lcProjectName which is $projectName lower-cased + * using $lcProjectName instead of the longer version + +2007-03-27T08:39 C.J. Adams-Collier + * src/data/autotools.xml + ! + - added whitespace-preservation + - added the missing projectName param + - replaced bin_SCRIPTS with something that worked + +2007-03-27T07:56 C.J. Adams-Collier + * src/data/autotools.xml + ! + - cleaned up duplicate checks + - placed initialization macros above system check macros + - added some more messages about what's going on + - added GACUTIL_FLAGS variable including /package option + ! + - added an incomplete bin_SCRIPTS + - RCS check says "building" instead of "compiling" + ! + - removed macros that are useful only for projects + ! + - created this element on this revision + - this is a wrapper shell script that lives in the $PATH and runs + the CIL assembly + +2007-03-26T20:18 C.J. Adams-Collier + * src/Core/Targets/AutotoolsTarget.cs + - creating new template arguments to contain the list of libs to + reference: source, binary & GAC + - source libs are included as part of this solution (untested) + - binary libs are distributed with the source (untested) + - GAC libs are assumed to be in the GAC or other lib path (tested) + * src/data/autotools.xml + - created new params through which to accept reference info + - created a working $(CSC) line + - added a TODO item for ordering project dependency for + AC_CONFIG_SUBDIRS code + +2007-03-26T08:41 C.J. Adams-Collier + * src/Core/Targets/AutotoolsTarget.cs + - now creating list of source files in managed code and passing + them to the template via s + * src/data/prebuild-1.7.xsd + - updated the header comment to 2007 + * src/data/autotools.xml + ! + - copied checks from Solution-level configure.ac + - copied solution-level config status + ! + - added elements for file list to be passed through + - made a temporary target for the assembly we're building + - added this target to the deps of "all:" + ! + - changed status header/footer from "- - -" to "===" + +2007-03-23T08:33 C.J. Adams-Collier + Added version attribute handling code for Property element + Added description element handling code + * prebuild.xml + - added /Prebuild/Solution/Property/@version attribute + - added /Prebuild/Solution/Property/Description element + * src/Core/Nodes/ProjectNode.cs + - added some docs where they were missing and obvious + - added code to handle @version + * src/Core/Nodes/DescriptionNode.cs + - new file. Used to handle /Prebuild/Solution/Property/Description + * src/Core/Targets/AutotoolsTarget.cs + - added mkdirDashP(), a recursive directory creation method + - WriteProject() now copies the files to autotools/ + * src/data/prebuild-1.7.xsd + - added /Prebuild/Solution/Property/Description element + - added /Prebuild/Solution/Property/@version attribute + * src/data/autotools.xml + - removed excess + - explicitly using dnpb: prefix + +2007-03-23T04:31 C.J. Adams-Collier + Merged code from my stripped-down test + Adding support for the /Prebuild/Solution/Project/Author element + * prebuild.xml + - added Author elements + - cleaned up the really long Project element + * src/Core/Nodes/ProjectNode.cs + - added Author tag processing code + * src/Core/Nodes/AuthorNode.cs + - Created to process Author elements + - based off of ReferencePathNode.cs + * src/Core/Targets/AutotoolsTarget.cs + - merged code from https://svn.colliertech.org/mono/dnpbAutotools/dnpbAutotools/test.cs + - renamed old WriteCombine to WriteCombineOld + - renamed old WriteProject to WriteProjectOld + * src/data/prebuild-1.7.xsd + - added Author element to Project + * src/data/autotools.xml + - lower-cased utf + + +2007-03-22T13:58 C.J. Adams-Collier + Exposing an XmlDocument that represents the prebuild.xml file + passed to the program + + * src/Core/Kernel.cs + - created an object member called XmlDocument m_CurrentDoc + - created a property to access its value + - using m_CurrentDoc to load up the prebuild.xml file rather than + a local variable called "doc" + +2007-03-22 C.J. Adams-Collier + * prebuild.xml + - added autotools.xml created at https://svn.colliertech.org/mono/dnpbAutotools/dnpbAutotools/autotools.xml + * src/data/autotools.xml + - the same + * src/Core/Targets/MonoDevelopTarget.cs + - fixed bug introduced in r206 + +2007-03-07 C.J. Adams-Collier + * src/data/prebuild-1.7.xsd + - added version attribute to Solution and Project elements + +2006-11-04T00:38 C.J. Adams-Collier + * placing AssemblyInfo.cs into Properties/ + * Fixed double-mention of the package name + +2006-11-03T15:23 C.J. Adams-Collier + * corrected a problem in the Include.am generation code + * created the new .exe + * copied it to the root of the build + +2006-11-03T14:57 C.J. Adams-Collier + * Updated the .exe file + +2006-11-03 C.J. Adams-Collier + * Added a TODO file + * Added a ChangeLog file + * applied some fixes for autotools gac and pkg-config installation + problems diff --git a/Prebuild/INSTALL b/Prebuild/INSTALL new file mode 100644 index 0000000000..23e5f25d0e --- /dev/null +++ b/Prebuild/INSTALL @@ -0,0 +1,236 @@ +Installation Instructions +************************* + +Copyright (C) 1994, 1995, 1996, 1999, 2000, 2001, 2002, 2004, 2005 Free +Software Foundation, Inc. + +This file is free documentation; the Free Software Foundation gives +unlimited permission to copy, distribute and modify it. + +Basic Installation +================== + +These are generic installation instructions. + + The `configure' shell script attempts to guess correct values for +various system-dependent variables used during compilation. It uses +those values to create a `Makefile' in each directory of the package. +It may also create one or more `.h' files containing system-dependent +definitions. Finally, it creates a shell script `config.status' that +you can run in the future to recreate the current configuration, and a +file `config.log' containing compiler output (useful mainly for +debugging `configure'). + + It can also use an optional file (typically called `config.cache' +and enabled with `--cache-file=config.cache' or simply `-C') that saves +the results of its tests to speed up reconfiguring. (Caching is +disabled by default to prevent problems with accidental use of stale +cache files.) + + If you need to do unusual things to compile the package, please try +to figure out how `configure' could check whether to do them, and mail +diffs or instructions to the address given in the `README' so they can +be considered for the next release. If you are using the cache, and at +some point `config.cache' contains results you don't want to keep, you +may remove or edit it. + + The file `configure.ac' (or `configure.in') is used to create +`configure' by a program called `autoconf'. You only need +`configure.ac' if you want to change it or regenerate `configure' using +a newer version of `autoconf'. + +The simplest way to compile this package is: + + 1. `cd' to the directory containing the package's source code and type + `./configure' to configure the package for your system. If you're + using `csh' on an old version of System V, you might need to type + `sh ./configure' instead to prevent `csh' from trying to execute + `configure' itself. + + Running `configure' takes awhile. While running, it prints some + messages telling which features it is checking for. + + 2. Type `make' to compile the package. + + 3. Optionally, type `make check' to run any self-tests that come with + the package. + + 4. Type `make install' to install the programs and any data files and + documentation. + + 5. You can remove the program binaries and object files from the + source code directory by typing `make clean'. To also remove the + files that `configure' created (so you can compile the package for + a different kind of computer), type `make distclean'. There is + also a `make maintainer-clean' target, but that is intended mainly + for the package's developers. If you use it, you may have to get + all sorts of other programs in order to regenerate files that came + with the distribution. + +Compilers and Options +===================== + +Some systems require unusual options for compilation or linking that the +`configure' script does not know about. Run `./configure --help' for +details on some of the pertinent environment variables. + + You can give `configure' initial values for configuration parameters +by setting variables in the command line or in the environment. Here +is an example: + + ./configure CC=c89 CFLAGS=-O2 LIBS=-lposix + + *Note Defining Variables::, for more details. + +Compiling For Multiple Architectures +==================================== + +You can compile the package for more than one kind of computer at the +same time, by placing the object files for each architecture in their +own directory. To do this, you must use a version of `make' that +supports the `VPATH' variable, such as GNU `make'. `cd' to the +directory where you want the object files and executables to go and run +the `configure' script. `configure' automatically checks for the +source code in the directory that `configure' is in and in `..'. + + If you have to use a `make' that does not support the `VPATH' +variable, you have to compile the package for one architecture at a +time in the source code directory. After you have installed the +package for one architecture, use `make distclean' before reconfiguring +for another architecture. + +Installation Names +================== + +By default, `make install' installs the package's commands under +`/usr/local/bin', include files under `/usr/local/include', etc. You +can specify an installation prefix other than `/usr/local' by giving +`configure' the option `--prefix=PREFIX'. + + You can specify separate installation prefixes for +architecture-specific files and architecture-independent files. If you +pass the option `--exec-prefix=PREFIX' to `configure', the package uses +PREFIX as the prefix for installing programs and libraries. +Documentation and other data files still use the regular prefix. + + In addition, if you use an unusual directory layout you can give +options like `--bindir=DIR' to specify different values for particular +kinds of files. Run `configure --help' for a list of the directories +you can set and what kinds of files go in them. + + If the package supports it, you can cause programs to be installed +with an extra prefix or suffix on their names by giving `configure' the +option `--program-prefix=PREFIX' or `--program-suffix=SUFFIX'. + +Optional Features +================= + +Some packages pay attention to `--enable-FEATURE' options to +`configure', where FEATURE indicates an optional part of the package. +They may also pay attention to `--with-PACKAGE' options, where PACKAGE +is something like `gnu-as' or `x' (for the X Window System). The +`README' should mention any `--enable-' and `--with-' options that the +package recognizes. + + For packages that use the X Window System, `configure' can usually +find the X include and library files automatically, but if it doesn't, +you can use the `configure' options `--x-includes=DIR' and +`--x-libraries=DIR' to specify their locations. + +Specifying the System Type +========================== + +There may be some features `configure' cannot figure out automatically, +but needs to determine by the type of machine the package will run on. +Usually, assuming the package is built to be run on the _same_ +architectures, `configure' can figure that out, but if it prints a +message saying it cannot guess the machine type, give it the +`--build=TYPE' option. TYPE can either be a short name for the system +type, such as `sun4', or a canonical name which has the form: + + CPU-COMPANY-SYSTEM + +where SYSTEM can have one of these forms: + + OS KERNEL-OS + + See the file `config.sub' for the possible values of each field. If +`config.sub' isn't included in this package, then this package doesn't +need to know the machine type. + + If you are _building_ compiler tools for cross-compiling, you should +use the option `--target=TYPE' to select the type of system they will +produce code for. + + If you want to _use_ a cross compiler, that generates code for a +platform different from the build platform, you should specify the +"host" platform (i.e., that on which the generated programs will +eventually be run) with `--host=TYPE'. + +Sharing Defaults +================ + +If you want to set default values for `configure' scripts to share, you +can create a site shell script called `config.site' that gives default +values for variables like `CC', `cache_file', and `prefix'. +`configure' looks for `PREFIX/share/config.site' if it exists, then +`PREFIX/etc/config.site' if it exists. Or, you can set the +`CONFIG_SITE' environment variable to the location of the site script. +A warning: not all `configure' scripts look for a site script. + +Defining Variables +================== + +Variables not defined in a site shell script can be set in the +environment passed to `configure'. However, some packages may run +configure again during the build, and the customized values of these +variables may be lost. In order to avoid this problem, you should set +them in the `configure' command line, using `VAR=value'. For example: + + ./configure CC=/usr/local2/bin/gcc + +causes the specified `gcc' to be used as the C compiler (unless it is +overridden in the site shell script). Here is a another example: + + /bin/bash ./configure CONFIG_SHELL=/bin/bash + +Here the `CONFIG_SHELL=/bin/bash' operand causes subsequent +configuration-related scripts to be executed by `/bin/bash'. + +`configure' Invocation +====================== + +`configure' recognizes the following options to control how it operates. + +`--help' +`-h' + Print a summary of the options to `configure', and exit. + +`--version' +`-V' + Print the version of Autoconf used to generate the `configure' + script, and exit. + +`--cache-file=FILE' + Enable the cache: use and save the results of the tests in FILE, + traditionally `config.cache'. FILE defaults to `/dev/null' to + disable caching. + +`--config-cache' +`-C' + Alias for `--cache-file=config.cache'. + +`--quiet' +`--silent' +`-q' + Do not print messages saying which checks are being made. To + suppress all normal output, redirect it to `/dev/null' (any error + messages will still be shown). + +`--srcdir=DIR' + Look for the package's source code in directory DIR. Usually + `configure' can determine that directory automatically. + +`configure' also accepts some other, not widely useful, options. Run +`configure --help' for more details. + diff --git a/Prebuild/NEWS b/Prebuild/NEWS new file mode 100644 index 0000000000..3ab3108b4c --- /dev/null +++ b/Prebuild/NEWS @@ -0,0 +1,200 @@ +Prebuild is an XML-driven pre-build tool allowing developers to easily generate project or make files for major IDE's and .NET development tools including: Visual Studio 2005, Visual Studio 2003, Visual Studio 2002, SharpDevelop, MonoDevelop, and NAnt. + +Documentation and downloads are available at http://dnpb.sourceforge.net. + +Prebuild is licensed under the BSD license. + +[ XXXXXXX XX, XXX - 1.3.2 ] + + Added Keyfile signing to NAnt target and VS2005 target + + Updated XSD file to 1.7 + + Boo and VisualBasic Language support in VS2005 target + + Added basic Autotools target. It creates a non-recursive Autotools system. + ! Multiple files can be excluded from the Match node + ! VS2005 now handles .resx files correctly. + ! NAnt and Autotools now handle defines + ! NAnt and Autotools now handle resources + + Conditional XML variables can be passed through the command line. + + Added /install and /remove command line flags to install and remove assemblies from the GAC + + Many fixes to VS2005 target + +[ July 21, 2006 - 1.3.1 ] + ! VS2005 fixes from Rob Loach + ! NAnt fixes from Rob Loach and David Hudson + ! XML doc fixes from Rob Loach + + Added SharpDevelop2 target (really just uses VS2005 target) + ! Fixed bug with BuildEvents in Monodevelop target + + Passing /yes will default to answering yes to any warnings + +[ February 28, 2006 - 1.3 ] + + Added MonoDevelop target. + + Added NAnt target. + + Lots of fixes to all targets. + * Cleaned up the code using FXCop. + * Updated schema to 1.6 to fix a typo and add a new parameter. + * jendave is now the maintainer of the project. RobLoach has been added as a developer. + * Removed references to 'dnpb'. + + Added rudimentary support for pre- and post- build scripts + * Updated examples. + +[ August 5, 2004 - 1.2 ] + + Added Visual Studio Express (vs2005express) target contributed by Borrillis and modified for use with different languages + + Added the allowedgroups command line option followed by a pipe-delimited list of project group filter flags (eg. Group1|Group2) allow optional filtering of all projects that dont have at least one of these flags + + Added the filterGroups XML attribute to the project node and updated the scheme to v1.5 for this addition, it is used to specified the delimited list of filter groups to which a project belongs + * Modified the removedir command line option to allow for a pipe-delimited list of directory names + ! Modified the resource loading code to search for resourced without the prepended namespace (as Visual Studio .NET does it) to allow for it to be compiled with SharpDevelop as well + + Added the GenerateXmlDocFile boolean option to the Options XML element + * Changed the behavior of the XmlDocFile option so that if not specified it uses the assemblyName (without file extension) + .xml for the file name instead of just not generating the file since the new GenerateXmlDocFile takes care of this + +[ January 3, 2004 - 1.1 ] + ! Replaced regex use for more efficient manual parsing to allow use on non-windows platforms with Mono which has Regex problems + + Added the checkOsVars attribute to the root element for enabling interpolation for Enviroment variables in the form ${var}, otherwise no checking is performed for efficiency-sake + * Make the version attribute on the root element optional as it isn't used and not needed since the schema url contains the version + +[ December 30, 2004 - 1.1 ] + ! Applied Leed's fix for SharpDevelop references + + Rewrote much of the processing for better validation and without the use of a temp file + + Added support for configurations at the project level which are named All. They now apply changes to all Solution level defined configs + * Changed all spaces into tabs + + Added support for the None build action + * Replaced all sequence's in the XML schema for all's because the order doesn't matter since the xml file is loaded into an XmlDocument + +[ December 25, 2004 - 1.0 ] + + Added the /removedir option for cleaning directories like obj before file releases + + Changed WriteTempXml() and the new DeleteTempXml() methods to be compiled only in DEBUG builds + * Made path optional for Match elements (defaults to current directory) and updates schema for it + ! Fixed XML example in the readme.txt + + Added example xml files to docs directory + * Updated license.txt to add Dan Moorehead and update copyright years + + Updated prebuild.xml to take advantage of the default path attribute for match elements + + Updated Clean to delete the obj directories + +[ December 25, 2004 - 0.13 ] + + Added dnpb.exe so that it can be used to generate the project files + + Added dnpb.ico + * Added parameterless Write statement to Log for writing a single line + * Changed scehema to version 1.3 for support of icon attribute + * Added support for All configuration name under a Project node signifying common settings for all configurations + ! Fixed the SupressWarnings by adding the corresponding field to OptionsNode + * Wrote documentation in docs/readme.txt + * Added Dan Moorehead to copyrights and extended date from 2004 to 2004-2005 + * Updated prebuild.xml + * Optimized Log class + * Updated OutputUsage() + * /clean targets all by default + * No log file is used by default, /log without value specified uses default file name + + Added support for the /pause which pauses the utility after execution to observe output + + +[ September 27, 2004 - 0.12.2a ] + ! Fixed a nasty bug when trying to delete our temp file for pre-processing. + +[ September 15, 2004 - 0.12.2 ] + + Expanded platform identification, thanks to the NAnt guys for shedding some + light on how to properly check for UNIX platforms! Thanks guys! + * POSIX OS identifier changed to UNIX. Valid OS names are now "Win32", "UNIX", + and "Unknown". + ! Fixed SharpDevelop target to properly use the 'rootNamespace' attribute of + the Project tag. + + New command-line switch, /ppo, forces DNPB to pre-process the file and write + the pre-processed file. This allows you to test/debug your pre-processor + macros. No other processing will be done. You can specify a target file as + a paramter for the /ppo switch, or DNPB will write the file 'preprocessed.xml' + if you do not specify a file. + + The Match tag now has a 'buildAction' attribute which functions exactly like + the attribute of the same name for the File tag. + +[ August 5, 2004 - 0.12.1 ] + + Added environment variable expansion for all values. Environment variables + should be listed in the form ${VAR}. + +[ July 30, 2004 - 0.12.0 ] + + Added preprocessing via XML processing information tags. Available tags + are: ?>, ?>, and . The + current expression parser is very basic, but will be replaced with a more + capable parser over time. Current operators available are: =, !=, <, >, + <=, >=. Current test variables available: OS, RuntimeVersion, RuntimeMajor, + RuntimeMinor, RuntimeRevision. + +[ July 27, 2004 - 0.11.4 ] + + Added 'useRegex' attribute to the Match tag. Matches can now use regular + expressions to match filenames. + + Added the 'assemblyName' attribute to the Project tag. Projects can now + set their output assembly name. + ! Fixed several bugs in the way that Project tags inheirt their parent + Solutions configuration options. This operation should now work fully as + intended. + ! Due to some wierdness, Project Guid's are now stored as part of the Project + node and created at parse time. + +[ May 11, 2004 - 0.11.3 ] + ! Fixed a bug where I was writing the wrong property name for a projects root + namespace. + ! Removed a DEBUG statement I had left in the code in 0.11.2. + ! Fixed a bug in the VS2002 writer which caused the version variables to not + be overriden correctly. + + Added the rootNamespace property to the element, allowing you to + specify the root namespace. + * /target and /clean are now mutually exclusive command line switches, and + they both now take the all option. In the case of /target all, all build + file for all targets will be created. In the case of /clean all, the user + will be prompted to make sure they want to do it, and if so, will clean + all build files for all targets. + +[ April 22, 2004 - 0.11.2 ] + ! Fixed a bug with the /file command-line operator. Was using the unresolved + file path rather then the resolved one, was making the attempt to open the + dnpb file fail. + ! Fixed a bug in the schema that required at least 1 solution and 1 reference + path. We can do just fine with 0 of either of these. Some files may be all + statements and not have any tags. + ! Fixed a bug that caused the project references not to be written with the + SharpDevelop target. + * Changed the schema to version 1.2, allowing for Configuration nodes to exist + under project nodes. The inheritance of values is hierarchical. Meaning, if + you define a configuration named Debug at the Soltion level, and one by the + same name at the Project level, the one at the Project level will first + inherit the options of the Solution level configuration, then set it's own + options. If you define a configuration at the Project level and it does not + exist at the Solution level, it will be created at the Solution level. + * Project references should now work correctly across the board. Note that due + to a restriction in Visual Studio, you can only reference projects in the same + solution. + +[ April 21, 2004 - 0.11.1 ] + ! Fixed a problem with resolving paths in various targets. Was not properly + setting the CWD. + * Schema updated to 1.1, moving the ReferencePath element from the Options + element to the Project element. This makes more logical sense, given that + reference paths are resolved relative to the project path. Any prebuild.xml + file referecning verison 1.0 will fail! Please update to the 1.1 schema. + +[ April 19, 2004 - 0.11.0 ] + * Added several attributes across the code to make FxCop happy + ! Fixed bugs in reference paths being written in the VS targets. + ! Fixed a bug in ProjectNode which was doing two CWDStack.Push() calls instead of + a Push/Pop pair. Was wreaking havoc with tags. + ! Fixed some bugs in the path tracking, both the Project and Solution nodes now + have a FullPath property, which is the full path to the file resolved at load + time. This should fix all path relativity problems. + + Added new /clean switch, allowing the target to clean up any files it generated. + in accordance, the ITarget interface has been updated to support a new Clean() + method. + + Completed addition of the tag, to allow the referencing of external + prebuild.xml files. + + Added the runtime attribute to the Project element. This allows the developer + to specify which runtime a project should target (Mono or Microsoft). This is + of course ignored in certain targets like the Visual Studio targets. + + Added the SharpDevelop target. + +[ April 13, 2004 - 0.10.1a ] + + Added the buildAction attribute to the File node. This is needed for dnpb + to even be able to bootstrap itself (dnpb-1.0.xsd must be an embedded resource) + +[ April 13, 2004 - 0.10.1 ] + * First Release + +[ Key ] +* = Change or information ++ = Addition +! = Bug Fix + diff --git a/Prebuild/README b/Prebuild/README new file mode 100644 index 0000000000..e8a2d69530 --- /dev/null +++ b/Prebuild/README @@ -0,0 +1,274 @@ +Prebuild Instructions + +Prebuild is an XML-driven pre-build tool allowing developers to easily generate project or make files for major IDE's and .NET development tools including: Visual Studio 2005, Visual Studio 2003, Visual Studio 2002, SharpDevelop, SharpDevelop2, MonoDevelop, and NAnt. + +_______________________________________________________________________________ +Overview + +Prebuild can be either be run from the command line to generate the +project and make files or you can execute the included batch (*.bat) +and Unix Shell script (*.sh) files. + +_______________________________________________________________________________ +The currently supported developement tools and their associated batch +and shell script files. + +Visual Studio .NET 2005 (VS2005.bat) +Visual Studio .NET 2003 (VS2003.bat) +Visual Studio .NET 2002 (VS2002.bat) +SharpDevelop (SharpDevelop.bat) - http://www.icsharpcode.net/OpenSource/SD/ +SharpDevelop2 (SharpDevelop.bat) - http://www.icsharpcode.net/OpenSource/SD/ +MonoDevelop (MonoDevelop.sh) - http://www.monodevelop.com/ +NAnt (nant.sh and nant.bat) - http://nant.sourceforge.net/ +Autotools (autotools.bat and autotools.sh) - http://en.wikipedia.org/wiki/GNU_build_system + +Notes: + +A Unix Shell script is provided for MonoDevelop, as it does not run on +Windows at this time. + +Visual Studio .NET 2005 and the Visual Express IDE's can import +solutions from older versions of Visual Studio .NET. + +Makefiles are not currently supported. + +_______________________________________________________________________________ +Command Line Syntax: + +Example: +> Prebuild /target vs2003 + +This will generate the project files for Visual Studio.NET 2003 and +place the redirect the log to a file named PrebuildLog.txt in the +parent directory + + +The syntax structure is as below, where commandParameter is optional +depending on the command and you can provide several option-value +pairs. + +Note: The '> ' signifies the command prompt, do not enter this literally + +> Prebuild /
/// The targets. - public Hashtable Targets + public Dictionary Targets { get { @@ -259,7 +255,7 @@ namespace Prebuild.Core private void LoadSchema() { - Assembly assembly = this.GetType().Assembly; + Assembly assembly = GetType().Assembly; Stream stream = assembly.GetManifestResourceStream("Prebuild.data." + m_Schema); if(stream == null) { @@ -319,23 +315,24 @@ namespace Prebuild.Core private void LogBanner() { - m_Log.Write("Prebuild v" + this.Version); - m_Log.Write("Copyright (c) 2004-2008"); - m_Log.Write("Matthew Holmes (matthew@wildfiregames.com),"); - m_Log.Write("Dan Moorehead (dan05a@gmail.com),"); - m_Log.Write("David Hudson (jendave@yahoo.com),"); - m_Log.Write("Rob Loach (http://www.robloach.net),"); - m_Log.Write("C.J. Adams-Collier (cjac@colliertech.org),"); + m_Log.Write("Prebuild v" + Version); + m_Log.Write("Copyright (c) 2004-2010"); + m_Log.Write("Matthew Holmes (matthew@wildfiregames.com),"); + m_Log.Write("Dan Moorehead (dan05a@gmail.com),"); + m_Log.Write("David Hudson (jendave@yahoo.com),"); + m_Log.Write("Rob Loach (http://www.robloach.net),"); + m_Log.Write("C.J. Adams-Collier (cjac@colliertech.org),"); + m_Log.Write("John Hurliman (john.hurliman@intel.com),"); - m_Log.Write("See 'prebuild /usage' for help"); - m_Log.Write(); + m_Log.Write("See 'prebuild /usage' for help"); + m_Log.Write(); } private void ProcessFile(string file) { - ProcessFile(file, this.m_Solutions); + ProcessFile(file, m_Solutions); } public void ProcessFile(ProcessNode node, SolutionNode parent) @@ -381,12 +378,12 @@ namespace Prebuild.Core Core.Parse.Preprocessor pre = new Core.Parse.Preprocessor(); //register command line arguments as XML variables - IDictionaryEnumerator dict = m_CommandLine.GetEnumerator(); + IEnumerator> dict = m_CommandLine.GetEnumerator(); while (dict.MoveNext()) { - string name = dict.Key.ToString().Trim(); + string name = dict.Current.Key.Trim(); if (name.Length > 0) - pre.RegisterVariable(name, dict.Value.ToString()); + pre.RegisterVariable(name, dict.Current.Value); } string xml = pre.Process(reader);//remove script and evaulate pre-proccessing to get schema-conforming XML @@ -422,6 +419,10 @@ namespace Prebuild.Core m_CurrentDoc = new XmlDocument(); try { +#if NO_VALIDATE + XmlReader validator = XmlReader.Create(new StringReader(xml)); + m_CurrentDoc.Load(validator); +#else XmlValidatingReader validator = new XmlValidatingReader(new XmlTextReader(new StringReader(xml))); //validate while reading from string into XmlDocument DOM structure in memory @@ -430,6 +431,7 @@ namespace Prebuild.Core validator.Schemas.Add(schema); } m_CurrentDoc.Load(validator); +#endif } catch(XmlException e) { @@ -541,7 +543,7 @@ namespace Prebuild.Core return null; } - NodeEntry ne = (NodeEntry)m_Nodes[node.Name]; + NodeEntry ne = m_Nodes[node.Name]; return ne.Type; } @@ -578,11 +580,11 @@ namespace Prebuild.Core { if(!m_Nodes.ContainsKey(node.Name)) { - //throw new XmlException("Unknown XML node: " + node.Name); + Console.WriteLine("WARNING: Unknown XML node: " + node.Name); return null; } - NodeEntry ne = (NodeEntry)m_Nodes[node.Name]; + NodeEntry ne = m_Nodes[node.Name]; Type type = ne.Type; //DataNodeAttribute dna = ne.Attribute; @@ -624,10 +626,8 @@ namespace Prebuild.Core /// The args. public void Initialize(LogTargets target, string[] args) { - m_Targets = new Hashtable(); - CacheTargets(this.GetType().Assembly); - m_Nodes = new Hashtable(); - CacheNodeTypes(this.GetType().Assembly); + CacheTargets(GetType().Assembly); + CacheNodeTypes(GetType().Assembly); CacheVersion(); m_CommandLine = new CommandLineCollection(args); @@ -750,11 +750,11 @@ namespace Prebuild.Core } else { - if (!m_Targets.Contains(target)) { + if (!m_Targets.ContainsKey(target)) { m_Log.Write(LogType.Error, "Unknown Target \"{0}\"", target); return; } - ITarget targ = (ITarget)m_Targets[target]; + ITarget targ = m_Targets[target]; if(clean) { @@ -793,18 +793,19 @@ namespace Prebuild.Core /// protected virtual void Dispose(bool disposing) { - if (!this.disposed) + if (!disposed) { if (disposing) { - if (this.m_Log != null) + GC.SuppressFinalize(this); + if (m_Log != null) { - this.m_Log.Close(); - this.m_Log = null; + m_Log.Close(); + m_Log = null; } } } - this.disposed = true; + disposed = true; } /// @@ -812,7 +813,7 @@ namespace Prebuild.Core /// ~Kernel() { - this.Dispose(false); + Dispose(false); } /// diff --git a/Prebuild/src/Core/Nodes/AuthorNode.cs b/Prebuild/src/Core/Nodes/AuthorNode.cs index 20e72c01f1..4c415bb6b1 100644 --- a/Prebuild/src/Core/Nodes/AuthorNode.cs +++ b/Prebuild/src/Core/Nodes/AuthorNode.cs @@ -24,8 +24,6 @@ IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY O #endregion using System; -using System.Collections; -using System.Collections.Specialized; using System.Xml; using Prebuild.Core.Attributes; diff --git a/Prebuild/src/Core/Nodes/CleanFilesNode.cs b/Prebuild/src/Core/Nodes/CleanFilesNode.cs new file mode 100644 index 0000000000..71405f9aaa --- /dev/null +++ b/Prebuild/src/Core/Nodes/CleanFilesNode.cs @@ -0,0 +1,80 @@ +#region BSD License +/* +Copyright (c) 2007 C.J. Adams-Collier (cjac@colliertech.org) + +Redistribution and use in source and binary forms, with or without modification, are permitted +provided that the following conditions are met: + +* Redistributions of source code must retain the above copyright notice, this list of conditions + and the following disclaimer. +* Redistributions in binary form must reproduce the above copyright notice, this list of conditions + and the following disclaimer in the documentation and/or other materials provided with the + distribution. +* The name of the author may not be used to endorse or promote products derived from this software + without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, +BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, +EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS +OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY +OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING +IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +*/ +#endregion + +using System; +using System.Collections.Generic; +using System.Xml; + +using Prebuild.Core.Attributes; +using Prebuild.Core.Interfaces; +using Prebuild.Core.Utilities; + +namespace Prebuild.Core.Nodes +{ + [DataNode("CleanFiles")] + public class CleanFilesNode : DataNode + { + #region Fields + + private string m_Pattern; + + #endregion + + #region Properties + + /// + /// Gets the signature. + /// + /// The signature. + public string Pattern + { + get + { + return m_Pattern; + } + } + + #endregion + + #region Public Methods + + /// + /// Parses the specified node. + /// + /// The node. + public override void Parse(XmlNode node) + { + if (node == null) + { + throw new ArgumentNullException("node"); + } + + m_Pattern = Helper.AttributeValue(node, "pattern", String.Empty); ; + m_Pattern = m_Pattern.Trim(); + } + + #endregion + } +} \ No newline at end of file diff --git a/Prebuild/src/Core/Nodes/CleanupNode.cs b/Prebuild/src/Core/Nodes/CleanupNode.cs new file mode 100644 index 0000000000..b8131b0ebb --- /dev/null +++ b/Prebuild/src/Core/Nodes/CleanupNode.cs @@ -0,0 +1,85 @@ +#region BSD License +/* +Copyright (c) 2007 C.J. Adams-Collier (cjac@colliertech.org) + +Redistribution and use in source and binary forms, with or without modification, are permitted +provided that the following conditions are met: + +* Redistributions of source code must retain the above copyright notice, this list of conditions + and the following disclaimer. +* Redistributions in binary form must reproduce the above copyright notice, this list of conditions + and the following disclaimer in the documentation and/or other materials provided with the + distribution. +* The name of the author may not be used to endorse or promote products derived from this software + without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, +BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, +EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS +OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY +OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING +IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +*/ +#endregion + +using System; +using System.Collections.Generic; +using System.Xml; + +using Prebuild.Core.Attributes; +using Prebuild.Core.Interfaces; + +namespace Prebuild.Core.Nodes +{ + [DataNode("Cleanup")] + public class CleanupNode : DataNode + { + #region Fields + + private List m_CleanFiles = new List(); + + #endregion + + #region Properties + + /// + /// Gets the signature. + /// + /// The signature. + public List CleanFiles + { + get + { + return m_CleanFiles; + } + } + + #endregion + + #region Public Methods + + /// + /// Parses the specified node. + /// + /// The node. + public override void Parse(XmlNode node) + { + if( node == null ) + { + throw new ArgumentNullException("node"); + } + + foreach (XmlNode child in node.ChildNodes) + { + IDataNode dataNode = Kernel.Instance.ParseNode(child, this); + if (dataNode is CleanFilesNode) + { + m_CleanFiles.Add((CleanFilesNode)dataNode); + } + } + } + + #endregion + } +} \ No newline at end of file diff --git a/Prebuild/src/Core/Nodes/ConfigurationNode.cs b/Prebuild/src/Core/Nodes/ConfigurationNode.cs index 67d78d55fd..cd2f740ae7 100644 --- a/Prebuild/src/Core/Nodes/ConfigurationNode.cs +++ b/Prebuild/src/Core/Nodes/ConfigurationNode.cs @@ -41,6 +41,7 @@ namespace Prebuild.Core.Nodes #region Fields private string m_Name = "unknown"; + private string m_Platform = "AnyCPU"; private OptionsNode m_Options; #endregion @@ -83,6 +84,33 @@ namespace Prebuild.Core.Nodes } } + /// + /// Identifies the platform for this specific configuration. + /// + public string Platform + { + get + { + return m_Platform; + } + set + { + switch ((value + "").ToLower()) + { + case "x86": + case "x64": + m_Platform = value; + break; + case "itanium": + m_Platform = "Itanium"; + break; + default: + m_Platform = "AnyCPU"; + break; + } + } + } + /// /// Gets the name. /// @@ -95,6 +123,22 @@ namespace Prebuild.Core.Nodes } } + /// + /// Gets the name and platform for the configuration. + /// + /// The name and platform. + public string NameAndPlatform + { + get + { + string platform = m_Platform; + if (platform == "AnyCPU") + platform = "Any CPU"; + + return String.Format("{0}|{1}", m_Name, platform); + } + } + /// /// Gets or sets the options. /// @@ -122,7 +166,9 @@ namespace Prebuild.Core.Nodes public override void Parse(XmlNode node) { m_Name = Helper.AttributeValue(node, "name", m_Name); - if( node == null ) + Platform = Helper.AttributeValue(node, "platform", m_Platform); + + if (node == null) { throw new ArgumentNullException("node"); } @@ -159,6 +205,7 @@ namespace Prebuild.Core.Nodes { ConfigurationNode ret = new ConfigurationNode(); ret.m_Name = m_Name; + ret.m_Platform = m_Platform; m_Options.CopyTo(ret.m_Options); return ret; } diff --git a/Prebuild/src/Core/Nodes/ConfigurationNodeCollection.cs b/Prebuild/src/Core/Nodes/ConfigurationNodeCollection.cs new file mode 100644 index 0000000000..1c38d9e443 --- /dev/null +++ b/Prebuild/src/Core/Nodes/ConfigurationNodeCollection.cs @@ -0,0 +1,71 @@ +#region BSD License +/* +Copyright (c) 2004-2005 Matthew Holmes (matthew@wildfiregames.com), Dan Moorehead (dan05a@gmail.com) + +Redistribution and use in source and binary forms, with or without modification, are permitted +provided that the following conditions are met: + +* Redistributions of source code must retain the above copyright notice, this list of conditions + and the following disclaimer. +* Redistributions in binary form must reproduce the above copyright notice, this list of conditions + and the following disclaimer in the documentation and/or other materials provided with the + distribution. +* The name of the author may not be used to endorse or promote products derived from this software + without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, +BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, +EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS +OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY +OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING +IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +*/ +#endregion + +using System.Collections.Generic; + +namespace Prebuild.Core.Nodes +{ + /// + /// Implements a specialized list of configuration nodes which allows for lookup via + /// configuration name and platform. + /// + public class ConfigurationNodeCollection : List + { + #region Properties + + public ConfigurationNode this[string nameAndPlatform] + { + get + { + foreach (ConfigurationNode configurationNode in this) + { + if (configurationNode.NameAndPlatform == nameAndPlatform) + { + return configurationNode; + } + } + + return null; + } + + set + { + // See if the node + ConfigurationNode configurationNode = this[nameAndPlatform]; + + if (configurationNode != null) + { + this[IndexOf(configurationNode)] = value; + } + else + { + Add(value); + } + } + } + + #endregion + } +} diff --git a/Prebuild/src/Core/Nodes/DataNode.cs b/Prebuild/src/Core/Nodes/DataNode.cs index 763e6c3831..318b13ccb9 100644 --- a/Prebuild/src/Core/Nodes/DataNode.cs +++ b/Prebuild/src/Core/Nodes/DataNode.cs @@ -104,7 +104,7 @@ namespace Prebuild.Core.Nodes foreach (string type in WebTypes) { - if (path.EndsWith(string.Format("{0}{1}", type, extension))) + if (path.EndsWith(type)) { return SubType.CodeBehind; } diff --git a/Prebuild/src/Core/Nodes/DatabaseProjectNode.cs b/Prebuild/src/Core/Nodes/DatabaseProjectNode.cs index 27c205162a..278ecd81ce 100644 --- a/Prebuild/src/Core/Nodes/DatabaseProjectNode.cs +++ b/Prebuild/src/Core/Nodes/DatabaseProjectNode.cs @@ -1,5 +1,4 @@ using System; -using System.Collections; using System.Collections.Generic; using System.Text; using System.Xml; diff --git a/Prebuild/src/Core/Nodes/DescriptionNode.cs b/Prebuild/src/Core/Nodes/DescriptionNode.cs index 353a5aec07..d1293a0c80 100644 --- a/Prebuild/src/Core/Nodes/DescriptionNode.cs +++ b/Prebuild/src/Core/Nodes/DescriptionNode.cs @@ -24,8 +24,6 @@ IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY O #endregion using System; -using System.Collections; -using System.Collections.Specialized; using System.Xml; using Prebuild.Core.Attributes; diff --git a/Prebuild/src/Core/Nodes/FileNode.cs b/Prebuild/src/Core/Nodes/FileNode.cs index 1520fcb789..01cea1ebdb 100644 --- a/Prebuild/src/Core/Nodes/FileNode.cs +++ b/Prebuild/src/Core/Nodes/FileNode.cs @@ -54,7 +54,15 @@ namespace Prebuild.Core.Nodes /// /// /// - EmbeddedResource + EmbeddedResource, + /// + /// + /// + ApplicationDefinition, + /// + /// + /// + Page } /// @@ -264,6 +272,12 @@ namespace Prebuild.Core.Nodes m_Valid = false; Kernel.Instance.Log.Write(LogType.Warning, "File does not exist: {0}", m_Path); } + + if (System.IO.Path.GetExtension(m_Path) == ".settings") + { + m_SubType = SubType.Settings; + m_BuildAction = BuildAction.None; + } } #endregion diff --git a/Prebuild/src/Core/Nodes/FilesNode.cs b/Prebuild/src/Core/Nodes/FilesNode.cs index dc306c2252..23a716cfde 100644 --- a/Prebuild/src/Core/Nodes/FilesNode.cs +++ b/Prebuild/src/Core/Nodes/FilesNode.cs @@ -24,8 +24,7 @@ IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY O #endregion using System; -using System.Collections; -using System.Collections.Specialized; +using System.Collections.Generic; using System.Xml; using Prebuild.Core.Attributes; @@ -42,41 +41,19 @@ namespace Prebuild.Core.Nodes { #region Fields - private StringCollection m_Files; - private Hashtable m_BuildActions; - private Hashtable m_SubTypes; - private Hashtable m_ResourceNames; - private Hashtable m_CopyToOutputs; - private Hashtable m_Links; - private Hashtable m_LinkPaths; - private Hashtable m_PreservePaths; - - #endregion - - #region Constructors - - /// - /// - /// - public FilesNode() - { - m_Files = new StringCollection(); - m_BuildActions = new Hashtable(); - m_SubTypes = new Hashtable(); - m_ResourceNames = new Hashtable(); - m_CopyToOutputs = new Hashtable(); - m_Links = new Hashtable(); - m_LinkPaths = new Hashtable(); - m_PreservePaths = new Hashtable(); - } + private readonly List m_Files = new List(); + private readonly Dictionary m_BuildActions = new Dictionary(); + private readonly Dictionary m_SubTypes = new Dictionary(); + private readonly Dictionary m_ResourceNames = new Dictionary(); + private readonly Dictionary m_CopyToOutputs = new Dictionary(); + private readonly Dictionary m_Links = new Dictionary(); + private readonly Dictionary m_LinkPaths = new Dictionary(); + private readonly Dictionary m_PreservePaths = new Dictionary(); #endregion #region Properties - /// - /// - /// public int Count { get @@ -89,11 +66,6 @@ namespace Prebuild.Core.Nodes #region Public Methods - /// - /// - /// - /// - /// public BuildAction GetBuildAction(string file) { if(!m_BuildActions.ContainsKey(file)) @@ -101,41 +73,41 @@ namespace Prebuild.Core.Nodes return BuildAction.Compile; } - return (BuildAction)m_BuildActions[file]; + return m_BuildActions[file]; } public CopyToOutput GetCopyToOutput(string file) { - if (!this.m_CopyToOutputs.ContainsKey(file)) + if (!m_CopyToOutputs.ContainsKey(file)) { return CopyToOutput.Never; } - return (CopyToOutput) this.m_CopyToOutputs[file]; + return m_CopyToOutputs[file]; } public bool GetIsLink(string file) { - if (!this.m_Links.ContainsKey(file)) + if (!m_Links.ContainsKey(file)) { return false; } - return (bool) this.m_Links[file]; + return m_Links[file]; } + public bool Contains(string file) + { + return m_Files.Contains(file); + } + public string GetLinkPath( string file ) { - if ( !this.m_LinkPaths.ContainsKey( file ) ) + if ( !m_LinkPaths.ContainsKey( file ) ) { return string.Empty; } - return (string)this.m_LinkPaths[ file ]; + return m_LinkPaths[ file ]; } - /// - /// - /// - /// - /// public SubType GetSubType(string file) { if(!m_SubTypes.ContainsKey(file)) @@ -143,29 +115,19 @@ namespace Prebuild.Core.Nodes return SubType.Code; } - return (SubType)m_SubTypes[file]; + return m_SubTypes[file]; } - /// - /// - /// - /// - /// public string GetResourceName(string file) { if(!m_ResourceNames.ContainsKey(file)) { - return ""; + return string.Empty; } - return (string)m_ResourceNames[file]; + return m_ResourceNames[file]; } - /// - /// - /// - /// - /// public bool GetPreservePath( string file ) { if ( !m_PreservePaths.ContainsKey( file ) ) @@ -173,13 +135,9 @@ namespace Prebuild.Core.Nodes return false; } - return (bool)m_PreservePaths[ file ]; + return m_PreservePaths[ file ]; } - /// - /// - /// - /// public override void Parse(XmlNode node) { if( node == null ) @@ -200,10 +158,10 @@ namespace Prebuild.Core.Nodes m_BuildActions[fileNode.Path] = fileNode.BuildAction; m_SubTypes[fileNode.Path] = fileNode.SubType; m_ResourceNames[fileNode.Path] = fileNode.ResourceName; - this.m_PreservePaths[ fileNode.Path ] = fileNode.PreservePath; - this.m_Links[ fileNode.Path ] = fileNode.IsLink; - this.m_LinkPaths[ fileNode.Path ] = fileNode.LinkPath; - this.m_CopyToOutputs[ fileNode.Path ] = fileNode.CopyToOutput; + m_PreservePaths[ fileNode.Path ] = fileNode.PreservePath; + m_Links[ fileNode.Path ] = fileNode.IsLink; + m_LinkPaths[ fileNode.Path ] = fileNode.LinkPath; + m_CopyToOutputs[ fileNode.Path ] = fileNode.CopyToOutput; } } @@ -216,13 +174,16 @@ namespace Prebuild.Core.Nodes if (!m_Files.Contains(file)) { m_Files.Add(file); - m_BuildActions[ file ] = matchNode.BuildAction == null ? GetBuildActionByFileName(file) : matchNode.BuildAction; - m_SubTypes[file] = matchNode.SubType == null ? GetSubTypeByFileName(file) : matchNode.SubType.Value; + if (matchNode.BuildAction == null) + m_BuildActions[file] = GetBuildActionByFileName(file); + else + m_BuildActions[file] = matchNode.BuildAction.Value; + m_SubTypes[file] = matchNode.SubType == null ? GetSubTypeByFileName(file) : matchNode.SubType.Value; m_ResourceNames[ file ] = matchNode.ResourceName; - this.m_PreservePaths[ file ] = matchNode.PreservePath; - this.m_Links[ file ] = matchNode.IsLink; - this.m_LinkPaths[ file ] = matchNode.LinkPath; - this.m_CopyToOutputs[ file ] = matchNode.CopyToOutput; + m_PreservePaths[ file ] = matchNode.PreservePath; + m_Links[ file ] = matchNode.IsLink; + m_LinkPaths[ file ] = matchNode.LinkPath; + m_CopyToOutputs[ file ] = matchNode.CopyToOutput; } } @@ -232,11 +193,7 @@ namespace Prebuild.Core.Nodes // TODO: Check in to why StringCollection's enumerator doesn't implement // IEnumerator? - /// - /// - /// - /// - public StringEnumerator GetEnumerator() + public IEnumerator GetEnumerator() { return m_Files.GetEnumerator(); } diff --git a/Prebuild/src/Core/Nodes/MatchNode.cs b/Prebuild/src/Core/Nodes/MatchNode.cs index 656d7d0718..9735265f05 100644 --- a/Prebuild/src/Core/Nodes/MatchNode.cs +++ b/Prebuild/src/Core/Nodes/MatchNode.cs @@ -25,7 +25,6 @@ IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY O using System; using System.Collections.Generic; -using System.Collections.Specialized; using System.IO; using System.Text.RegularExpressions; using System.Xml; @@ -33,7 +32,6 @@ using System.Xml; using Prebuild.Core.Attributes; using Prebuild.Core.Interfaces; using Prebuild.Core.Utilities; -using System.Collections; namespace Prebuild.Core.Nodes { @@ -45,7 +43,7 @@ namespace Prebuild.Core.Nodes { #region Fields - private readonly StringCollection m_Files = new StringCollection(); + private readonly List m_Files = new List(); private Regex m_Regex; private BuildAction? m_BuildAction; private SubType? m_SubType; @@ -63,7 +61,7 @@ namespace Prebuild.Core.Nodes /// /// /// - public StringCollection Files + public IEnumerable Files { get { @@ -97,7 +95,7 @@ namespace Prebuild.Core.Nodes { get { - return this.m_CopyToOutput; + return m_CopyToOutput; } } @@ -105,7 +103,7 @@ namespace Prebuild.Core.Nodes { get { - return this.m_Link; + return m_Link; } } @@ -113,7 +111,7 @@ namespace Prebuild.Core.Nodes { get { - return this.m_LinkPath; + return m_LinkPath; } } /// @@ -149,21 +147,35 @@ namespace Prebuild.Core.Nodes private void RecurseDirectories(string path, string pattern, bool recurse, bool useRegex, List exclusions) { Match match; - Boolean excludeFile; - try + try { string[] files; - if(!useRegex) + Boolean excludeFile; + if(!useRegex) { - files = Directory.GetFiles(path, pattern); + try + { + files = Directory.GetFiles(path, pattern); + } + catch (IOException) + { + // swallow weird IOException error when running in a virtual box + // guest OS on a network share when the host OS is not Windows. + // This seems to happen on network shares + // when no files match, and may be related to this report: + // http://connect.microsoft.com/VisualStudio/feedback/ViewFeedback.aspx?FeedbackID=254546 + + files = null; + } + if(files != null) { - string fileTemp; - foreach (string file in files) + foreach (string file in files) { excludeFile = false; - if (file.Substring(0,2) == "./" || file.Substring(0,2) == ".\\") + string fileTemp; + if (file.Substring(0,2) == "./" || file.Substring(0,2) == ".\\") { fileTemp = file.Substring(2); } @@ -187,47 +199,64 @@ namespace Prebuild.Core.Nodes } } - else - { - return; - } + + // don't call return here, because we may need to recursively search directories below + // this one, even if no matches were found in this directory. } else { - files = Directory.GetFiles(path); - foreach(string file in files) - { - excludeFile = false; - - match = m_Regex.Match(file); - if(match.Success) - { - // Check all excludions and set flag if there are any hits. - foreach ( ExcludeNode exclude in exclusions ) - { - Regex exRegEx = new Regex( exclude.Pattern ); - match = exRegEx.Match( file ); - excludeFile |= !match.Success; - } - - if ( !excludeFile ) - { - m_Files.Add( file ); - } - } + try + { + files = Directory.GetFiles(path); } + catch (IOException) + { + // swallow weird IOException error when running in a virtual box + // guest OS on a network share. + files = null; + } + + if (files != null) + { + foreach (string file in files) + { + excludeFile = false; + + match = m_Regex.Match(file); + if (match.Success) + { + // Check all excludions and set flag if there are any hits. + foreach (ExcludeNode exclude in exclusions) + { + Regex exRegEx = new Regex(exclude.Pattern); + match = exRegEx.Match(file); + excludeFile |= !match.Success; + } + + if (!excludeFile) + { + m_Files.Add(file); + } + } + } + } } if(recurse) { string[] dirs = Directory.GetDirectories(path); if(dirs != null && dirs.Length > 0) - { - foreach(string str in dirs) - { - RecurseDirectories(Helper.NormalizePath(str), pattern, recurse, useRegex, exclusions); - } - } + { + foreach (string str in dirs) + { + // hack to skip subversion folders. Not having this can cause + // a significant performance hit when running on a network drive. + if (str.EndsWith(".svn")) + continue; + + RecurseDirectories(Helper.NormalizePath(str), pattern, recurse, useRegex, exclusions); + } + } } } catch(DirectoryNotFoundException) @@ -266,14 +295,14 @@ namespace Prebuild.Core.Nodes //string subType = Helper.AttributeValue(node, "subType", string.Empty); //if (subType != String.Empty) // m_SubType = (SubType)Enum.Parse(typeof(SubType), subType); - m_ResourceName = Helper.AttributeValue(node, "resourceName", m_ResourceName.ToString()); - this.m_CopyToOutput = (CopyToOutput) Enum.Parse(typeof(CopyToOutput), Helper.AttributeValue(node, "copyToOutput", this.m_CopyToOutput.ToString())); - this.m_Link = bool.Parse(Helper.AttributeValue(node, "link", bool.FalseString)); - if ( this.m_Link == true ) + m_ResourceName = Helper.AttributeValue(node, "resourceName", m_ResourceName); + m_CopyToOutput = (CopyToOutput) Enum.Parse(typeof(CopyToOutput), Helper.AttributeValue(node, "copyToOutput", m_CopyToOutput.ToString())); + m_Link = bool.Parse(Helper.AttributeValue(node, "link", bool.FalseString)); + if ( m_Link ) { - this.m_LinkPath = Helper.AttributeValue( node, "linkPath", string.Empty ); + m_LinkPath = Helper.AttributeValue( node, "linkPath", string.Empty ); } - this.m_PreservePath = bool.Parse( Helper.AttributeValue( node, "preservePath", bool.FalseString ) ); + m_PreservePath = bool.Parse( Helper.AttributeValue( node, "preservePath", bool.FalseString ) ); if(path != null && path.Length == 0) @@ -318,11 +347,19 @@ namespace Prebuild.Core.Nodes RecurseDirectories( path, pattern, recurse, useRegex, m_Exclusions ); - if(m_Files.Count < 1) - { - throw new WarningException("Match returned no files: {0}{1}", Helper.EndPath(path), pattern); - } - m_Regex = null; + if (m_Files.Count < 1) + { + // Include the project name when the match node returns no matches to provide extra + // debug info. + ProjectNode project = Parent.Parent as ProjectNode; + string projectName = ""; + + if (project != null) + projectName = " in project " + project.AssemblyName; + + throw new WarningException("Match" + projectName + " returned no files: {0}{1}", Helper.EndPath(path), pattern); + } + m_Regex = null; } #endregion diff --git a/Prebuild/src/Core/Nodes/OptionsNode.cs b/Prebuild/src/Core/Nodes/OptionsNode.cs index b63034bfe8..577de710ed 100644 --- a/Prebuild/src/Core/Nodes/OptionsNode.cs +++ b/Prebuild/src/Core/Nodes/OptionsNode.cs @@ -24,8 +24,7 @@ IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY O #endregion using System; -using System.Collections; -using System.Collections.Specialized; +using System.Collections.Generic; using System.Reflection; using System.Xml; @@ -43,7 +42,7 @@ namespace Prebuild.Core.Nodes { #region Fields - private static Hashtable m_OptionFields; + private static readonly Dictionary m_OptionFields = new Dictionary(); [OptionNode("CompilerDefines")] private string m_CompilerDefines = ""; @@ -495,7 +494,7 @@ namespace Prebuild.Core.Nodes } } - private StringCollection m_FieldsDefined; + private readonly List m_FieldsDefined = new List(); #endregion @@ -508,7 +507,6 @@ namespace Prebuild.Core.Nodes { Type t = typeof(OptionsNode); - m_OptionFields = new Hashtable(); foreach(FieldInfo f in t.GetFields(BindingFlags.NonPublic | BindingFlags.Instance)) { object[] attrs = f.GetCustomAttributes(typeof(OptionNodeAttribute), false); @@ -522,14 +520,6 @@ namespace Prebuild.Core.Nodes } } - /// - /// Initializes a new instance of the class. - /// - public OptionsNode() - { - m_FieldsDefined = new StringCollection(); - } - #endregion #region Properties @@ -547,7 +537,7 @@ namespace Prebuild.Core.Nodes return null; } - FieldInfo f = (FieldInfo)m_OptionFields[index]; + FieldInfo f = m_OptionFields[index]; return f.GetValue(this); } } @@ -591,7 +581,7 @@ namespace Prebuild.Core.Nodes return; } - FieldInfo f = (FieldInfo)m_OptionFields[nodeName]; + FieldInfo f = m_OptionFields[nodeName]; f.SetValue(this, Helper.TranslateValue(f.FieldType, val)); FlagDefined(f.Name); } diff --git a/Prebuild/src/Core/Nodes/ProcessNode.cs b/Prebuild/src/Core/Nodes/ProcessNode.cs index 6bfbe16be3..8ca8e493d2 100644 --- a/Prebuild/src/Core/Nodes/ProcessNode.cs +++ b/Prebuild/src/Core/Nodes/ProcessNode.cs @@ -24,8 +24,6 @@ IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY O #endregion using System; -using System.Collections; -using System.Collections.Specialized; using System.Xml; using Prebuild.Core.Attributes; diff --git a/Prebuild/src/Core/Nodes/ProjectNode.cs b/Prebuild/src/Core/Nodes/ProjectNode.cs index 04af7a3582..fb92b32e73 100644 --- a/Prebuild/src/Core/Nodes/ProjectNode.cs +++ b/Prebuild/src/Core/Nodes/ProjectNode.cs @@ -24,7 +24,6 @@ IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY O #endregion using System; -using System.Collections; using System.Collections.Generic; using System.IO; using System.Xml; @@ -90,10 +89,10 @@ namespace Prebuild.Core.Nodes /// .NET 3.5 /// v3_5, - /// - /// .NET 4.0 - /// - v4_0, + /// + /// .NET 4.0 + /// + v4_0, } /// /// The Node object representing /Prebuild/Solution/Project elements @@ -121,7 +120,7 @@ namespace Prebuild.Core.Nodes private Guid m_Guid; private string m_DebugStartParameters; - private Hashtable m_Configurations = new Hashtable(); + private readonly Dictionary m_Configurations = new Dictionary(); private readonly List m_ReferencePaths = new List(); private readonly List m_References = new List(); private readonly List m_Authors = new List(); @@ -149,7 +148,7 @@ namespace Prebuild.Core.Nodes { get { - return this.m_Framework; + return m_Framework; } } /// @@ -283,7 +282,7 @@ namespace Prebuild.Core.Nodes } } - private bool m_GenerateAssemblyInfoFile = false; + private bool m_GenerateAssemblyInfoFile; /// /// @@ -328,11 +327,11 @@ namespace Prebuild.Core.Nodes /// Gets the configurations. /// /// The configurations. - public IList Configurations + public List Configurations { get { - ArrayList tmp = new ArrayList(ConfigurationsTable.Values); + List tmp = new List(ConfigurationsTable.Values); tmp.Sort(); return tmp; } @@ -342,7 +341,7 @@ namespace Prebuild.Core.Nodes /// Gets the configurations table. /// /// The configurations table. - public Hashtable ConfigurationsTable + public Dictionary ConfigurationsTable { get { @@ -420,7 +419,7 @@ namespace Prebuild.Core.Nodes SolutionNode parent = (SolutionNode)base.Parent; foreach(ConfigurationNode conf in parent.Configurations) { - m_Configurations[conf.Name] = conf.Clone(); + m_Configurations[conf.NameAndPlatform] = (ConfigurationNode) conf.Clone(); } } } @@ -455,19 +454,19 @@ namespace Prebuild.Core.Nodes if(String.Compare(conf.Name, "all", true) == 0) //apply changes to all, this may not always be applied first, //so it *may* override changes to the same properties for configurations defines at the project level { - foreach(ConfigurationNode confNode in this.m_Configurations.Values) + foreach(ConfigurationNode confNode in m_Configurations.Values) { conf.CopyTo(confNode);//update the config templates defines at the project level with the overrides } } - if(m_Configurations.ContainsKey(conf.Name)) + if(m_Configurations.ContainsKey(conf.NameAndPlatform)) { - ConfigurationNode parentConf = (ConfigurationNode)m_Configurations[conf.Name]; + ConfigurationNode parentConf = m_Configurations[conf.NameAndPlatform]; conf.CopyTo(parentConf);//update the config templates defines at the project level with the overrides } else { - m_Configurations[conf.Name] = conf; + m_Configurations[conf.NameAndPlatform] = conf; } } @@ -504,12 +503,12 @@ namespace Prebuild.Core.Nodes m_GenerateAssemblyInfoFile = Helper.ParseBoolean(node, "generateAssemblyInfoFile", false); m_DebugStartParameters = Helper.AttributeValue(node, "debugStartParameters", string.Empty); - if(m_AssemblyName == null || m_AssemblyName.Length < 1) + if(string.IsNullOrEmpty(m_AssemblyName)) { m_AssemblyName = m_Name; } - if(m_RootNamespace == null || m_RootNamespace.Length < 1) + if(string.IsNullOrEmpty(m_RootNamespace)) { m_RootNamespace = m_Name; } @@ -572,7 +571,7 @@ namespace Prebuild.Core.Nodes public int CompareTo(object obj) { ProjectNode that = (ProjectNode)obj; - return this.m_Name.CompareTo(that.m_Name); + return m_Name.CompareTo(that.m_Name); } #endregion diff --git a/Prebuild/src/Core/Nodes/ReferencePathNode.cs b/Prebuild/src/Core/Nodes/ReferencePathNode.cs index f0543c267e..7331cd7b58 100644 --- a/Prebuild/src/Core/Nodes/ReferencePathNode.cs +++ b/Prebuild/src/Core/Nodes/ReferencePathNode.cs @@ -24,8 +24,6 @@ IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY O #endregion using System; -using System.Collections; -using System.Collections.Specialized; using System.Xml; using Prebuild.Core.Attributes; diff --git a/Prebuild/src/Core/Nodes/SolutionNode.cs b/Prebuild/src/Core/Nodes/SolutionNode.cs index 2a1b8e2c55..10c02234da 100644 --- a/Prebuild/src/Core/Nodes/SolutionNode.cs +++ b/Prebuild/src/Core/Nodes/SolutionNode.cs @@ -24,10 +24,8 @@ IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY O #endregion using System; -using System.Collections; using System.Collections.Generic; using System.Diagnostics; -using System.IO; using System.Xml; using Prebuild.Core.Attributes; @@ -50,18 +48,19 @@ namespace Prebuild.Core.Nodes private string m_Name = "unknown"; private string m_Path = ""; private string m_FullPath = ""; - private string m_ActiveConfig = "Debug"; + private string m_ActiveConfig; private string m_Version = "1.0.0"; private OptionsNode m_Options; private FilesNode m_Files; - private readonly Hashtable m_Configurations = new Hashtable(); - private readonly Hashtable m_Projects = new Hashtable(); - private readonly Hashtable m_DatabaseProjects = new Hashtable(); + private readonly ConfigurationNodeCollection m_Configurations = new ConfigurationNodeCollection(); + private readonly Dictionary m_Projects = new Dictionary(); + private readonly Dictionary m_DatabaseProjects = new Dictionary(); private readonly List m_ProjectsOrder = new List(); - private readonly Hashtable m_Solutions = new Hashtable(); + private readonly Dictionary m_Solutions = new Dictionary(); + private CleanupNode m_Cleanup; - #endregion + #endregion #region Properties public override IDataNode Parent @@ -77,7 +76,7 @@ namespace Prebuild.Core.Nodes SolutionNode solution = (SolutionNode)value; foreach (ConfigurationNode conf in solution.Configurations) { - m_Configurations[conf.Name] = conf.Clone(); + m_Configurations[conf.Name] = (ConfigurationNode) conf.Clone(); } } @@ -85,6 +84,18 @@ namespace Prebuild.Core.Nodes } } + public CleanupNode Cleanup + { + get + { + return m_Cleanup; + } + set + { + m_Cleanup = value; + } + } + public Guid Guid { get @@ -188,13 +199,13 @@ namespace Prebuild.Core.Nodes /// Gets the configurations. /// /// The configurations. - public ICollection Configurations + public ConfigurationNodeCollection Configurations { get { - ArrayList tmp = new ArrayList(ConfigurationsTable.Values); - tmp.Sort(); - return tmp; + ConfigurationNodeCollection tmp = new ConfigurationNodeCollection(); + tmp.AddRange(ConfigurationsTable); + return tmp; } } @@ -202,7 +213,7 @@ namespace Prebuild.Core.Nodes /// Gets the configurations table. /// /// The configurations table. - public Hashtable ConfigurationsTable + public ConfigurationNodeCollection ConfigurationsTable { get { @@ -212,7 +223,7 @@ namespace Prebuild.Core.Nodes /// /// Gets the database projects. /// - public ICollection DatabaseProjects + public ICollection DatabaseProjects { get { @@ -222,7 +233,7 @@ namespace Prebuild.Core.Nodes /// /// Gets the nested solutions. /// - public ICollection Solutions + public ICollection Solutions { get { @@ -232,22 +243,22 @@ namespace Prebuild.Core.Nodes /// /// Gets the nested solutions hash table. /// - public Hashtable SolutionsTable + public Dictionary SolutionsTable { get { - return this.m_Solutions; + return m_Solutions; } } /// /// Gets the projects. /// /// The projects. - public ICollection Projects + public ICollection Projects { get { - ArrayList tmp = new ArrayList(m_Projects.Values); + List tmp = new List(m_Projects.Values); tmp.Sort(); return tmp; } @@ -257,7 +268,7 @@ namespace Prebuild.Core.Nodes /// Gets the projects table. /// /// The projects table. - public Hashtable ProjectsTable + public Dictionary ProjectsTable { get { @@ -325,16 +336,23 @@ namespace Prebuild.Core.Nodes } else if(dataNode is ConfigurationNode) { - m_Configurations[((ConfigurationNode)dataNode).Name] = dataNode; + ConfigurationNode configurationNode = (ConfigurationNode) dataNode; + m_Configurations[configurationNode.NameAndPlatform] = configurationNode; + + // If the active configuration is null, then we populate it. + if (ActiveConfig == null) + { + ActiveConfig = configurationNode.Name; + } } else if(dataNode is ProjectNode) { - m_Projects[((ProjectNode)dataNode).Name] = dataNode; + m_Projects[((ProjectNode)dataNode).Name] = (ProjectNode) dataNode; m_ProjectsOrder.Add((ProjectNode)dataNode); } else if(dataNode is SolutionNode) { - m_Solutions[((SolutionNode)dataNode).Name] = dataNode; + m_Solutions[((SolutionNode)dataNode).Name] = (SolutionNode) dataNode; } else if (dataNode is ProcessNode) { @@ -343,7 +361,13 @@ namespace Prebuild.Core.Nodes } else if (dataNode is DatabaseProjectNode) { - m_DatabaseProjects[((DatabaseProjectNode)dataNode).Name] = dataNode; + m_DatabaseProjects[((DatabaseProjectNode)dataNode).Name] = (DatabaseProjectNode) dataNode; + } + else if(dataNode is CleanupNode) + { + if(m_Cleanup != null) + throw new WarningException("There can only be one Cleanup node."); + m_Cleanup = (CleanupNode)dataNode; } } } diff --git a/Prebuild/src/Core/Parse/Preprocessor.cs b/Prebuild/src/Core/Parse/Preprocessor.cs index b2306e43db..0648fad8d8 100644 --- a/Prebuild/src/Core/Parse/Preprocessor.cs +++ b/Prebuild/src/Core/Parse/Preprocessor.cs @@ -24,7 +24,7 @@ IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY O #endregion using System; -using System.Collections; +using System.Collections.Generic; using System.IO; using System.Text.RegularExpressions; using System.Xml; @@ -83,9 +83,9 @@ namespace Prebuild.Core.Parse #region Fields - XmlDocument m_OutDoc; - Stack m_IfStack; - Hashtable m_Variables; + readonly XmlDocument m_OutDoc = new XmlDocument(); + readonly Stack m_IfStack = new Stack(); + readonly Dictionary m_Variables = new Dictionary(); #endregion @@ -96,10 +96,6 @@ namespace Prebuild.Core.Parse ///
public Preprocessor() { - m_OutDoc = new XmlDocument(); - m_IfStack = new Stack(); - m_Variables = new Hashtable(); - RegisterVariable("OS", GetOS()); RegisterVariable("RuntimeVersion", Environment.Version.Major); RegisterVariable("RuntimeMajor", Environment.Version.Major); @@ -237,11 +233,10 @@ namespace Prebuild.Core.Parse string str = ""; OperatorSymbol oper = OperatorSymbol.None; bool inStr = false; - char c; - - for(int i = 0; i < exp.Length; i++) + + for(int i = 0; i < exp.Length; i++) { - c = exp[i]; + char c = exp[i]; if(Char.IsWhiteSpace(c)) { continue; @@ -326,16 +321,16 @@ namespace Prebuild.Core.Parse { throw new WarningException("Expected operator in expression"); } - else if(id.Length < 1) - { - throw new WarningException("Expected identifier in expression"); - } - else if(str.Length < 1) - { - throw new WarningException("Expected value in expression"); - } + if(id.Length < 1) + { + throw new WarningException("Expected identifier in expression"); + } + if(str.Length < 1) + { + throw new WarningException("Expected value in expression"); + } - bool ret = false; + bool ret; try { object val = m_Variables[id.ToLower()]; @@ -344,19 +339,17 @@ namespace Prebuild.Core.Parse throw new WarningException("Unknown identifier '{0}'", id); } - int numVal, numVal2; - string strVal, strVal2; - Type t = val.GetType(); + Type t = val.GetType(); if(t.IsAssignableFrom(typeof(int))) { - numVal = (int)val; - numVal2 = Int32.Parse(str); + int numVal = (int)val; + int numVal2 = Int32.Parse(str); ret = CompareNum(oper, numVal, numVal2); } else { - strVal = val.ToString(); - strVal2 = str; + string strVal = val.ToString(); + string strVal2 = str; ret = CompareStr(oper, strVal, strVal2); } } @@ -369,6 +362,70 @@ namespace Prebuild.Core.Parse return ret; } + /// + /// Taken from current Prebuild included in OpenSim 0.7.x + /// + /// + /// A + /// + /// + /// A + /// + private static void WildCardInclude (Stack readerStack, string include) + { + if (!include.Contains ("*")) { + return; + } + + // Console.WriteLine("Processing {0}", include); + + // Break up the include into pre and post wildcard sections + string preWildcard = include.Substring (0, include.IndexOf ("*")); + string postWildcard = include.Substring (include.IndexOf ("*") + 2); + + // If preWildcard is a directory, recurse + if (Directory.Exists (preWildcard)) { + string[] directories = Directory.GetDirectories (preWildcard); + Array.Sort (directories); + Array.Reverse (directories); + foreach (string dirPath in directories) { + //Console.WriteLine ("Scanning : {0}", dirPath); + + string includeFile = Path.Combine (dirPath, postWildcard); + if (includeFile.Contains ("*")) { + // postWildcard included another wildcard, recurse. + WildCardInclude (readerStack, includeFile); + } else { + FileInfo file = new FileInfo (includeFile); + if (file.Exists) { + //Console.WriteLine ("Including File: {0}", includeFile); + XmlReader newReader = new XmlTextReader (file.Open (FileMode.Open, FileAccess.Read, FileShare.Read)); + readerStack.Push (newReader); + } + } + } + } else { + // preWildcard is not a path to a directory, so the wildcard is in the filename + string searchFilename = Path.GetFileName (preWildcard.Substring (preWildcard.IndexOf ("/") + 1) + "*" + postWildcard); + Console.WriteLine ("searchFilename: {0}", searchFilename); + + string searchDirectory = Path.GetDirectoryName (preWildcard); + Console.WriteLine ("searchDirectory: {0}", searchDirectory); + + string[] files = Directory.GetFiles (searchDirectory, searchFilename); + Array.Sort (files); + Array.Reverse (files); + foreach (string includeFile in files) { + FileInfo file = new FileInfo (includeFile); + if (file.Exists) { + // Console.WriteLine ("Including File: {0}", includeFile); + XmlReader newReader = new XmlTextReader (file.Open (FileMode.Open, FileAccess.Read, FileShare.Read)); + readerStack.Push (newReader); + } + } + } + } + #endregion #region Public Methods @@ -392,7 +449,7 @@ namespace Prebuild.Core.Parse /// Performs validation on the xml source as well as evaluates conditional and flow expresions ///
/// For invalid use of conditional expressions or for invalid XML syntax. If a XmlValidatingReader is passed, then will also throw exceptions for non-schema-conforming xml - /// + /// /// the output xml public string Process(XmlReader initialReader) { @@ -411,13 +468,13 @@ namespace Prebuild.Core.Parse // readers which lets the operation add more // readers to generate a multi-file parser and not require // XML fragments that a recursive version would use. - Stack readerStack = new Stack(); + Stack readerStack = new Stack(); readerStack.Push(initialReader); while(readerStack.Count > 0) { // Pop off the next reader. - XmlReader reader = (XmlReader) readerStack.Pop(); + XmlReader reader = readerStack.Pop(); // Process through this XML reader until it is // completed (or it is replaced by the include @@ -437,7 +494,7 @@ namespace Prebuild.Core.Parse case "include": // use regular expressions to parse out the attributes. MatchCollection matches = includeFileRegex.Matches(reader.Value); - + // make sure there is only one file attribute. if(matches.Count > 1) { @@ -448,38 +505,37 @@ namespace Prebuild.Core.Parse { throw new WarningException("An node was found, but it did not specify the file attribute."); } - + + // ***** Adding for wildcard handling // Push current reader back onto the stack. - readerStack.Push(reader); - - // Pull the file out from the regex and make sure it is a valid file before using it. - string filename = matches[0].Groups[1].Value; - - filename = String.Join(Path.DirectorySeparatorChar.ToString(), filename.Split(new char[] { '/', '\\' })); - - if (!filename.Contains("*")) - { - FileInfo includeFile = new FileInfo(filename); - - if (!includeFile.Exists) - { - throw new WarningException("Cannot include file: " + includeFile.FullName); + readerStack.Push (reader); + + // Pull the file out from the regex and make sure it is a valid file before using it. + string filename = matches[0].Groups[1].Value; + + filename = String.Join (Path.DirectorySeparatorChar.ToString (), filename.Split (new char[] { '/', '\\' })); + + if (!filename.Contains ("*")) { + + FileInfo includeFile = new FileInfo (filename); + if (!includeFile.Exists) { + throw new WarningException ("Cannot include file: " + includeFile.FullName); } - - // Create a new reader object for this file, and push it onto the stack - XmlReader newReader = new XmlTextReader(includeFile.Open(FileMode.Open, FileAccess.Read, FileShare.Read)); - readerStack.Push(newReader); + + // Create a new reader object for this file. Then put the old reader back on the stack and start + // processing using this new XML reader. + + XmlReader newReader = new XmlTextReader (includeFile.Open (FileMode.Open, FileAccess.Read, FileShare.Read)); + reader = newReader; + readerStack.Push (reader); + + } else { + WildCardInclude (readerStack, filename); } - else - { - WildCardInclude(readerStack, filename); - } - - // continue reading with whatever reader is on the top of the stack - reader = (XmlReader)readerStack.Pop(); + + reader = (XmlReader)readerStack.Pop (); ignore = true; - - break; + break; case "if": m_IfStack.Push(context); @@ -492,12 +548,12 @@ namespace Prebuild.Core.Parse { throw new WarningException("Unexpected 'elseif' outside of 'if'"); } - else if(context.State != IfState.If && context.State != IfState.ElseIf) - { - throw new WarningException("Unexpected 'elseif' outside of 'if'"); - } + if(context.State != IfState.If && context.State != IfState.ElseIf) + { + throw new WarningException("Unexpected 'elseif' outside of 'if'"); + } - context.State = IfState.ElseIf; + context.State = IfState.ElseIf; if(!context.EverKept) { context.Keep = ParseExpression(reader.Value); @@ -515,12 +571,12 @@ namespace Prebuild.Core.Parse { throw new WarningException("Unexpected 'else' outside of 'if'"); } - else if(context.State != IfState.If && context.State != IfState.ElseIf) - { - throw new WarningException("Unexpected 'else' outside of 'if'"); - } + if(context.State != IfState.If && context.State != IfState.ElseIf) + { + throw new WarningException("Unexpected 'else' outside of 'if'"); + } - context.State = IfState.Else; + context.State = IfState.Else; context.Keep = !context.EverKept; ignore = true; break; @@ -531,7 +587,7 @@ namespace Prebuild.Core.Parse throw new WarningException("Unexpected 'endif' outside of 'if'"); } - context = (IfContext)m_IfStack.Pop(); + context = m_IfStack.Pop(); ignore = true; break; } @@ -591,73 +647,6 @@ namespace Prebuild.Core.Parse return xmlText.ToString(); } - private static void WildCardInclude(Stack readerStack, string include) - { - if (!include.Contains("*")) - { - return; - } - -// Console.WriteLine("Processing {0}", include); - - // Break up the include into pre and post wildcard sections - string preWildcard = include.Substring(0, include.IndexOf("*")); - string postWildcard = include.Substring(include.IndexOf("*") + 2); - - // If preWildcard is a directory, recurse - if (Directory.Exists(preWildcard)) - { - string[] directories = Directory.GetDirectories(preWildcard); - Array.Sort(directories); - Array.Reverse(directories); - foreach (string dirPath in directories ) - { - Console.WriteLine("Scanning : {0}", dirPath); - - string includeFile = Path.Combine(dirPath, postWildcard); - if (includeFile.Contains("*")) - { - // postWildcard included another wildcard, recurse. - WildCardInclude(readerStack, includeFile); - } - else - { - FileInfo file = new FileInfo(includeFile); - if (file.Exists) - { - Console.WriteLine("Including File: {0}", includeFile); - XmlReader newReader = new XmlTextReader(file.Open(FileMode.Open, FileAccess.Read, FileShare.Read)); - readerStack.Push(newReader); - } - } - } - } - else - { - // preWildcard is not a path to a directory, so the wildcard is in the filename - string searchFilename = Path.GetFileName(preWildcard.Substring(preWildcard.IndexOf("/") + 1) + "*" + postWildcard); - // Console.WriteLine("searchFilename: {0}", searchFilename); - - string searchDirectory = Path.GetDirectoryName(preWildcard); - // Console.WriteLine("searchDirectory: {0}", searchDirectory); - - string[] files = Directory.GetFiles(searchDirectory, searchFilename); - Array.Sort(files); - Array.Reverse(files); - foreach (string includeFile in files) - { - FileInfo file = new FileInfo(includeFile); - if (file.Exists) - { - Console.WriteLine("Including File: {0}", includeFile); - XmlReader newReader = new XmlTextReader(file.Open(FileMode.Open, FileAccess.Read, FileShare.Read)); - readerStack.Push(newReader); - } - } - } - - } - #endregion } } diff --git a/Prebuild/src/Core/Targets/.NAntTarget.cs.swp b/Prebuild/src/Core/Targets/.NAntTarget.cs.swp new file mode 100644 index 0000000000..afec61c43b Binary files /dev/null and b/Prebuild/src/Core/Targets/.NAntTarget.cs.swp differ diff --git a/Prebuild/src/Core/Targets/AutotoolsTarget.cs b/Prebuild/src/Core/Targets/AutotoolsTarget.cs index 5dcbb38269..485e4dd724 100644 --- a/Prebuild/src/Core/Targets/AutotoolsTarget.cs +++ b/Prebuild/src/Core/Targets/AutotoolsTarget.cs @@ -66,9 +66,7 @@ POSSIBILITY OF SUCH DAMAGE. #endregion using System; -using System.Collections; using System.Collections.Generic; -using System.Collections.Specialized; using System.IO; using System.Reflection; using System.Text; @@ -81,7 +79,6 @@ using System.Diagnostics; using Prebuild.Core.Attributes; using Prebuild.Core.Interfaces; using Prebuild.Core.Nodes; -using Prebuild.Core.Parse; using Prebuild.Core.Utilities; namespace Prebuild.Core.Targets @@ -170,16 +167,16 @@ namespace Prebuild.Core.Targets XmlDocument autotoolsDoc; XmlUrlResolver xr; System.Security.Policy.Evidence e; - Hashtable assemblyPathToPackage = new Hashtable(); - Hashtable assemblyFullNameToPath = new Hashtable(); - Hashtable packagesHash = new Hashtable(); + readonly Dictionary assemblyPathToPackage = new Dictionary(); + readonly Dictionary assemblyFullNameToPath = new Dictionary(); + readonly Dictionary packagesHash = new Dictionary(); readonly List packages = new List(); #endregion #region Private Methods - private void mkdirDashP(string dirName) + private static void mkdirDashP(string dirName) { DirectoryInfo di = new DirectoryInfo(dirName); if (di.Exists) @@ -193,7 +190,7 @@ namespace Prebuild.Core.Targets di.Create(); } - private void chkMkDir(string dirName) + private static void chkMkDir(string dirName) { System.IO.DirectoryInfo di = new System.IO.DirectoryInfo(dirName); @@ -222,13 +219,12 @@ namespace Prebuild.Core.Targets (m_Kernel.CurrentDoc, argList, templateWriter, xr); } - string NormalizeAsmName(string name) + static string NormalizeAsmName(string name) { int i = name.IndexOf(", PublicKeyToken=null"); if (i != -1) return name.Substring(0, i).Trim(); - else - return name; + return name; } private void AddAssembly(string assemblyfile, SystemPackage package) @@ -247,7 +243,7 @@ namespace Prebuild.Core.Targets } } - private List GetAssembliesWithLibInfo(string line, string file) + private static List GetAssembliesWithLibInfo(string line, string file) { List references = new List(); List libdirs = new List(); @@ -278,7 +274,7 @@ namespace Prebuild.Core.Targets return retval; } - private List GetAssembliesWithoutLibInfo(string line, string file) + private static List GetAssembliesWithoutLibInfo(string line, string file) { List references = new List(); foreach (string reference in line.Split(' ')) @@ -292,7 +288,7 @@ namespace Prebuild.Core.Targets return references; } - private string ProcessPiece(string piece, string pcfile) + private static string ProcessPiece(string piece, string pcfile) { int start = piece.IndexOf("${"); if (start == -1) @@ -307,7 +303,7 @@ namespace Prebuild.Core.Targets return ProcessPiece(piece.Replace("${" + variable + "}", interp), pcfile); } - private string GetVariableFromPkgConfig(string var, string pcfile) + private static string GetVariableFromPkgConfig(string var, string pcfile) { ProcessStartInfo psi = new ProcessStartInfo("pkg-config"); psi.RedirectStandardOutput = true; @@ -327,7 +323,7 @@ namespace Prebuild.Core.Targets { // Don't register the package twice string pname = Path.GetFileNameWithoutExtension(pcfile); - if (packagesHash.Contains(pname)) + if (packagesHash.ContainsKey(pname)) return; List fullassemblies = null; @@ -507,158 +503,6 @@ namespace Prebuild.Core.Targets WriteProject(solution, project); } } - private static string PrependPath(string path) - { - string tmpPath = Helper.NormalizePath(path, '/'); - Regex regex = new Regex(@"(\w):/(\w+)"); - Match match = regex.Match(tmpPath); - if (match.Success || tmpPath[0] == '.' || tmpPath[0] == '/') - { - tmpPath = Helper.NormalizePath(tmpPath); - } - else - { - tmpPath = Helper.NormalizePath("./" + tmpPath); - } - - return tmpPath; - } - - private static string BuildReference(SolutionNode solution, - ReferenceNode refr) - { - string ret = ""; - if (solution.ProjectsTable.ContainsKey(refr.Name)) - { - ProjectNode project = - (ProjectNode)solution.ProjectsTable[refr.Name]; - string fileRef = FindFileReference(refr.Name, project); - string finalPath = - Helper.NormalizePath(Helper.MakeFilePath(project.FullPath + - "/$(BUILD_DIR)/$(CONFIG)/", - refr.Name, "dll"), - '/'); - ret += finalPath; - return ret; - } - else - { - ProjectNode project = (ProjectNode)refr.Parent; - string fileRef = FindFileReference(refr.Name, project); - - if (refr.Path != null || fileRef != null) - { - string finalPath = ((refr.Path != null) ? - Helper.NormalizePath(refr.Path + "/" + - refr.Name + ".dll", - '/') : - fileRef - ); - ret += Path.Combine(project.Path, finalPath); - return ret; - } - - try - { - //Assembly assem = Assembly.Load(refr.Name); - //if (assem != null) - //{ - // int index = refr.Name.IndexOf(","); - // if ( index > 0) - // { - // ret += assem.Location; - // //Console.WriteLine("Location1: " + assem.Location); - // } - // else - // { - // ret += (refr.Name + ".dll"); - // //Console.WriteLine("Location2: " + assem.Location); - // } - //} - //else - //{ - int index = refr.Name.IndexOf(","); - if (index > 0) - { - ret += refr.Name.Substring(0, index) + ".dll"; - //Console.WriteLine("Location3: " + assem.Location); - } - else - { - ret += (refr.Name + ".dll"); - //Console.WriteLine("Location4: " + assem.Location); - } - //} - } - catch (System.NullReferenceException e) - { - e.ToString(); - int index = refr.Name.IndexOf(","); - if (index > 0) - { - ret += refr.Name.Substring(0, index) + ".dll"; - //Console.WriteLine("Location5: " + assem.Location); - } - else - { - ret += (refr.Name + ".dll"); - //Console.WriteLine("Location6: " + assem.Location); - } - } - } - return ret; - } - - private static string BuildReferencePath(SolutionNode solution, - ReferenceNode refr) - { - string ret = ""; - if (solution.ProjectsTable.ContainsKey(refr.Name)) - { - ProjectNode project = - (ProjectNode)solution.ProjectsTable[refr.Name]; - string finalPath = - Helper.NormalizePath(Helper.MakeReferencePath(project.FullPath + - "/${build.dir}/"), - '/'); - ret += finalPath; - return ret; - } - else - { - ProjectNode project = (ProjectNode)refr.Parent; - string fileRef = FindFileReference(refr.Name, project); - - if (refr.Path != null || fileRef != null) - { - string finalPath = ((refr.Path != null) ? - Helper.NormalizePath(refr.Path, '/') : - fileRef - ); - ret += finalPath; - return ret; - } - - try - { - Assembly assem = Assembly.Load(refr.Name); - if (assem != null) - { - ret += ""; - } - else - { - ret += ""; - } - } - catch (System.NullReferenceException e) - { - e.ToString(); - ret += ""; - } - } - return ret; - } private static string FindFileReference(string refName, ProjectNode project) @@ -831,7 +675,7 @@ namespace Prebuild.Core.Targets } catch { - Console.WriteLine("Error! '{0}'", e.ToString()); + Console.WriteLine("Error! '{0}'", e); } } @@ -865,7 +709,7 @@ namespace Prebuild.Core.Targets // Set up references for (int refNum = 0; refNum < project.References.Count; refNum++) { - ReferenceNode refr = (ReferenceNode)project.References[refNum]; + ReferenceNode refr = project.References[refNum]; Assembly refAssembly = Assembly.LoadWithPartialName(refr.Name); /* Determine which pkg-config (.pc) file refers to @@ -873,25 +717,28 @@ namespace Prebuild.Core.Targets SystemPackage package = null; - if (packagesHash.Contains(refr.Name)){ - package = (SystemPackage)packagesHash[refr.Name]; + if (packagesHash.ContainsKey(refr.Name)) + { + package = packagesHash[refr.Name]; - }else{ - string assemblyFullName = string.Empty; - if (refAssembly != null) - assemblyFullName = refAssembly.FullName; + } + else + { + string assemblyFullName = string.Empty; + if (refAssembly != null) + assemblyFullName = refAssembly.FullName; - string assemblyFileName = string.Empty; - if (assemblyFullName != string.Empty && - assemblyFullNameToPath.Contains(assemblyFullName) - ) - assemblyFileName = - (string)assemblyFullNameToPath[assemblyFullName]; + string assemblyFileName = string.Empty; + if (assemblyFullName != string.Empty && + assemblyFullNameToPath.ContainsKey(assemblyFullName) + ) + assemblyFileName = + assemblyFullNameToPath[assemblyFullName]; - if (assemblyFileName != string.Empty && - assemblyPathToPackage.Contains(assemblyFileName) - ) - package = (SystemPackage)assemblyPathToPackage[assemblyFileName]; + if (assemblyFileName != string.Empty && + assemblyPathToPackage.ContainsKey(assemblyFileName) + ) + package = assemblyPathToPackage[assemblyFileName]; } @@ -958,7 +805,7 @@ namespace Prebuild.Core.Targets */ ProjectNode sourcePrj = - ((ProjectNode)(solution.ProjectsTable[refr.Name])); + ((solution.ProjectsTable[refr.Name])); string target = String.Format("{0}:\n" + @@ -1067,564 +914,6 @@ namespace Prebuild.Core.Targets transformToFile(Path.Combine(projectDir, project.Name.ToLower() + ".in"), argList, "/Autotools/ProjectWrapperScriptIn"); } - private void WriteProjectOld(SolutionNode solution, ProjectNode project) - { - string projFile = Helper.MakeFilePath(project.FullPath, "Include", "am"); - StreamWriter ss = new StreamWriter(projFile); - ss.NewLine = "\n"; - - m_Kernel.CurrentWorkingDirectory.Push(); - Helper.SetCurrentDir(Path.GetDirectoryName(projFile)); - - using (ss) - { - ss.WriteLine(Helper.AssemblyFullName(project.AssemblyName, project.Type) + ":"); - ss.WriteLine("\tmkdir -p " + Helper.MakePathRelativeTo(solution.FullPath, project.Path) + "/$(BUILD_DIR)/$(CONFIG)/"); - foreach (string file in project.Files) - { - if (project.Files.GetSubType(file) != SubType.Code && project.Files.GetSubType(file) != SubType.Settings) - { - ss.Write("\tresgen "); - ss.Write(Helper.NormalizePath(Path.Combine(project.Path, file.Substring(0, file.LastIndexOf('.')) + ".resx "), '/')); - if (project.Files.GetResourceName(file) != "") - { - ss.WriteLine(Helper.NormalizePath(Path.Combine(project.Path, project.RootNamespace + "." + project.Files.GetResourceName(file) + ".resources"), '/')); - } - else - { - ss.WriteLine(Helper.NormalizePath(Path.Combine(project.Path, project.RootNamespace + "." + file.Substring(0, file.LastIndexOf('.')) + ".resources"), '/')); - } - } - } - ss.WriteLine("\t$(CSC)\t/out:" + Helper.MakePathRelativeTo(solution.FullPath, project.Path) + "/$(BUILD_DIR)/$(CONFIG)/" + Helper.AssemblyFullName(project.AssemblyName, project.Type) + " \\"); - ss.WriteLine("\t\t/target:" + project.Type.ToString().ToLower() + " \\"); - if (project.References.Count > 0) - { - ss.Write("\t\t/reference:"); - bool firstref = true; - foreach (ReferenceNode refr in project.References) - { - if (firstref) - { - firstref = false; - } - else - { - ss.Write(","); - } - ss.Write("{0}", Helper.NormalizePath(Helper.MakePathRelativeTo(solution.FullPath, BuildReference(solution, refr)), '/')); - } - ss.WriteLine(" \\"); - } - //ss.WriteLine("\t\tProperties/AssemblyInfo.cs \\"); - - foreach (string file in project.Files) - { - switch (project.Files.GetBuildAction(file)) - { - case BuildAction.EmbeddedResource: - ss.Write("\t\t/resource:"); - ss.WriteLine(Helper.NormalizePath(Path.Combine(project.Path, file), '/') + " \\"); - break; - default: - if (project.Files.GetSubType(file) != SubType.Code && project.Files.GetSubType(file) != SubType.Settings) - { - ss.Write("\t\t/resource:"); - if (project.Files.GetResourceName(file) != "") - { - ss.WriteLine(Helper.NormalizePath(Path.Combine(project.Path, project.RootNamespace + "." + project.Files.GetResourceName(file) + ".resources"), '/') + "," + project.RootNamespace + "." + project.Files.GetResourceName(file) + ".resources" + " \\"); - } - else - { - ss.WriteLine(Helper.NormalizePath(Path.Combine(project.Path, project.RootNamespace + "." + file.Substring(0, file.LastIndexOf('.')) + ".resources"), '/') + "," + project.RootNamespace + "." + file.Substring(0, file.LastIndexOf('.')) + ".resources" + " \\"); - } - } - break; - } - } - - foreach (ConfigurationNode conf in project.Configurations) - { - if (conf.Options.KeyFile != "") - { - ss.WriteLine("\t\t/keyfile:" + Helper.NormalizePath(Path.Combine(project.Path, conf.Options.KeyFile), '/') + " \\"); - break; - } - } - foreach (ConfigurationNode conf in project.Configurations) - { - if (conf.Options.AllowUnsafe) - { - ss.WriteLine("\t\t/unsafe \\"); - break; - } - } - if (project.AppIcon != "") - { - ss.WriteLine("\t\t/win32icon:" + Helper.NormalizePath(Path.Combine(project.Path, project.AppIcon), '/') + " \\"); - } - - foreach (ConfigurationNode conf in project.Configurations) - { - ss.WriteLine("\t\t/define:{0}", conf.Options.CompilerDefines.Replace(';', ',') + " \\"); - break; - } - - foreach (ConfigurationNode conf in project.Configurations) - { - if (GetXmlDocFile(project, conf) != "") - { - ss.WriteLine("\t\t/doc:" + Helper.MakePathRelativeTo(solution.FullPath, project.Path) + "/$(BUILD_DIR)/$(CONFIG)/" + project.Name + ".xml \\"); - break; - } - } - foreach (string file in project.Files) - { - switch (project.Files.GetBuildAction(file)) - { - case BuildAction.Compile: - ss.WriteLine("\t\t\\"); - ss.Write("\t\t" + NormalizePath(Path.Combine(Helper.MakePathRelativeTo(solution.FullPath, project.Path), file))); - break; - default: - break; - } - } - ss.WriteLine(); - ss.WriteLine(); - - if (project.Type == ProjectType.Library) - { - ss.WriteLine("install-data-local:"); - ss.WriteLine(" echo \"$(GACUTIL) /i bin/Release/" + project.Name + ".dll /f $(GACUTIL_FLAGS)\"; \\"); - ss.WriteLine(" $(GACUTIL) /i bin/Release/" + project.Name + ".dll /f $(GACUTIL_FLAGS) || exit 1;"); - ss.WriteLine(); - ss.WriteLine("uninstall-local:"); - ss.WriteLine(" echo \"$(GACUTIL) /u " + project.Name + " $(GACUTIL_FLAGS)\"; \\"); - ss.WriteLine(" $(GACUTIL) /u " + project.Name + " $(GACUTIL_FLAGS) || exit 1;"); - ss.WriteLine(); - } - ss.WriteLine("CLEANFILES = $(BUILD_DIR)/$(CONFIG)/" + Helper.AssemblyFullName(project.AssemblyName, project.Type) + " $(BUILD_DIR)/$(CONFIG)/" + project.AssemblyName + ".mdb $(BUILD_DIR)/$(CONFIG)/" + project.AssemblyName + ".pdb " + project.AssemblyName + ".xml"); - ss.WriteLine("EXTRA_DIST = \\"); - ss.Write(" $(FILES)"); - foreach (ConfigurationNode conf in project.Configurations) - { - if (conf.Options.KeyFile != "") - { - ss.Write(" \\"); - ss.WriteLine("\t" + conf.Options.KeyFile); - } - break; - } - } - m_Kernel.CurrentWorkingDirectory.Pop(); - } - bool hasLibrary = false; - - private void WriteCombineOld(SolutionNode solution) - { - - /* TODO: These vars should be pulled from the prebuild.xml file */ - string releaseVersion = "2.0.0"; - string assemblyVersion = "2.1.0.0"; - string description = - "Tao Framework " + solution.Name + " Binding For .NET"; - - hasLibrary = false; - m_Kernel.Log.Write("Creating Autotools make files"); - foreach (ProjectNode project in solution.Projects) - { - if (m_Kernel.AllowProject(project.FilterGroups)) - { - m_Kernel.Log.Write("...Creating makefile: {0}", project.Name); - WriteProject(solution, project); - } - } - - m_Kernel.Log.Write(""); - string combFile = Helper.MakeFilePath(solution.FullPath, "Makefile", "am"); - StreamWriter ss = new StreamWriter(combFile); - ss.NewLine = "\n"; - - m_Kernel.CurrentWorkingDirectory.Push(); - Helper.SetCurrentDir(Path.GetDirectoryName(combFile)); - - using (ss) - { - foreach (ProjectNode project in solution.ProjectsTableOrder) - { - if (project.Type == ProjectType.Library) - { - hasLibrary = true; - break; - } - } - - if (hasLibrary) - { - ss.Write("pkgconfig_in_files = "); - foreach (ProjectNode project in solution.ProjectsTableOrder) - { - if (project.Type == ProjectType.Library) - { - string combFilepc = Helper.MakeFilePath(solution.FullPath, project.Name, "pc.in"); - ss.Write(" " + project.Name + ".pc.in "); - StreamWriter sspc = new StreamWriter(combFilepc); - sspc.NewLine = "\n"; - using (sspc) - { - sspc.WriteLine("prefix=@prefix@"); - sspc.WriteLine("exec_prefix=${prefix}"); - sspc.WriteLine("libdir=${exec_prefix}/lib"); - sspc.WriteLine(); - sspc.WriteLine("Name: @PACKAGE_NAME@"); - sspc.WriteLine("Description: @DESCRIPTION@"); - sspc.WriteLine("Version: @ASSEMBLY_VERSION@"); - sspc.WriteLine("Libs: -r:${libdir}/mono/gac/@PACKAGE_NAME@/@ASSEMBLY_VERSION@__@PUBKEY@/@PACKAGE_NAME@.dll"); - } - } - } - - ss.WriteLine(); - ss.WriteLine("pkgconfigdir=$(prefix)/lib/pkgconfig"); - ss.WriteLine("pkgconfig_DATA=$(pkgconfig_in_files:.pc.in=.pc)"); - } - ss.WriteLine(); - foreach (ProjectNode project in solution.ProjectsTableOrder) - { - string path = Helper.MakePathRelativeTo(solution.FullPath, project.FullPath); - ss.WriteLine("-include x {0}", - Helper.NormalizePath(Helper.MakeFilePath(path, "Include", "am"), '/')); - } - ss.WriteLine(); - ss.WriteLine("all: \\"); - ss.Write("\t"); - foreach (ProjectNode project in solution.ProjectsTableOrder) - { - string path = Helper.MakePathRelativeTo(solution.FullPath, project.FullPath); - ss.Write(Helper.AssemblyFullName(project.AssemblyName, project.Type) + " "); - - } - ss.WriteLine(); - if (hasLibrary) - { - ss.WriteLine("EXTRA_DIST = \\"); - ss.WriteLine("\t$(pkgconfig_in_files)"); - } - else - { - ss.WriteLine("EXTRA_DIST = "); - } - ss.WriteLine(); - ss.WriteLine("DISTCLEANFILES = \\"); - ss.WriteLine("\tconfigure \\"); - ss.WriteLine("\tMakefile.in \\"); - ss.WriteLine("\taclocal.m4"); - } - combFile = Helper.MakeFilePath(solution.FullPath, "configure", "ac"); - StreamWriter ts = new StreamWriter(combFile); - ts.NewLine = "\n"; - using (ts) - { - if (this.hasLibrary) - { - foreach (ProjectNode project in solution.ProjectsTableOrder) - { - if (project.Type == ProjectType.Library) - { - ts.WriteLine("AC_INIT(" + project.Name + ".pc.in)"); - break; - } - } - } - else - { - ts.WriteLine("AC_INIT(Makefile.am)"); - } - ts.WriteLine("AC_PREREQ(2.53)"); - ts.WriteLine("AC_CANONICAL_SYSTEM"); - - ts.WriteLine("PACKAGE_NAME={0}", solution.Name); - ts.WriteLine("PACKAGE_VERSION={0}", releaseVersion); - ts.WriteLine("DESCRIPTION=\"{0}\"", description); - ts.WriteLine("AC_SUBST(DESCRIPTION)"); - ts.WriteLine("AM_INIT_AUTOMAKE([$PACKAGE_NAME],[$PACKAGE_VERSION],[$DESCRIPTION])"); - - ts.WriteLine("ASSEMBLY_VERSION={0}", assemblyVersion); - ts.WriteLine("AC_SUBST(ASSEMBLY_VERSION)"); - - ts.WriteLine("PUBKEY=`sn -t $PACKAGE_NAME.snk | grep 'Public Key Token' | awk -F: '{print $2}' | sed -e 's/^ //'`"); - ts.WriteLine("AC_SUBST(PUBKEY)"); - - ts.WriteLine(); - ts.WriteLine("AM_MAINTAINER_MODE"); - ts.WriteLine(); - ts.WriteLine("dnl AC_PROG_INTLTOOL([0.25])"); - ts.WriteLine(); - ts.WriteLine("AC_PROG_INSTALL"); - ts.WriteLine(); - ts.WriteLine("MONO_REQUIRED_VERSION=1.1"); - ts.WriteLine(); - ts.WriteLine("AC_MSG_CHECKING([whether we're compiling from CVS])"); - ts.WriteLine("if test -f \"$srcdir/.cvs_version\" ; then"); - ts.WriteLine(" from_cvs=yes"); - ts.WriteLine("else"); - ts.WriteLine(" if test -f \"$srcdir/.svn\" ; then"); - ts.WriteLine(" from_cvs=yes"); - ts.WriteLine(" else"); - ts.WriteLine(" from_cvs=no"); - ts.WriteLine(" fi"); - ts.WriteLine("fi"); - ts.WriteLine(); - ts.WriteLine("AC_MSG_RESULT($from_cvs)"); - ts.WriteLine(); - ts.WriteLine("AC_PATH_PROG(MONO, mono)"); - ts.WriteLine("AC_PATH_PROG(GMCS, gmcs)"); - ts.WriteLine("AC_PATH_PROG(GACUTIL, gacutil)"); - ts.WriteLine(); - ts.WriteLine("AC_MSG_CHECKING([for mono])"); - ts.WriteLine("dnl if test \"x$MONO\" = \"x\" ; then"); - ts.WriteLine("dnl AC_MSG_ERROR([Can't find \"mono\" in your PATH])"); - ts.WriteLine("dnl else"); - ts.WriteLine(" AC_MSG_RESULT([found])"); - ts.WriteLine("dnl fi"); - ts.WriteLine(); - ts.WriteLine("AC_MSG_CHECKING([for gmcs])"); - ts.WriteLine("dnl if test \"x$GMCS\" = \"x\" ; then"); - ts.WriteLine("dnl AC_MSG_ERROR([Can't find \"gmcs\" in your PATH])"); - ts.WriteLine("dnl else"); - ts.WriteLine(" AC_MSG_RESULT([found])"); - ts.WriteLine("dnl fi"); - ts.WriteLine(); - //ts.WriteLine("AC_MSG_CHECKING([for gacutil])"); - //ts.WriteLine("if test \"x$GACUTIL\" = \"x\" ; then"); - //ts.WriteLine(" AC_MSG_ERROR([Can't find \"gacutil\" in your PATH])"); - //ts.WriteLine("else"); - //ts.WriteLine(" AC_MSG_RESULT([found])"); - //ts.WriteLine("fi"); - ts.WriteLine(); - ts.WriteLine("AC_SUBST(PATH)"); - ts.WriteLine("AC_SUBST(LD_LIBRARY_PATH)"); - ts.WriteLine(); - ts.WriteLine("dnl CSFLAGS=\"-debug -nowarn:1574\""); - ts.WriteLine("CSFLAGS=\"\""); - ts.WriteLine("AC_SUBST(CSFLAGS)"); - ts.WriteLine(); - // ts.WriteLine("AC_MSG_CHECKING(--disable-sdl argument)"); - // ts.WriteLine("AC_ARG_ENABLE(sdl,"); - // ts.WriteLine(" [ --disable-sdl Disable Sdl interface.],"); - // ts.WriteLine(" [disable_sdl=$disableval],"); - // ts.WriteLine(" [disable_sdl=\"no\"])"); - // ts.WriteLine("AC_MSG_RESULT($disable_sdl)"); - // ts.WriteLine("if test \"$disable_sdl\" = \"yes\"; then"); - // ts.WriteLine(" AC_DEFINE(FEAT_SDL)"); - // ts.WriteLine("fi"); - ts.WriteLine(); - ts.WriteLine("dnl Find pkg-config"); - ts.WriteLine("AC_PATH_PROG(PKGCONFIG, pkg-config, no)"); - ts.WriteLine("if test \"x$PKG_CONFIG\" = \"xno\"; then"); - ts.WriteLine(" AC_MSG_ERROR([You need to install pkg-config])"); - ts.WriteLine("fi"); - ts.WriteLine(); - ts.WriteLine("PKG_CHECK_MODULES(MONO_DEPENDENCY, mono >= $MONO_REQUIRED_VERSION, has_mono=true, has_mono=false)"); - ts.WriteLine("BUILD_DIR=\"bin\""); - ts.WriteLine("AC_SUBST(BUILD_DIR)"); - ts.WriteLine("CONFIG=\"Release\""); - ts.WriteLine("AC_SUBST(CONFIG)"); - ts.WriteLine(); - ts.WriteLine("if test \"x$has_mono\" = \"xtrue\"; then"); - ts.WriteLine(" AC_PATH_PROG(RUNTIME, mono, no)"); - ts.WriteLine(" AC_PATH_PROG(CSC, gmcs, no)"); - ts.WriteLine(" if test `uname -s` = \"Darwin\"; then"); - ts.WriteLine(" LIB_PREFIX="); - ts.WriteLine(" LIB_SUFFIX=.dylib"); - ts.WriteLine(" else"); - ts.WriteLine(" LIB_PREFIX=.so"); - ts.WriteLine(" LIB_SUFFIX="); - ts.WriteLine(" fi"); - ts.WriteLine("else"); - ts.WriteLine(" AC_PATH_PROG(CSC, csc.exe, no)"); - ts.WriteLine(" if test x$CSC = \"xno\"; then"); - ts.WriteLine(" AC_MSG_ERROR([You need to install either mono or .Net])"); - ts.WriteLine(" else"); - ts.WriteLine(" RUNTIME="); - ts.WriteLine(" LIB_PREFIX="); - ts.WriteLine(" LIB_SUFFIX=.dylib"); - ts.WriteLine(" fi"); - ts.WriteLine("fi"); - ts.WriteLine(); - ts.WriteLine("AC_SUBST(LIB_PREFIX)"); - ts.WriteLine("AC_SUBST(LIB_SUFFIX)"); - ts.WriteLine(); - ts.WriteLine("AC_SUBST(BASE_DEPENDENCIES_CFLAGS)"); - ts.WriteLine("AC_SUBST(BASE_DEPENDENCIES_LIBS)"); - ts.WriteLine(); - ts.WriteLine("dnl Find monodoc"); - ts.WriteLine("MONODOC_REQUIRED_VERSION=1.0"); - ts.WriteLine("AC_SUBST(MONODOC_REQUIRED_VERSION)"); - ts.WriteLine("PKG_CHECK_MODULES(MONODOC_DEPENDENCY, monodoc >= $MONODOC_REQUIRED_VERSION, enable_monodoc=yes, enable_monodoc=no)"); - ts.WriteLine(); - ts.WriteLine("if test \"x$enable_monodoc\" = \"xyes\"; then"); - ts.WriteLine(" AC_PATH_PROG(MONODOC, monodoc, no)"); - ts.WriteLine(" if test x$MONODOC = xno; then"); - ts.WriteLine(" enable_monodoc=no"); - ts.WriteLine(" fi"); - ts.WriteLine("else"); - ts.WriteLine(" MONODOC="); - ts.WriteLine("fi"); - ts.WriteLine(); - ts.WriteLine("AC_SUBST(MONODOC)"); - ts.WriteLine("AM_CONDITIONAL(ENABLE_MONODOC, test \"x$enable_monodoc\" = \"xyes\")"); - ts.WriteLine(); - ts.WriteLine("AC_PATH_PROG(GACUTIL, gacutil, no)"); - ts.WriteLine("if test \"x$GACUTIL\" = \"xno\" ; then"); - ts.WriteLine(" AC_MSG_ERROR([No gacutil tool found])"); - ts.WriteLine("fi"); - ts.WriteLine(); - // foreach(ProjectNode project in solution.ProjectsTableOrder) - // { - // if (project.Type == ProjectType.Library) - // { - // } - // } - ts.WriteLine("GACUTIL_FLAGS='/package $(PACKAGE_NAME) /gacdir $(DESTDIR)$(prefix)'"); - ts.WriteLine("AC_SUBST(GACUTIL_FLAGS)"); - ts.WriteLine(); - ts.WriteLine("winbuild=no"); - ts.WriteLine("case \"$host\" in"); - ts.WriteLine(" *-*-mingw*|*-*-cygwin*)"); - ts.WriteLine(" winbuild=yes"); - ts.WriteLine(" ;;"); - ts.WriteLine("esac"); - ts.WriteLine("AM_CONDITIONAL(WINBUILD, test x$winbuild = xyes)"); - ts.WriteLine(); - // ts.WriteLine("dnl Check for SDL"); - // ts.WriteLine(); - // ts.WriteLine("AC_PATH_PROG([SDL_CONFIG], [sdl-config])"); - // ts.WriteLine("have_sdl=no"); - // ts.WriteLine("if test -n \"${SDL_CONFIG}\"; then"); - // ts.WriteLine(" have_sdl=yes"); - // ts.WriteLine(" SDL_CFLAGS=`$SDL_CONFIG --cflags`"); - // ts.WriteLine(" SDL_LIBS=`$SDL_CONFIG --libs`"); - // ts.WriteLine(" #"); - // ts.WriteLine(" # sdl-config sometimes emits an rpath flag pointing at its library"); - // ts.WriteLine(" # installation directory. We don't want this, as it prevents users from"); - // ts.WriteLine(" # linking sdl-viewer against, for example, a locally compiled libGL when a"); - // ts.WriteLine(" # version of the library also exists in SDL's library installation"); - // ts.WriteLine(" # directory, typically /usr/lib."); - // ts.WriteLine(" #"); - // ts.WriteLine(" SDL_LIBS=`echo $SDL_LIBS | sed 's/-Wl,-rpath,[[^ ]]* //'`"); - // ts.WriteLine("fi"); - // ts.WriteLine("AC_SUBST([SDL_CFLAGS])"); - // ts.WriteLine("AC_SUBST([SDL_LIBS])"); - ts.WriteLine(); - ts.WriteLine("AC_OUTPUT(["); - ts.WriteLine("Makefile"); - // TODO: this does not work quite right. - //ts.WriteLine("Properties/AssemblyInfo.cs"); - foreach (ProjectNode project in solution.ProjectsTableOrder) - { - if (project.Type == ProjectType.Library) - { - ts.WriteLine(project.Name + ".pc"); - } - // string path = Helper.MakePathRelativeTo(solution.FullPath, project.FullPath); - // ts.WriteLine(Helper.NormalizePath(Helper.MakeFilePath(path, "Include"),'/')); - } - ts.WriteLine("])"); - ts.WriteLine(); - ts.WriteLine("#po/Makefile.in"); - ts.WriteLine(); - ts.WriteLine("echo \"---\""); - ts.WriteLine("echo \"Configuration summary\""); - ts.WriteLine("echo \"\""); - ts.WriteLine("echo \" * Installation prefix: $prefix\""); - ts.WriteLine("echo \" * compiler: $CSC\""); - ts.WriteLine("echo \" * Documentation: $enable_monodoc ($MONODOC)\""); - ts.WriteLine("echo \" * Package Name: $PACKAGE_NAME\""); - ts.WriteLine("echo \" * Version: $PACKAGE_VERSION\""); - ts.WriteLine("echo \" * Public Key: $PUBKEY\""); - ts.WriteLine("echo \"\""); - ts.WriteLine("echo \"---\""); - ts.WriteLine(); - } - - ts.NewLine = "\n"; - foreach (ProjectNode project in solution.ProjectsTableOrder) - { - if (project.GenerateAssemblyInfoFile) - { - GenerateAssemblyInfoFile(solution, combFile); - } - } - } - - private static void GenerateAssemblyInfoFile(SolutionNode solution, string combFile) - { - System.IO.Directory.CreateDirectory(Helper.MakePathRelativeTo(solution.FullPath, "Properties")); - combFile = Helper.MakeFilePath(solution.FullPath + "/Properties/", "AssemblyInfo.cs", "in"); - StreamWriter ai = new StreamWriter(combFile); - - using (ai) - { - ai.WriteLine("#region License"); - ai.WriteLine("/*"); - ai.WriteLine("MIT License"); - ai.WriteLine("Copyright (c)2003-2006 Tao Framework Team"); - ai.WriteLine("http://www.taoframework.com"); - ai.WriteLine("All rights reserved."); - ai.WriteLine(""); - ai.WriteLine("Permission is hereby granted, free of charge, to any person obtaining a copy"); - ai.WriteLine("of this software and associated documentation files (the \"Software\"), to deal"); - ai.WriteLine("in the Software without restriction, including without limitation the rights"); - ai.WriteLine("to use, copy, modify, merge, publish, distribute, sublicense, and/or sell"); - ai.WriteLine("copies of the Software, and to permit persons to whom the Software is"); - ai.WriteLine("furnished to do so, subject to the following conditions:"); - ai.WriteLine(""); - ai.WriteLine("The above copyright notice and this permission notice shall be included in all"); - ai.WriteLine("copies or substantial portions of the Software."); - ai.WriteLine(""); - ai.WriteLine("THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR"); - ai.WriteLine("IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,"); - ai.WriteLine("FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE"); - ai.WriteLine("AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER"); - ai.WriteLine("LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,"); - ai.WriteLine("OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE"); - ai.WriteLine("SOFTWARE."); - ai.WriteLine("*/"); - ai.WriteLine("#endregion License"); - ai.WriteLine(""); - ai.WriteLine("using System;"); - ai.WriteLine("using System.Reflection;"); - ai.WriteLine("using System.Runtime.InteropServices;"); - ai.WriteLine("using System.Security;"); - ai.WriteLine("using System.Security.Permissions;"); - ai.WriteLine(""); - ai.WriteLine("[assembly: AllowPartiallyTrustedCallers]"); - ai.WriteLine("[assembly: AssemblyCompany(\"Tao Framework -- http://www.taoframework.com\")]"); - ai.WriteLine("[assembly: AssemblyConfiguration(\"Retail\")]"); - ai.WriteLine("[assembly: AssemblyCopyright(\"Copyright (c)2003-2006 Tao Framework Team. All rights reserved.\")]"); - ai.WriteLine("[assembly: AssemblyCulture(\"\")]"); - ai.WriteLine("[assembly: AssemblyDefaultAlias(\"@PACKAGE_NAME@\")]"); - ai.WriteLine("[assembly: AssemblyDelaySign(false)]"); - ai.WriteLine("[assembly: AssemblyDescription(\"@DESCRIPTION@\")]"); - ai.WriteLine("[assembly: AssemblyFileVersion(\"@ASSEMBLY_VERSION@\")]"); - ai.WriteLine("[assembly: AssemblyInformationalVersion(\"@ASSEMBLY_VERSION@\")]"); - ai.WriteLine("[assembly: AssemblyKeyName(\"\")]"); - ai.WriteLine("[assembly: AssemblyProduct(\"@PACKAGE_NAME@.dll\")]"); - ai.WriteLine("[assembly: AssemblyTitle(\"@DESCRIPTION@\")]"); - ai.WriteLine("[assembly: AssemblyTrademark(\"Tao Framework -- http://www.taoframework.com\")]"); - ai.WriteLine("[assembly: AssemblyVersion(\"@ASSEMBLY_VERSION@\")]"); - ai.WriteLine("[assembly: CLSCompliant(true)]"); - ai.WriteLine("[assembly: ComVisible(false)]"); - ai.WriteLine("[assembly: SecurityPermission(SecurityAction.RequestMinimum, Flags = SecurityPermissionFlag.Execution)]"); - ai.WriteLine("[assembly: SecurityPermission(SecurityAction.RequestMinimum, Flags = SecurityPermissionFlag.SkipVerification)]"); - ai.WriteLine("[assembly: SecurityPermission(SecurityAction.RequestMinimum, Flags = SecurityPermissionFlag.UnmanagedCode)]"); - - } - //return combFile; - } - private void CleanProject(ProjectNode project) { m_Kernel.Log.Write("...Cleaning project: {0}", project.Name); @@ -1677,7 +966,7 @@ namespace Prebuild.Core.Targets m_Kernel.Log.Write("Parsing system pkg-config files"); RunInitialization(); - string streamName = "autotools.xml"; + const string streamName = "autotools.xml"; string fqStreamName = String.Format("Prebuild.data.{0}", streamName ); @@ -1727,10 +1016,9 @@ namespace Prebuild.Core.Targets string pwd = Directory.GetCurrentDirectory(); //string pwd = System.Environment.GetEnvironmentVariable("PWD"); - string rootDir = ""; //if (pwd.Length != 0) //{ - rootDir = Path.Combine(pwd, "autotools"); + string rootDir = Path.Combine(pwd, "autotools"); //} //else //{ diff --git a/Prebuild/src/Core/Targets/DebugTarget.cs b/Prebuild/src/Core/Targets/DebugTarget.cs index dc4e666ebd..650007ecc6 100644 --- a/Prebuild/src/Core/Targets/DebugTarget.cs +++ b/Prebuild/src/Core/Targets/DebugTarget.cs @@ -27,7 +27,7 @@ IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY O /* * $Source$ * $Author: jendave $ - * $Date: 2006-09-20 09:42:51 +0200 (on, 20 sep 2006) $ + * $Date: 2006-09-20 08:42:51 +0100 (Wed, 20 Sep 2006) $ * $Revision: 164 $ */ #endregion diff --git a/Prebuild/src/Core/Targets/MakefileTarget.cs b/Prebuild/src/Core/Targets/MakefileTarget.cs index 86676d08cb..54046dd9bb 100644 --- a/Prebuild/src/Core/Targets/MakefileTarget.cs +++ b/Prebuild/src/Core/Targets/MakefileTarget.cs @@ -24,8 +24,6 @@ IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY O #endregion using System; -using System.Collections; -using System.Collections.Specialized; using System.IO; using System.Text.RegularExpressions; @@ -110,7 +108,7 @@ namespace Prebuild.Core.Targets { string path; // Project references change with configurations. - if (solution.ProjectsTable.Contains(refr.Name)) + if (solution.ProjectsTable.ContainsKey(refr.Name)) continue; path = FindFileReference(refr.Name, project); if (path != null) @@ -220,7 +218,7 @@ namespace Prebuild.Core.Targets } // Dependencies on other projects. foreach (ReferenceNode refr in project.References) - if (solution.ProjectsTable.Contains(refr.Name)) + if (solution.ProjectsTable.ContainsKey(refr.Name)) { ProjectNode refProj = (ProjectNode)solution.ProjectsTable[refr.Name]; if (ProjectClashes(refProj)) @@ -256,7 +254,7 @@ namespace Prebuild.Core.Targets // Build references to other projects. Now that sux. // We have to reference the other project in the same conf. foreach (ReferenceNode refr in project.References) - if (solution.ProjectsTable.Contains(refr.Name)) + if (solution.ProjectsTable.ContainsKey(refr.Name)) { ProjectNode refProj; refProj = (ProjectNode)solution.ProjectsTable[refr.Name]; @@ -274,7 +272,7 @@ namespace Prebuild.Core.Targets { string outPath, srcPath, destPath; outPath = Helper.NormalizePath((string)conf.Options["OutputPath"]); - if (solution.ProjectsTable.Contains(refr.Name)) + if (solution.ProjectsTable.ContainsKey(refr.Name)) { ProjectNode refProj; refProj = (ProjectNode)solution.ProjectsTable[refr.Name]; diff --git a/Prebuild/src/Core/Targets/MonoDevelopTarget.cs b/Prebuild/src/Core/Targets/MonoDevelopTarget.cs index c8401fd42a..ea6d2c2233 100644 --- a/Prebuild/src/Core/Targets/MonoDevelopTarget.cs +++ b/Prebuild/src/Core/Targets/MonoDevelopTarget.cs @@ -24,8 +24,6 @@ IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY O #endregion using System; -using System.Collections; -using System.Collections.Specialized; using System.IO; using System.Reflection; using System.Text.RegularExpressions; @@ -274,7 +272,11 @@ namespace Prebuild.Core.Targets ss.WriteLine(" "); foreach(string file in project.Files) { - string buildAction = "Compile"; + string buildAction; + string dependson = ""; + string resource_id = ""; + string copyToOutput = ""; + switch(project.Files.GetBuildAction(file)) { case BuildAction.None: @@ -294,9 +296,58 @@ namespace Prebuild.Core.Targets break; } + if (project.Files.GetCopyToOutput(file) != CopyToOutput.Never) + buildAction = "FileCopy"; + // Sort of a hack, we try and resolve the path and make it relative, if we can. - string filePath = PrependPath(file); - ss.WriteLine(" ", filePath, buildAction); + string extension = Path.GetExtension(file); + string designer_format = string.Format(".Designer{0}", extension); + + if (file.EndsWith(designer_format)) + { + string basename = file.Substring(0, file.LastIndexOf(designer_format)); + string[] extensions = new string[] { ".cs", ".resx", ".settings" }; + + foreach(string ext in extensions) + { + if (project.Files.Contains(basename + ext)) + { + dependson = string.Format(" dependson=\"{0}{1}\"", basename, ext); + break; + } + } + } + if (extension == ".resx") + { + buildAction = "EmbedAsResource"; + string basename = file.Substring(0, file.LastIndexOf(".resx")); + + // Visual Studio type resx + form dependency + if (project.Files.Contains(basename + ".cs")) + { + dependson = string.Format(" dependson=\"{0}{1}\"", basename, ".cs"); + } + + // We need to specify a resources file name to avoid MissingManifestResourceExceptions + // in libraries that are built. + resource_id = string.Format(" resource_id=\"{0}.{1}.resources\"", + project.AssemblyName, basename.Replace("/", ".")); + } + + switch(project.Files.GetCopyToOutput(file)) + { + case CopyToOutput.Always: + copyToOutput = string.Format(" copyToOutputDirectory=\"Always\""); + break; + case CopyToOutput.PreserveNewest: + copyToOutput = string.Format(" copyToOutputDirectory=\"PreserveNewest\""); + break; + } + + // Sort of a hack, we try and resolve the path and make it relative, if we can. + string filePath = PrependPath(file); + ss.WriteLine(" ", + filePath, buildAction, dependson, resource_id, copyToOutput); } ss.WriteLine(" "); diff --git a/Prebuild/src/Core/Targets/NAntTarget.cs b/Prebuild/src/Core/Targets/NAntTarget.cs index 9a6ee17819..d4a33f8d3b 100644 --- a/Prebuild/src/Core/Targets/NAntTarget.cs +++ b/Prebuild/src/Core/Targets/NAntTarget.cs @@ -36,10 +36,8 @@ POSSIBILITY OF SUCH DAMAGE. #endregion using System; -using System.Collections; -using System.Collections.Specialized; +using System.Collections.Generic; using System.IO; -using System.Reflection; using System.Text.RegularExpressions; using Prebuild.Core.Attributes; @@ -255,9 +253,12 @@ namespace Prebuild.Core.Targets ss.WriteLine(" {0}", ""); ss.WriteLine(" {0}", ""); - ss.Write(" "); + // This disables a very different behavior between VS and NAnt. With Nant, + // If you have using System.Xml; it will ensure System.Xml.dll is referenced, + // but not in VS. This will force the behaviors to match, so when it works + // in nant, it will work in VS. + ss.Write(" noconfig=\"true\""); + ss.WriteLine(">"); ss.WriteLine(" ", project.RootNamespace); foreach (string file in project.Files) { @@ -357,7 +363,20 @@ namespace Prebuild.Core.Targets foreach (ReferenceNode refr in project.References) { string path = Helper.NormalizePath(Helper.MakePathRelativeTo(project.FullPath, BuildReference(solution, project, refr)), '/'); - ss.WriteLine(" "); + if (refr.Path != null) { + if (ExtensionSpecified(refr.Name)) + { + ss.WriteLine (" "); + } + else + { + ss.WriteLine (" "); + } + } + else + { + ss.WriteLine (" "); + } } ss.WriteLine(" "); @@ -490,15 +509,32 @@ namespace Prebuild.Core.Targets ss.WriteLine(" "); ss.WriteLine(" "); - // actually use active config out of prebuild.xml - ss.WriteLine(" ", solution.ActiveConfig); + // Use the active configuration, which is the first configuration name in the prebuild file. + Dictionary emittedConfigurations = new Dictionary(); + + ss.WriteLine(" ", solution.ActiveConfig); + ss.WriteLine(); foreach (ConfigurationNode conf in solution.Configurations) { - ss.WriteLine(); - ss.WriteLine(" ", conf.Name); + // If the name isn't in the emitted configurations, we give a high level target to the + // platform specific on. This lets "Debug" point to "Debug-AnyCPU". + if (!emittedConfigurations.ContainsKey(conf.Name)) + { + // Add it to the dictionary so we only emit one. + emittedConfigurations.Add(conf.Name, conf.Platform); + + // Write out the target block. + ss.WriteLine(" ", conf.Name, conf.Platform); + ss.WriteLine(" "); + ss.WriteLine(); + } + + // Write out the target for the configuration. + ss.WriteLine(" ", conf.Name, conf.Platform); ss.WriteLine(" ", conf.Name); ss.WriteLine(" ", conf.Options["DebugInformation"].ToString().ToLower()); + ss.WriteLine("\t\t ", conf.Platform); ss.WriteLine(" "); ss.WriteLine(); } @@ -559,19 +595,19 @@ namespace Prebuild.Core.Targets if (item is DirectoryInfo) { } else if (item is FileInfo) { - if (re.Match(((FileInfo)item).FullName) != + if (re.Match(item.FullName) != System.Text.RegularExpressions.Match.Empty) { - Console.WriteLine("Including file: " + ((FileInfo)item).FullName); + Console.WriteLine("Including file: " + item.FullName); - using (FileStream fs = new FileStream(((FileInfo)item).FullName, + using (FileStream fs = new FileStream(item.FullName, FileMode.Open, FileAccess.Read, FileShare.None)) { using (StreamReader sr = new StreamReader(fs)) { - ss.WriteLine("", ((FileInfo)item).FullName); + ss.WriteLine("", (item).FullName); while (sr.Peek() != -1) { ss.WriteLine(sr.ReadLine()); @@ -601,6 +637,10 @@ namespace Prebuild.Core.Targets ss.WriteLine(" "); ss.WriteLine(" "); //ss.WriteLine(" "); + + // justincc: FIXME FIXME FIXME - A temporary OpenSim hack to clean up files when "nant clean" is executed. + // Should be replaced with extreme prejudice once anybody finds out if the CleanFiles stuff works or there is + // another working mechanism for specifying this stuff ss.WriteLine(" "); ss.WriteLine(" "); ss.WriteLine(" "); @@ -611,7 +651,21 @@ namespace Prebuild.Core.Targets ss.WriteLine(" "); ss.WriteLine(" "); ss.WriteLine(" "); - ss.WriteLine(" "); + + if (solution.Cleanup != null && solution.Cleanup.CleanFiles.Count > 0) + { + foreach (CleanFilesNode cleanFile in solution.Cleanup.CleanFiles) + { + ss.WriteLine(" "); + ss.WriteLine(" "); + ss.WriteLine(" ", cleanFile.Pattern); + ss.WriteLine(" ", cleanFile.Pattern); + ss.WriteLine(" "); + ss.WriteLine(" "); + } + } + + ss.WriteLine(" "); foreach (ProjectNode project in solution.Projects) { string path = Helper.MakePathRelativeTo(solution.FullPath, project.FullPath); diff --git a/Prebuild/src/Core/Targets/SharpDevelopTarget.cs b/Prebuild/src/Core/Targets/SharpDevelopTarget.cs index cf7ce0260b..8e3205025f 100644 --- a/Prebuild/src/Core/Targets/SharpDevelopTarget.cs +++ b/Prebuild/src/Core/Targets/SharpDevelopTarget.cs @@ -24,11 +24,8 @@ IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY O #endregion using System; -using System.Collections; -using System.Collections.Specialized; using System.IO; using System.Text.RegularExpressions; -using System.Reflection; using Prebuild.Core.Attributes; using Prebuild.Core.Interfaces; diff --git a/Prebuild/src/Core/Targets/VS2003Target.cs b/Prebuild/src/Core/Targets/VS2003Target.cs index 1bcb7dce0d..10e2dc4a71 100644 --- a/Prebuild/src/Core/Targets/VS2003Target.cs +++ b/Prebuild/src/Core/Targets/VS2003Target.cs @@ -24,8 +24,7 @@ IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY O #endregion using System; -using System.Collections; -using System.Collections.Specialized; +using System.Collections.Generic; using System.IO; using Prebuild.Core.Attributes; @@ -47,7 +46,7 @@ namespace Prebuild.Core.Targets string versionName = "2003"; VSVersion version = VSVersion.VS71; - Hashtable m_Tools; + readonly Dictionary m_Tools = new Dictionary(); Kernel m_Kernel; /// @@ -58,11 +57,11 @@ namespace Prebuild.Core.Targets { get { - return this.solutionVersion; + return solutionVersion; } set { - this.solutionVersion = value; + solutionVersion = value; } } /// @@ -73,11 +72,11 @@ namespace Prebuild.Core.Targets { get { - return this.productVersion; + return productVersion; } set { - this.productVersion = value; + productVersion = value; } } /// @@ -88,11 +87,11 @@ namespace Prebuild.Core.Targets { get { - return this.schemaVersion; + return schemaVersion; } set { - this.schemaVersion = value; + schemaVersion = value; } } /// @@ -103,11 +102,11 @@ namespace Prebuild.Core.Targets { get { - return this.versionName; + return versionName; } set { - this.versionName = value; + versionName = value; } } /// @@ -118,11 +117,11 @@ namespace Prebuild.Core.Targets { get { - return this.version; + return version; } set { - this.version = value; + version = value; } } @@ -135,8 +134,6 @@ namespace Prebuild.Core.Targets /// public VS2003Target() { - m_Tools = new Hashtable(); - m_Tools["C#"] = new ToolInfo("C#", "{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}", "csproj", "CSHARP"); m_Tools["VB.NET"] = new ToolInfo("VB.NET", "{F184B08F-C81C-45F6-A57F-5ABD9991F28F}", "vbproj", "VisualBasic"); } @@ -178,23 +175,20 @@ namespace Prebuild.Core.Targets throw new UnknownLanguageException("Unknown .NET language: " + project.Language); } - ToolInfo toolInfo = (ToolInfo)m_Tools[project.Language]; + ToolInfo toolInfo = m_Tools[project.Language]; string projectFile = Helper.MakeFilePath(project.FullPath, project.Name, toolInfo.FileExtension); StreamWriter ps = new StreamWriter(projectFile); m_Kernel.CurrentWorkingDirectory.Push(); Helper.SetCurrentDir(Path.GetDirectoryName(projectFile)); - IEnumerator enumerator; - //ConfigurationNode scripts; - using(ps) { ps.WriteLine(""); ps.WriteLine(" <{0}", toolInfo.XmlTag); ps.WriteLine("\t\t\t\tProjectType = \"Local\""); - ps.WriteLine("\t\t\t\tProductVersion = \"{0}\"", this.ProductVersion); - ps.WriteLine("\t\t\t\tSchemaVersion = \"{0}\"", this.SchemaVersion); + ps.WriteLine("\t\t\t\tProductVersion = \"{0}\"", ProductVersion); + ps.WriteLine("\t\t\t\tSchemaVersion = \"{0}\"", SchemaVersion); ps.WriteLine("\t\t\t\tProjectGuid = \"{{{0}}}\"", project.Guid.ToString().ToUpper()); ps.WriteLine("\t\t>"); @@ -209,16 +203,13 @@ namespace Prebuild.Core.Targets ps.WriteLine("\t\t\t\t DefaultTargetSchema = \"IE50\""); ps.WriteLine("\t\t\t\t DelaySign = \"false\""); - if(this.Version == VSVersion.VS70) + if(Version == VSVersion.VS70) { ps.WriteLine("\t\t\t\t NoStandardLibraries = \"false\""); } - ps.WriteLine("\t\t\t\t OutputType = \"{0}\"", project.Type.ToString()); + ps.WriteLine("\t\t\t\t OutputType = \"{0}\"", project.Type); - enumerator = project.Configurations.GetEnumerator(); - enumerator.Reset(); - enumerator.MoveNext(); foreach(ConfigurationNode conf in project.Configurations) { if (conf.Options["PreBuildEvent"] != null && conf.Options["PreBuildEvent"].ToString().Length != 0) @@ -266,7 +257,7 @@ namespace Prebuild.Core.Targets ps.WriteLine("\t\t\t\t FileAlignment = \"{0}\"", conf.Options["FileAlignment"]); ps.WriteLine("\t\t\t\t IncrementalBuild = \"{0}\"", conf.Options["IncrementalBuild"].ToString().ToLower()); - if(this.Version == VSVersion.VS71) + if(Version == VSVersion.VS71) { ps.WriteLine("\t\t\t\t NoStdLib = \"{0}\"", conf.Options["NoStdLib"].ToString().ToLower()); ps.WriteLine("\t\t\t\t NoWarn = \"{0}\"", conf.Options["SuppressWarnings"].ToString().ToLower()); @@ -293,9 +284,9 @@ namespace Prebuild.Core.Targets if(solution.ProjectsTable.ContainsKey(refr.Name)) { - ProjectNode refProject = (ProjectNode)solution.ProjectsTable[refr.Name]; + ProjectNode refProject = solution.ProjectsTable[refr.Name]; ps.WriteLine(" Project = \"{{{0}}}\"", refProject.Guid.ToString().ToUpper()); - ps.WriteLine(" Package = \"{0}\"", toolInfo.Guid.ToString().ToUpper()); + ps.WriteLine(" Package = \"{0}\"", toolInfo.Guid.ToUpper()); } else { @@ -409,7 +400,7 @@ namespace Prebuild.Core.Targets private void WriteSolution(SolutionNode solution) { - m_Kernel.Log.Write("Creating Visual Studio {0} solution and project files", this.VersionName); + m_Kernel.Log.Write("Creating Visual Studio {0} solution and project files", VersionName); foreach(ProjectNode project in solution.Projects) { @@ -429,7 +420,7 @@ namespace Prebuild.Core.Targets using(ss) { - ss.WriteLine("Microsoft Visual Studio Solution File, Format Version {0}", this.SolutionVersion); + ss.WriteLine("Microsoft Visual Studio Solution File, Format Version {0}", SolutionVersion); foreach(ProjectNode project in solution.Projects) { if(!m_Tools.ContainsKey(project.Language)) @@ -437,7 +428,7 @@ namespace Prebuild.Core.Targets throw new UnknownLanguageException("Unknown .NET language: " + project.Language); } - ToolInfo toolInfo = (ToolInfo)m_Tools[project.Language]; + ToolInfo toolInfo = m_Tools[project.Language]; string path = Helper.MakePathRelativeTo(solution.FullPath, project.FullPath); ss.WriteLine("Project(\"{0}\") = \"{1}\", \"{2}\", \"{{{3}}}\"", @@ -464,10 +455,10 @@ namespace Prebuild.Core.Targets { for(int i = 0; i < project.References.Count; i++) { - ReferenceNode refr = (ReferenceNode)project.References[i]; + ReferenceNode refr = project.References[i]; if(solution.ProjectsTable.ContainsKey(refr.Name)) { - ProjectNode refProject = (ProjectNode)solution.ProjectsTable[refr.Name]; + ProjectNode refProject = solution.ProjectsTable[refr.Name]; ss.WriteLine("\t\t({{{0}}}).{1} = ({{{2}}})", project.Guid.ToString().ToUpper() , i, @@ -519,7 +510,7 @@ namespace Prebuild.Core.Targets { m_Kernel.Log.Write("...Cleaning project: {0}", project.Name); - ToolInfo toolInfo = (ToolInfo)m_Tools[project.Language]; + ToolInfo toolInfo = m_Tools[project.Language]; string projectFile = Helper.MakeFilePath(project.FullPath, project.Name, toolInfo.FileExtension); string userFile = projectFile + ".user"; @@ -529,7 +520,7 @@ namespace Prebuild.Core.Targets private void CleanSolution(SolutionNode solution) { - m_Kernel.Log.Write("Cleaning Visual Studio {0} solution and project files", this.VersionName, solution.Name); + m_Kernel.Log.Write("Cleaning Visual Studio {0} solution and project files", VersionName, solution.Name); string slnFile = Helper.MakeFilePath(solution.FullPath, solution.Name, "sln"); string suoFile = Helper.MakeFilePath(solution.FullPath, solution.Name, "suo"); diff --git a/Prebuild/src/Core/Targets/VS2005Target.cs b/Prebuild/src/Core/Targets/VS2005Target.cs index 63461c9fe5..9c70e26a37 100644 --- a/Prebuild/src/Core/Targets/VS2005Target.cs +++ b/Prebuild/src/Core/Targets/VS2005Target.cs @@ -24,8 +24,6 @@ IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY O #endregion using System; -using System.Collections; -using System.Collections.Specialized; using System.IO; using System.Text; diff --git a/Prebuild/src/Core/Targets/VS2008Target.cs b/Prebuild/src/Core/Targets/VS2008Target.cs index e685962b5a..fee4f7f27f 100644 --- a/Prebuild/src/Core/Targets/VS2008Target.cs +++ b/Prebuild/src/Core/Targets/VS2008Target.cs @@ -1,6 +1,4 @@ using System; -using System.Collections; -using System.Collections.Specialized; using System.IO; using System.Text; @@ -27,9 +25,6 @@ namespace Prebuild.Core.Targets string name = "vs2008"; VSVersion version = VSVersion.VS90; - Hashtable tools; - Kernel kernel; - /// /// Gets or sets the solution version. /// @@ -120,7 +115,7 @@ namespace Prebuild.Core.Targets #region Constructors /// - /// Initializes a new instance of the class. + /// Initializes a new instance of the class. /// public VS2008Target() : base() diff --git a/Prebuild/src/Core/Targets/VS2010Target.cs b/Prebuild/src/Core/Targets/VS2010Target.cs index 8772d18595..b16120c389 100644 --- a/Prebuild/src/Core/Targets/VS2010Target.cs +++ b/Prebuild/src/Core/Targets/VS2010Target.cs @@ -1,6 +1,4 @@ -using System; -using System.Collections; -using System.Collections.Specialized; +using System; using System.IO; using System.Text; @@ -13,98 +11,104 @@ using System.CodeDom.Compiler; namespace Prebuild.Core.Targets { - /// - /// - /// - [Target("vs2010")] - public class VS2010Target : VSGenericTarget - { - #region Fields - string solutionVersion = "11.00"; - string productVersion = "9.0.21022"; - string schemaVersion = "2.0"; - string versionName = "Visual Studio 2010"; - string name = "vs2008"; - VSVersion version = VSVersion.VS10; + /// + /// + /// + [Target("vs2010")] + public class VS2010Target : VSGenericTarget + { + #region Fields + + string solutionVersion = "11.00"; + string productVersion = "9.0.30729"; + string schemaVersion = "2.0"; + string versionName = "Visual Studio 2010"; + string name = "vs2010"; + VSVersion version = VSVersion.VS10; - Hashtable tools; - Kernel kernel; - - /// - /// Gets or sets the solution version. - /// - /// The solution version. - public override string SolutionVersion - { - get - { - return solutionVersion; - } - } - /// - /// Gets or sets the product version. - /// - /// The product version. - public override string ProductVersion - { - get - { - return productVersion; - } - } - /// - /// Gets or sets the schema version. - /// - /// The schema version. - public override string SchemaVersion - { - get - { - return schemaVersion; - } - } - /// - /// Gets or sets the name of the version. - /// - /// The name of the version. - public override string VersionName - { - get - { - return versionName; - } - } - /// - /// Gets or sets the version. - /// - /// The version. - public override VSVersion Version - { - get - { - return version; - } - } - /// - /// Gets the name. - /// - /// The name. - public override string Name - { - get - { - return name; - } - } + #endregion + + #region Properties + + /// + /// Gets or sets the solution version. + /// + /// The solution version. + public override string SolutionVersion + { + get + { + return solutionVersion; + } + } + + /// + /// Gets or sets the product version. + /// + /// The product version. + public override string ProductVersion + { + get + { + return productVersion; + } + } + + /// + /// Gets or sets the schema version. + /// + /// The schema version. + public override string SchemaVersion + { + get + { + return schemaVersion; + } + } + + /// + /// Gets or sets the name of the version. + /// + /// The name of the version. + public override string VersionName + { + get + { + return versionName; + } + } + + /// + /// Gets or sets the version. + /// + /// The version. + public override VSVersion Version + { + get + { + return version; + } + } + + /// + /// Gets the name. + /// + /// The name. + public override string Name + { + get + { + return name; + } + } protected override string GetToolsVersionXml(FrameworkVersion frameworkVersion) { switch (frameworkVersion) { - case FrameworkVersion.v4_0: - return "ToolsVersion=\"4.0\""; + case FrameworkVersion.v4_0: case FrameworkVersion.v3_5: - return "ToolsVersion=\"3.5\""; + return "ToolsVersion=\"4.0\""; case FrameworkVersion.v3_0: return "ToolsVersion=\"3.0\""; default: @@ -117,18 +121,18 @@ namespace Prebuild.Core.Targets get { return "# Visual Studio 2010"; } } - #endregion + #endregion - #region Constructors + #region Constructors - /// - /// Initializes a new instance of the class. - /// - public VS2010Target() - : base() - { - } + /// + /// Initializes a new instance of the class. + /// + public VS2010Target() + : base() + { + } - #endregion - } + #endregion + } } diff --git a/Prebuild/src/Core/Targets/VSGenericTarget.cs b/Prebuild/src/Core/Targets/VSGenericTarget.cs index fdcc2b909a..cd3f5bbe1d 100644 --- a/Prebuild/src/Core/Targets/VSGenericTarget.cs +++ b/Prebuild/src/Core/Targets/VSGenericTarget.cs @@ -5,32 +5,27 @@ Copyright (c) 2008 Matthew Holmes (matthew@wildfiregames.com), John Anderson (so Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: -* Redistributions of source code must retain the above copyright notice, this list of conditions - and the following disclaimer. -* Redistributions in binary form must reproduce the above copyright notice, this list of conditions - and the following disclaimer in the documentation and/or other materials provided with the - distribution. -* The name of the author may not be used to endorse or promote products derived from this software - without specific prior written permission. + * Redistributions of source code must retain the above copyright notice, this list of conditions + and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright notice, this list of conditions + and the following disclaimer in the documentation and/or other materials provided with the + distribution. + * The name of the author may not be used to endorse or promote products derived from this software + without specific prior written permission. -THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, -BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, +BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -*/ + */ #endregion using System; -using System.Collections; using System.Collections.Generic; -using System.Collections.Specialized; using System.IO; -using System.Text; - -using Prebuild.Core.Attributes; using Prebuild.Core.Interfaces; using Prebuild.Core.Nodes; using Prebuild.Core.Utilities; @@ -46,59 +41,59 @@ namespace Prebuild.Core.Targets { #region Fields - readonly Hashtable tools = new Hashtable(); + readonly Dictionary tools = new Dictionary(); Kernel kernel; #endregion - #region Properties - /// - /// Gets or sets the solution version. - /// - /// The solution version. - public abstract string SolutionVersion { get; } - /// - /// Gets or sets the product version. - /// - /// The product version. - public abstract string ProductVersion { get; } - /// - /// Gets or sets the schema version. - /// - /// The schema version. - public abstract string SchemaVersion { get; } - /// - /// Gets or sets the name of the version. - /// - /// The name of the version. - public abstract string VersionName { get; } - /// - /// Gets or sets the version. - /// - /// The version. - public abstract VSVersion Version { get; } - /// - /// Gets the name. - /// - /// The name. - public abstract string Name { get; } + #region Properties + /// + /// Gets or sets the solution version. + /// + /// The solution version. + public abstract string SolutionVersion { get; } + /// + /// Gets or sets the product version. + /// + /// The product version. + public abstract string ProductVersion { get; } + /// + /// Gets or sets the schema version. + /// + /// The schema version. + public abstract string SchemaVersion { get; } + /// + /// Gets or sets the name of the version. + /// + /// The name of the version. + public abstract string VersionName { get; } + /// + /// Gets or sets the version. + /// + /// The version. + public abstract VSVersion Version { get; } + /// + /// Gets the name. + /// + /// The name. + public abstract string Name { get; } - protected abstract string GetToolsVersionXml(FrameworkVersion version); - public abstract string SolutionTag { get; } + protected abstract string GetToolsVersionXml(FrameworkVersion version); + public abstract string SolutionTag { get; } - #endregion + #endregion #region Constructors /// - /// Initializes a new instance of the class. + /// Initializes a new instance of the class. /// protected VSGenericTarget() { - this.tools["C#"] = new ToolInfo("C#", "{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}", "csproj", "CSHARP", "$(MSBuildBinPath)\\Microsoft.CSHARP.Targets"); - this.tools["Database"] = new ToolInfo("Database", "{4F174C21-8C12-11D0-8340-0000F80270F8}", "dbp", "UNKNOWN"); - this.tools["Boo"] = new ToolInfo("Boo", "{45CEA7DC-C2ED-48A6-ACE0-E16144C02365}", "booproj", "Boo", "$(BooBinPath)\\Boo.Microsoft.Build.targets"); - this.tools["VisualBasic"] = new ToolInfo("VisualBasic", "{F184B08F-C81C-45F6-A57F-5ABD9991F28F}", "vbproj", "VisualBasic", "$(MSBuildBinPath)\\Microsoft.VisualBasic.Targets"); - this.tools["Folder"] = new ToolInfo("Folder", "{2150E333-8FDC-42A3-9474-1A3956D46DE8}", null, null); + tools["C#"] = new ToolInfo("C#", "{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}", "csproj", "CSHARP", "$(MSBuildBinPath)\\Microsoft.CSHARP.Targets"); + tools["Database"] = new ToolInfo("Database", "{4F174C21-8C12-11D0-8340-0000F80270F8}", "dbp", "UNKNOWN"); + tools["Boo"] = new ToolInfo("Boo", "{45CEA7DC-C2ED-48A6-ACE0-E16144C02365}", "booproj", "Boo", "$(BooBinPath)\\Boo.Microsoft.Build.targets"); + tools["VisualBasic"] = new ToolInfo("VisualBasic", "{F184B08F-C81C-45F6-A57F-5ABD9991F28F}", "vbproj", "VisualBasic", "$(MSBuildBinPath)\\Microsoft.VisualBasic.Targets"); + tools["Folder"] = new ToolInfo("Folder", "{2150E333-8FDC-42A3-9474-1A3956D46DE8}", null, null); } #endregion @@ -124,7 +119,7 @@ namespace Prebuild.Core.Targets } catch (ArgumentException) { - this.kernel.Log.Write(LogType.Warning, "Could not resolve reference path: {0}", node.Path); + kernel.Log.Write(LogType.Warning, "Could not resolve reference path: {0}", node.Path); } } @@ -144,7 +139,7 @@ namespace Prebuild.Core.Targets private static ProjectNode FindProjectInSolutionRecursively(string name, SolutionNode solution) { if (solution.ProjectsTable.ContainsKey(name)) - return (ProjectNode)solution.ProjectsTable[name]; + return solution.ProjectsTable[name]; foreach (SolutionNode child in solution.Solutions) { @@ -163,7 +158,7 @@ namespace Prebuild.Core.Targets throw new UnknownLanguageException("Unknown .NET language: " + project.Language); } - ToolInfo toolInfo = (ToolInfo)tools[project.Language]; + ToolInfo toolInfo = tools[project.Language]; string projectFile = Helper.MakeFilePath(project.FullPath, project.Name, toolInfo.FileExtension); StreamWriter ps = new StreamWriter(projectFile); @@ -173,83 +168,83 @@ namespace Prebuild.Core.Targets #region Project File using (ps) { - ps.WriteLine("", this.Version == VSVersion.VS10 ? "4.0" : "3.5"); - ps.WriteLine(" "); - ps.WriteLine(" Local"); - ps.WriteLine(" {0}", this.ProductVersion); - ps.WriteLine(" {0}", this.SchemaVersion); - ps.WriteLine(" {{{0}}}", project.Guid.ToString().ToUpper()); + ps.WriteLine("", GetToolsVersionXml(project.FrameworkVersion)); + ps.WriteLine(" "); + ps.WriteLine(" Local"); + ps.WriteLine(" {0}", ProductVersion); + ps.WriteLine(" {0}", SchemaVersion); + ps.WriteLine(" {{{0}}}", project.Guid.ToString().ToUpper()); // Visual Studio has a hard coded guid for the project type if (project.Type == ProjectType.Web) - ps.WriteLine(" {349c5851-65df-11da-9384-00065b846f21};{fae04ec0-301f-11d3-bf4b-00c04f79efbc}"); - ps.WriteLine(" Debug"); - ps.WriteLine(" AnyCPU"); - ps.WriteLine(" {0}", project.AppIcon); - ps.WriteLine(" "); - ps.WriteLine(" "); - ps.WriteLine(" {0}", project.AssemblyName); + ps.WriteLine(" {349c5851-65df-11da-9384-00065b846f21};{fae04ec0-301f-11d3-bf4b-00c04f79efbc}"); + ps.WriteLine(" Debug"); + ps.WriteLine(" {0}", project.AppIcon); + ps.WriteLine(" "); + ps.WriteLine(" "); + ps.WriteLine(" {0}", project.AssemblyName); foreach (ConfigurationNode conf in project.Configurations) { if (conf.Options.KeyFile != "") { - ps.WriteLine(" {0}", conf.Options.KeyFile); - ps.WriteLine(" true"); + ps.WriteLine(" {0}", conf.Options.KeyFile); + ps.WriteLine(" true"); break; } } - ps.WriteLine(" JScript"); - ps.WriteLine(" Grid"); - ps.WriteLine(" IE50"); - ps.WriteLine(" false"); - ps.WriteLine(" {0}", project.FrameworkVersion.ToString().Replace("_", ".")); + ps.WriteLine(" JScript"); + ps.WriteLine(" Grid"); + ps.WriteLine(" IE50"); + ps.WriteLine(" false"); + ps.WriteLine(" {0}", project.FrameworkVersion.ToString().Replace("_", ".")); - ps.WriteLine(" {0}", project.Type == ProjectType.Web ? ProjectType.Library.ToString() : project.Type.ToString()); - ps.WriteLine(" {0}", project.DesignerFolder); - ps.WriteLine(" {0}", project.RootNamespace); - ps.WriteLine(" {0}", project.StartupObject); - if (string.IsNullOrEmpty(project.DebugStartParameters)) - { - ps.WriteLine(" {0}", project.DebugStartParameters); - } - ps.WriteLine(" "); - ps.WriteLine(" "); + ps.WriteLine(" {0}", project.Type == ProjectType.Web ? ProjectType.Library.ToString() : project.Type.ToString()); + ps.WriteLine(" {0}", project.DesignerFolder); + ps.WriteLine(" {0}", project.RootNamespace); + ps.WriteLine(" {0}", project.StartupObject); + if (string.IsNullOrEmpty(project.DebugStartParameters)) + { + ps.WriteLine(" {0}", project.DebugStartParameters); + } + ps.WriteLine(" "); + ps.WriteLine(" "); - ps.WriteLine(" "); + ps.WriteLine(" "); foreach (ConfigurationNode conf in project.Configurations) { - ps.Write(" ", conf.Name); - ps.WriteLine(" {0}", conf.Options["AllowUnsafe"]); - ps.WriteLine(" {0}", conf.Options["BaseAddress"]); - ps.WriteLine(" {0}", conf.Options["CheckUnderflowOverflow"]); - ps.WriteLine(" "); - ps.WriteLine(" "); - ps.WriteLine(" {0}", conf.Options["CompilerDefines"]); - ps.WriteLine(" {0}", Helper.NormalizePath(conf.Options["XmlDocFile"].ToString())); - ps.WriteLine(" {0}", conf.Options["DebugInformation"]); - ps.WriteLine(" {0}", conf.Options["FileAlignment"]); - ps.WriteLine(" {0}", conf.Options["OptimizeCode"]); + ps.Write(" ", conf.Name, conf.Platform); + ps.WriteLine(" {0}", conf.Options["AllowUnsafe"]); + ps.WriteLine(" {0}", conf.Options["BaseAddress"]); + ps.WriteLine(" {0}", conf.Options["CheckUnderflowOverflow"]); + ps.WriteLine(" "); + ps.WriteLine(" "); + ps.WriteLine(" {0}", conf.Options["CompilerDefines"]); + ps.WriteLine(" {0}", Helper.NormalizePath(conf.Options["XmlDocFile"].ToString())); + ps.WriteLine(" {0}", conf.Options["DebugInformation"]); + ps.WriteLine(" {0}", conf.Options["FileAlignment"]); + ps.WriteLine(" {0}", conf.Options["OptimizeCode"]); if (project.Type != ProjectType.Web) - ps.WriteLine(" {0}", - Helper.EndPath(Helper.NormalizePath(conf.Options["OutputPath"].ToString()))); + ps.WriteLine(" {0}", + Helper.EndPath(Helper.NormalizePath(conf.Options["OutputPath"].ToString()))); else - ps.WriteLine(" {0}", - Helper.EndPath(Helper.NormalizePath("bin\\"))); + ps.WriteLine(" {0}", + Helper.EndPath(Helper.NormalizePath("bin\\"))); - ps.WriteLine(" {0}", conf.Options["RegisterComInterop"]); - ps.WriteLine(" {0}", conf.Options["RemoveIntegerChecks"]); - ps.WriteLine(" {0}", conf.Options["WarningsAsErrors"]); - ps.WriteLine(" {0}", conf.Options["WarningLevel"]); - ps.WriteLine(" {0}", conf.Options["NoStdLib"]); - ps.WriteLine(" {0}", conf.Options["SuppressWarnings"]); - ps.WriteLine(" "); + ps.WriteLine(" {0}", conf.Options["RegisterComInterop"]); + ps.WriteLine(" {0}", conf.Options["RemoveIntegerChecks"]); + ps.WriteLine(" {0}", conf.Options["WarningsAsErrors"]); + ps.WriteLine(" {0}", conf.Options["WarningLevel"]); + ps.WriteLine(" {0}", conf.Options["NoStdLib"]); + ps.WriteLine(" {0}", conf.Options["SuppressWarnings"]); + ps.WriteLine(" {0}", conf.Platform); + ps.WriteLine(" "); } - //ps.WriteLine(" "); + //ps.WriteLine(" "); - List projectReferences = new List(); + Dictionary projectReferences = new Dictionary(); List otherReferences = new List(); foreach (ReferenceNode refr in project.References) @@ -259,57 +254,75 @@ namespace Prebuild.Core.Targets if (projectNode == null) otherReferences.Add(refr); else - projectReferences.Add(projectNode); + projectReferences.Add(refr, projectNode); } // Assembly References - ps.WriteLine(" "); + ps.WriteLine(" "); foreach (ReferenceNode refr in otherReferences) { - ps.Write(" "); - ps.Write(" "); + ps.Write(" "); ps.Write(refr.Name); ps.WriteLine(""); - // TODO: Allow reference to *.exe files - ps.WriteLine(" {0}", refr.LocalCopy); - ps.WriteLine(" "); + + if(!String.IsNullOrEmpty(refr.Path)) + { + // Use absolute path to assembly (for determining assembly type) + string absolutePath = Path.Combine(project.FullPath, refr.Path); + if(File.Exists(Helper.MakeFilePath(absolutePath, refr.Name, "exe"))) { + // Assembly is an executable (exe) + ps.WriteLine(" {0}", Helper.MakeFilePath(refr.Path, refr.Name, "exe")); + } else if(File.Exists(Helper.MakeFilePath(absolutePath, refr.Name, "dll"))) { + // Assembly is an library (dll) + ps.WriteLine(" {0}", Helper.MakeFilePath(refr.Path, refr.Name, "dll")); + } else { + string referencePath = Helper.MakeFilePath(refr.Path, refr.Name, "dll"); + kernel.Log.Write(LogType.Warning, "Reference \"{0}\": The specified file doesn't exist.", referencePath); + ps.WriteLine(" {0}", Helper.MakeFilePath(refr.Path, refr.Name, "dll")); + } + } + + ps.WriteLine(" {0}", refr.LocalCopy); + ps.WriteLine(" "); } - ps.WriteLine(" "); + ps.WriteLine(" "); //Project References - ps.WriteLine(" "); - foreach (ProjectNode projectReference in projectReferences) + ps.WriteLine(" "); + foreach (KeyValuePair pair in projectReferences) { - ToolInfo tool = (ToolInfo)tools[projectReference.Language]; - if (tools == null) - throw new UnknownLanguageException(); + ToolInfo tool = tools[pair.Value.Language]; + if (tools == null) + throw new UnknownLanguageException(); - string path = - Helper.MakePathRelativeTo(project.FullPath, - Helper.MakeFilePath(projectReference.FullPath, projectReference.Name, tool.FileExtension)); - ps.WriteLine(" ", path); + string path = + Helper.MakePathRelativeTo(project.FullPath, + Helper.MakeFilePath(pair.Value.FullPath, pair.Value.Name, tool.FileExtension)); + ps.WriteLine(" ", path); // TODO: Allow reference to visual basic projects - ps.WriteLine(" {0}", projectReference.Name); - ps.WriteLine(" {0}", projectReference.Guid.ToString("B").ToUpper()); - ps.WriteLine(" {0}", tool.Guid.ToUpper()); + ps.WriteLine(" {0}", pair.Value.Name); + ps.WriteLine(" {0}", pair.Value.Guid.ToString("B").ToUpper()); + ps.WriteLine(" {0}", tool.Guid.ToUpper()); - ps.WriteLine(" False" ); + //This is the Copy Local flag in VS + ps.WriteLine(" {0}", pair.Key.LocalCopy); - ps.WriteLine(" "); + ps.WriteLine(" "); } - ps.WriteLine(" "); + ps.WriteLine(" "); - // ps.WriteLine(" "); - ps.WriteLine(" "); + // ps.WriteLine(" "); + ps.WriteLine(" "); - // ps.WriteLine(" "); + // ps.WriteLine(" "); List list = new List(); - foreach (string path in project.Files) + foreach (string path in project.Files) { string lower = path.ToLower(); if (lower.EndsWith(".resx")) @@ -318,93 +331,106 @@ namespace Prebuild.Core.Targets if (!list.Contains(codebehind)) list.Add(codebehind); } + } - foreach (string file in project.Files) + foreach (string filePath in project.Files) { // if (file == "Properties\\Bind.Designer.cs") // { // Console.WriteLine("Wait a minute!"); // Console.WriteLine(project.Files.GetSubType(file).ToString()); // } - - SubType subType = project.Files.GetSubType(file); + SubType subType = project.Files.GetSubType(filePath); + + // Visual Studio chokes on file names if forward slash is used as a path separator + // instead of backslash. So we must make sure that all file paths written to the + // project file use \ as a path separator. + string file = filePath.Replace(@"/", @"\"); if (subType != SubType.Code && subType != SubType.Settings && subType != SubType.Designer - && subType != SubType.CodeBehind) + && subType != SubType.CodeBehind) { - ps.WriteLine(" ", file.Substring(0, file.LastIndexOf('.')) + ".resx"); - ps.WriteLine(" {0}", Path.GetFileName(file)); - ps.WriteLine(" Designer"); - ps.WriteLine(" "); + ps.WriteLine(" ", file.Substring(0, file.LastIndexOf('.')) + ".resx"); + ps.WriteLine(" {0}", Path.GetFileName(file)); + ps.WriteLine(" Designer"); + ps.WriteLine(" "); // } if (subType == SubType.Designer) { - ps.WriteLine(" ", file); - ps.WriteLine(" " + subType + ""); - ps.WriteLine(" ResXFileCodeGenerator"); + ps.WriteLine(" ", file); string autogen_name = file.Substring(0, file.LastIndexOf('.')) + ".Designer.cs"; - string dependent_name = file.Substring(0, file.LastIndexOf('.')) + ".cs"; + string dependent_name = filePath.Substring(0, file.LastIndexOf('.')) + ".cs"; - ps.WriteLine(" {0}", autogen_name); - - // Check for a parent .cs file with the same name as this designer file - if (File.Exists(dependent_name)) - ps.WriteLine(" {0}", Path.GetFileName(dependent_name)); - - ps.WriteLine(" "); - if (File.Exists(autogen_name)) + // Check for a parent .cs file with the same name as this designer file + if (File.Exists(Helper.NormalizePath(dependent_name))) { - ps.WriteLine(" ", autogen_name); - ps.WriteLine(" True"); - ps.WriteLine(" True"); + ps.WriteLine(" {0}", Path.GetFileName(dependent_name)); + } + else + { + ps.WriteLine(" ResXFileCodeGenerator"); + ps.WriteLine(" {0}", Path.GetFileName(autogen_name)); + ps.WriteLine(" " + subType + ""); + } + + ps.WriteLine(" "); + if (File.Exists(Helper.NormalizePath(autogen_name))) + { + ps.WriteLine(" ", autogen_name); + //ps.WriteLine(" True"); - // If a parent .cs file exists, link this autogen file to it. Otherwise link - // to the designer file - if (File.Exists(dependent_name)) - ps.WriteLine(" {0}", Path.GetFileName(dependent_name)); - else - ps.WriteLine(" {0}", Path.GetFileName(file)); - - ps.WriteLine(" "); + // If a parent .cs file exists, link this autogen file to it. Otherwise link + // to the designer file + if (File.Exists(dependent_name)) + { + ps.WriteLine(" {0}", Path.GetFileName(dependent_name)); + } + else + { + ps.WriteLine(" True"); + ps.WriteLine(" {0}", Path.GetFileName(filePath)); + } + + ps.WriteLine(" "); } list.Add(autogen_name); } if (subType == SubType.Settings) { - ps.Write(" <{0} ", project.Files.GetBuildAction(file)); + ps.Write(" <{0} ", project.Files.GetBuildAction(filePath)); ps.WriteLine("Include=\"{0}\">", file); - string fileName = Path.GetFileName(file); - if (project.Files.GetBuildAction(file) == BuildAction.None) + string fileName = Path.GetFileName(filePath); + if (project.Files.GetBuildAction(filePath) == BuildAction.None) { - ps.WriteLine(" SettingsSingleFileGenerator"); - ps.WriteLine(" {0}", fileName.Substring(0, fileName.LastIndexOf('.')) + ".Designer.cs"); + ps.WriteLine(" SettingsSingleFileGenerator"); + ps.WriteLine(" {0}", fileName.Substring(0, fileName.LastIndexOf('.')) + ".Designer.cs"); } else { - ps.WriteLine(" Code"); - ps.WriteLine(" True"); - ps.WriteLine(" True"); + ps.WriteLine(" Code"); + ps.WriteLine(" True"); + ps.WriteLine(" True"); string fileNameShort = fileName.Substring(0, fileName.LastIndexOf('.')); string fileNameShorter = fileNameShort.Substring(0, fileNameShort.LastIndexOf('.')); - ps.WriteLine(" {0}", Path.GetFileName(fileNameShorter + ".settings")); + ps.WriteLine(" {0}", Path.GetFileName(fileNameShorter + ".settings")); } - ps.WriteLine(" ", project.Files.GetBuildAction(file)); + ps.WriteLine(" ", project.Files.GetBuildAction(filePath)); } else if (subType != SubType.Designer) { string path = Helper.NormalizePath(file); - string path_lower = path.ToLower(); + string path_lower = path.ToLower(); - if (!list.Contains(file)) + if (!list.Contains(filePath)) { - ps.Write(" <{0} ", project.Files.GetBuildAction(path)); + ps.Write(" <{0} ", project.Files.GetBuildAction(filePath)); int startPos = 0; - if (project.Files.GetPreservePath(file)) + if (project.Files.GetPreservePath(filePath)) { while ((@"./\").IndexOf(file.Substring(startPos, 1)) != -1) startPos++; @@ -415,60 +441,75 @@ namespace Prebuild.Core.Targets startPos = file.LastIndexOf(Path.GetFileName(path)); } - ps.WriteLine("Include=\"{0}\">", path); + // be sure to write out the path with backslashes so VS recognizes + // the file properly. + ps.WriteLine("Include=\"{0}\">", file); int last_period_index = file.LastIndexOf('.'); string short_file_name = file.Substring(0, last_period_index); string extension = Path.GetExtension(path); - string designer_format = string.Format(".designer{0}", extension); + // make this upper case, so that when File.Exists tests for the + // existence of a designer file on a case-sensitive platform, + // it is correctly identified. + string designer_format = string.Format(".Designer{0}", extension); - if (path_lower.EndsWith(designer_format)) + if (path_lower.EndsWith(designer_format.ToLowerInvariant())) { - int designer_index = path_lower.IndexOf(designer_format); + int designer_index = path.IndexOf(designer_format); string file_name = path.Substring(0, designer_index); - if (File.Exists(file_name)) - ps.WriteLine(" {0}", Path.GetFileName(file_name)); + // There are two corrections to the next lines: + // 1. Fix the connection between a designer file and a form + // or usercontrol that don't have an associated resx file. + // 2. Connect settings files to associated designer files. + if (File.Exists(file_name + extension)) + ps.WriteLine(" {0}", Path.GetFileName(file_name + extension)); else if (File.Exists(file_name + ".resx")) - ps.WriteLine(" {0}", Path.GetFileName(file_name + ".resx")); + ps.WriteLine(" {0}", Path.GetFileName(file_name + ".resx")); + else if (File.Exists(file_name + ".settings")) + { + ps.WriteLine(" {0}", Path.GetFileName(file_name + ".settings")); + ps.WriteLine(" True"); + ps.WriteLine(" True"); + } } else if (subType == SubType.CodeBehind) { - ps.WriteLine(" {0}", Path.GetFileName(short_file_name)); + ps.WriteLine(" {0}", Path.GetFileName(short_file_name)); } - if (project.Files.GetIsLink(file)) + if (project.Files.GetIsLink(filePath)) { - string alias = project.Files.GetLinkPath(file); + string alias = project.Files.GetLinkPath(filePath); alias += file.Substring(startPos); alias = Helper.NormalizePath(alias); - ps.WriteLine(" {0}", alias); + ps.WriteLine(" {0}", alias); } - else if (project.Files.GetBuildAction(file) != BuildAction.None) + else if (project.Files.GetBuildAction(filePath) != BuildAction.None) { - if (project.Files.GetBuildAction(file) != BuildAction.EmbeddedResource) + if (project.Files.GetBuildAction(filePath) != BuildAction.EmbeddedResource) { - ps.WriteLine(" {0}", subType); + ps.WriteLine(" {0}", subType); } } - if (project.Files.GetCopyToOutput(file) != CopyToOutput.Never) + if (project.Files.GetCopyToOutput(filePath) != CopyToOutput.Never) { - ps.WriteLine(" {0}", project.Files.GetCopyToOutput(file)); + ps.WriteLine(" {0}", project.Files.GetCopyToOutput(filePath)); } - ps.WriteLine(" ", project.Files.GetBuildAction(file)); + ps.WriteLine(" ", project.Files.GetBuildAction(filePath)); } } } - ps.WriteLine(" "); - ps.WriteLine(" "); - ps.WriteLine(" "); - ps.WriteLine(" "); - ps.WriteLine(" "); - ps.WriteLine(" "); - ps.WriteLine(" "); - ps.WriteLine(" "); + ps.WriteLine(" "); + ps.WriteLine(" "); + ps.WriteLine(" "); + ps.WriteLine(" "); + ps.WriteLine(" "); + ps.WriteLine(" "); + ps.WriteLine(" "); + ps.WriteLine(" "); ps.WriteLine(""); } #endregion @@ -478,23 +519,36 @@ namespace Prebuild.Core.Targets ps = new StreamWriter(projectFile + ".user"); using (ps) { + // Get the first configuration from the project. + ConfigurationNode firstConfiguration = null; + + if (project.Configurations.Count > 0) + { + firstConfiguration = project.Configurations[0]; + } + ps.WriteLine(""); //ps.WriteLine( "" ); //ps.WriteLine(" <{0}>", toolInfo.XMLTag); - //ps.WriteLine(" "); - ps.WriteLine(" "); - //ps.WriteLine(" ", MakeRefPath(project)); - ps.WriteLine(" Debug"); - ps.WriteLine(" AnyCPU"); - ps.WriteLine(" {0}", MakeRefPath(project)); - ps.WriteLine(" {0}", this.ProductVersion); - ps.WriteLine(" ProjectFiles"); - ps.WriteLine(" 0"); - ps.WriteLine(" "); + //ps.WriteLine(" "); + ps.WriteLine(" "); + //ps.WriteLine(" ", MakeRefPath(project)); + + if (firstConfiguration != null) + { + ps.WriteLine(" {0}", firstConfiguration.Name); + ps.WriteLine(" {0}", firstConfiguration.Platform); + } + + ps.WriteLine(" {0}", MakeRefPath(project)); + ps.WriteLine(" {0}", ProductVersion); + ps.WriteLine(" ProjectFiles"); + ps.WriteLine(" 0"); + ps.WriteLine(" "); foreach (ConfigurationNode conf in project.Configurations) { - ps.Write(" "); } ps.WriteLine(""); @@ -504,9 +558,9 @@ namespace Prebuild.Core.Targets kernel.CurrentWorkingDirectory.Pop(); } - private void WriteSolution(SolutionNode solution, bool writeSolutionToDisk) + private void WriteSolution(SolutionNode solution, bool writeSolutionToDisk) { - kernel.Log.Write("Creating {0} solution and project files", this.VersionName); + kernel.Log.Write("Creating {0} solution and project files", VersionName); foreach (SolutionNode child in solution.Solutions) { @@ -531,13 +585,13 @@ namespace Prebuild.Core.Targets kernel.Log.Write(""); string solutionFile = Helper.MakeFilePath(solution.FullPath, solution.Name, "sln"); - using (StreamWriter ss = new StreamWriter(solutionFile)) - { - kernel.CurrentWorkingDirectory.Push(); - Helper.SetCurrentDir(Path.GetDirectoryName(solutionFile)); + using (StreamWriter ss = new StreamWriter(solutionFile)) + { + kernel.CurrentWorkingDirectory.Push(); + Helper.SetCurrentDir(Path.GetDirectoryName(solutionFile)); - ss.WriteLine("Microsoft Visual Studio Solution File, Format Version {0}", this.SolutionVersion); - ss.WriteLine(SolutionTag); + ss.WriteLine("Microsoft Visual Studio Solution File, Format Version {0}", SolutionVersion); + ss.WriteLine(SolutionTag); WriteProjectDeclarations(ss, solution, solution); @@ -546,7 +600,7 @@ namespace Prebuild.Core.Targets ss.WriteLine("\tGlobalSection(SolutionConfigurationPlatforms) = preSolution"); foreach (ConfigurationNode conf in solution.Configurations) { - ss.WriteLine("\t\t{0}|Any CPU = {0}|Any CPU", conf.Name); + ss.WriteLine("\t\t{0} = {0}", conf.NameAndPlatform); } ss.WriteLine("\tEndGlobalSection"); @@ -571,7 +625,7 @@ namespace Prebuild.Core.Targets } } - private void WriteProjectDeclarations(StreamWriter writer, SolutionNode actualSolution, SolutionNode embeddedSolution) + private void WriteProjectDeclarations(TextWriter writer, SolutionNode actualSolution, SolutionNode embeddedSolution) { foreach (SolutionNode childSolution in embeddedSolution.Solutions) { @@ -595,7 +649,7 @@ namespace Prebuild.Core.Targets } } - private static void WriteNestedProjectMap(StreamWriter writer, SolutionNode embeddedSolution) + private static void WriteNestedProjectMap(TextWriter writer, SolutionNode embeddedSolution) { foreach (ProjectNode project in embeddedSolution.Projects) { @@ -614,31 +668,31 @@ namespace Prebuild.Core.Targets } } - private static void WriteNestedProject(StreamWriter writer, SolutionNode solution, Guid projectGuid) + private static void WriteNestedProject(TextWriter writer, SolutionNode solution, Guid projectGuid) { WriteNestedFolder(writer, solution.Guid, projectGuid); } - private static void WriteNestedFolder(StreamWriter writer, Guid parentGuid, Guid childGuid) + private static void WriteNestedFolder(TextWriter writer, Guid parentGuid, Guid childGuid) { writer.WriteLine("\t\t{0} = {1}", - childGuid.ToString("B").ToUpper(), - parentGuid.ToString("B").ToUpper()); + childGuid.ToString("B").ToUpper(), + parentGuid.ToString("B").ToUpper()); } - private static void WriteConfigurationLines(ICollection configurations, SolutionNode solution, StreamWriter ss) + private static void WriteConfigurationLines(IEnumerable configurations, SolutionNode solution, TextWriter ss) { foreach (ProjectNode project in solution.Projects) { foreach (ConfigurationNode conf in configurations) { - ss.WriteLine("\t\t{0}.{1}|Any CPU.ActiveCfg = {1}|Any CPU", - project.Guid.ToString("B").ToUpper(), - conf.Name); + ss.WriteLine("\t\t{0}.{1}.ActiveCfg = {1}", + project.Guid.ToString("B").ToUpper(), + conf.NameAndPlatform); - ss.WriteLine("\t\t{0}.{1}|Any CPU.Build.0 = {1}|Any CPU", - project.Guid.ToString("B").ToUpper(), - conf.Name); + ss.WriteLine("\t\t{0}.{1}.Build.0 = {1}", + project.Guid.ToString("B").ToUpper(), + conf.NameAndPlatform); } } @@ -648,54 +702,37 @@ namespace Prebuild.Core.Targets } } - private void WriteSolutionFiles(SolutionNode solution, StreamWriter ss) + private void WriteSolutionFiles(SolutionNode solution, TextWriter ss) { - if (solution.Files != null && solution.Files.Count > 0) - { - WriteProject(ss, "Folder", solution.Guid, "Solution Files", "Solution Files", solution.Files); - } + if(solution.Files != null && solution.Files.Count > 0) + WriteProject(ss, "Folder", solution.Guid, "Solution Files", "Solution Files", solution.Files); } - private void WriteEmbeddedSolution(StreamWriter writer, SolutionNode embeddedSolution) + private void WriteEmbeddedSolution(TextWriter writer, SolutionNode embeddedSolution) { WriteProject(writer, "Folder", embeddedSolution.Guid, embeddedSolution.Name, embeddedSolution.Name, embeddedSolution.Files); } - private void WriteProject(SolutionNode solution, StreamWriter ss, ProjectNode project) + private void WriteProject(SolutionNode solution, TextWriter ss, ProjectNode project) { WriteProject(ss, solution, project.Language, project.Guid, project.Name, project.FullPath); } - private void WriteProject(SolutionNode solution, StreamWriter ss, DatabaseProjectNode dbProject) + private void WriteProject(SolutionNode solution, TextWriter ss, DatabaseProjectNode dbProject) { if (solution.Files != null && solution.Files.Count > 0) WriteProject(ss, solution, "Database", dbProject.Guid, dbProject.Name, dbProject.FullPath); } - private static bool ExtensionSpecified(string refName) - { - return refName.EndsWith(".dll") || refName.EndsWith(".exe"); - } - - private static string GetProjectExtension(ProjectNode project) - { - string extension = ".dll"; - if (project.Type == ProjectType.Exe) - { - extension = ".exe"; - } - return extension; - } - const string ProjectDeclarationBeginFormat = "Project(\"{0}\") = \"{1}\", \"{2}\", \"{3}\""; const string ProjectDeclarationEndFormat = "EndProject"; - private void WriteProject(StreamWriter ss, SolutionNode solution, string language, Guid guid, string name, string projectFullPath) + private void WriteProject(TextWriter ss, SolutionNode solution, string language, Guid guid, string name, string projectFullPath) { if (!tools.ContainsKey(language)) throw new UnknownLanguageException("Unknown .NET language: " + language); - ToolInfo toolInfo = (ToolInfo)tools[language]; + ToolInfo toolInfo = tools[language]; string path = Helper.MakePathRelativeTo(solution.FullPath, projectFullPath); @@ -704,23 +741,23 @@ namespace Prebuild.Core.Targets WriteProject(ss, language, guid, name, path); } - private void WriteProject(StreamWriter writer, string language, Guid projectGuid, string name, string location) + private void WriteProject(TextWriter writer, string language, Guid projectGuid, string name, string location) { WriteProject(writer, language, projectGuid, name, location, null); } - private void WriteProject(StreamWriter writer, string language, Guid projectGuid, string name, string location, FilesNode files) + private void WriteProject(TextWriter writer, string language, Guid projectGuid, string name, string location, FilesNode files) { if (!tools.ContainsKey(language)) throw new UnknownLanguageException("Unknown .NET language: " + language); - ToolInfo toolInfo = (ToolInfo)tools[language]; + ToolInfo toolInfo = tools[language]; writer.WriteLine(ProjectDeclarationBeginFormat, - toolInfo.Guid, - name, - location, - projectGuid.ToString("B").ToUpper()); + toolInfo.Guid, + name, + location, + projectGuid.ToString("B").ToUpper()); if (files != null) { @@ -738,7 +775,7 @@ namespace Prebuild.Core.Targets private void WriteDatabaseProject(SolutionNode solution, DatabaseProjectNode project) { string projectFile = Helper.MakeFilePath(project.FullPath, project.Name, "dbp"); - IndentedTextWriter ps = new IndentedTextWriter(new StreamWriter(projectFile), " "); + IndentedTextWriter ps = new IndentedTextWriter(new StreamWriter(projectFile), " "); kernel.CurrentWorkingDirectory.Push(); @@ -777,12 +814,10 @@ namespace Prebuild.Core.Targets kernel.CurrentWorkingDirectory.Pop(); } - private bool ContainsSqlFiles(string folder) + private static bool ContainsSqlFiles(string folder) { - foreach (string file in Directory.GetFiles(folder, "*.sql")) - { + if(Directory.GetFiles(folder, "*.sql").Length > 0) return true; // if the folder contains 1 .sql file, that's good enough - } foreach (string child in Directory.GetDirectories(folder)) { @@ -793,7 +828,7 @@ namespace Prebuild.Core.Targets return false; } - private void WriteDatabaseFoldersAndFiles(IndentedTextWriter writer, string folder) + private static void WriteDatabaseFoldersAndFiles(IndentedTextWriter writer, string folder) { foreach (string child in Directory.GetDirectories(folder)) { @@ -816,7 +851,7 @@ namespace Prebuild.Core.Targets { kernel.Log.Write("...Cleaning project: {0}", project.Name); - ToolInfo toolInfo = (ToolInfo)tools[project.Language]; + ToolInfo toolInfo = tools[project.Language]; string projectFile = Helper.MakeFilePath(project.FullPath, project.Name, toolInfo.FileExtension); string userFile = projectFile + ".user"; @@ -826,7 +861,7 @@ namespace Prebuild.Core.Targets private void CleanSolution(SolutionNode solution) { - kernel.Log.Write("Cleaning {0} solution and project files", this.VersionName, solution.Name); + kernel.Log.Write("Cleaning {0} solution and project files", VersionName, solution.Name); string slnFile = Helper.MakeFilePath(solution.FullPath, solution.Name, "sln"); string suoFile = Helper.MakeFilePath(solution.FullPath, solution.Name, "suo"); diff --git a/Prebuild/src/Core/Targets/VSVersion.cs b/Prebuild/src/Core/Targets/VSVersion.cs index 59549b00a9..699b5ca019 100644 --- a/Prebuild/src/Core/Targets/VSVersion.cs +++ b/Prebuild/src/Core/Targets/VSVersion.cs @@ -45,10 +45,10 @@ namespace Prebuild.Core.Targets /// /// Visual Studio 2008 /// - VS90, - /// - /// Visual Studio 2010 - /// - VS10 + VS90, + /// + /// Visual Studio 2010 + /// + VS10 } } diff --git a/Prebuild/src/Core/Targets/XcodeTarget.cs b/Prebuild/src/Core/Targets/XcodeTarget.cs index d96f65b86d..5393cec05f 100644 --- a/Prebuild/src/Core/Targets/XcodeTarget.cs +++ b/Prebuild/src/Core/Targets/XcodeTarget.cs @@ -24,8 +24,6 @@ IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY O #endregion using System; -using System.Collections; -using System.Collections.Specialized; using System.IO; using System.Reflection; using System.Text.RegularExpressions; diff --git a/Prebuild/src/Core/Utilities/CommandLineCollection.cs b/Prebuild/src/Core/Utilities/CommandLineCollection.cs index 22752aa1e1..786fa1e49d 100644 --- a/Prebuild/src/Core/Utilities/CommandLineCollection.cs +++ b/Prebuild/src/Core/Utilities/CommandLineCollection.cs @@ -23,10 +23,8 @@ IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY O */ #endregion -using System; using System.Collections; -using System.Collections.Specialized; -using System.Diagnostics; +using System.Collections.Generic; namespace Prebuild.Core.Utilities { @@ -34,15 +32,15 @@ namespace Prebuild.Core.Utilities /// The CommandLine class parses and interprets the command-line arguments passed to /// prebuild. /// - public class CommandLineCollection + public class CommandLineCollection : IEnumerable> { #region Fields // The raw OS arguments - private string[] m_RawArgs; + private readonly string[] m_RawArgs; // Command-line argument storage - private Hashtable m_Arguments; + private readonly Dictionary m_Arguments = new Dictionary(); #endregion @@ -54,8 +52,7 @@ namespace Prebuild.Core.Utilities public CommandLineCollection(string[] args) { m_RawArgs = args; - m_Arguments = new Hashtable(); - + Parse(); } @@ -69,11 +66,11 @@ namespace Prebuild.Core.Utilities return; int idx = 0; - string arg = null, lastArg = null; + string lastArg = null; while(idx 2 && arg[0] == '/') { @@ -119,16 +116,13 @@ namespace Prebuild.Core.Utilities /// null string if no parameter was specified, and the value if a parameter was specified public string this[string index] { - get + get { - if(m_Arguments.ContainsKey(index)) + if(m_Arguments.ContainsKey(index)) { - return (string)(m_Arguments[index]); - } - else - { - return null; + return (m_Arguments[index]); } + return null; } } @@ -143,11 +137,16 @@ namespace Prebuild.Core.Utilities /// An /// that can be used to iterate through the collection. /// - public IDictionaryEnumerator GetEnumerator() + public IEnumerator> GetEnumerator() { - return m_Arguments.GetEnumerator(); + return m_Arguments.GetEnumerator(); } - #endregion + IEnumerator IEnumerable.GetEnumerator() + { + return GetEnumerator(); + } + + #endregion } } diff --git a/Prebuild/src/Core/Utilities/CurrentDirectory.cs b/Prebuild/src/Core/Utilities/CurrentDirectory.cs index 5fabdf0943..9624c35ed5 100644 --- a/Prebuild/src/Core/Utilities/CurrentDirectory.cs +++ b/Prebuild/src/Core/Utilities/CurrentDirectory.cs @@ -24,7 +24,7 @@ IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY O #endregion using System; -using System.Collections; +using System.Collections.Generic; namespace Prebuild.Core.Utilities { @@ -35,19 +35,7 @@ namespace Prebuild.Core.Utilities { #region Fields - private Stack m_Stack; - - #endregion - - #region Constructors - - /// - /// Initializes a new instance of the class. - /// - public CurrentDirectory() - { - m_Stack = new Stack(); - } + private readonly Stack m_Stack = new Stack(); #endregion @@ -71,7 +59,7 @@ namespace Prebuild.Core.Utilities return; } - string cwd = (string)m_Stack.Pop(); + string cwd = m_Stack.Pop(); Helper.SetCurrentDir(cwd); } diff --git a/Prebuild/src/Core/Utilities/Helper.cs b/Prebuild/src/Core/Utilities/Helper.cs index 9a0d131c7e..8c3e9680c5 100644 --- a/Prebuild/src/Core/Utilities/Helper.cs +++ b/Prebuild/src/Core/Utilities/Helper.cs @@ -24,7 +24,7 @@ IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY O #endregion using System; -using System.Collections; +using System.Collections.Generic; using System.Diagnostics; using System.IO; using System.Runtime.InteropServices; @@ -42,8 +42,6 @@ namespace Prebuild.Core.Utilities { #region Fields - private static Stack dirStack; - private static Regex varRegex; static bool checkForOSVariables; /// @@ -61,61 +59,13 @@ namespace Prebuild.Core.Utilities } } - #endregion - - #region Constructors - - /// - /// Initializes the class. - /// - static Helper() - { - dirStack = new Stack(); - //m_VarRegex = new Regex(@"\${(?[\w|_]+)}"); - } - - #endregion - - #region Properties - - /// - /// - /// - public static Stack DirStack - { - get - { - return dirStack; - } - } - - /// - /// - /// - public static Regex VarRegex - { - get - { - return varRegex; - } - set - { - varRegex = value; - } - } - #endregion #region Public Methods #region String Parsing - #region Inner Classes and Delegates - /// - /// - /// + public delegate string StringLookup(string key); - - #endregion /// /// Gets a collection of StringLocationPair objects that represent the matches @@ -545,35 +495,6 @@ namespace Prebuild.Core.Utilities return attrs[0]; } - /* A bit of overhead for simple group parsing, there are problems with Regex in Mono - public static string ParseValue(string val) - { - if(val == null || val.Length < 1 || !CheckForOSVariables) - return val; - - string tmp = val; - Match m = m_VarRegex.Match(val); - while(m.Success) - { - if(m.Groups["var"] == null) - continue; - - Capture c = m.Groups["var"].Captures[0]; - if(c == null) - continue; - - string var = c.Value; - string envVal = Environment.GetEnvironmentVariable(var); - if(envVal == null) - envVal = ""; - - tmp = tmp.Replace("${" + var + "}", envVal); - m = m.NextMatch(); - } - - return tmp; - }*/ - /// /// Attributes the value. /// diff --git a/Prebuild/src/Core/Utilities/Log.cs b/Prebuild/src/Core/Utilities/Log.cs index 548e987690..4df3defdd0 100644 --- a/Prebuild/src/Core/Utilities/Log.cs +++ b/Prebuild/src/Core/Utilities/Log.cs @@ -82,7 +82,7 @@ namespace Prebuild.Core.Utilities { #region Fields - private StreamWriter m_Writer; + private TextWriter m_Writer; private LogTargets m_Target = LogTargets.Null; bool disposed; @@ -96,14 +96,20 @@ namespace Prebuild.Core.Utilities /// The target. /// Name of the file. public Log(LogTargets target, string fileName) - { - m_Target = target; - - if((m_Target & LogTargets.File) != 0) - { - m_Writer = new StreamWriter(fileName, false); - } - } + { + m_Target = target; + + if ((m_Target & LogTargets.File) != 0) + { + m_Writer = new StreamWriter(fileName, false); + } + else if ((m_Target & LogTargets.Console) != 0) + { + // Prevents null reference exceptions when outputing to the log file. + // This seems to only happen when running on a network drive. + m_Writer = Console.Out; + } + } #endregion diff --git a/Prebuild/src/Core/WarningException.cs b/Prebuild/src/Core/WarningException.cs index df90dc8d7d..b7c3668cce 100644 --- a/Prebuild/src/Core/WarningException.cs +++ b/Prebuild/src/Core/WarningException.cs @@ -31,7 +31,7 @@ namespace Prebuild.Core /// /// /// - [Serializable()] + [Serializable] public class WarningException : Exception { #region Constructors diff --git a/Prebuild/src/Prebuild.cs b/Prebuild/src/Prebuild.cs index 2d12b53066..081c89c404 100644 --- a/Prebuild/src/Prebuild.cs +++ b/Prebuild/src/Prebuild.cs @@ -26,9 +26,9 @@ IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY O #region CVS Information /* * $Source$ - * $Author: jendave $ - * $Date: 2006-09-26 23:43:35 +0200 (ti, 26 sep 2006) $ - * $Revision: 168 $ + * $Author: kunnis $ + * $Date: 2009-04-15 02:33:14 +0100 (Wed, 15 Apr 2009) $ + * $Revision: 308 $ */ #endregion @@ -86,17 +86,17 @@ namespace Prebuild { kernel.Process(); } - } - catch(Exception ex) - { - Console.WriteLine("Unhandled error: {0}", ex.Message); - //#if DEBUG - Console.WriteLine("{0}", ex.StackTrace); - //#endif - } - finally - { - if(kernel.PauseAfterFinish) + } +#if !DEBUG + catch (Exception ex) + { + Console.WriteLine("Unhandled error: {0}", ex.Message); + Console.WriteLine("{0}", ex.StackTrace); + } +#endif + finally + { + if(kernel != null && kernel.PauseAfterFinish) { Console.WriteLine("\nPress enter to continue..."); Console.ReadLine(); diff --git a/Prebuild/src/Properties/AssemblyInfo.cs b/Prebuild/src/Properties/AssemblyInfo.cs index 65c8736add..f3ac30f39d 100644 --- a/Prebuild/src/Properties/AssemblyInfo.cs +++ b/Prebuild/src/Properties/AssemblyInfo.cs @@ -61,16 +61,17 @@ using System.Resources; [assembly: AssemblyConfiguration(".NET CLR")] [assembly: AssemblyCompany("The Prebuild Project")] [assembly: AssemblyProduct("")] -[assembly: AssemblyCopyright("Copyright 2004-2008 " + +[assembly: AssemblyCopyright("Copyright 2004-2010 " + "Matthew Holmes, " + "Dan Moorehead, " + "C.J. Adams-Collier, " + "Rob Loach, " + - "David Hudson,")] + "David Hudson," + + "John Hurliman")] [assembly: AssemblyTrademark("")] [assembly: AssemblyCulture("")] [assembly: NeutralResourcesLanguageAttribute("en-US")] -[assembly: AssemblyVersion("2.0.4.*")] +[assembly: AssemblyVersion("2.0.5.*")] // // Version information for an assembly consists of the following four values: diff --git a/Prebuild/src/data/prebuild-1.7.xsd b/Prebuild/src/data/prebuild-1.7.xsd index c3f8d6bb67..3675503bab 100644 --- a/Prebuild/src/data/prebuild-1.7.xsd +++ b/Prebuild/src/data/prebuild-1.7.xsd @@ -40,7 +40,7 @@ - + @@ -57,6 +57,7 @@ + @@ -224,6 +225,7 @@ + @@ -232,6 +234,7 @@ + @@ -275,6 +278,7 @@ + @@ -322,10 +326,25 @@ + + + + + + + + + + + + + + + diff --git a/Prebuild/src/data/prebuild-1.8.xsd b/Prebuild/src/data/prebuild-1.8.xsd new file mode 100644 index 0000000000..8f5c1a4566 --- /dev/null +++ b/Prebuild/src/data/prebuild-1.8.xsd @@ -0,0 +1,331 @@ + + + + + Copyright (c) 2004-2007 + Matthew Holmes (calefaction at houston . rr . com), + Dan Moorehead (dan05a at gmail . com), + David Hudson (jendave at yahoo dot com), + C.J. Adams-Collier (cjac at colliertech dot com) + + .NET Prebuild is a cross-platform XML-driven pre-build tool which + allows developers to easily generate project or make files for major + IDE's and .NET development tools including: Visual Studio .NET 2002, + 2003, and 2005, SharpDevelop, MonoDevelop, NAnt, Xcode and the GNU Autotools. + + BSD License: + + Redistribution and use in source and binary forms, with or without modification, are permitted + provided that the following conditions are met: + + * Redistributions of source code must retain the above copyright notice, this list of conditions + and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright notice, this list of conditions + and the following disclaimer in the documentation and/or other materials provided with the + distribution. + * The name of the author may not be used to endorse or promote products derived from this software + without specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE AUTHOR 'AS IS' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, + BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, + EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY + OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING + IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/Prebuild/src/data/prebuild-1.9.xsd b/Prebuild/src/data/prebuild-1.9.xsd new file mode 100644 index 0000000000..fbca556f19 --- /dev/null +++ b/Prebuild/src/data/prebuild-1.9.xsd @@ -0,0 +1,336 @@ + + + + + Copyright (c) 2004-2007 + Matthew Holmes (calefaction at houston . rr . com), + Dan Moorehead (dan05a at gmail . com), + David Hudson (jendave at yahoo dot com), + C.J. Adams-Collier (cjac at colliertech dot com) + + .NET Prebuild is a cross-platform XML-driven pre-build tool which + allows developers to easily generate project or make files for major + IDE's and .NET development tools including: Visual Studio .NET 2002, + 2003, and 2005, SharpDevelop, MonoDevelop, NAnt, Xcode and the GNU Autotools. + + BSD License: + + Redistribution and use in source and binary forms, with or without modification, are permitted + provided that the following conditions are met: + + * Redistributions of source code must retain the above copyright notice, this list of conditions + and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright notice, this list of conditions + and the following disclaimer in the documentation and/or other materials provided with the + distribution. + * The name of the author may not be used to endorse or promote products derived from this software + without specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE AUTHOR 'AS IS' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, + BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, + EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY + OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING + IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/README.txt b/README.txt index 18784be11d..391a6599d1 100644 --- a/README.txt +++ b/README.txt @@ -1,8 +1,8 @@ Welcome to OpenSim! -================ -=== OVERVIEW === -================ +================== +==== OVERVIEW ==== +================== OpenSim is a BSD Licensed Open Source project to develop a functioning virtual worlds server platform capable of supporting multiple clients diff --git a/ThirdPartyLicenses/MonoAddins.txt b/ThirdPartyLicenses/MonoAddins.txt new file mode 100644 index 0000000000..10c23b37dd --- /dev/null +++ b/ThirdPartyLicenses/MonoAddins.txt @@ -0,0 +1,41 @@ +Authors: Lluis Sanchez Gual + +The MIT License + +Copyright (C) 2007 Novell, Inc (http://www.novell.com) + + + +Permission is hereby granted, free of charge, to any person obtaining +a copy + of this software and associated documentation files (the "Software"), +to deal + in the Software without restriction, including without limitation +the rights +to use, copy, modify, merge, publish, distribute, sublicense, +and/or sell +copies of the Software, and to permit persons to whom the +Software is +furnished to do so, subject to the following conditions: + + + +The above copyright notice and this permission notice shall be included in + +all copies or substantial portions of the Software. + + + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NON INFRINGEMENT. +IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, +DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR +OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR +THE USE OR OTHER DEALINGS IN +THE SOFTWARE. diff --git a/bin/Community.CsharpSqlite.Sqlite.dll b/bin/Community.CsharpSqlite.Sqlite.dll new file mode 100644 index 0000000000..93ac7bd8dc Binary files /dev/null and b/bin/Community.CsharpSqlite.Sqlite.dll differ diff --git a/bin/Community.CsharpSqlite.Sqlite.pdb b/bin/Community.CsharpSqlite.Sqlite.pdb new file mode 100644 index 0000000000..3920d80249 Binary files /dev/null and b/bin/Community.CsharpSqlite.Sqlite.pdb differ diff --git a/bin/Community.CsharpSqlite.dll b/bin/Community.CsharpSqlite.dll new file mode 100644 index 0000000000..a2e4513e34 Binary files /dev/null and b/bin/Community.CsharpSqlite.dll differ diff --git a/bin/Community.CsharpSqlite.pdb b/bin/Community.CsharpSqlite.pdb new file mode 100644 index 0000000000..bb8c4e5ce3 Binary files /dev/null and b/bin/Community.CsharpSqlite.pdb differ diff --git a/bin/Mono.Addins.CecilReflector.dll b/bin/Mono.Addins.CecilReflector.dll new file mode 100644 index 0000000000..a1a638265c Binary files /dev/null and b/bin/Mono.Addins.CecilReflector.dll differ diff --git a/bin/Mono.Addins.Setup.dll b/bin/Mono.Addins.Setup.dll new file mode 100644 index 0000000000..8aa6d5f2cf Binary files /dev/null and b/bin/Mono.Addins.Setup.dll differ diff --git a/bin/Mono.Addins.dll b/bin/Mono.Addins.dll index 5dc95203db..ea330fdc9b 100644 Binary files a/bin/Mono.Addins.dll and b/bin/Mono.Addins.dll differ diff --git a/bin/MySql.Data.dll b/bin/MySql.Data.dll index 7aa95ec345..c28c618f23 100644 Binary files a/bin/MySql.Data.dll and b/bin/MySql.Data.dll differ diff --git a/bin/Newtonsoft.Json.dll b/bin/Newtonsoft.Json.Net20.dll similarity index 100% rename from bin/Newtonsoft.Json.dll rename to bin/Newtonsoft.Json.Net20.dll diff --git a/bin/OpenMetaverse.Rendering.Meshmerizer.dll b/bin/OpenMetaverse.Rendering.Meshmerizer.dll new file mode 100755 index 0000000000..6139a9d5d9 Binary files /dev/null and b/bin/OpenMetaverse.Rendering.Meshmerizer.dll differ diff --git a/bin/OpenMetaverse.StructuredData.XML b/bin/OpenMetaverse.StructuredData.XML index 374bc25e38..897a330e54 100644 --- a/bin/OpenMetaverse.StructuredData.XML +++ b/bin/OpenMetaverse.StructuredData.XML @@ -17,17 +17,17 @@ - + Deserializes binary LLSD - - + Serialized data + OSD containting deserialized data - + Deserializes binary LLSD - - + Stream to read the data from + OSD containting deserialized data @@ -57,7 +57,7 @@ - + diff --git a/bin/OpenMetaverse.StructuredData.dll b/bin/OpenMetaverse.StructuredData.dll index f4992a21ea..e3b729c6ee 100644 Binary files a/bin/OpenMetaverse.StructuredData.dll and b/bin/OpenMetaverse.StructuredData.dll differ diff --git a/bin/OpenMetaverse.Utilities.XML b/bin/OpenMetaverse.Utilities.XML deleted file mode 100644 index 3fdf0044c0..0000000000 --- a/bin/OpenMetaverse.Utilities.XML +++ /dev/null @@ -1,98 +0,0 @@ - - - - OpenMetaverse.Utilities - - - - Amount of time to wait for the voice daemon to respond. - The value needs to stay relatively high because some of the calls - require the voice daemon to make remote queries before replying - - - - Does not appear to be working - - - - - - - Returns the new user ID or throws an exception containing the error code - The error codes can be found here: https://wiki.secondlife.com/wiki/RegAPIError - - New user account to create - The UUID of the new user account - - - - See https://secure-web6.secondlife.com/developers/third_party_reg/#service_create_user or - https://wiki.secondlife.com/wiki/RegAPIDoc for description - - - - - - - - - - - - - - - - - - - - - - Aims at the specified position, enters mouselook, presses and - releases the left mouse button, and leaves mouselook - - - Target to shoot at - - - - - Enters mouselook, presses and releases the left mouse button, and leaves mouselook - - - - - - A psuedo-realistic chat function that uses the typing sound and - animation, types at three characters per second, and randomly - pauses. This function will block until the message has been sent - - A reference to the client that will chat - The chat message to send - - - - A psuedo-realistic chat function that uses the typing sound and - animation, types at a given rate, and randomly pauses. This - function will block until the message has been sent - - A reference to the client that will chat - The chat message to send - The chat type (usually Normal, Whisper or Shout) - Characters per second rate for chatting - - - Unknown voice service level - - - Spatialized local chat - - - Remote multi-party chat - - - One-to-one and small group chat - - - diff --git a/bin/OpenMetaverse.Utilities.dll b/bin/OpenMetaverse.Utilities.dll deleted file mode 100644 index 04248beaea..0000000000 Binary files a/bin/OpenMetaverse.Utilities.dll and /dev/null differ diff --git a/bin/OpenMetaverse.XML b/bin/OpenMetaverse.XML index cdb618e0dc..6e57fed0d7 100644 --- a/bin/OpenMetaverse.XML +++ b/bin/OpenMetaverse.XML @@ -4,555 +4,3342 @@ OpenMetaverse - + + = + + + Number of times we've received an unknown CAPS exception in series. + + + For exponential backoff on error. + + - Identifier code for primitive types + Add a custom decoder callback + + The key of the field to decode + The custom decode handler + + + + Remove a custom decoder callback + + The key of the field to decode + The custom decode handler + + + + Creates a formatted string containing the values of a Packet + + The Packet + A formatted string of values of the nested items in the Packet object + + + + Decode an IMessage object into a beautifully formatted string + + The IMessage object + Recursion level (used for indenting) + A formatted string containing the names and values of the source object + + + + A custom decoder callback + + The key of the object + the data to decode + A string represending the fieldData + + + + Access to the data server which allows searching for land, events, people, etc - - None + + The event subscribers. null if no subcribers - - A Primitive + + Raises the EventInfoReply event + An EventInfoReplyEventArgs object containing the + data returned from the data server - - A Avatar + + Thread sync lock object - - Linden grass + + The event subscribers. null if no subcribers - - Linden tree + + Raises the DirEventsReply event + An DirEventsReplyEventArgs object containing the + data returned from the data server - - A primitive that acts as the source for a particle stream + + Thread sync lock object - - A Linden tree + + The event subscribers. null if no subcribers - + + Raises the PlacesReply event + A PlacesReplyEventArgs object containing the + data returned from the data server + + + Thread sync lock object + + + The event subscribers. null if no subcribers + + + Raises the DirPlacesReply event + A DirPlacesReplyEventArgs object containing the + data returned from the data server + + + Thread sync lock object + + + The event subscribers. null if no subcribers + + + Raises the DirClassifiedsReply event + A DirClassifiedsReplyEventArgs object containing the + data returned from the data server + + + Thread sync lock object + + + The event subscribers. null if no subcribers + + + Raises the DirGroupsReply event + A DirGroupsReplyEventArgs object containing the + data returned from the data server + + + Thread sync lock object + + + The event subscribers. null if no subcribers + + + Raises the DirPeopleReply event + A DirPeopleReplyEventArgs object containing the + data returned from the data server + + + Thread sync lock object + + + The event subscribers. null if no subcribers + + + Raises the DirLandReply event + A DirLandReplyEventArgs object containing the + data returned from the data server + + + Thread sync lock object + + - Primary parameters for primitives such as Physics Enabled or Phantom + Constructs a new instance of the DirectoryManager class + An instance of GridClient - - Deprecated - - - Whether physics are enabled for this object - - - - - - - - - - - - - - - - - - - - - Whether this object contains an active touch script - - - - - - Whether this object can receive payments - - - Whether this object is phantom (no collisions) - - - - - - - - - - - - - - - Deprecated - - - - - - - - - - - - Deprecated - - - - - - - - - - - - - - - Server flag, will not be sent to clients. Specifies that - the object is destroyed when it touches a simulator edge - - - Server flag, will not be sent to clients. Specifies that - the object will be returned to the owner's inventory when it - touches a simulator edge - - - Server flag, will not be sent to clients. - - - Server flag, will not be sent to client. Specifies that - the object is hovering/flying - - - - - - - - - - - - - - - - Sound flags for sounds attached to primitives - - - - - - - - - - - - - - - - - - - - - - - - - - Material type for a primitive - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Used in a helper function to roughly determine prim shape - - - - - Extra parameters for primitives, these flags are for features that have - been added after the original ObjectFlags that has all eight bits - reserved already - - - - Whether this object has flexible parameters - - - Whether this object has light parameters - - - Whether this object is a sculpted prim - - + + Query the data server for a list of classified ads containing the specified string. + Defaults to searching for classified placed in any category, and includes PG, Adult and Mature + results. - - - - - - - - - - - - - + Responses are sent 16 per response packet, there is no way to know how many results a query reply will contain however assuming + the reply packets arrived ordered, a response with less than 16 entries would indicate all results have been received + The event is raised when a response is received from the simulator + A string containing a list of keywords to search for + A UUID to correlate the results when the event is raised - - - - - - - - - - - - - - - - - - - - - - + + Query the data server for a list of classified ads which contain specified keywords (Overload) + The event is raised when a response is received from the simulator - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Attachment points for objects on avatar bodies - - - Both InventoryObject and InventoryAttachment types can be attached + A string containing a list of keywords to search for + The category to search + A set of flags which can be ORed to modify query options + such as classified maturity rating. + A UUID to correlate the results when the event is raised + + Search classified ads containing the key words "foo" and "bar" in the "Any" category that are either PG or Mature + + UUID searchID = StartClassifiedSearch("foo bar", ClassifiedCategories.Any, ClassifiedQueryFlags.PG | ClassifiedQueryFlags.Mature); + + + + Responses are sent 16 at a time, there is no way to know how many results a query reply will contain however assuming + the reply packets arrived ordered, a response with less than 16 entries would indicate all results have been received - - Right hand if object was not previously attached - - - Chest - - - Skull - - - Left shoulder - - - Right shoulder - - - Left hand - - - Right hand - - - Left foot - - - Right foot - - - Spine - - - Pelvis - - - Mouth - - - Chin - - - Left ear - - - Right ear - - - Left eyeball - - - Right eyeball - - - Nose - - - Right upper arm - - - Right forearm - - - Left upper arm - - - Left forearm - - - Right hip - - - Right upper leg - - - Right lower leg - - - Left hip - - - Left upper leg - - - Left lower leg - - - Stomach - - - Left pectoral - - - Right pectoral - - - HUD Center position 2 - - - HUD Top-right - - - HUD Top - - - HUD Top-left - - - HUD Center - - - HUD Bottom-left - - - HUD Bottom - - - HUD Bottom-right - - + - Tree foliage types + Starts search for places (Overloaded) + + The event is raised when a response is received from the simulator + + Search text + Each request is limited to 100 places + being returned. To get the first 100 result entries of a request use 0, + from 100-199 use 1, 200-299 use 2, etc. + A UUID to correlate the results when the event is raised + + + + Queries the dataserver for parcels of land which are flagged to be shown in search + + The event is raised when a response is received from the simulator + + A string containing a list of keywords to search for separated by a space character + A set of flags which can be ORed to modify query options + such as classified maturity rating. + The category to search + Each request is limited to 100 places + being returned. To get the first 100 result entries of a request use 0, + from 100-199 use 1, 200-299 use 2, etc. + A UUID to correlate the results when the event is raised + + Search places containing the key words "foo" and "bar" in the "Any" category that are either PG or Adult + + UUID searchID = StartDirPlacesSearch("foo bar", DirFindFlags.DwellSort | DirFindFlags.IncludePG | DirFindFlags.IncludeAdult, ParcelCategory.Any, 0); + + + + Additional information on the results can be obtained by using the ParcelManager.InfoRequest method + + + + + Starts a search for land sales using the directory + + The event is raised when a response is received from the simulator + + What type of land to search for. Auction, + estate, mainland, "first land", etc + The OnDirLandReply event handler must be registered before + calling this function. There is no way to determine how many + results will be returned, or how many times the callback will be + fired other than you won't get more than 100 total parcels from + each query. + + + + Starts a search for land sales using the directory + + The event is raised when a response is received from the simulator + + What type of land to search for. Auction, + estate, mainland, "first land", etc + Maximum price to search for + Maximum area to search for + Each request is limited to 100 parcels + being returned. To get the first 100 parcels of a request use 0, + from 100-199 use 1, 200-299 use 2, etc. + The OnDirLandReply event handler must be registered before + calling this function. There is no way to determine how many + results will be returned, or how many times the callback will be + fired other than you won't get more than 100 total parcels from + each query. + + + + Send a request to the data server for land sales listings + + + Flags sent to specify query options + + Available flags: + Specify the parcel rating with one or more of the following: + IncludePG IncludeMature IncludeAdult + + Specify the field to pre sort the results with ONLY ONE of the following: + PerMeterSort NameSort AreaSort PricesSort + + Specify the order the results are returned in, if not specified the results are pre sorted in a Descending Order + SortAsc + + Specify additional filters to limit the results with one or both of the following: + LimitByPrice LimitByArea + + Flags can be combined by separating them with the | (pipe) character + + Additional details can be found in + + What type of land to search for. Auction, + Estate or Mainland + Maximum price to search for when the + DirFindFlags.LimitByPrice flag is specified in findFlags + Maximum area to search for when the + DirFindFlags.LimitByArea flag is specified in findFlags + Each request is limited to 100 parcels + being returned. To get the first 100 parcels of a request use 0, + from 100-199 use 100, 200-299 use 200, etc. + The event will be raised with the response from the simulator + + There is no way to determine how many results will be returned, or how many times the callback will be + fired other than you won't get more than 100 total parcels from + each reply. + + Any land set for sale to either anybody or specific to the connected agent will be included in the + results if the land is included in the query + + + // request all mainland, any maturity rating that is larger than 512 sq.m + StartLandSearch(DirFindFlags.SortAsc | DirFindFlags.PerMeterSort | DirFindFlags.LimitByArea | DirFindFlags.IncludePG | DirFindFlags.IncludeMature | DirFindFlags.IncludeAdult, SearchTypeFlags.Mainland, 0, 512, 0); + + + + + Search for Groups + + The name or portion of the name of the group you wish to search for + Start from the match number + + + + + Search for Groups + + The name or portion of the name of the group you wish to search for + Start from the match number + Search flags + + + + + Search the People directory for other avatars + + The name or portion of the name of the avatar you wish to search for + + + + + + Search Places for parcels of land you personally own - - Pine1 tree - - - Oak tree - - - Tropical Bush1 - - - Palm1 tree - - - Dogwood tree - - - Tropical Bush2 - - - Palm2 tree - - - Cypress1 tree - - - Cypress2 tree - - - Pine2 tree - - - Plumeria - - - Winter pinetree1 - - - Winter Aspen tree - - - Winter pinetree2 - - - Eucalyptus tree - - - Fern - - - Eelgrass - - - Sea Sword - - - Kelp1 plant - - - Beach grass - - - Kelp2 plant - - + - Grass foliage types + Searches Places for land owned by the specified group + + ID of the group you want to recieve land list for (You must be a member of the group) + Transaction (Query) ID which can be associated with results from your request. + + + + Search the Places directory for parcels that are listed in search and contain the specified keywords + + A string containing the keywords to search for + Transaction (Query) ID which can be associated with results from your request. + + + + Search Places - All Options + + One of the Values from the DirFindFlags struct, ie: AgentOwned, GroupOwned, etc. + One of the values from the SearchCategory Struct, ie: Any, Linden, Newcomer + A string containing a list of keywords to search for separated by a space character + String Simulator Name to search in + LLUID of group you want to recieve results for + Transaction (Query) ID which can be associated with results from your request. + Transaction (Query) ID which can be associated with results from your request. + + + + Search All Events with specifid searchText in all categories, includes PG, Mature and Adult + + A string containing a list of keywords to search for separated by a space character + Each request is limited to 100 entries + being returned. To get the first group of entries of a request use 0, + from 100-199 use 100, 200-299 use 200, etc. + UUID of query to correlate results in callback. + + + + Search Events + + A string containing a list of keywords to search for separated by a space character + One or more of the following flags: DateEvents, IncludePG, IncludeMature, IncludeAdult + from the Enum + + Multiple flags can be combined by separating the flags with the | (pipe) character + "u" for in-progress and upcoming events, -or- number of days since/until event is scheduled + For example "0" = Today, "1" = tomorrow, "2" = following day, "-1" = yesterday, etc. + Each request is limited to 100 entries + being returned. To get the first group of entries of a request use 0, + from 100-199 use 100, 200-299 use 200, etc. + EventCategory event is listed under. + UUID of query to correlate results in callback. + + + Requests Event Details + ID of Event returned from the method + + + Process an incoming packet and raise the appropriate events + The sender + The EventArgs object containing the packet data + + + Process an incoming packet and raise the appropriate events + The sender + The EventArgs object containing the packet data + + + Process an incoming event message + The Unique Capabilities Key + The event message containing the data + The simulator the message originated from + + + Process an incoming packet and raise the appropriate events + The sender + The EventArgs object containing the packet data + + + Process an incoming packet and raise the appropriate events + The sender + The EventArgs object containing the packet data + + + Process an incoming event message + The Unique Capabilities Key + The event message containing the data + The simulator the message originated from + + + Process an incoming packet and raise the appropriate events + The sender + The EventArgs object containing the packet data + + + Process an incoming packet and raise the appropriate events + The sender + The EventArgs object containing the packet data + + + Process an incoming packet and raise the appropriate events + The sender + The EventArgs object containing the packet data + + + Process an incoming packet and raise the appropriate events + The sender + The EventArgs object containing the packet data + + + Raised when the data server responds to a request. + + + Raised when the data server responds to a request. + + + Raised when the data server responds to a request. + + + Raised when the data server responds to a request. + + + Raised when the data server responds to a request. + + + Raised when the data server responds to a request. + + + Raised when the data server responds to a request. + + + Raised when the data server responds to a request. + + + Classified Ad categories + + + Classified is listed in the Any category + + + Classified is shopping related + + + Classified is + + + + + + + + + + + + + + + + + + + + + + + + Event Categories + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Query Flags used in many of the DirectoryManager methods to specify which query to execute and how to return the results. + + Flags can be combined using the | (pipe) character, not all flags are available in all queries - + + Query the People database + + - + - + + Query the Groups database + + + Query the Events database + + + Query the land holdings database for land owned by the currently connected agent + + - + + Query the land holdings database for land which is owned by a Group + + + Specifies the query should pre sort the results based upon traffic + when searching the Places database + + - + - + - + + + + + Specifies the query should pre sort the results in an ascending order when searching the land sales database. + This flag is only used when searching the land sales database + + + Specifies the query should pre sort the results using the SalePrice field when searching the land sales database. + This flag is only used when searching the land sales database + + + Specifies the query should pre sort the results by calculating the average price/sq.m (SalePrice / Area) when searching the land sales database. + This flag is only used when searching the land sales database + + + Specifies the query should pre sort the results using the ParcelSize field when searching the land sales database. + This flag is only used when searching the land sales database + + + Specifies the query should pre sort the results using the Name field when searching the land sales database. + This flag is only used when searching the land sales database + + + When set, only parcels less than the specified Price will be included when searching the land sales database. + This flag is only used when searching the land sales database + + + When set, only parcels greater than the specified Size will be included when searching the land sales database. + This flag is only used when searching the land sales database + + + + + + + + + Include PG land in results. This flag is used when searching both the Groups, Events and Land sales databases + + + Include Mature land in results. This flag is used when searching both the Groups, Events and Land sales databases + + + Include Adult land in results. This flag is used when searching both the Groups, Events and Land sales databases + + + + + - Action associated with clicking on an object + Land types to search dataserver for - - Touch object + + Search Auction, Mainland and Estate - - Sit on object + + Land which is currently up for auction - - Purchase object or contents + + Parcels which are on the mainland (Linden owned) continents - - Pay the object + + Parcels which are on privately owned simulators - - Open task inventory + + + The content rating of the event + - - Play parcel media + + Event is PG - - Open parcel media + + Event is Mature + + + Event is Adult + + + + Classified Ad Options + + There appear to be two formats the flags are packed in. + This set of flags is for the newer style + + + + + + + + + + + + + + + + + + + Classified ad query options + + + + Include all ads in results + + + Include PG ads in results + + + Include Mature ads in results + + + Include Adult ads in results + + + + The For Sale flag in PlacesReplyData + + + + Parcel is not listed for sale + + + Parcel is For Sale + + + + A classified ad on the grid + + + + UUID for this ad, useful for looking up detailed + information about it + + + The title of this classified ad + + + Flags that show certain options applied to the classified + + + Creation date of the ad + + + Expiration date of the ad + + + Price that was paid for this ad + + + Print the struct data as a string + A string containing the field name, and field value + + + + A parcel retrieved from the dataserver such as results from the + "For-Sale" listings or "Places" Search + + + + The unique dataserver parcel ID + This id is used to obtain additional information from the entry + by using the method + + + A string containing the name of the parcel + + + The size of the parcel + This field is not returned for Places searches + + + The price of the parcel + This field is not returned for Places searches + + + If True, this parcel is flagged to be auctioned + + + If true, this parcel is currently set for sale + + + Parcel traffic + + + Print the struct data as a string + A string containing the field name, and field value + + + + An Avatar returned from the dataserver + + + + Online status of agent + This field appears to be obsolete and always returns false + + + The agents first name + + + The agents last name + + + The agents + + + Print the struct data as a string + A string containing the field name, and field value + + + + Response to a "Groups" Search + + + + The Group ID + + + The name of the group + + + The current number of members + + + Print the struct data as a string + A string containing the field name, and field value + + + + Parcel information returned from a request + + Represents one of the following: + A parcel of land on the grid that has its Show In Search flag set + A parcel of land owned by the agent making the request + A parcel of land owned by a group the agent making the request is a member of + + + In a request for Group Land, the First record will contain an empty record + + Note: This is not the same as searching the land for sale data source + + + + The ID of the Agent of Group that owns the parcel + + + The name + + + The description + + + The Size of the parcel + + + The billable Size of the parcel, for mainland + parcels this will match the ActualArea field. For Group owned land this will be 10 percent smaller + than the ActualArea. For Estate land this will always be 0 + + + Indicates the ForSale status of the parcel + + + The Gridwide X position + + + The Gridwide Y position + + + The Z position of the parcel, or 0 if no landing point set + + + The name of the Region the parcel is located in + + + The Asset ID of the parcels Snapshot texture + + + The calculated visitor traffic + + + The billing product SKU + Known values are: + + 023Mainland / Full Region + 024Estate / Full Region + 027Estate / Openspace + 029Estate / Homestead + 129Mainland / Homestead (Linden Owned) + + + + + No longer used, will always be 0 + + + Get a SL URL for the parcel + A string, containing a standard SLURL + + + Print the struct data as a string + A string containing the field name, and field value + + + + An "Event" Listing summary + + + + The ID of the event creator + + + The name of the event + + + The events ID + + + A string containing the short date/time the event will begin + + + The event start time in Unixtime (seconds since epoch) + + + The events maturity rating + + + Print the struct data as a string + A string containing the field name, and field value + + + + The details of an "Event" + + + + The events ID + + + The ID of the event creator + + + The name of the event + + + The category + + + The events description + + + The short date/time the event will begin + + + The event start time in Unixtime (seconds since epoch) UTC adjusted + + + The length of the event in minutes + + + 0 if no cover charge applies + + + The cover charge amount in L$ if applicable + + + The name of the region where the event is being held + + + The gridwide location of the event + + + The maturity rating + + + Get a SL URL for the parcel where the event is hosted + A string, containing a standard SLURL + + + Print the struct data as a string + A string containing the field name, and field value + + + Contains the Event data returned from the data server from an EventInfoRequest + + + Construct a new instance of the EventInfoReplyEventArgs class + A single EventInfo object containing the details of an event + + + + A single EventInfo object containing the details of an event + + + + Contains the "Event" detail data returned from the data server + + + Construct a new instance of the DirEventsReplyEventArgs class + The ID of the query returned by the data server. + This will correlate to the ID returned by the method + A list containing the "Events" returned by the search query + + + The ID returned by + + + A list of "Events" returned by the data server + + + Contains the "Event" list data returned from the data server + + + Construct a new instance of PlacesReplyEventArgs class + The ID of the query returned by the data server. + This will correlate to the ID returned by the method + A list containing the "Places" returned by the data server query + + + The ID returned by + + + A list of "Places" returned by the data server + + + Contains the places data returned from the data server + + + Construct a new instance of the DirPlacesReplyEventArgs class + The ID of the query returned by the data server. + This will correlate to the ID returned by the method + A list containing land data returned by the data server + + + The ID returned by + + + A list containing Places data returned by the data server + + + Contains the classified data returned from the data server + + + Construct a new instance of the DirClassifiedsReplyEventArgs class + A list of classified ad data returned from the data server + + + A list containing Classified Ads returned by the data server + + + Contains the group data returned from the data server + + + Construct a new instance of the DirGroupsReplyEventArgs class + The ID of the query returned by the data server. + This will correlate to the ID returned by the method + A list of groups data returned by the data server + + + The ID returned by + + + A list containing Groups data returned by the data server + + + Contains the people data returned from the data server + + + Construct a new instance of the DirPeopleReplyEventArgs class + The ID of the query returned by the data server. + This will correlate to the ID returned by the method + A list of people data returned by the data server + + + The ID returned by + + + A list containing People data returned by the data server + + + Contains the land sales data returned from the data server + + + Construct a new instance of the DirLandReplyEventArgs class + A list of parcels for sale returned by the data server + + + A list containing land forsale data returned by the data server + + + + Sent to the client to indicate a teleport request has completed + + + + + Interface requirements for Messaging system + + + + The of the agent + + + + + + The simulators handle the agent teleported to + + + A Uri which contains a list of Capabilities the simulator supports + + + Indicates the level of access required + to access the simulator, or the content rating, or the simulators + map status + + + The IP Address of the simulator + + + The UDP Port the simulator will listen for UDP traffic on + + + Status flags indicating the state of the Agent upon arrival, Flying, etc. + + + + Serialize the object + + An containing the objects data + + + + Deserialize the message + + An containing the data + + + + Sent to the viewer when a neighboring simulator is requesting the agent make a connection to it. + + + + + Serialize the object + + An containing the objects data + + + + Deserialize the message + + An containing the data + + + + Serialize the object + + An containing the objects data + + + + Deserialize the message + + An containing the data + + + + Serialize the object + + An containing the objects data + + + + Deserialize the message + + An containing the data + + + + A message sent to the client which indicates a teleport request has failed + and contains some information on why it failed + + + + + + + A string key of the reason the teleport failed e.g. CouldntTPCloser + Which could be used to look up a value in a dictionary or enum + + + The of the Agent + + + A string human readable message containing the reason + An example: Could not teleport closer to destination + + + + Serialize the object + + An containing the objects data + + + + Deserialize the message + + An containing the data + + + + Serialize the object + + An containing the objects data + + + + Deserialize the message + + An containing the data + + + + Contains a list of prim owner information for a specific parcel in a simulator + + + A Simulator will always return at least 1 entry + If agent does not have proper permission the OwnerID will be UUID.Zero + If agent does not have proper permission OR there are no primitives on parcel + the DataBlocksExtended map will not be sent from the simulator + + + + An Array of objects + + + + Serialize the object + + An containing the objects data + + + + Deserialize the message + + An containing the data + + + + Prim ownership information for a specified owner on a single parcel + + + + The of the prim owner, + UUID.Zero if agent has no permission to view prim owner information + + + The total number of prims + + + True if the OwnerID is a + + + True if the owner is online + This is no longer used by the LL Simulators + + + The date the most recent prim was rezzed + + + + The details of a single parcel in a region, also contains some regionwide globals + + + + Simulator-local ID of this parcel + + + Maximum corner of the axis-aligned bounding box for this + parcel + + + Minimum corner of the axis-aligned bounding box for this + parcel + + + Total parcel land area + + + + + + Key of authorized buyer + + + Bitmap describing land layout in 4x4m squares across the + entire region + + + + + + Date land was claimed + + + Appears to always be zero + + + Parcel Description + + + + + + + + + Total number of primitives owned by the parcel group on + this parcel + + + Whether the land is deeded to a group or not + + + + + + Maximum number of primitives this parcel supports + + + The Asset UUID of the Texture which when applied to a + primitive will display the media + + + A URL which points to any Quicktime supported media type + + + A byte, if 0x1 viewer should auto scale media to fit object + + + URL For Music Stream + + + Parcel Name + + + Autoreturn value in minutes for others' objects + + + + + + Total number of other primitives on this parcel + + + UUID of the owner of this parcel + + + Total number of primitives owned by the parcel owner on + this parcel + + + + + + How long is pass valid for + + + Price for a temporary pass + + + + + + + + + + + + + + + True if the region denies access to age unverified users + + + + + + This field is no longer used + + + The result of a request for parcel properties + + + Sale price of the parcel, only useful if ForSale is set + The SalePrice will remain the same after an ownership + transfer (sale), so it can be used to see the purchase price after + a sale if the new owner has not changed it + + + + Number of primitives your avatar is currently + selecting and sitting on in this parcel + + + + + + + + A number which increments by 1, starting at 0 for each ParcelProperties request. + Can be overriden by specifying the sequenceID with the ParcelPropertiesRequest being sent. + a Negative number indicates the action in has occurred. + + + + Maximum primitives across the entire simulator + + + Total primitives across the entire simulator + + + + + + Key of parcel snapshot + + + Parcel ownership status + + + Total number of primitives on this parcel + + + + + + + + + A description of the media + + + An Integer which represents the height of the media + + + An integer which represents the width of the media + + + A boolean, if true the viewer should loop the media + + + A string which contains the mime type of the media + + + true to obscure (hide) media url + + + true to obscure (hide) music url + + + + Serialize the object + + An containing the objects data + + + + Deserialize the message + + An containing the data + + + A message sent from the viewer to the simulator to updated a specific parcels settings + + + The of the agent authorized to purchase this + parcel of land or a NULL if the sale is authorized to anyone + + + true to enable auto scaling of the parcel media + + + The category of this parcel used when search is enabled to restrict + search results + + + A string containing the description to set + + + The of the which allows for additional + powers and restrictions. + + + The which specifies how avatars which teleport + to this parcel are handled + + + The LocalID of the parcel to update settings on + + + A string containing the description of the media which can be played + to visitors + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Deserialize the message + + An containing the data + + + + Serialize the object + + An containing the objects data + + + Base class used for the RemoteParcelRequest message + + + + A message sent from the viewer to the simulator to request information + on a remote parcel + + + + Local sim position of the parcel we are looking up + + + Region handle of the parcel we are looking up + + + Region of the parcel we are looking up + + + + Serialize the object + + An containing the objects data + + + + Deserialize the message + + An containing the data + + + + A message sent from the simulator to the viewer in response to a + which will contain parcel information + + + + The grid-wide unique parcel ID + + + + Serialize the object + + An containing the objects data + + + + Deserialize the message + + An containing the data + + + + A message containing a request for a remote parcel from a viewer, or a response + from the simulator to that request + + + + The request or response details block + + + + Serialize the object + + An containing the objects data + + + + Deserialize the message + + An containing the data + + + + Serialize the object + + An containing the objects data + + + + Deserialize the message + + An containing the data + + + + Serialize the object + + An containing the objects data + + + + Deserialize the message + + An containing the data + + + + A message sent from the simulator to an agent which contains + the groups the agent is in + + + + The Agent receiving the message + + + An array containing information + for each the agent is a member of + + + An array containing information + for each the agent is a member of + + + + Serialize the object + + An containing the objects data + + + + Deserialize the message + + An containing the data + + + Group Details specific to the agent + + + true of the agent accepts group notices + + + The agents tier contribution to the group + + + The Groups + + + The of the groups insignia + + + The name of the group + + + The aggregate permissions the agent has in the group for all roles the agent + is assigned + + + An optional block containing additional agent specific information + + + true of the agent allows this group to be + listed in their profile + + + + A message sent from the viewer to the simulator which + specifies the language and permissions for others to detect + the language specified + + + + A string containng the default language + to use for the agent + + + true of others are allowed to + know the language setting + + + + Serialize the object + + An containing the objects data + + + + Deserialize the message + + An containing the data + + + + An EventQueue message sent from the simulator to an agent when the agent + leaves a group + + + + + An Array containing the AgentID and GroupID + + + + + Serialize the object + + An containing the objects data + + + + Deserialize the message + + An containing the data + + + An object containing the Agents UUID, and the Groups UUID + + + The ID of the Agent leaving the group + + + The GroupID the Agent is leaving + + + Base class for Asset uploads/results via Capabilities + + + + The request state + + + + + Serialize the object + + An containing the objects data + + + + Deserialize the message + + An containing the data + + + + A message sent from the viewer to the simulator to request a temporary upload capability + which allows an asset to be uploaded + + + + The Capability URL sent by the simulator to upload the baked texture to + + + + A message sent from the simulator that will inform the agent the upload is complete, + and the UUID of the uploaded asset + + + + The uploaded texture asset ID + + + + A message sent from the viewer to the simulator to request a temporary + capability URI which is used to upload an agents baked appearance textures + + + + Object containing request or response + + + + Serialize the object + + An containing the objects data + + + + Deserialize the message + + An containing the data + + + + A message sent from the simulator which indicates the minimum version required for + using voice chat + + + + Major Version Required + + + Minor version required + + + The name of the region sending the version requrements + + + + Serialize the object + + An containing the objects data + + + + Deserialize the message + + An containing the data + + + + A message sent from the simulator to the viewer containing the + voice server URI + + + + The Parcel ID which the voice server URI applies + + + The name of the region + + + A uri containing the server/channel information + which the viewer can utilize to participate in voice conversations + + + + Serialize the object + + An containing the objects data + + + + Deserialize the message + + An containing the data + + + + + + + + + + + + + + + Serialize the object + + An containing the objects data + + + + Deserialize the message + + An containing the data + + + + A message sent by the viewer to the simulator to request a temporary + capability for a script contained with in a Tasks inventory to be updated + + + + Object containing request or response + + + + Serialize the object + + An containing the objects data + + + + Deserialize the message + + An containing the data + + + + A message sent from the simulator to the viewer to indicate + a Tasks scripts status. + + + + The Asset ID of the script + + + True of the script is compiled/ran using the mono interpreter, false indicates it + uses the older less efficient lsl2 interprter + + + The Task containing the scripts + + + true of the script is in a running state + + + + Serialize the object + + An containing the objects data + + + + Deserialize the message + + An containing the data + + + + A message containing the request/response used for updating a gesture + contained with an agents inventory + + + + Object containing request or response + + + + Serialize the object + + An containing the objects data + + + + Deserialize the message + + An containing the data + + + + A message request/response which is used to update a notecard contained within + a tasks inventory + + + + The of the Task containing the notecard asset to update + + + The notecard assets contained in the tasks inventory + + + + Serialize the object + + An containing the objects data + + + + Deserialize the message + + An containing the data + + + + A reusable class containing a message sent from the viewer to the simulator to request a temporary uploader capability + which is used to update an asset in an agents inventory + + + + + The Notecard AssetID to replace + + + + + Serialize the object + + An containing the objects data + + + + Deserialize the message + + An containing the data + + + + A message containing the request/response used for updating a notecard + contained with an agents inventory + + + + Object containing request or response + + + + Serialize the object + + An containing the objects data + + + + Deserialize the message + + An containing the data + + + + Serialize the object + + An containing the objects data + + + + Deserialize the message + + An containing the data + + + + A message sent from the simulator to the viewer which indicates + an error occurred while attempting to update a script in an agents or tasks + inventory + + + + true of the script was successfully compiled by the simulator + + + A string containing the error which occured while trying + to update the script + + + A new AssetID assigned to the script + + + + A message sent from the viewer to the simulator + requesting the update of an existing script contained + within a tasks inventory + + + + if true, set the script mode to running + + + The scripts InventoryItem ItemID to update + + + A lowercase string containing either "mono" or "lsl2" which + specifies the script is compiled and ran on the mono runtime, or the older + lsl runtime + + + The tasks which contains the script to update + + + + Serialize the object + + An containing the objects data + + + + Deserialize the message + + An containing the data + + + + A message containing either the request or response used in updating a script inside + a tasks inventory + + + + Object containing request or response + + + + Serialize the object + + An containing the objects data + + + + Deserialize the message + + An containing the data + + + + Response from the simulator to notify the viewer the upload is completed, and + the UUID of the script asset and its compiled status + + + + The uploaded texture asset ID + + + true of the script was compiled successfully + + + + A message sent from a viewer to the simulator requesting a temporary uploader capability + used to update a script contained in an agents inventory + + + + The existing asset if of the script in the agents inventory to replace + + + The language of the script + Defaults to lsl version 2, "mono" might be another possible option + + + + Serialize the object + + An containing the objects data + + + + Deserialize the message + + An containing the data + + + + A message containing either the request or response used in updating a script inside + an agents inventory + + + + Object containing request or response + + + + Serialize the object + + An containing the objects data + + + + Deserialize the message + + An containing the data + + + + Serialize the object + + An containing the objects data + + + + Deserialize the message + + An containing the data + + + Base class for Map Layers via Capabilities + + + + + + + Serialize the object + + An containing the objects data + + + + Deserialize the message + + An containing the data + + + + Sent by an agent to the capabilities server to request map layers + + + + + A message sent from the simulator to the viewer which contains an array of map images and their grid coordinates + + + + An array containing LayerData items + + + + Serialize the object + + An containing the objects data + + + + Deserialize the message + + An containing the data + + + + An object containing map location details + + + + The Asset ID of the regions tile overlay + + + The grid location of the southern border of the map tile + + + The grid location of the western border of the map tile + + + The grid location of the eastern border of the map tile + + + The grid location of the northern border of the map tile + + + Object containing request or response + + + + Serialize the object + + An containing the objects data + + + + Deserialize the message + + An containing the data + + + + New as of 1.23 RC1, no details yet. + + + + + Serialize the object + + An containing the objects data + + + + Deserialize the message + + An containing the data + + + + Serialize the object + + An containing the objects data + + + + Deserialize the message + + An containing the data + + + A string containing the method used + + + + A request sent from an agent to the Simulator to begin a new conference. + Contains a list of Agents which will be included in the conference + + + + An array containing the of the agents invited to this conference + + + The conferences Session ID + + + + Serialize the object + + An containing the objects data + + + + Deserialize the message + + An containing the data + + + + A moderation request sent from a conference moderator + Contains an agent and an optional action to take + + + + The Session ID + + + + + + A list containing Key/Value pairs, known valid values: + key: text value: true/false - allow/disallow specified agents ability to use text in session + key: voice value: true/false - allow/disallow specified agents ability to use voice in session + + "text" or "voice" + + + + + + + Serialize the object + + An containing the objects data + + + + Deserialize the message + + An containing the data + + + + A message sent from the agent to the simulator which tells the + simulator we've accepted a conference invitation + + + + The conference SessionID + + + + Serialize the object + + An containing the objects data + + + + Deserialize the message + + An containing the data + + + + Serialize the object + + An containing the objects data + + + + Deserialize the message + + An containing the data + + + + Serialize the object + + An containing the objects data + + + + Deserialize the message + + An containing the data + + + + Serialize the object + + An containing the objects data + + + + Deserialize the message + + An containing the data + + + Key of sender + + + Name of sender + + + Key of destination avatar + + + ID of originating estate + + + Key of originating region + + + Coordinates in originating region + + + Instant message type + + + Group IM session toggle + + + Key of IM session, for Group Messages, the groups UUID + + + Timestamp of the instant message + + + Instant message text + + + Whether this message is held for offline avatars + + + Context specific packed data + + + Is this invitation for voice group/conference chat + + + + Serialize the object + + An containing the objects data + + + + Deserialize the message + + An containing the data + + + + Sent from the simulator to the viewer. + + When an agent initially joins a session the AgentUpdatesBlock object will contain a list of session members including + a boolean indicating they can use voice chat in this session, a boolean indicating they are allowed to moderate + this session, and lastly a string which indicates another agent is entering the session with the Transition set to "ENTER" + + During the session lifetime updates on individuals are sent. During the update the booleans sent during the initial join are + excluded with the exception of the Transition field. This indicates a new user entering or exiting the session with + the string "ENTER" or "LEAVE" respectively. + + + + + Serialize the object + + An containing the objects data + + + + Deserialize the message + + An containing the data + + + + An EventQueue message sent when the agent is forcibly removed from a chatterbox session + + + + + A string containing the reason the agent was removed + + + + + The ChatterBoxSession's SessionID + + + + + Serialize the object + + An containing the objects data + + + + Deserialize the message + + An containing the data + + + + Serialize the object + + An containing the objects data + + + + Deserialize the message + + An containing the data + + + + Serialize the object + + An containing the objects data + + + + Deserialize the message + + An containing the data + + + + Serialize the object + + An containing the objects data + + + + Deserialize the message + + An containing the data + + + + Serialize the object + + An containing the objects data + + + + Deserialize the message + + An containing the data + + + + + + + + + Serialize the object + + An containing the objects data + + + + Deserialize the message + + An containing the data + + + + Serialize the object + + An containing the objects data + + + + Deserialize the message + + An containing the data + + + + Serialize the object + + An containing the objects data + + + + Deserialize the message + + An containing the data + + + + A message sent from the viewer to the simulator which + specifies that the user has changed current URL + of the specific media on a prim face + + + + + New URL + + + + + Prim UUID where navigation occured + + + + + Face index + + + + + Serialize the object + + An containing the objects data + + + + Deserialize the message + + An containing the data + + + Base class used for the ObjectMedia message + + + + Message used to retrive prim media data + + + + + Prim UUID + + + + + Requested operation, either GET or UPDATE + + + + + Serialize object + + Serialized object as OSDMap + + + + Deserialize the message + + An containing the data + + + + Message used to update prim media data + + + + + Prim UUID + + + + + Array of media entries indexed by face number + + + + + Media version string + + + + + Serialize object + + Serialized object as OSDMap + + + + Deserialize the message + + An containing the data + + + + Message used to update prim media data + + + + + Prim UUID + + + + + Array of media entries indexed by face number + + + + + Requested operation, either GET or UPDATE + + + + + Serialize object + + Serialized object as OSDMap + + + + Deserialize the message + + An containing the data + + + + Message for setting or getting per face MediaEntry + + + + The request or response details block + + + + Serialize the object + + An containing the objects data + + + + Deserialize the message + + An containing the data + + + Details about object resource usage + + + Object UUID + + + Object name + + + Indicates if object is group owned + + + Locatio of the object + + + Object owner + + + Resource usage, keys are resource names, values are resource usage for that specific resource + + + + Deserializes object from OSD + + An containing the data + + + + Makes an instance based on deserialized data + + serialized data + Instance containg deserialized data + + + Details about parcel resource usage + + + Parcel UUID + + + Parcel local ID + + + Parcel name + + + Indicates if parcel is group owned + + + Parcel owner + + + Array of containing per object resource usage + + + + Deserializes object from OSD + + An containing the data + + + + Makes an instance based on deserialized data + + serialized data + Instance containg deserialized data + + + Resource usage base class, both agent and parcel resource + usage contains summary information + + + Summary of available resources, keys are resource names, + values are resource usage for that specific resource + + + Summary resource usage, keys are resource names, + values are resource usage for that specific resource + + + + Serializes object + + serialized data + + + + Deserializes object from OSD + + An containing the data + + + Agent resource usage + + + Per attachment point object resource usage + + + + Deserializes object from OSD + + An containing the data + + + + Makes an instance based on deserialized data + + serialized data + Instance containg deserialized data + + + + Detects which class handles deserialization of this message + + An containing the data + Object capable of decoding this message + + + Request message for parcel resource usage + + + UUID of the parel to request resource usage info + + + + Serializes object + + serialized data + + + + Deserializes object from OSD + + An containing the data + + + Response message for parcel resource usage + + + URL where parcel resource usage details can be retrieved + + + URL where parcel resource usage summary can be retrieved + + + + Serializes object + + serialized data + + + + Deserializes object from OSD + + An containing the data + + + + Detects which class handles deserialization of this message + + An containing the data + Object capable of decoding this message + + + Parcel resource usage + + + Array of containing per percal resource usage + + + + Deserializes object from OSD + + An containing the data + + + + Type of gesture step + + + + + Base class for gesture steps + + + + + Retururns what kind of gesture step this is + + + + + Describes animation step of a gesture + + + + + If true, this step represents start of animation, otherwise animation stop + + + + + Animation asset + + + + + Animation inventory name + + + + + Returns what kind of gesture step this is + + + + + Describes sound step of a gesture + + + + + Sound asset + + + + + Sound inventory name + + + + + Returns what kind of gesture step this is + + + + + Describes sound step of a gesture + + + + + Text to output in chat + + + + + Returns what kind of gesture step this is + + + + + Describes sound step of a gesture + + + + + If true in this step we wait for all animations to finish + + + + + If true gesture player should wait for the specified amount of time + + + + + Time in seconds to wait if WaitForAnimation is false + + + + + Returns what kind of gesture step this is + + + + + Describes the final step of a gesture + + + + + Returns what kind of gesture step this is + + + + + Represents a sequence of animations, sounds, and chat actions + + + + + Base class for all Asset types + + + + A byte array containing the raw asset data + + + True if the asset it only stored on the server temporarily + + + A unique ID + + + + Construct a new Asset object + + + + + Construct a new Asset object + + A unique specific to this asset + A byte array containing the raw asset data + + + + Regenerates the AssetData byte array from the properties + of the derived class. + + + + + Decodes the AssetData, placing it in appropriate properties of the derived + class. + + True if the asset decoding succeeded, otherwise false + + + The assets unique ID + + + + The "type" of asset, Notecard, Animation, etc + + + + + Keyboard key that triggers the gestyre + + + + + Modifier to the trigger key + + + + + String that triggers playing of the gesture sequence + + + + + Text that replaces trigger in chat once gesture is triggered + + + + + Sequence of gesture steps + + + + + Constructs guesture asset + + + + + Constructs guesture asset + + A unique specific to this asset + A byte array containing the raw asset data + + + + Encodes gesture asset suitable for uplaod + + + + + Decodes gesture assset into play sequence + + true if the asset data was decoded successfully + + + + Returns asset type + + + + + Archives assets + + + + + Archive assets + + + + + Archive the assets given to this archiver to the given archive. + + + + + + Write an assets metadata file to the given archive + + + + + + Write asset data files to the given archive + + + + + + Constants for the archiving module + + + + + The location of the archive control file + + + + + Path for the assets held in an archive + + + + + Path for the prims file + + + + + Path for terrains. Technically these may be assets, but I think it's quite nice to split them out. + + + + + Path for region settings. + + + + + The character the separates the uuid from extension information in an archived asset filename + + + + + Extensions used for asset types in the archive + + + + + Capabilities is the name of the bi-directional HTTP REST protocol + used to communicate non real-time transactions such as teleporting or + group messaging + + + + Reference to the simulator this system is connected to + + + + Default constructor + + + + + + + Request the URI of a named capability + + Name of the capability to request + The URI of the requested capability, or String.Empty if + the capability does not exist + + + + Process any incoming events, check to see if we have a message created for the event, + + + + + + Capabilities URI this system was initialized with + + + Whether the capabilities event queue is connected and + listening for incoming events + + + + Triggered when an event is received via the EventQueueGet + capability + + Event name + Decoded event data + The simulator that generated the event + + + + Throttles the network traffic for various different traffic types. + Access this class through GridClient.Throttle + + + + + Default constructor, uses a default high total of 1500 KBps (1536000) + + + + + Constructor that decodes an existing AgentThrottle packet in to + individual values + + Reference to the throttle data in an AgentThrottle + packet + Offset position to start reading at in the + throttle data + This is generally not needed in clients as the server will + never send a throttle packet to the client + + + + Send an AgentThrottle packet to the current server using the + current values + + + + + Send an AgentThrottle packet to the specified server using the + current values + + + + + Convert the current throttle values to a byte array that can be put + in an AgentThrottle packet + + Byte array containing all the throttle values + + + Maximum bits per second for resending unacknowledged packets + + + Maximum bits per second for LayerData terrain + + + Maximum bits per second for LayerData wind data + + + Maximum bits per second for LayerData clouds + + + Unknown, includes object data + + + Maximum bits per second for textures + + + Maximum bits per second for downloaded assets + + + Maximum bits per second the entire connection, divided up + between invidiual streams using default multipliers @@ -684,6 +3471,16 @@ + + + Current version of the media data for the prim + + + + + Array of media entries indexed by face number + + @@ -1355,570 +4152,6 @@ - - - Abstract base for rendering plugins - - - - - Generates a basic mesh structure from a primitive - - Primitive to generate the mesh from - Level of detail to generate the mesh at - The generated mesh - - - - Generates a a series of faces, each face containing a mesh and - metadata - - Primitive to generate the mesh from - Level of detail to generate the mesh at - The generated mesh - - - - Apply texture coordinate modifications from a - to a list of vertices - - Vertex list to modify texture coordinates for - Center-point of the face - Face texture parameters - - - - Avatar profile flags - - - - - Represents an avatar (other than your own) - - - - Groups that this avatar is a member of - - - Positive and negative ratings - - - Avatar properties including about text, profile URL, image IDs and - publishing settings - - - Avatar interests including spoken languages, skills, and "want to" - choices - - - Movement control flags for avatars. Typically not set or used by - clients. To move your avatar, use Client.Self.Movement instead - - - - Default constructor - - - - First name - - - Last name - - - Full name - - - Active group - - - - Positive and negative ratings - - - - Positive ratings for Behavior - - - Negative ratings for Behavior - - - Positive ratings for Appearance - - - Negative ratings for Appearance - - - Positive ratings for Building - - - Negative ratings for Building - - - Positive ratings given by this avatar - - - Negative ratings given by this avatar - - - - Avatar properties including about text, profile URL, image IDs and - publishing settings - - - - First Life about text - - - First Life image ID - - - - - - - - - - - - - - - Profile image ID - - - Flags of the profile - - - Web URL for this profile - - - Should this profile be published on the web - - - Avatar Online Status - - - Is this a mature profile - - - - - - - - - - Avatar interests including spoken languages, skills, and "want to" - choices - - - - Languages profile field - - - - - - - - - - - - - - - - Starts a thread that keeps the daemon running - - - - - - - Stops the daemon and the thread keeping it running - - - - - - - - - - - - - This is used to get a list of audio devices that can be used for capture (input) of voice. - - - - - - This is used to get a list of audio devices that can be used for render (playback) of voice. - - - - - This command is used to select the render device. - - The name of the device as returned by the Aux.GetRenderDevices command. - - - - This command is used to select the capture device. - - The name of the device as returned by the Aux.GetCaptureDevices command. - - - - This command is used to start the audio capture process which will cause - AuxAudioProperty Events to be raised. These events can be used to display a - microphone VU meter for the currently selected capture device. This command - should not be issued if the user is on a call. - - (unused but required) - - - - - This command is used to stop the audio capture process. - - - - - - This command is used to set the mic volume while in the audio tuning process. - Once an acceptable mic level is attained, the application must issue a - connector set mic volume command to have that level be used while on voice - calls. - - the microphone volume (-100 to 100 inclusive) - - - - - This command is used to set the speaker volume while in the audio tuning - process. Once an acceptable speaker level is attained, the application must - issue a connector set speaker volume command to have that level be used while - on voice calls. - - the speaker volume (-100 to 100 inclusive) - - - - - This is used to initialize and stop the Connector as a whole. The Connector - Create call must be completed successfully before any other requests are made - (typically during application initialization). The shutdown should be called - when the application is shutting down to gracefully release resources - - A string value indicting the Application name - URL for the management server - LoggingSettings - - - - - - Shutdown Connector -- Should be called when the application is shutting down - to gracefully release resources - - Handle returned from successful Connector ‘create’ request - - - - Mute or unmute the microphone - - Handle returned from successful Connector ‘create’ request - true (mute) or false (unmute) - - - - Mute or unmute the speaker - - Handle returned from successful Connector ‘create’ request - true (mute) or false (unmute) - - - - Set microphone volume - - Handle returned from successful Connector ‘create’ request - The level of the audio, a number between -100 and 100 where - 0 represents ‘normal’ speaking volume - - - - Set local speaker volume - - Handle returned from successful Connector ‘create’ request - The level of the audio, a number between -100 and 100 where - 0 represents ‘normal’ speaking volume - - - - Create a Session - Sessions typically represent a connection to a media session with one or more - participants. This is used to generate an ‘outbound’ call to another user or - channel. The specifics depend on the media types involved. A session handle is - required to control the local user functions within the session (or remote - users if the current account has rights to do so). Currently creating a - session automatically connects to the audio media, there is no need to call - Session.Connect at this time, this is reserved for future use. - - Handle returned from successful Connector ‘create’ request - This is the URI of the terminating point of the session (ie who/what is being called) - This is the display name of the entity being called (user or channel) - Only needs to be supplied when the target URI is password protected - This indicates the format of the password as passed in. This can either be - “ClearText” or “SHA1UserName”. If this element does not exist, it is assumed to be “ClearText”. If it is - “SHA1UserName”, the password as passed in is the SHA1 hash of the password and username concatenated together, - then base64 encoded, with the final “=” character stripped off. - - - - - - - Used to accept a call - - SessionHandle such as received from SessionNewEvent - "default" - - - - - This command is used to start the audio render process, which will then play - the passed in file through the selected audio render device. This command - should not be issued if the user is on a call. - - The fully qualified path to the sound file. - True if the file is to be played continuously and false if it is should be played once. - - - - - This command is used to stop the audio render process. - - The fully qualified path to the sound file issued in the start render command. - - - - - This is used to ‘end’ an established session (i.e. hang-up or disconnect). - - Handle returned from successful Session ‘create’ request or a SessionNewEvent - - - - - Set the combined speaking and listening position in 3D space. - There appears to be no response to this request. - - Handle returned from successful Session ‘create’ request or a SessionNewEvent - Speaking position - Listening position - - - - - Set User Volume for a particular user. Does not affect how other users hear that user. - - Handle returned from successful Session ‘create’ request or a SessionNewEvent - - The level of the audio, a number between -100 and 100 where 0 represents ‘normal’ speaking volume - - - - - This is used to login a specific user account(s). It may only be called after - Connector initialization has completed successfully - - Handle returned from successful Connector ‘create’ request - User's account name - User's account password - Values may be “AutoAnswer” or “VerifyAnswer” - "" - This is an integer that specifies how often - the daemon will send participant property events while in a channel. If this is not set - the default will be “on state change”, which means that the events will be sent when - the participant starts talking, stops talking, is muted, is unmuted. - The valid values are: - 0 – Never - 5 – 10 times per second - 10 – 5 times per second - 50 – 1 time per second - 100 – on participant state change (this is the default) - false - - - - - This is used to logout a user session. It should only be called with a valid AccountHandle. - - Handle returned from successful Connector ‘login’ request - - - - Response to Session.Create request - - - Response to Session.Connect request - - - Response to Session.RenderAudioStart request - - - Response to Session.RenderAudioStop request - - - Response to Session.Terminate request - - - Response to Session.SetParticipantVolumeForMe request - - - Sent when an incoming session occurs - - - Sent for specific Session state changes (connected, disconnected) - - - Sent for specific Participant state changes (new participants, dropped participants) - - - Sent for specific Participant Property changes (IsSpeaking, Volume, Energy, etc.) - - - - - - Response to Connector.Create request - - - Response to Connector.InitiateShutdown request - - - Response to Connector.MuteLocalMic request - - - Response to Connector.MuteLocalSpeaker request - - - Response to Connector.SetLocalMicVolume request - - - Response to Connector.SetLocalSpeakerVolume request - - - Response to Aux.GetCaptureDevices request - - - Response to Aux.GetRenderDevices request - - - Response to Aux.SetRenderDevice request - - - Response to Aux.SetCaptureDevice request - - - Response to Aux.CaptureAudioStart request - - - Response to Aux.CaptureAudioStop request - - - Response to Aux.SetMicLevel request - - - Response to Aux.SetSpeakerLevel request - - - Audio Properties Events are sent after audio capture is started. - These events are used to display a microphone VU meter - - - Response to Account.Login request - - - Response to Account.Logout request - - - This event message is sent whenever the login state of the - particular Account has transitioned from one value to another - - - Enable logging - - - The folder where any logs will be created - - - This will be prepended to beginning of each log file - - - The suffix or extension to be appended to each log file - - - - 0: NONE - No logging - 1: ERROR - Log errors only - 2: WARNING - Log errors and warnings - 3: INFO - Log errors, warnings and info - 4: DEBUG - Log errors, warnings, info and debug - - - - - Constructor for default logging settings - - - - Response to Session.Create request - - - Response to Session.Connect request - - - Response to Session.RenderAudioStart request - - - Response to Session.RenderAudioStop request - - - Response to Session.Terminate request - - - Response to Session.SetParticipantVolumeForMe request - - - - Audio Properties Events are sent after audio capture is started. These events are used to display a microphone VU meter - - True if voice is detected on the microphone - audio energy, from 0 to 1 - current mic volume - currently unimplemented, and always 0 - - - Positional vector of the users position - - - Velocity vector of the position - - - At Orientation (X axis) of the position - - - Up Orientation (Y axis) of the position - - - Left Orientation (Z axis) of the position - A Wrapper around openjpeg to encode and decode images to and from byte arrays @@ -2007,2574 +4240,84 @@ Packet end position - + - Type of gesture step + Represents an that represents an avatars body ie: Hair, Etc. - + - Base class for gesture steps + Represents a Wearable Asset, Clothing, Hair, Skin, Etc - - - Retururns what kind of gesture step this is - + + A string containing the name of the asset - - - Describes animation step of a gesture - + + A string containing a short description of the asset - - - If true, this step represents start of animation, otherwise animation stop - + + The Assets WearableType - - - Animation asset - + + The For-Sale status of the object - - - Animation inventory name - + + An Integer representing the purchase price of the asset - - - Returns what kind of gesture step this is - + + The of the assets creator - - - Describes sound step of a gesture - + + The of the assets current owner - - - Sound asset - + + The of the assets prior owner - - - Sound inventory name - + + The of the Group this asset is set to - - - Returns what kind of gesture step this is - + + True if the asset is owned by a - - - Describes sound step of a gesture - + + The Permissions mask of the asset - - - Text to output in chat - + + A Dictionary containing Key/Value pairs of the objects parameters - - - Returns what kind of gesture step this is - + + A Dictionary containing Key/Value pairs where the Key is the textures Index and the Value is the Textures - - - Describes sound step of a gesture - + + Initializes a new instance of an AssetWearable object - - - If true in this step we wait for all animations to finish - - - - - If true gesture player should wait for the specified amount of time - - - - - Time in seconds to wait if WaitForAnimation is false - - - - - Returns what kind of gesture step this is - - - - - Describes the final step of a gesture - - - - - Returns what kind of gesture step this is - - - - - Represents a sequence of animations, sounds, and chat actions - - - - - Base class for all Asset types - - - - A byte array containing the raw asset data - - - True if the asset it only stored on the server temporarily - - - A unique ID - - - - Construct a new Asset object - - - - - Construct a new Asset object - + + Initializes a new instance of an AssetWearable object with parameters A unique specific to this asset A byte array containing the raw asset data - + - Regenerates the AssetData byte array from the properties - of the derived class. + Decode an assets byte encoded data to a string + + true if the asset data was decoded successfully + + + + Encode the assets string represantion into a format consumable by the asset server - - - Decodes the AssetData, placing it in appropriate properties of the derived - class. - - True if the asset decoding succeeded, otherwise false + + Initializes a new instance of an AssetBodyPart object - - The assets unique ID - - - - The "type" of asset, Notecard, Animation, etc - - - - - Keyboard key that triggers the gestyre - - - - - Modifier to the trigger key - - - - - String that triggers playing of the gesture sequence - - - - - Text that replaces trigger in chat once gesture is triggered - - - - - Sequence of gesture steps - - - - - Constructs guesture asset - - - - - Constructs guesture asset - + + Initializes a new instance of an AssetBodyPart object with parameters A unique specific to this asset A byte array containing the raw asset data - - - Encodes gesture asset suitable for uplaod - - - - - Decodes gesture assset into play sequence - - - - - - Returns asset type - - - - - Class for controlling various system settings. - - Some values are readonly because they affect things that - happen when the GridClient object is initialized, so changing them at - runtime won't do any good. Non-readonly values may affect things that - happen at login or dynamically - - - Main grid login server - - - Beta grid login server - - - - InventoryManager requests inventory information on login, - GridClient initializes an Inventory store for main inventory. - - - - - InventoryManager requests library information on login, - GridClient initializes an Inventory store for the library. - - - - Number of milliseconds before an asset transfer will time - out - - - Number of milliseconds between sending pings to each sim - - - Number of milliseconds between sending camera updates - - - Number of milliseconds between updating the current - positions of moving, non-accelerating and non-colliding objects - - - Millisecond interval between ticks, where all ACKs are - sent out and the age of unACKed packets is checked - - - The initial size of the packet inbox, where packets are - stored before processing - - - Maximum size of packet that we want to send over the wire - - - The maximum value of a packet sequence number before it - rolls over back to one - - - The maximum size of the sequence number archive, used to - check for resent and/or duplicate packets - - - The relative directory where external resources are kept - - - Login server to connect to - - - IP Address the client will bind to - - - Use XML-RPC Login or LLSD Login, default is XML-RPC Login - - - Number of milliseconds before a teleport attempt will time - out - - - Number of milliseconds before NetworkManager.Logout() will - time out - - - Number of milliseconds before a CAPS call will time out - Setting this too low will cause web requests time out and - possibly retry repeatedly - - - Number of milliseconds for xml-rpc to timeout - - - Milliseconds before a packet is assumed lost and resent - - - Milliseconds without receiving a packet before the - connection to a simulator is assumed lost - - - Milliseconds to wait for a simulator info request through - the grid interface - - - Maximum number of queued ACKs to be sent before SendAcks() - is forced - - - Network stats queue length (seconds) - - - Enable to process packets synchronously, where all of the - callbacks for each packet must return before the next packet is - processed - This is an experimental feature and is not completely - reliable yet. Ideally it would reduce context switches and thread - overhead, but several calls currently block for a long time and - would need to be rewritten as asynchronous code before this is - feasible - - - Enable/disable storing terrain heightmaps in the - TerrainManager - - - Enable/disable sending periodic camera updates - - - Enable/disable automatically setting the bandwidth throttle - after connecting to each simulator - The default throttle uses the equivalent of the maximum - bandwidth setting in the official client. If you do not set a - throttle your connection will by default be throttled well below - the minimum values and you may experience connection problems - - - Enable/disable the sending of pings to monitor lag and - packet loss - - - Should we connect to multiple sims? This will allow - viewing in to neighboring simulators and sim crossings - (Experimental) - - - If true, all object update packets will be decoded in to - native objects. If false, only updates for our own agent will be - decoded. Registering an event handler will force objects for that - type to always be decoded. If this is disabled the object tracking - will have missing or partial prim and avatar information - - - If true, when a cached object check is received from the - server the full object info will automatically be requested - - - Whether to establish connections to HTTP capabilities - servers for simulators - - - Whether to decode sim stats - - - The capabilities servers are currently designed to - periodically return a 502 error which signals for the client to - re-establish a connection. Set this to true to log those 502 errors - - - If true, any reference received for a folder or item - the library is not aware of will automatically be fetched - - - If true, and SEND_AGENT_UPDATES is true, - AgentUpdate packets will continuously be sent out to give the bot - smoother movement and autopiloting - - - If true, currently visible avatars will be stored - in dictionaries inside Simulator.ObjectAvatars. - If false, a new Avatar or Primitive object will be created - each time an object update packet is received - - - If true, currently visible avatars will be stored - in dictionaries inside Simulator.ObjectPrimitives. - If false, a new Avatar or Primitive object will be created - each time an object update packet is received - - - If true, position and velocity will periodically be - interpolated (extrapolated, technically) for objects and - avatars that are being tracked by the library. This is - necessary to increase the accuracy of speed and position - estimates for simulated objects - - - If true, parcel details will be stored in the - Simulator.Parcels dictionary as they are received - - - - If true, an incoming parcel properties reply will automatically send - a request for the parcel access list - - - - - if true, an incoming parcel properties reply will automatically send - a request for the traffic count. - - - - - If true, images, and other assets downloaded from the server - will be cached in a local directory - - - - Path to store cached texture data - - - Maximum size cached files are allowed to take on disk (bytes) - - - Default color used for viewer particle effects - - - Maximum number of times to resend a failed packet - - - Throttle outgoing packet rate - - - The maximum number of concurrent texture downloads allowed - Increasing this number will not necessarily increase texture retrieval times due to - simulator throttles - - - - The Refresh timer inteval is used to set the delay between checks for stalled texture downloads - - This is a static variable which applies to all instances - - - - Textures taking longer than this value will be flagged as timed out and removed from the pipeline - - - - - Get or set the minimum log level to output to the console by default - - If the library is not compiled with DEBUG defined and this level is set to DEBUG - You will get no output on the console. This behavior can be overriden by creating - a logger configuration file for log4net - - - - Attach avatar names to log messages - - - Log packet retransmission info - - - Constructor - Reference to a GridClient object - - - - Gets the cost of uploading an asset to the grid - - - - - - Cost of uploading an asset - Read-only since this value is dynamically fetched at login - - - - Return a decoded capabilities message as a strongly typed object - - A string containing the name of the capabilities message key - An to decode - A strongly typed object containing the decoded information from the capabilities message, or null - if no existing Message object exists for the specified event - - - - Sent to the client to indicate a teleport request has completed - - - - - Interface requirements for Messaging system - - - - The of the agent - - - - - - The simulators handle the agent teleported to - - - A Uri which contains a list of Capabilities the simulator supports - - - Indicates the level of access required - to access the simulator, or the content rating, or the simulators - map status - - - The IP Address of the simulator - - - The UDP Port the simulator will listen for UDP traffic on - - - Status flags indicating the state of the Agent upon arrival, Flying, etc. - - - - Serialize the object - - An containing the objects data - - - - Deserialize the message - - An containing the data - - - - Sent to the viewer when a neighboring simulator is requesting the agent make a connection to it. - - - - - Serialize the object - - An containing the objects data - - - - Deserialize the message - - An containing the data - - - - Serialize the object - - An containing the objects data - - - - Deserialize the message - - An containing the data - - - - Serialize the object - - An containing the objects data - - - - Deserialize the message - - An containing the data - - - - A message sent to the client which indicates a teleport request has failed - and contains some information on why it failed - - - - - - - A string key of the reason the teleport failed e.g. CouldntTPCloser - Which could be used to look up a value in a dictionary or enum - - - The of the Agent - - - A string human readable message containing the reason - An example: Could not teleport closer to destination - - - - Serialize the object - - An containing the objects data - - - - Deserialize the message - - An containing the data - - - - Serialize the object - - An containing the objects data - - - - Deserialize the message - - An containing the data - - - - Contains a list of prim owner information for a specific parcel in a simulator - - - A Simulator will always return at least 1 entry - If agent does not have proper permission the OwnerID will be UUID.Zero - If agent does not have proper permission OR there are no primitives on parcel - the DataBlocksExtended map will not be sent from the simulator - - - - An Array of objects - - - - Serialize the object - - An containing the objects data - - - - Deserialize the message - - An containing the data - - - - Prim ownership information for a specified owner on a single parcel - - - - The of the prim owner, - UUID.Zero if agent has no permission to view prim owner information - - - The total number of prims - - - True if the OwnerID is a - - - True if the owner is online - This is no longer used by the LL Simulators - - - The date the most recent prim was rezzed - - - - The details of a single parcel in a region, also contains some regionwide globals - - - - Simulator-local ID of this parcel - - - Maximum corner of the axis-aligned bounding box for this - parcel - - - Minimum corner of the axis-aligned bounding box for this - parcel - - - Total parcel land area - - - - - - Key of authorized buyer - - - Bitmap describing land layout in 4x4m squares across the - entire region - - - - - - Date land was claimed - - - Appears to always be zero - - - Parcel Description - - - - - - - - - Total number of primitives owned by the parcel group on - this parcel - - - Whether the land is deeded to a group or not - - - - - - Maximum number of primitives this parcel supports - - - The Asset UUID of the Texture which when applied to a - primitive will display the media - - - A URL which points to any Quicktime supported media type - - - A byte, if 0x1 viewer should auto scale media to fit object - - - URL For Music Stream - - - Parcel Name - - - Autoreturn value in minutes for others' objects - - - - - - Total number of other primitives on this parcel - - - UUID of the owner of this parcel - - - Total number of primitives owned by the parcel owner on - this parcel - - - - - - How long is pass valid for - - - Price for a temporary pass - - - - - - - - - - - - This field is no longer used - - - The result of a request for parcel properties - - - Sale price of the parcel, only useful if ForSale is set - The SalePrice will remain the same after an ownership - transfer (sale), so it can be used to see the purchase price after - a sale if the new owner has not changed it - - - - Number of primitives your avatar is currently - selecting and sitting on in this parcel - - - - - - - - A number which increments by 1, starting at 0 for each ParcelProperties request. - Can be overriden by specifying the sequenceID with the ParcelPropertiesRequest being sent. - a Negative number indicates the action in has occurred. - - - - Maximum primitives across the entire simulator - - - Total primitives across the entire simulator - - - - - - Key of parcel snapshot - - - Parcel ownership status - - - Total number of primitives on this parcel - - - - - - - - - TRUE of region denies access to age unverified users - - - A description of the media - - - An Integer which represents the height of the media - - - An integer which represents the width of the media - - - A boolean, if true the viewer should loop the media - - - A string which contains the mime type of the media - - - true to obscure (hide) media url - - - true to obscure (hide) music url - - - - Serialize the object - - An containing the objects data - - - - Deserialize the message - - An containing the data - - - A message sent from the viewer to the simulator to updated a specific parcels settings - - - The of the agent authorized to purchase this - parcel of land or a NULL if the sale is authorized to anyone - - - true to enable auto scaling of the parcel media - - - The category of this parcel used when search is enabled to restrict - search results - - - A string containing the description to set - - - The of the which allows for additional - powers and restrictions. - - - The which specifies how avatars which teleport - to this parcel are handled - - - The LocalID of the parcel to update settings on - - - A string containing the description of the media which can be played - to visitors - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Deserialize the message - - An containing the data - - - - Serialize the object - - An containing the objects data - - - Base class used for the RemoteParcelRequest message - - - - A message sent from the viewer to the simulator to request information - on a remote parcel - - - - Local sim position of the parcel we are looking up - - - Region handle of the parcel we are looking up - - - Region of the parcel we are looking up - - - - Serialize the object - - An containing the objects data - - - - Deserialize the message - - An containing the data - - - - A message sent from the simulator to the viewer in response to a - which will contain parcel information - - - - The grid-wide unique parcel ID - - - - Serialize the object - - An containing the objects data - - - - Deserialize the message - - An containing the data - - - - A message containing a request for a remote parcel from a viewer, or a response - from the simulator to that request - - - - The request or response details block - - - - Serialize the object - - An containing the objects data - - - - Deserialize the message - - An containing the data - - - - Serialize the object - - An containing the objects data - - - - Deserialize the message - - An containing the data - - - - A message sent from the simulator to an agent which contains - the groups the agent is in - - - - The Agent receiving the message - - - An array containing information - for each the agent is a member of - - - An array containing information - for each the agent is a member of - - - - Serialize the object - - An containing the objects data - - - - Deserialize the message - - An containing the data - - - Group Details specific to the agent - - - true of the agent accepts group notices - - - The agents tier contribution to the group - - - The Groups - - - The of the groups insignia - - - The name of the group - - - The aggregate permissions the agent has in the group for all roles the agent - is assigned - - - An optional block containing additional agent specific information - - - true of the agent allows this group to be - listed in their profile - - - - A message sent from the viewer to the simulator which - specifies the language and permissions for others to detect - the language specified - - - - A string containng the default language - to use for the agent - - - true of others are allowed to - know the language setting - - - - Serialize the object - - An containing the objects data - - - - Deserialize the message - - An containing the data - - - - An EventQueue message sent from the simulator to an agent when the agent - leaves a group - - - - - An Array containing the AgentID and GroupID - - - - - Serialize the object - - An containing the objects data - - - - Deserialize the message - - An containing the data - - - An object containing the Agents UUID, and the Groups UUID - - - The ID of the Agent leaving the group - - - The GroupID the Agent is leaving - - - Base class for Asset uploads/results via Capabilities - - - - Serialize the object - - An containing the objects data - - - - Deserialize the message - - An containing the data - - - - A message sent from the viewer to the simulator to request a temporary upload capability - which allows an asset to be uploaded - - - - The request state (Always "upload") - - - The Capability URL sent by the simulator to upload the baked texture to - - - - A message sent from the simulator that will inform the agent the upload is complete, - and the UUID of the uploaded asset - - - - The request state (Always "complete") - - - The uploaded texture asset ID - - - - A message sent from the viewer to the simulator to request a temporary - capability URI which is used to upload an agents baked appearance textures - - - - Object containing request or response - - - - Serialize the object - - An containing the objects data - - - - Deserialize the message - - An containing the data - - - - A message sent from the simulator which indicates the minimum version required for - using voice chat - - - - Major Version Required - - - Minor version required - - - The name of the region sending the version requrements - - - - Serialize the object - - An containing the objects data - - - - Deserialize the message - - An containing the data - - - - A message sent from the simulator to the viewer containing the - voice server URI - - - - The Parcel ID which the voice server URI applies - - - The name of the region - - - A uri containing the server/channel information - which the viewer can utilize to participate in voice conversations - - - - Serialize the object - - An containing the objects data - - - - Deserialize the message - - An containing the data - - - - - - - - - - - - - - - Serialize the object - - An containing the objects data - - - - Deserialize the message - - An containing the data - - - - A message sent by the viewer to the simulator to request a temporary - capability for a script contained with in a Tasks inventory to be updated - - - - Object containing request or response - - - - Serialize the object - - An containing the objects data - - - - Deserialize the message - - An containing the data - - - - A message sent from the simulator to the viewer to indicate - a Tasks scripts status. - - - - The Asset ID of the script - - - True of the script is compiled/ran using the mono interpreter, false indicates it - uses the older less efficient lsl2 interprter - - - The Task containing the scripts - - - true of the script is in a running state - - - - Serialize the object - - An containing the objects data - - - - Deserialize the message - - An containing the data - - - - A message containing the request/response used for updating a gesture - contained with an agents inventory - - - - Object containing request or response - - - - Serialize the object - - An containing the objects data - - - - Deserialize the message - - An containing the data - - - - A message request/response which is used to update a notecard contained within - a tasks inventory - - - - The of the Task containing the notecard asset to update - - - The notecard assets contained in the tasks inventory - - - - Serialize the object - - An containing the objects data - - - - Deserialize the message - - An containing the data - - - - A reusable class containing a message sent from the viewer to the simulator to request a temporary uploader capability - which is used to update an asset in an agents inventory - - - - - The Notecard AssetID to replace - - - - - Serialize the object - - An containing the objects data - - - - Deserialize the message - - An containing the data - - - - A message containing the request/response used for updating a notecard - contained with an agents inventory - - - - Object containing request or response - - - - Serialize the object - - An containing the objects data - - - - Deserialize the message - - An containing the data - - - - Serialize the object - - An containing the objects data - - - - Deserialize the message - - An containing the data - - - - A message sent from the simulator to the viewer which indicates - an error occurred while attempting to update a script in an agents or tasks - inventory - - - - true of the script was successfully compiled by the simulator - - - The state of the request - - - A string containing the error which occured while trying - to update the script - - - A new AssetID assigned to the script - - - - A message sent from the viewer to the simulator - requesting the update of an existing script contained - within a tasks inventory - - - - if true, set the script mode to running - - - The scripts InventoryItem ItemID to update - - - A lowercase string containing either "mono" or "lsl2" which - specifies the script is compiled and ran on the mono runtime, or the older - lsl runtime - - - The tasks which contains the script to update - - - - Serialize the object - - An containing the objects data - - - - Deserialize the message - - An containing the data - - - - A message containing either the request or response used in updating a script inside - a tasks inventory - - - - Object containing request or response - - - - Serialize the object - - An containing the objects data - - - - Deserialize the message - - An containing the data - - - - Response from the simulator to notify the viewer the upload is completed, and - the UUID of the script asset and its compiled status - - - - The request state (Always "complete") - - - The uploaded texture asset ID - - - true of the script was compiled successfully - - - - A message sent from a viewer to the simulator requesting a temporary uploader capability - used to update a script contained in an agents inventory - - - - The existing asset if of the script in the agents inventory to replace - - - The language of the script - Defaults to lsl version 2, "mono" might be another possible option - - - - Serialize the object - - An containing the objects data - - - - Deserialize the message - - An containing the data - - - - A message containing either the request or response used in updating a script inside - an agents inventory - - - - Object containing request or response - - - - Serialize the object - - An containing the objects data - - - - Deserialize the message - - An containing the data - - - - Serialize the object - - An containing the objects data - - - - Deserialize the message - - An containing the data - - - - A message sent from the simulator to the viewer which contains an array of map images and their grid coordinates - - - - - - - An array containing LayerData items - - - - Serialize the object - - An containing the objects data - - - - Deserialize the message - - An containing the data - - - - A n object containing map location details - - - - The Asset ID of the regions tile overlay - - - The grid location of the southern border of the map tile - - - The grid location of the western border of the map tile - - - The grid location of the eastern border of the map tile - - - The grid location of the northern border of the map tile - - - - New as of 1.23 RC1, no details yet. - - - - - Serialize the object - - An containing the objects data - - - - Deserialize the message - - An containing the data - - - - Serialize the object - - An containing the objects data - - - - Deserialize the message - - An containing the data - - - A string containing the method used - - - - A request sent from an agent to the Simulator to begin a new conference. - Contains a list of Agents which will be included in the conference - - - - An array containing the of the agents invited to this conference - - - The conferences Session ID - - - - Serialize the object - - An containing the objects data - - - - Deserialize the message - - An containing the data - - - - A moderation request sent from a conference moderator - Contains an agent and an optional action to take - - - - The Session ID - - - - - - A list containing Key/Value pairs, known valid values: - key: text value: true/false - allow/disallow specified agents ability to use text in session - key: voice value: true/false - allow/disallow specified agents ability to use voice in session - - "text" or "voice" - - - - - - - Serialize the object - - An containing the objects data - - - - Deserialize the message - - An containing the data - - - - A message sent from the agent to the simulator which tells the - simulator we've accepted a conference invitation - - - - The conference SessionID - - - - Serialize the object - - An containing the objects data - - - - Deserialize the message - - An containing the data - - - - Serialize the object - - An containing the objects data - - - - Deserialize the message - - An containing the data - - - - Serialize the object - - An containing the objects data - - - - Deserialize the message - - An containing the data - - - - Serialize the object - - An containing the objects data - - - - Deserialize the message - - An containing the data - - - Key of sender - - - Name of sender - - - Key of destination avatar - - - ID of originating estate - - - Key of originating region - - - Coordinates in originating region - - - Instant message type - - - Group IM session toggle - - - Key of IM session, for Group Messages, the groups UUID - - - Timestamp of the instant message - - - Instant message text - - - Whether this message is held for offline avatars - - - Context specific packed data - - - - Serialize the object - - An containing the objects data - - - - Deserialize the message - - An containing the data - - - - Sent from the simulator to the viewer. - - When an agent initially joins a session the AgentUpdatesBlock object will contain a list of session members including - a boolean indicating they can use voice chat in this session, a boolean indicating they are allowed to moderate - this session, and lastly a string which indicates another agent is entering the session with the Transition set to "ENTER" - - During the session lifetime updates on individuals are sent. During the update the booleans sent during the initial join are - excluded with the exception of the Transition field. This indicates a new user entering or exiting the session with - the string "ENTER" or "LEAVE" respectively. - - - - - Serialize the object - - An containing the objects data - - - - Deserialize the message - - An containing the data - - - - An EventQueue message sent when the agent is forcibly removed from a chatterbox session - - - - - A string containing the reason the agent was removed - - - - - The ChatterBoxSession's SessionID - - - - - Serialize the object - - An containing the objects data - - - - Deserialize the message - - An containing the data - - - - Serialize the object - - An containing the objects data - - - - Deserialize the message - - An containing the data - - - - Serialize the object - - An containing the objects data - - - - Deserialize the message - - An containing the data - - - - Serialize the object - - An containing the objects data - - - - Deserialize the message - - An containing the data - - - - Serialize the object - - An containing the objects data - - - - Deserialize the message - - An containing the data - - - - - - - - - Serialize the object - - An containing the objects data - - - - Deserialize the message - - An containing the data - - - - Serialize the object - - An containing the objects data - - - - Deserialize the message - - An containing the data - - - - Serialize the object - - An containing the objects data - - - - Deserialize the message - - An containing the data - - - - Constants for the archiving module - - - - - The location of the archive control file - - - - - Path for the assets held in an archive - - - - - Path for the prims file - - - - - Path for terrains. Technically these may be assets, but I think it's quite nice to split them out. - - - - - Path for region settings. - - - - - The character the separates the uuid from extension information in an archived asset filename - - - - - Extensions used for asset types in the archive - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - The ObservableDictionary class is used for storing key/value pairs. It has methods for firing - events to subscribers when items are added, removed, or changed. - - Key - Value - - - - A dictionary of callbacks to fire when specified action occurs - - - - - Register a callback to be fired when an action occurs - - The action - The callback to fire - - - - Unregister a callback - - The action - The callback to fire - - - - - - - - - - Internal dictionary that this class wraps around. Do not - modify or enumerate the contents of this dictionary without locking - - - - Initializes a new instance of the Class - with the specified key/value, has the default initial capacity. - - - - // initialize a new ObservableDictionary named testDict with a string as the key and an int as the value. - public ObservableDictionary<string, int> testDict = new ObservableDictionary<string, int>(); - - - - - - Initializes a new instance of the Class - with the specified key/value, With its initial capacity specified. - - Initial size of dictionary - - - // initialize a new ObservableDictionary named testDict with a string as the key and an int as the value, - // initially allocated room for 10 entries. - public ObservableDictionary<string, int> testDict = new ObservableDictionary<string, int>(10); - - - - - - Try to get entry from the with specified key - - Key to use for lookup - Value returned - if specified key exists, if not found - - - // find your avatar using the Simulator.ObjectsAvatars ObservableDictionary: - Avatar av; - if (Client.Network.CurrentSim.ObjectsAvatars.TryGetValue(Client.Self.AgentID, out av)) - Console.WriteLine("Found Avatar {0}", av.Name); - - - - - - - Finds the specified match. - - The match. - Matched value - - - // use a delegate to find a prim in the ObjectsPrimitives ObservableDictionary - // with the ID 95683496 - uint findID = 95683496; - Primitive findPrim = sim.ObjectsPrimitives.Find( - delegate(Primitive prim) { return prim.ID == findID; }); - - - - - Find All items in an - return matching items. - a containing found items. - - Find All prims within 20 meters and store them in a List - - int radius = 20; - List<Primitive> prims = Client.Network.CurrentSim.ObjectsPrimitives.FindAll( - delegate(Primitive prim) { - Vector3 pos = prim.Position; - return ((prim.ParentID == 0) && (pos != Vector3.Zero) && (Vector3.Distance(pos, location) < radius)); - } - ); - - - - - Find All items in an - return matching keys. - a containing found keys. - - Find All keys which also exist in another dictionary - - List<UUID> matches = myDict.FindAll( - delegate(UUID id) { - return myOtherDict.ContainsKey(id); - } - ); - - - - - Check if Key exists in Dictionary - Key to check for - if found, otherwise - - - Check if Value exists in Dictionary - Value to check for - if found, otherwise - - - - Adds the specified key to the dictionary, dictionary locking is not performed, - - - The key - The value - - - - Removes the specified key, dictionary locking is not performed - - The key. - if successful, otherwise - - - - Clear the contents of the dictionary - - - - - Enumerator for iterating dictionary entries - - - - - - Gets the number of Key/Value pairs contained in the - - - - - Indexer for the dictionary - - The key - The value - - - Describes tasks returned in LandStatReply - - - - Estate level administration and utilities - - - - Textures for each of the four terrain height levels - - - Upper/lower texture boundaries for each corner of the sim - - - - Constructor for EstateTools class - - - - - - Requests estate information such as top scripts and colliders - - - - - - - - Requests estate settings, including estate manager and access/ban lists - - - Requests the "Top Scripts" list for the current region - - - Requests the "Top Colliders" list for the current region - - - - Set several estate specific configuration variables - - The Height of the waterlevel over the entire estate. Defaults to 20 - The maximum height change allowed above the baked terrain. Defaults to 4 - The minimum height change allowed below the baked terrain. Defaults to -4 - true to use - if True forces the sun position to the position in SunPosition - The current position of the sun on the estate, or when FixedSun is true the static position - the sun will remain. 6.0 = Sunrise, 30.0 = Sunset - - - - Request return of objects owned by specified avatar - - The Agents owning the primitives to return - specify the coverage and type of objects to be included in the return - true to perform return on entire estate - - - - - - - - - Used for setting and retrieving various estate panel settings - - EstateOwnerMessage Method field - List of parameters to include - - - - Kick an avatar from an estate - - Key of Agent to remove - - - - Ban an avatar from an estate - Key of Agent to remove - Ban user from this estate and all others owned by the estate owner - - - Unban an avatar from an estate - Key of Agent to remove - /// Unban user from this estate and all others owned by the estate owner - - - - Send a message dialog to everyone in an entire estate - - Message to send all users in the estate - - - - Send a message dialog to everyone in a simulator - - Message to send all users in the simulator - - - - Send an avatar back to their home location - - Key of avatar to send home - - - - Begin the region restart process - - - - - Cancels a region restart - - - - Estate panel "Region" tab settings - - - Estate panel "Debug" tab settings - - - Used for setting the region's terrain textures for its four height levels - - - - - - - Used for setting sim terrain texture heights - - - Requests the estate covenant - - - - Upload a terrain RAW file - - A byte array containing the encoded terrain data - The name of the file being uploaded - The Id of the transfer request - - - - Teleports all users home in current Estate - - - - - Remove estate manager - Key of Agent to Remove - removes manager to this estate and all others owned by the estate owner - - - - Add estate manager - Key of Agent to Add - Add agent as manager to this estate and all others owned by the estate owner - - - - Add's an agent to the estate Allowed list - Key of Agent to Add - Add agent as an allowed reisdent to All estates if true - - - - Removes an agent from the estate Allowed list - Key of Agent to Remove - Removes agent as an allowed reisdent from All estates if true - - - - - Add's a group to the estate Allowed list - Key of Group to Add - Add Group as an allowed group to All estates if true - - - - - Removes a group from the estate Allowed list - Key of Group to Remove - Removes Group as an allowed Group from All estates if true - - - - - - - - - - - - - - - - - - Triggered upon a successful .GetTopColliders() - - - Triggered upon a successful .GetTopScripts() - - - Returned, along with other info, upon a successful .GetInfo() - - - Returned, along with other info, upon a successful .GetInfo() - - - Returned, along with other info, upon a successful .GetInfo() - - - Returned, along with other info, upon a successful .GetInfo() - - - Returned, along with other info, upon a successful .GetInfo() - - - Triggered upon a successful .RequestCovenant() - - - - Triggered on LandStatReply when the report type is for "top colliders" - - - - - - - Triggered on LandStatReply when the report type is for "top scripts" - - - - - - - Triggered when the list of estate managers is received for the current estate - - - - - - - - FIXME - Enumerate all params from EstateOwnerMessage packet - - - - - - - - Used in the ReportType field of a LandStatRequest - - - Used by EstateOwnerMessage packets - - - Used by EstateOwnerMessage packets - - - - - - - - No flags set - - - Only return targets scripted objects - - - Only return targets objects if on others land - - - Returns target's scripted objects and objects on other parcels - - - Ground texture settings for each corner of the region - - - Used by GroundTextureHeightSettings - - - The high and low texture thresholds for each corner of the sim - - - - Archives assets - - - - - Archive assets - - - - - Archive the assets given to this archiver to the given archive. - - - - - - Write an assets metadata file to the given archive - - - - - - Write asset data files to the given archive - - - - - - - - - - - - - - - - + + Override the base classes AssetType @@ -4789,14 +4532,8843 @@ - + - Attempts to convert an LLSD structure to a known Packet type + Permission request flags, asked when a script wants to control an Avatar + + + + Placeholder for empty values, shouldn't ever see this + + + Script wants ability to take money from you + + + Script wants to take camera controls for you + + + Script wants to remap avatars controls + + + Script wants to trigger avatar animations + This function is not implemented on the grid + + + Script wants to attach or detach the prim or primset to your avatar + + + Script wants permission to release ownership + This function is not implemented on the grid + The concept of "public" objects does not exist anymore. + + + Script wants ability to link/delink with other prims + + + Script wants permission to change joints + This function is not implemented on the grid + + + Script wants permissions to change permissions + This function is not implemented on the grid + + + Script wants to track avatars camera position and rotation + + + Script wants to control your camera + + + + Special commands used in Instant Messages + + + + Indicates a regular IM from another agent + + + Simple notification box with an OK button + + + You've been invited to join a group. + + + Inventory offer + + + Accepted inventory offer + + + Declined inventory offer + + + Group vote + + + An object is offering its inventory + + + Accept an inventory offer from an object + + + Decline an inventory offer from an object + + + Unknown + + + Start a session, or add users to a session + + + Start a session, but don't prune offline users + + + Start a session with your group + + + Start a session without a calling card (finder or objects) + + + Send a message to a session + + + Leave a session + + + Indicates that the IM is from an object + + + Sent an IM to a busy user, this is the auto response + + + Shows the message in the console and chat history + + + Send a teleport lure + + + Response sent to the agent which inititiated a teleport invitation + + + Response sent to the agent which inititiated a teleport invitation + + + Only useful if you have Linden permissions + + + A placeholder type for future expansion, currently not + used + + + IM to tell the user to go to an URL + + + IM for help + + + IM sent automatically on call for help, sends a lure + to each Helper reached + + + Like an IM but won't go to email + + + IM from a group officer to all group members + + + Unknown + + + Unknown + + + Accept a group invitation + + + Decline a group invitation + + + Unknown + + + An avatar is offering you friendship + + + An avatar has accepted your friendship offer + + + An avatar has declined your friendship offer + + + Indicates that a user has started typing + + + Indicates that a user has stopped typing + + + + Flag in Instant Messages, whether the IM should be delivered to + offline avatars as well + + + + Only deliver to online avatars + + + If the avatar is offline the message will be held until + they login next, and possibly forwarded to their e-mail account + + + + Conversion type to denote Chat Packet types in an easier-to-understand format + + + + Whisper (5m radius) + + + Normal chat (10/20m radius), what the official viewer typically sends + + + Shouting! (100m radius) + + + Event message when an Avatar has begun to type + + + Event message when an Avatar has stopped typing + + + Send the message to the debug channel + + + Event message when an object uses llOwnerSay + + + Special value to support llRegionSay, never sent to the client + + + + Identifies the source of a chat message + + + + Chat from the grid or simulator + + + Chat from another avatar + + + Chat from an object + + + + + + + + + + + + + + + + + + Effect type used in ViewerEffect packets + + + + + + + + + + + + + + + + + + + + + + + + + Project a beam from a source to a destination, such as + the one used when editing an object + + + + + + + + + + + + Create a swirl of particles around an object + + + + + + + + + Cause an avatar to look at an object + + + Cause an avatar to point at an object + + + + The action an avatar is doing when looking at something, used in + ViewerEffect packets for the LookAt effect + + + + + + + + + + + + + + + + + + + + + + Deprecated + + + + + + + + + + + + + + + + The action an avatar is doing when pointing at something, used in + ViewerEffect packets for the PointAt effect + + + + + + + + + + + + + + + + + Money transaction types + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Flags sent when a script takes or releases a control + + NOTE: (need to verify) These might be a subset of the ControlFlags enum in Movement, + + + No Flags set + + + Forward (W or up Arrow) + + + Back (S or down arrow) + + + Move left (shift+A or left arrow) + + + Move right (shift+D or right arrow) + + + Up (E or PgUp) + + + Down (C or PgDown) + + + Rotate left (A or left arrow) + + + Rotate right (D or right arrow) + + + Left Mouse Button + + + Left Mouse button in MouseLook + + + + Currently only used to hide your group title + + + + No flags set + + + Hide your group title + + + + Action state of the avatar, which can currently be typing and + editing + + + + + + + + + + + + + + Current teleport status + + + + Unknown status + + + Teleport initialized + + + Teleport in progress + + + Teleport failed + + + Teleport completed + + + Teleport cancelled + + + + + + + + No flags set, or teleport failed + + + Set when newbie leaves help island for first time + + + + + + Via Lure + + + Via Landmark + + + Via Location + + + Via Home + + + Via Telehub + + + Via Login + + + Linden Summoned + + + Linden Forced me + + + + + + Agent Teleported Home via Script + + + + + + + + + + + + forced to new location for example when avatar is banned or ejected + + + Teleport Finished via a Lure + + + Finished, Sim Changed + + + Finished, Same Sim + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Instant Message + + + + Key of sender + + + Name of sender + + + Key of destination avatar + + + ID of originating estate + + + Key of originating region + + + Coordinates in originating region + + + Instant message type + + + Group IM session toggle + + + Key of IM session, for Group Messages, the groups UUID + + + Timestamp of the instant message + + + Instant message text + + + Whether this message is held for offline avatars + + + Context specific packed data + + + Print the struct data as a string + A string containing the field name, and field value + + + + Manager class for our own avatar + + + + The event subscribers. null if no subcribers + + + Raises the ChatFromSimulator event + A ChatEventArgs object containing the + data returned from the data server + + + Thread sync lock object + + + The event subscribers. null if no subcribers + + + Raises the ScriptDialog event + A SctriptDialogEventArgs object containing the + data returned from the data server + + + Thread sync lock object + + + The event subscribers. null if no subcribers + + + Raises the ScriptQuestion event + A ScriptQuestionEventArgs object containing the + data returned from the data server + + + Thread sync lock object + + + The event subscribers. null if no subcribers + + + Raises the LoadURL event + A LoadUrlEventArgs object containing the + data returned from the data server + + + Thread sync lock object + + + The event subscribers. null if no subcribers + + + Raises the MoneyBalance event + A BalanceEventArgs object containing the + data returned from the data server + + + Thread sync lock object + + + The event subscribers. null if no subcribers + + + Raises the MoneyBalanceReply event + A MoneyBalanceReplyEventArgs object containing the + data returned from the data server + + + Thread sync lock object + + + The event subscribers. null if no subcribers + + + Raises the IM event + A InstantMessageEventArgs object containing the + data returned from the data server + + + Thread sync lock object + + + The event subscribers. null if no subcribers + + + Raises the TeleportProgress event + A TeleportEventArgs object containing the + data returned from the data server + + + Thread sync lock object + + + The event subscribers. null if no subcribers + + + Raises the AgentDataReply event + A AgentDataReplyEventArgs object containing the + data returned from the data server + + + Thread sync lock object + + + The event subscribers. null if no subcribers + + + Raises the AnimationsChanged event + A AnimationsChangedEventArgs object containing the + data returned from the data server + + + Thread sync lock object + + + The event subscribers. null if no subcribers + + + Raises the MeanCollision event + A MeanCollisionEventArgs object containing the + data returned from the data server + + + Thread sync lock object + + + The event subscribers. null if no subcribers + + + Raises the RegionCrossed event + A RegionCrossedEventArgs object containing the + data returned from the data server + + + Thread sync lock object + + + The event subscribers. null if no subcribers + + + Raises the GroupChatJoined event + A GroupChatJoinedEventArgs object containing the + data returned from the data server + + + Thread sync lock object + + + The event subscribers. null if no subcribers + + + Raises the AlertMessage event + A AlertMessageEventArgs object containing the + data returned from the data server + + + Thread sync lock object + + + The event subscribers. null if no subcribers + + + Raises the ScriptControlChange event + A ScriptControlEventArgs object containing the + data returned from the data server + + + Thread sync lock object + + + The event subscribers. null if no subcribers + + + Raises the CameraConstraint event + A CameraConstraintEventArgs object containing the + data returned from the data server + + + Thread sync lock object + + + The event subscribers. null if no subcribers + + + Raises the ScriptSensorReply event + A ScriptSensorReplyEventArgs object containing the + data returned from the data server + + + Thread sync lock object + + + The event subscribers. null if no subcribers + + + Raises the AvatarSitResponse event + A AvatarSitResponseEventArgs object containing the + data returned from the data server + + + Thread sync lock object + + + The event subscribers. null if no subcribers + + + Raises the ChatSessionMemberAdded event + A ChatSessionMemberAddedEventArgs object containing the + data returned from the data server + + + Thread sync lock object + + + The event subscribers. null if no subcribers + + + Raises the ChatSessionMemberLeft event + A ChatSessionMemberLeftEventArgs object containing the + data returned from the data server + + + Thread sync lock object + + + Reference to the GridClient instance + + + Used for movement and camera tracking + + + Currently playing animations for the agent. Can be used to + check the current movement status such as walking, hovering, aiming, + etc. by checking against system animations found in the Animations class + + + Dictionary containing current Group Chat sessions and members + + + + Constructor, setup callbacks for packets related to our avatar + + A reference to the Class + + + + Send a text message from the Agent to the Simulator + + A containing the message + The channel to send the message on, 0 is the public channel. Channels above 0 + can be used however only scripts listening on the specified channel will see the message + Denotes the type of message being sent, shout, whisper, etc. + + + + Request any instant messages sent while the client was offline to be resent. + + + + + Send an Instant Message to another Avatar + + The recipients + A containing the message to send + + + + Send an Instant Message to an existing group chat or conference chat + + The recipients + A containing the message to send + IM session ID (to differentiate between IM windows) + + + + Send an Instant Message + + The name this IM will show up as being from + Key of Avatar + Text message being sent + IM session ID (to differentiate between IM windows) + IDs of sessions for a conference + + + + Send an Instant Message + + The name this IM will show up as being from + Key of Avatar + Text message being sent + IM session ID (to differentiate between IM windows) + Type of instant message to send + Whether to IM offline avatars as well + Senders Position + RegionID Sender is In + Packed binary data that is specific to + the dialog type + + + + Send an Instant Message to a group + + of the group to send message to + Text Message being sent. + + + + Send an Instant Message to a group the agent is a member of + + The name this IM will show up as being from + of the group to send message to + Text message being sent + + + + Send a request to join a group chat session + + of Group to leave + + + + Exit a group chat session. This will stop further Group chat messages + from being sent until session is rejoined. + + of Group chat session to leave + + + + Reply to script dialog questions. + + Channel initial request came on + Index of button you're "clicking" + Label of button you're "clicking" + of Object that sent the dialog request + + + + + Accept invite for to a chatterbox session + + of session to accept invite to + + + + Start a friends conference + + List of UUIDs to start a conference with + the temportary session ID returned in the callback> + + + + Start a particle stream between an agent and an object + + Key of the source agent + Key of the target object + + The type from the enum + A unique for this effect + + + + Start a particle stream between an agent and an object + + Key of the source agent + Key of the target object + A representing the beams offset from the source + A which sets the avatars lookat animation + of the Effect + + + + Create a particle beam between an avatar and an primitive + + The ID of source avatar + The ID of the target primitive + global offset + A object containing the combined red, green, blue and alpha + color values of particle beam + a float representing the duration the parcicle beam will last + A Unique ID for the beam + + + + + Create a particle swirl around a target position using a packet + + global offset + A object containing the combined red, green, blue and alpha + color values of particle beam + a float representing the duration the parcicle beam will last + A Unique ID for the beam + + + + Sends a request to sit on the specified object + + of the object to sit on + Sit at offset + + + + Follows a call to to actually sit on the object + + + + Stands up from sitting on a prim or the ground + true of AgentUpdate was sent + + + + Does a "ground sit" at the avatar's current position + + + + + Starts or stops flying + + True to start flying, false to stop flying + + + + Starts or stops crouching + + True to start crouching, false to stop crouching + + + + Starts a jump (begin holding the jump key) + + + + + Use the autopilot sim function to move the avatar to a new + position. Uses double precision to get precise movements + + The z value is currently not handled properly by the simulator + Global X coordinate to move to + Global Y coordinate to move to + Z coordinate to move to + + + + Use the autopilot sim function to move the avatar to a new position + + The z value is currently not handled properly by the simulator + Integer value for the global X coordinate to move to + Integer value for the global Y coordinate to move to + Floating-point value for the Z coordinate to move to + + + + Use the autopilot sim function to move the avatar to a new position + + The z value is currently not handled properly by the simulator + Integer value for the local X coordinate to move to + Integer value for the local Y coordinate to move to + Floating-point value for the Z coordinate to move to + + + Macro to cancel autopilot sim function + Not certain if this is how it is really done + true if control flags were set and AgentUpdate was sent to the simulator + + + + Grabs an object + + an unsigned integer of the objects ID within the simulator + + + + + Overload: Grab a simulated object + + an unsigned integer of the objects ID within the simulator + + The texture coordinates to grab + The surface coordinates to grab + The face of the position to grab + The region coordinates of the position to grab + The surface normal of the position to grab (A normal is a vector perpindicular to the surface) + The surface binormal of the position to grab (A binormal is a vector tangen to the surface + pointing along the U direction of the tangent space + + + + Drag an object + + of the object to drag + Drag target in region coordinates + + + + Overload: Drag an object + + of the object to drag + Drag target in region coordinates + + The texture coordinates to grab + The surface coordinates to grab + The face of the position to grab + The region coordinates of the position to grab + The surface normal of the position to grab (A normal is a vector perpindicular to the surface) + The surface binormal of the position to grab (A binormal is a vector tangen to the surface + pointing along the U direction of the tangent space + + + + Release a grabbed object + + The Objects Simulator Local ID + + + + + + + Release a grabbed object + + The Objects Simulator Local ID + The texture coordinates to grab + The surface coordinates to grab + The face of the position to grab + The region coordinates of the position to grab + The surface normal of the position to grab (A normal is a vector perpindicular to the surface) + The surface binormal of the position to grab (A binormal is a vector tangen to the surface + pointing along the U direction of the tangent space + + + + Touches an object + + an unsigned integer of the objects ID within the simulator + + + + + Request the current L$ balance + + + + + Give Money to destination Avatar + + UUID of the Target Avatar + Amount in L$ + + + + Give Money to destination Avatar + + UUID of the Target Avatar + Amount in L$ + Description that will show up in the + recipients transaction history + + + + Give L$ to an object + + object to give money to + amount of L$ to give + name of object + + + + Give L$ to a group + + group to give money to + amount of L$ to give + + + + Give L$ to a group + + group to give money to + amount of L$ to give + description of transaction + + + + Pay texture/animation upload fee + + + + + Pay texture/animation upload fee + + description of the transaction + + + + Give Money to destination Object or Avatar + + UUID of the Target Object/Avatar + Amount in L$ + Reason (Optional normally) + The type of transaction + Transaction flags, mostly for identifying group + transactions + + + + Plays a gesture + + Asset of the gesture + + + + Mark gesture active + + Inventory of the gesture + Asset of the gesture + + + + Mark gesture inactive + + Inventory of the gesture + + + + Send an AgentAnimation packet that toggles a single animation on + + The of the animation to start playing + Whether to ensure delivery of this packet or not + + + + Send an AgentAnimation packet that toggles a single animation off + + The of a + currently playing animation to stop playing + Whether to ensure delivery of this packet or not + + + + Send an AgentAnimation packet that will toggle animations on or off + + A list of animation s, and whether to + turn that animation on or off + Whether to ensure delivery of this packet or not + + + + Teleports agent to their stored home location + + true on successful teleport to home location + + + + Teleport agent to a landmark + + of the landmark to teleport agent to + true on success, false on failure + + + + Attempt to look up a simulator name and teleport to the discovered + destination + + Region name to look up + Position to teleport to + True if the lookup and teleport were successful, otherwise + false + + + + Attempt to look up a simulator name and teleport to the discovered + destination + + Region name to look up + Position to teleport to + Target to look at + True if the lookup and teleport were successful, otherwise + false + + + + Teleport agent to another region + + handle of region to teleport agent to + position in destination sim to teleport to + true on success, false on failure + This call is blocking + + + + Teleport agent to another region + + handle of region to teleport agent to + position in destination sim to teleport to + direction in destination sim agent will look at + true on success, false on failure + This call is blocking + + + + Request teleport to a another simulator + + handle of region to teleport agent to + position in destination sim to teleport to + + + + Request teleport to a another simulator + + handle of region to teleport agent to + position in destination sim to teleport to + direction in destination sim agent will look at + + + + Teleport agent to a landmark + + of the landmark to teleport agent to + + + + Send a teleport lure to another avatar with default "Join me in ..." invitation message + + target avatars to lure + + + + Send a teleport lure to another avatar with custom invitation message + + target avatars to lure + custom message to send with invitation + + + + Respond to a teleport lure by either accepting it and initiating + the teleport, or denying it + + of the avatar sending the lure + IM session of the incoming lure request + true to accept the lure, false to decline it + + + + Update agent profile + + struct containing updated + profile information + + + + Update agents profile interests + + selection of interests from struct + + + + Set the height and the width of the client window. This is used + by the server to build a virtual camera frustum for our avatar + + New height of the viewer window + New width of the viewer window + + + + Request the list of muted objects and avatars for this agent + + + + + Sets home location to agents current position + + will fire an AlertMessage () with + success or failure message + + + + Move an agent in to a simulator. This packet is the last packet + needed to complete the transition in to a new simulator + + Object + + + + Reply to script permissions request + + Object + of the itemID requesting permissions + of the taskID requesting permissions + list of permissions to allow + + + + Respond to a group invitation by either accepting or denying it + + UUID of the group (sent in the AgentID field of the invite message) + IM Session ID from the group invitation message + Accept the group invitation or deny it + + + + Requests script detection of objects and avatars + + name of the object/avatar to search for + UUID of the object or avatar to search for + Type of search from ScriptSensorTypeFlags + range of scan (96 max?) + the arc in radians to search within + an user generated ID to correlate replies with + Simulator to perform search in + + + + Create or update profile pick + + UUID of the pick to update, or random UUID to create a new pick + Is this a top pick? (typically false) + UUID of the parcel (UUID.Zero for the current parcel) + Name of the pick + Global position of the pick landmark + UUID of the image displayed with the pick + Long description of the pick + + + + Delete profile pick + + UUID of the pick to delete + + + + Create or update profile Classified + + UUID of the classified to update, or random UUID to create a new classified + Defines what catagory the classified is in + UUID of the image displayed with the classified + Price that the classified will cost to place for a week + Global position of the classified landmark + Name of the classified + Long description of the classified + if true, auto renew classified after expiration + + + + Create or update profile Classified + + UUID of the classified to update, or random UUID to create a new classified + Defines what catagory the classified is in + UUID of the image displayed with the classified + Price that the classified will cost to place for a week + Name of the classified + Long description of the classified + if true, auto renew classified after expiration + + + + Delete a classified ad + + The classified ads ID + + + + Fetches resource usage by agents attachmetns + + Called when the requested information is collected + + + + Take an incoming ImprovedInstantMessage packet, auto-parse, and if + OnInstantMessage is defined call that with the appropriate arguments + + The sender + The EventArgs object containing the packet data + + + + Take an incoming Chat packet, auto-parse, and if OnChat is defined call + that with the appropriate arguments. + + The sender + The EventArgs object containing the packet data + + + + Used for parsing llDialogs + + The sender + The EventArgs object containing the packet data + + + + Used for parsing llRequestPermissions dialogs + + The sender + The EventArgs object containing the packet data + + + + Handles Script Control changes when Script with permissions releases or takes a control + + The sender + The EventArgs object containing the packet data + + + + Used for parsing llLoadURL Dialogs + + The sender + The EventArgs object containing the packet data + + + + Update client's Position, LookAt and region handle from incoming packet + + The sender + The EventArgs object containing the packet data + This occurs when after an avatar moves into a new sim + + + Process an incoming packet and raise the appropriate events + The sender + The EventArgs object containing the packet data + + + Process an incoming packet and raise the appropriate events + The sender + The EventArgs object containing the packet data + + + Process an incoming packet and raise the appropriate events + The sender + The EventArgs object containing the packet data + + + + Process TeleportFailed message sent via EventQueue, informs agent its last teleport has failed and why. + + The Message Key + An IMessage object Deserialized from the recieved message event + The simulator originating the event message + + + + Process TeleportFinish from Event Queue and pass it onto our TeleportHandler + + The message system key for this event + IMessage object containing decoded data from OSD + The simulator originating the event message + + + Process an incoming packet and raise the appropriate events + The sender + The EventArgs object containing the packet data + + + Process an incoming packet and raise the appropriate events + The sender + The EventArgs object containing the packet data + + + Process an incoming packet and raise the appropriate events + The sender + The EventArgs object containing the packet data + + + + Crossed region handler for message that comes across the EventQueue. Sent to an agent + when the agent crosses a sim border into a new region. + + The message key + the IMessage object containing the deserialized data sent from the simulator + The which originated the packet + + + Process an incoming packet and raise the appropriate events + The sender + The EventArgs object containing the packet data + This packet is now being sent via the EventQueue + + + + Group Chat event handler + + The capability Key + IMessage object containing decoded data from OSD + + + + + Response from request to join a group chat + + + IMessage object containing decoded data from OSD + + + + + Someone joined or left group chat + + + IMessage object containing decoded data from OSD + + + + + Handle a group chat Invitation + + Caps Key + IMessage object containing decoded data from OSD + Originating Simulator + + + + Moderate a chat session + + the of the session to moderate, for group chats this will be the groups UUID + the of the avatar to moderate + Either "voice" to moderate users voice, or "text" to moderate users text session + true to moderate (silence user), false to allow avatar to speak + + + Process an incoming packet and raise the appropriate events + The sender + The EventArgs object containing the packet data + + + Process an incoming packet and raise the appropriate events + The sender + The EventArgs object containing the packet data + + + Process an incoming packet and raise the appropriate events + The sender + The EventArgs object containing the packet data + + + Process an incoming packet and raise the appropriate events + The sender + The EventArgs object containing the packet data + + + Raised when a scripted object or agent within range sends a public message + + + Raised when a scripted object sends a dialog box containing possible + options an agent can respond to + + + Raised when an object requests a change in the permissions an agent has permitted + + + Raised when a script requests an agent open the specified URL + + + Raised when an agents currency balance is updated + + + Raised when a transaction occurs involving currency such as a land purchase + + + Raised when an ImprovedInstantMessage packet is recieved from the simulator, this is used for everything from + private messaging to friendship offers. The Dialog field defines what type of message has arrived + + + Raised when an agent has requested a teleport to another location, or when responding to a lure. Raised multiple times + for each teleport indicating the progress of the request + + + Raised when a simulator sends agent specific information for our avatar. + + + Raised when our agents animation playlist changes + + + Raised when an object or avatar forcefully collides with our agent + + + Raised when our agent crosses a region border into another region + + + Raised when our agent succeeds or fails to join a group chat session + + + Raised when a simulator sends an urgent message usually indication the recent failure of + another action we have attempted to take such as an attempt to enter a parcel where we are denied access + + + Raised when a script attempts to take or release specified controls for our agent + + + Raised when the simulator detects our agent is trying to view something + beyond its limits + + + Raised when a script sensor reply is received from a simulator + + + Raised in response to a request + + + Raised when an avatar enters a group chat session we are participating in + + + Raised when an agent exits a group chat session we are participating in + + + Your (client) avatars + "client", "agent", and "avatar" all represent the same thing + + + Temporary assigned to this session, used for + verifying our identity in packets + + + Shared secret that is never sent over the wire + + + Your (client) avatar ID, local to the current region/sim + + + Where the avatar started at login. Can be "last", "home" + or a login + + + The access level of this agent, usually M or PG + + + The CollisionPlane of Agent + + + An representing the velocity of our agent + + + An representing the acceleration of our agent + + + A which specifies the angular speed, and axis about which an Avatar is rotating. + + + Position avatar client will goto when login to 'home' or during + teleport request to 'home' region. + + + LookAt point saved/restored with HomePosition + + + Avatar First Name (i.e. Philip) + + + Avatar Last Name (i.e. Linden) + + + Avatar Full Name (i.e. Philip Linden) + + + Gets the health of the agent + + + Gets the current balance of the agent + + + Gets the local ID of the prim the agent is sitting on, + zero if the avatar is not currently sitting + + + Gets the of the agents active group. + + + Gets the Agents powers in the currently active group + + + Current status message for teleporting + + + Current position of the agent as a relative offset from + the simulator, or the parent object if we are sitting on something + + + Current rotation of the agent as a relative rotation from + the simulator, or the parent object if we are sitting on something + + + Current position of the agent in the simulator + + + + A representing the agents current rotation + + + + Returns the global grid position of the avatar + + + + Called once attachment resource usage information has been collected + + Indicates if operation was successfull + Attachment resource usage information + + + + Used to specify movement actions for your agent + + + + Empty flag + + + Move Forward (SL Keybinding: W/Up Arrow) + + + Move Backward (SL Keybinding: S/Down Arrow) + + + Move Left (SL Keybinding: Shift-(A/Left Arrow)) + + + Move Right (SL Keybinding: Shift-(D/Right Arrow)) + + + Not Flying: Jump/Flying: Move Up (SL Keybinding: E) + + + Not Flying: Croutch/Flying: Move Down (SL Keybinding: C) + + + Unused + + + Unused + + + Unused + + + Unused + + + ORed with AGENT_CONTROL_AT_* if the keyboard is being used + + + ORed with AGENT_CONTROL_LEFT_* if the keyboard is being used + + + ORed with AGENT_CONTROL_UP_* if the keyboard is being used + + + Fly + + + + + + Finish our current animation + + + Stand up from the ground or a prim seat + + + Sit on the ground at our current location + + + Whether mouselook is currently enabled + + + Legacy, used if a key was pressed for less than a certain amount of time + + + Legacy, used if a key was pressed for less than a certain amount of time + + + Legacy, used if a key was pressed for less than a certain amount of time + + + Legacy, used if a key was pressed for less than a certain amount of time + + + Legacy, used if a key was pressed for less than a certain amount of time + + + Legacy, used if a key was pressed for less than a certain amount of time + + + + + + + + + Set when the avatar is idled or set to away. Note that the away animation is + activated separately from setting this flag + + + + + + + + + + + + + + + + Agent movement and camera control + + Agent movement is controlled by setting specific + After the control flags are set, An AgentUpdate is required to update the simulator of the specified flags + This is most easily accomplished by setting one or more of the AgentMovement properties + + Movement of an avatar is always based on a compass direction, for example AtPos will move the + agent from West to East or forward on the X Axis, AtNeg will of course move agent from + East to West or backward on the X Axis, LeftPos will be South to North or forward on the Y Axis + The Z axis is Up, finer grained control of movements can be done using the Nudge properties + + + + Agent camera controls + + + Currently only used for hiding your group title + + + Action state of the avatar, which can currently be + typing and editing + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Timer for sending AgentUpdate packets + + + Default constructor + + + + Send an AgentUpdate with the camera set at the current agent + position and pointing towards the heading specified + + Camera rotation in radians + Whether to send the AgentUpdate reliable + or not + + + + Rotates the avatar body and camera toward a target position. + This will also anchor the camera position on the avatar + + Region coordinates to turn toward + + + + Send new AgentUpdate packet to update our current camera + position and rotation + + + + + Send new AgentUpdate packet to update our current camera + position and rotation + + Whether to require server acknowledgement + of this packet + + + + Send new AgentUpdate packet to update our current camera + position and rotation + + Whether to require server acknowledgement + of this packet + Simulator to send the update to + + + + Builds an AgentUpdate packet entirely from parameters. This + will not touch the state of Self.Movement or + Self.Movement.Camera in any way + + + + + + + + + + + + + + + Move agent positive along the X axis + + + Move agent negative along the X axis + + + Move agent positive along the Y axis + + + Move agent negative along the Y axis + + + Move agent positive along the Z axis + + + Move agent negative along the Z axis + + + + + + + + + + + + + + + + + + + + + + + + Causes simulator to make agent fly + + + Stop movement + + + Finish animation + + + Stand up from a sit + + + Tells simulator to sit agent on ground + + + Place agent into mouselook mode + + + Nudge agent positive along the X axis + + + Nudge agent negative along the X axis + + + Nudge agent positive along the Y axis + + + Nudge agent negative along the Y axis + + + Nudge agent positive along the Z axis + + + Nudge agent negative along the Z axis + + + + + + + + + Tell simulator to mark agent as away + + + + + + + + + + + + + + + + Returns "always run" value, or changes it by sending a SetAlwaysRunPacket + + + + The current value of the agent control flags + + + Gets or sets the interval in milliseconds at which + AgentUpdate packets are sent to the current simulator. Setting + this to a non-zero value will also enable the packet sending if + it was previously off, and setting it to zero will disable + + + Gets or sets whether AgentUpdate packets are sent to + the current simulator + + + Reset movement controls every time we send an update + + + + Camera controls for the agent, mostly a thin wrapper around + CoordinateFrame. This class is only responsible for state + tracking and math, it does not send any packets + + + + + + + The camera is a local frame of reference inside of + the larger grid space. This is where the math happens + + + + Default constructor + + + + + + + + + + + + + + + + + + + + + + Construct a new instance of the ChatEventArgs object + + Sim from which the message originates + The message sent + The audible level of the message + The type of message sent: whisper, shout, etc + The source type of the message sender + The name of the agent or object sending the message + The ID of the agent or object sending the message + The ID of the object owner, or the agent ID sending the message + The position of the agent or object sending the message + + + Get the simulator sending the message + + + Get the message sent + + + Get the audible level of the message + + + Get the type of message sent: whisper, shout, etc + + + Get the source type of the message sender + + + Get the name of the agent or object sending the message + + + Get the ID of the agent or object sending the message + + + Get the ID of the object owner, or the agent ID sending the message + + + Get the position of the agent or object sending the message + + + Contains the data sent when a primitive opens a dialog with this agent + + + + Construct a new instance of the ScriptDialogEventArgs + + The dialog message + The name of the object that sent the dialog request + The ID of the image to be displayed + The ID of the primitive sending the dialog + The first name of the senders owner + The last name of the senders owner + The communication channel the dialog was sent on + The string labels containing the options presented in this dialog + + + Get the dialog message + + + Get the name of the object that sent the dialog request + + + Get the ID of the image to be displayed + + + Get the ID of the primitive sending the dialog + + + Get the first name of the senders owner + + + Get the last name of the senders owner + + + Get the communication channel the dialog was sent on, responses + should also send responses on this same channel + + + Get the string labels containing the options presented in this dialog + + + Contains the data sent when a primitive requests debit or other permissions + requesting a YES or NO answer + + + + Construct a new instance of the ScriptQuestionEventArgs + + The simulator containing the object sending the request + The ID of the script making the request + The ID of the primitive containing the script making the request + The name of the primitive making the request + The name of the owner of the object making the request + The permissions being requested + + + Get the simulator containing the object sending the request + + + Get the ID of the script making the request + + + Get the ID of the primitive containing the script making the request + + + Get the name of the primitive making the request + + + Get the name of the owner of the object making the request + + + Get the permissions being requested + + + Contains the data sent when a primitive sends a request + to an agent to open the specified URL + + + + Construct a new instance of the LoadUrlEventArgs + + The name of the object sending the request + The ID of the object sending the request + The ID of the owner of the object sending the request + True if the object is owned by a group + The message sent with the request + The URL the object sent + + + Get the name of the object sending the request + + + Get the ID of the object sending the request + + + Get the ID of the owner of the object sending the request + + + True if the object is owned by a group + + + Get the message sent with the request + + + Get the URL the object sent + + + The date received from an ImprovedInstantMessage + + + + Construct a new instance of the InstantMessageEventArgs object + + the InstantMessage object + the simulator where the InstantMessage origniated + + + Get the InstantMessage object + + + Get the simulator where the InstantMessage origniated + + + Contains the currency balance + + + + Construct a new BalanceEventArgs object + + The currenct balance + + + + Get the currenct balance + + + + Contains the transaction summary when an item is purchased, + money is given, or land is purchased + + + + Construct a new instance of the MoneyBalanceReplyEventArgs object + + The ID of the transaction + True of the transaction was successful + The current currency balance + The meters credited + The meters comitted + A brief description of the transaction + + + Get the ID of the transaction + + + True of the transaction was successful + + + Get the remaining currency balance + + + Get the meters credited + + + Get the meters comitted + + + Get the description of the transaction + + + Data sent from the simulator containing information about your agent and active group information + + + + Construct a new instance of the AgentDataReplyEventArgs object + + The agents first name + The agents last name + The agents active group ID + The group title of the agents active group + The combined group powers the agent has in the active group + The name of the group the agent has currently active + + + Get the agents first name + + + Get the agents last name + + + Get the active group ID of your agent + + + Get the active groups title of your agent + + + Get the combined group powers of your agent + + + Get the active group name of your agent + + + Data sent by the simulator to indicate the active/changed animations + applied to your agent + + + + Construct a new instance of the AnimationsChangedEventArgs class + + The dictionary that contains the changed animations + + + Get the dictionary that contains the changed animations + + + + Data sent from a simulator indicating a collision with your agent + + + + + Construct a new instance of the MeanCollisionEventArgs class + + The type of collision that occurred + The ID of the agent or object that perpetrated the agression + The ID of the Victim + The strength of the collision + The Time the collision occurred + + + Get the Type of collision + + + Get the ID of the agent or object that collided with your agent + + + Get the ID of the agent that was attacked + + + A value indicating the strength of the collision + + + Get the time the collision occurred + + + Data sent to your agent when it crosses region boundaries + + + + Construct a new instance of the RegionCrossedEventArgs class + + The simulator your agent just left + The simulator your agent is now in + + + Get the simulator your agent just left + + + Get the simulator your agent is now in + + + Data sent from the simulator when your agent joins a group chat session + + + + Construct a new instance of the GroupChatJoinedEventArgs class + + The ID of the session + The name of the session + A temporary session id used for establishing new sessions + True of your agent successfully joined the session + + + Get the ID of the group chat session + + + Get the name of the session + + + Get the temporary session ID used for establishing new sessions + + + True if your agent successfully joined the session + + + Data sent by the simulator containing urgent messages + + + + Construct a new instance of the AlertMessageEventArgs class + + The alert message + + + Get the alert message + + + Data sent by a script requesting to take or release specified controls to your agent + + + + Construct a new instance of the ScriptControlEventArgs class + + The controls the script is attempting to take or release to the agent + True if the script is passing controls back to the agent + True if the script is requesting controls be released to the script + + + Get the controls the script is attempting to take or release to the agent + + + True if the script is passing controls back to the agent + + + True if the script is requesting controls be released to the script + + + + Data sent from the simulator to an agent to indicate its view limits + + + + + Construct a new instance of the CameraConstraintEventArgs class + + The collision plane + + + Get the collision plane + + + + Data containing script sensor requests which allow an agent to know the specific details + of a primitive sending script sensor requests + + + + + Construct a new instance of the ScriptSensorReplyEventArgs + + The ID of the primitive sending the sensor + The ID of the group associated with the primitive + The name of the primitive sending the sensor + The ID of the primitive sending the sensor + The ID of the owner of the primitive sending the sensor + The position of the primitive sending the sensor + The range the primitive specified to scan + The rotation of the primitive sending the sensor + The type of sensor the primitive sent + The velocity of the primitive sending the sensor + + + Get the ID of the primitive sending the sensor + + + Get the ID of the group associated with the primitive + + + Get the name of the primitive sending the sensor + + + Get the ID of the primitive sending the sensor + + + Get the ID of the owner of the primitive sending the sensor + + + Get the position of the primitive sending the sensor + + + Get the range the primitive specified to scan + + + Get the rotation of the primitive sending the sensor + + + Get the type of sensor the primitive sent + + + Get the velocity of the primitive sending the sensor + + + Contains the response data returned from the simulator in response to a + + + Construct a new instance of the AvatarSitResponseEventArgs object + + + Get the ID of the primitive the agent will be sitting on + + + True if the simulator Autopilot functions were involved + + + Get the camera offset of the agent when seated + + + Get the camera eye offset of the agent when seated + + + True of the agent will be in mouselook mode when seated + + + Get the position of the agent when seated + + + Get the rotation of the agent when seated + + + Data sent when an agent joins a chat session your agent is currently participating in + + + + Construct a new instance of the ChatSessionMemberAddedEventArgs object + + The ID of the chat session + The ID of the agent joining + + + Get the ID of the chat session + + + Get the ID of the agent that joined + + + Data sent when an agent exits a chat session your agent is currently participating in + + + + Construct a new instance of the ChatSessionMemberLeftEventArgs object + + The ID of the chat session + The ID of the Agent that left + + + Get the ID of the chat session + + + Get the ID of the agent that left + + + + Return a decoded capabilities message as a strongly typed object + + A string containing the name of the capabilities message key + An to decode + A strongly typed object containing the decoded information from the capabilities message, or null + if no existing Message object exists for the specified event + + + + Represents a string of characters encoded with specific formatting properties + + + + A text string containing main text of the notecard + + + List of s embedded on the notecard + + + Construct an Asset of type Notecard + + + + Construct an Asset object of type Notecard + + A unique specific to this asset + A byte array containing the raw asset data + + + + Encode the raw contents of a string with the specific Linden Text properties + + + + + Decode the raw asset data including the Linden Text properties + + true if the AssetData was successfully decoded + + + Override the base classes AssetType + + + + Class for controlling various system settings. + + Some values are readonly because they affect things that + happen when the GridClient object is initialized, so changing them at + runtime won't do any good. Non-readonly values may affect things that + happen at login or dynamically + + + Main grid login server + + + Beta grid login server + + + + InventoryManager requests inventory information on login, + GridClient initializes an Inventory store for main inventory. + + + + + InventoryManager requests library information on login, + GridClient initializes an Inventory store for the library. + + + + Number of milliseconds between sending pings to each sim + + + Number of milliseconds between sending camera updates + + + Number of milliseconds between updating the current + positions of moving, non-accelerating and non-colliding objects + + + Millisecond interval between ticks, where all ACKs are + sent out and the age of unACKed packets is checked + + + The initial size of the packet inbox, where packets are + stored before processing + + + Maximum size of packet that we want to send over the wire + + + The maximum value of a packet sequence number before it + rolls over back to one + + + The maximum size of the sequence number archive, used to + check for resent and/or duplicate packets + + + The relative directory where external resources are kept + + + Login server to connect to + + + IP Address the client will bind to + + + Use XML-RPC Login or LLSD Login, default is XML-RPC Login + + + Number of milliseconds before an asset transfer will time + out + + + Number of milliseconds before a teleport attempt will time + out + + + Number of milliseconds before NetworkManager.Logout() will + time out + + + Number of milliseconds before a CAPS call will time out + Setting this too low will cause web requests time out and + possibly retry repeatedly + + + Number of milliseconds for xml-rpc to timeout + + + Milliseconds before a packet is assumed lost and resent + + + Milliseconds without receiving a packet before the + connection to a simulator is assumed lost + + + Milliseconds to wait for a simulator info request through + the grid interface + + + Maximum number of queued ACKs to be sent before SendAcks() + is forced + + + Network stats queue length (seconds) + + + Enable/disable storing terrain heightmaps in the + TerrainManager + + + Enable/disable sending periodic camera updates + + + Enable/disable automatically setting agent appearance at + login and after sim crossing + + + Enable/disable automatically setting the bandwidth throttle + after connecting to each simulator + The default throttle uses the equivalent of the maximum + bandwidth setting in the official client. If you do not set a + throttle your connection will by default be throttled well below + the minimum values and you may experience connection problems + + + Enable/disable the sending of pings to monitor lag and + packet loss + + + Should we connect to multiple sims? This will allow + viewing in to neighboring simulators and sim crossings + (Experimental) + + + If true, all object update packets will be decoded in to + native objects. If false, only updates for our own agent will be + decoded. Registering an event handler will force objects for that + type to always be decoded. If this is disabled the object tracking + will have missing or partial prim and avatar information + + + If true, when a cached object check is received from the + server the full object info will automatically be requested + + + Whether to establish connections to HTTP capabilities + servers for simulators + + + Whether to decode sim stats + + + The capabilities servers are currently designed to + periodically return a 502 error which signals for the client to + re-establish a connection. Set this to true to log those 502 errors + + + If true, any reference received for a folder or item + the library is not aware of will automatically be fetched + + + If true, and SEND_AGENT_UPDATES is true, + AgentUpdate packets will continuously be sent out to give the bot + smoother movement and autopiloting + + + If true, currently visible avatars will be stored + in dictionaries inside Simulator.ObjectAvatars. + If false, a new Avatar or Primitive object will be created + each time an object update packet is received + + + If true, currently visible avatars will be stored + in dictionaries inside Simulator.ObjectPrimitives. + If false, a new Avatar or Primitive object will be created + each time an object update packet is received + + + If true, position and velocity will periodically be + interpolated (extrapolated, technically) for objects and + avatars that are being tracked by the library. This is + necessary to increase the accuracy of speed and position + estimates for simulated objects + + + + If true, utilization statistics will be tracked. There is a minor penalty + in CPU time for enabling this option. + + + + If true, parcel details will be stored in the + Simulator.Parcels dictionary as they are received + + + + If true, an incoming parcel properties reply will automatically send + a request for the parcel access list + + + + + if true, an incoming parcel properties reply will automatically send + a request for the traffic count. + + + + + If true, images, and other assets downloaded from the server + will be cached in a local directory + + + + Path to store cached texture data + + + Maximum size cached files are allowed to take on disk (bytes) + + + Default color used for viewer particle effects + + + Maximum number of times to resend a failed packet + + + Throttle outgoing packet rate + + + UUID of a texture used by some viewers to indentify type of client used + + + + Download textures using GetTexture capability when available + + + + The maximum number of concurrent texture downloads allowed + Increasing this number will not necessarily increase texture retrieval times due to + simulator throttles + + + + The Refresh timer inteval is used to set the delay between checks for stalled texture downloads + + This is a static variable which applies to all instances + + + + Textures taking longer than this value will be flagged as timed out and removed from the pipeline + + + + + Get or set the minimum log level to output to the console by default + + If the library is not compiled with DEBUG defined and this level is set to DEBUG + You will get no output on the console. This behavior can be overriden by creating + a logger configuration file for log4net + + + + Attach avatar names to log messages + + + Log packet retransmission info + + + Constructor + Reference to a GridClient object + + + Process an incoming packet and raise the appropriate events + The sender + The EventArgs object containing the packet data + + + Cost of uploading an asset + Read-only since this value is dynamically fetched at login + + + + NetworkManager is responsible for managing the network layer of + OpenMetaverse. It tracks all the server connections, serializes + outgoing traffic and deserializes incoming traffic, and provides + instances of delegates for network-related events. + + + Login Routines + + + + The event subscribers, null of no subscribers + + + Raises the PacketSent Event + A PacketSentEventArgs object containing + the data sent from the simulator + + + Thread sync lock object + + + The event subscribers, null of no subscribers + + + Raises the LoggedOut Event + A LoggedOutEventArgs object containing + the data sent from the simulator + + + Thread sync lock object + + + The event subscribers, null of no subscribers + + + Raises the SimConnecting Event + A SimConnectingEventArgs object containing + the data sent from the simulator + + + Thread sync lock object + + + The event subscribers, null of no subscribers + + + Raises the SimConnected Event + A SimConnectedEventArgs object containing + the data sent from the simulator + + + Thread sync lock object + + + The event subscribers, null of no subscribers + + + Raises the SimDisconnected Event + A SimDisconnectedEventArgs object containing + the data sent from the simulator + + + Thread sync lock object + + + The event subscribers, null of no subscribers + + + Raises the Disconnected Event + A DisconnectedEventArgs object containing + the data sent from the simulator + + + Thread sync lock object + + + The event subscribers, null of no subscribers + + + Raises the SimChanged Event + A SimChangedEventArgs object containing + the data sent from the simulator + + + Thread sync lock object + + + The event subscribers, null of no subscribers + + + Raises the EventQueueRunning Event + A EventQueueRunningEventArgs object containing + the data sent from the simulator + + + Thread sync lock object + + + All of the simulators we are currently connected to + + + Handlers for incoming capability events + + + Handlers for incoming packets + + + Incoming packets that are awaiting handling + + + Outgoing packets that are awaiting handling + + + + Default constructor + + Reference to the GridClient object + + + + Register an event handler for a packet. This is a low level event + interface and should only be used if you are doing something not + supported in the library + + Packet type to trigger events for + Callback to fire when a packet of this type + is received + + + + Register an event handler for a packet. This is a low level event + interface and should only be used if you are doing something not + supported in the library + + Packet type to trigger events for + Callback to fire when a packet of this type + is received + True if the callback should be ran + asynchronously. Only set this to false (synchronous for callbacks + that will always complete quickly) + If any callback for a packet type is marked as + asynchronous, all callbacks for that packet type will be fired + asynchronously + + + + Unregister an event handler for a packet. This is a low level event + interface and should only be used if you are doing something not + supported in the library + + Packet type this callback is registered with + Callback to stop firing events for + + + + Register a CAPS event handler. This is a low level event interface + and should only be used if you are doing something not supported in + the library + + Name of the CAPS event to register a handler for + Callback to fire when a CAPS event is received + + + + Unregister a CAPS event handler. This is a low level event interface + and should only be used if you are doing something not supported in + the library + + Name of the CAPS event this callback is + registered with + Callback to stop firing events for + + + + Send a packet to the simulator the avatar is currently occupying + + Packet to send + + + + Send a packet to a specified simulator + + Packet to send + Simulator to send the packet to + + + + Connect to a simulator + + IP address to connect to + Port to connect to + Handle for this simulator, to identify its + location in the grid + Whether to set CurrentSim to this new + connection, use this if the avatar is moving in to this simulator + URL of the capabilities server to use for + this sim connection + A Simulator object on success, otherwise null + + + + Connect to a simulator + + IP address and port to connect to + Handle for this simulator, to identify its + location in the grid + Whether to set CurrentSim to this new + connection, use this if the avatar is moving in to this simulator + URL of the capabilities server to use for + this sim connection + A Simulator object on success, otherwise null + + + + Initiate a blocking logout request. This will return when the logout + handshake has completed or when Settings.LOGOUT_TIMEOUT + has expired and the network layer is manually shut down + + + + + Initiate the logout process. Check if logout succeeded with the + OnLogoutReply event, and if this does not fire the + Shutdown() function needs to be manually called + + + + + Close a connection to the given simulator + + + + + + + Shutdown will disconnect all the sims except for the current sim + first, and then kill the connection to CurrentSim. This should only + be called if the logout process times out on RequestLogout + + Type of shutdown + + + + Shutdown will disconnect all the sims except for the current sim + first, and then kill the connection to CurrentSim. This should only + be called if the logout process times out on RequestLogout + + Type of shutdown + Shutdown message + + + + Searches through the list of currently connected simulators to find + one attached to the given IPEndPoint + + IPEndPoint of the Simulator to search for + A Simulator reference on success, otherwise null + + + + Fire an event when an event queue connects for capabilities + + Simulator the event queue is attached to + + + Process an incoming packet and raise the appropriate events + The sender + The EventArgs object containing the packet data + + + Process an incoming packet and raise the appropriate events + The sender + The EventArgs object containing the packet data + + + Process an incoming packet and raise the appropriate events + The sender + The EventArgs object containing the packet data + + + Process an incoming packet and raise the appropriate events + The sender + The EventArgs object containing the packet data + + + Process an incoming packet and raise the appropriate events + The sender + The EventArgs object containing the packet data + + + Process an incoming packet and raise the appropriate events + The sender + The EventArgs object containing the packet data + + + Process an incoming packet and raise the appropriate events + The sender + The EventArgs object containing the packet data + + + The event subscribers, null of no subscribers + + + Raises the LoginProgress Event + A LoginProgressEventArgs object containing + the data sent from the simulator + + + Thread sync lock object + + + Seed CAPS URL returned from the login server + + + A list of packets obtained during the login process which + networkmanager will log but not process + + + + Generate sane default values for a login request + + Account first name + Account last name + Account password + Client application name + Client application version + A populated struct containing + sane defaults + + + + Simplified login that takes the most common and required fields + + Account first name + Account last name + Account password + Client application name + Client application version + Whether the login was successful or not. On failure the + LoginErrorKey string will contain the error code and LoginMessage + will contain a description of the error + + + + Simplified login that takes the most common fields along with a + starting location URI, and can accept an MD5 string instead of a + plaintext password + + Account first name + Account last name + Account password or MD5 hash of the password + such as $1$1682a1e45e9f957dcdf0bb56eb43319c + Client application name + Starting location URI that can be built with + StartLocation() + Client application version + Whether the login was successful or not. On failure the + LoginErrorKey string will contain the error code and LoginMessage + will contain a description of the error + + + + Login that takes a struct of all the values that will be passed to + the login server + + The values that will be passed to the login + server, all fields must be set even if they are String.Empty + Whether the login was successful or not. On failure the + LoginErrorKey string will contain the error code and LoginMessage + will contain a description of the error + + + + Build a start location URI for passing to the Login function + + Name of the simulator to start in + X coordinate to start at + Y coordinate to start at + Z coordinate to start at + String with a URI that can be used to login to a specified + location + + + + Handles response from XML-RPC login replies + + + + + Handle response from LLSD login replies + + + + + + + + Get current OS + + Either "Win" or "Linux" + + + + Get clients default Mac Address + + A string containing the first found Mac Address + + + Raised when the simulator sends us data containing + ... + + + Raised when the simulator sends us data containing + ... + + + Raised when the simulator sends us data containing + ... + + + Raised when the simulator sends us data containing + ... + + + Raised when the simulator sends us data containing + ... + + + Raised when the simulator sends us data containing + ... + + + Raised when the simulator sends us data containing + ... + + + Raised when the simulator sends us data containing + ... + + + Unique identifier associated with our connections to + simulators + + + The simulator that the logged in avatar is currently + occupying + + + Shows whether the network layer is logged in to the + grid or not + + + Number of packets in the incoming queue + + + Number of packets in the outgoing queue + + + Raised when the simulator sends us data containing + ... + + + Called when a reply is received from the login server, the + login sequence will block until this event returns + + + Current state of logging in + + + Upon login failure, contains a short string key for the + type of login error that occurred + + + The raw XML-RPC reply from the login server, exactly as it + was received (minus the HTTP header) + + + During login this contains a descriptive version of + LoginStatusCode. After a successful login this will contain the + message of the day, and after a failed login a descriptive error + message will be returned + + + + Explains why a simulator or the grid disconnected from us + + + + The client requested the logout or simulator disconnect + + + The server notified us that it is disconnecting + + + Either a socket was closed or network traffic timed out + + + The last active simulator shut down + + + + Holds a simulator reference and a decoded packet, these structs are put in + the packet inbox for event handling + + + + Reference to the simulator that this packet came from + + + Packet that needs to be processed + + + + Holds a simulator reference and a serialized packet, these structs are put in + the packet outbox for sending + + + + Reference to the simulator this packet is destined for + + + Packet that needs to be sent + + + Sequence number of the wrapped packet + + + Number of times this packet has been resent + + + Environment.TickCount when this packet was last sent over the wire + + + + + + + + + + + + + + Type of return to use when returning objects from a parcel + + + + + + + Return objects owned by parcel owner + + + Return objects set to group + + + Return objects not owned by parcel owner or set to group + + + Return a specific list of objects on parcel + + + Return objects that are marked for-sale + + + + Blacklist/Whitelist flags used in parcels Access List + + + + Agent is denied access + + + Agent is granted access + + + + The result of a request for parcel properties + + + + No matches were found for the request + + + Request matched a single parcel + + + Request matched multiple parcels + + + + Flags used in the ParcelAccessListRequest packet to specify whether + we want the access list (whitelist), ban list (blacklist), or both + + + + Request the access list + + + Request the ban list + + + Request both White and Black lists + + + + Sequence ID in ParcelPropertiesReply packets (sent when avatar + tries to cross a parcel border) + + + + Parcel is currently selected + + + Parcel restricted to a group the avatar is not a + member of + + + Avatar is banned from the parcel + + + Parcel is restricted to an access list that the + avatar is not on + + + Response to hovering over a parcel + + + + The tool to use when modifying terrain levels + + + + Level the terrain + + + Raise the terrain + + + Lower the terrain + + + Smooth the terrain + + + Add random noise to the terrain + + + Revert terrain to simulator default + + + + The tool size to use when changing terrain levels + + + + Small + + + Medium + + + Large + + + + Reasons agent is denied access to a parcel on the simulator + + + + Agent is not denied, access is granted + + + Agent is not a member of the group set for the parcel, or which owns the parcel + + + Agent is not on the parcels specific allow list + + + Agent is on the parcels ban list + + + Unknown + + + Agent is not age verified and parcel settings deny access to non age verified avatars + + + + Parcel overlay type. This is used primarily for highlighting and + coloring which is why it is a single integer instead of a set of + flags + + These values seem to be poorly thought out. The first three + bits represent a single value, not flags. For example Auction (0x05) is + not a combination of OwnedByOther (0x01) and ForSale(0x04). However, + the BorderWest and BorderSouth values are bit flags that get attached + to the value stored in the first three bits. Bits four, five, and six + are unused + + + Public land + + + Land is owned by another avatar + + + Land is owned by a group + + + Land is owned by the current avatar + + + Land is for sale + + + Land is being auctioned + + + To the west of this area is a parcel border + + + To the south of this area is a parcel border + + + + Various parcel properties + + + + No flags set + + + Allow avatars to fly (a client-side only restriction) + + + Allow foreign scripts to run + + + This parcel is for sale + + + Allow avatars to create a landmark on this parcel + + + Allows all avatars to edit the terrain on this parcel + + + Avatars have health and can take damage on this parcel. + If set, avatars can be killed and sent home here + + + Foreign avatars can create objects here + + + All objects on this parcel can be purchased + + + Access is restricted to a group + + + Access is restricted to a whitelist + + + Ban blacklist is enabled + + + Unknown + + + List this parcel in the search directory + + + Allow personally owned parcels to be deeded to group + + + If Deeded, owner contributes required tier to group parcel is deeded to + + + Restrict sounds originating on this parcel to the + parcel boundaries + + + Objects on this parcel are sold when the land is + purchsaed + + + Allow this parcel to be published on the web + + + The information for this parcel is mature content + + + The media URL is an HTML page + + + The media URL is a raw HTML string + + + Restrict foreign object pushes + + + Ban all non identified/transacted avatars + + + Allow group-owned scripts to run + + + Allow object creation by group members or group + objects + + + Allow all objects to enter this parcel + + + Only allow group and owner objects to enter this parcel + + + Voice Enabled on this parcel + + + Use Estate Voice channel for Voice on this parcel + + + Deny Age Unverified Users + + + + Parcel ownership status + + + + Placeholder + + + Parcel is leased (owned) by an avatar or group + + + Parcel is in process of being leased (purchased) by an avatar or group + + + Parcel has been abandoned back to Governor Linden + + + + Category parcel is listed in under search + + + + No assigned category + + + Linden Infohub or public area + + + Adult themed area + + + Arts and Culture + + + Business + + + Educational + + + Gaming + + + Hangout or Club + + + Newcomer friendly + + + Parks and Nature + + + Residential + + + Shopping + + + Not Used? + + + Other + + + Not an actual category, only used for queries + + + + Type of teleport landing for a parcel + + + + Unset, simulator default + + + Specific landing point set for this parcel + + + No landing point set, direct teleports enabled for + this parcel + + + + Parcel Media Command used in ParcelMediaCommandMessage + + + + Stop the media stream and go back to the first frame + + + Pause the media stream (stop playing but stay on current frame) + + + Start the current media stream playing and stop when the end is reached + + + Start the current media stream playing, + loop to the beginning when the end is reached and continue to play + + + Specifies the texture to replace with video + If passing the key of a texture, it must be explicitly typecast as a key, + not just passed within double quotes. + + + Specifies the movie URL (254 characters max) + + + Specifies the time index at which to begin playing + + + Specifies a single agent to apply the media command to + + + Unloads the stream. While the stop command sets the texture to the first frame of the movie, + unload resets it to the real texture that the movie was replacing. + + + Turn on/off the auto align feature, similar to the auto align checkbox in the parcel media properties + (NOT to be confused with the "align" function in the textures view of the editor!) Takes TRUE or FALSE as parameter. + + + Allows a Web page or image to be placed on a prim (1.19.1 RC0 and later only). + Use "text/html" for HTML. + + + Resizes a Web page to fit on x, y pixels (1.19.1 RC0 and later only). + This might still not be working + + + Sets a description for the media being displayed (1.19.1 RC0 and later only). + + + + Some information about a parcel of land returned from a DirectoryManager search + + + + Global Key of record + + + Parcel Owners + + + Name field of parcel, limited to 128 characters + + + Description field of parcel, limited to 256 characters + + + Total Square meters of parcel + + + Total area billable as Tier, for group owned land this will be 10% less than ActualArea + + + True of parcel is in Mature simulator + + + Grid global X position of parcel + + + Grid global Y position of parcel + + + Grid global Z position of parcel (not used) + + + Name of simulator parcel is located in + + + Texture of parcels display picture + + + Float representing calculated traffic based on time spent on parcel by avatars + + + Sale price of parcel (not used) + + + Auction ID of parcel + + + + Parcel Media Information + + + + A byte, if 0x1 viewer should auto scale media to fit object + + + A boolean, if true the viewer should loop the media + + + The Asset UUID of the Texture which when applied to a + primitive will display the media + + + A URL which points to any Quicktime supported media type + + + A description of the media + + + An Integer which represents the height of the media + + + An integer which represents the width of the media + + + A string which contains the mime type of the media + + + + Parcel of land, a portion of virtual real estate in a simulator + + + + The total number of contiguous 4x4 meter blocks your agent owns within this parcel + + + The total number of contiguous 4x4 meter blocks contained in this parcel owned by a group or agent other than your own + + + Deprecated, Value appears to always be 0 + + + Simulator-local ID of this parcel + + + UUID of the owner of this parcel + + + Whether the land is deeded to a group or not + + + + + + Date land was claimed + + + Appears to always be zero + + + This field is no longer used + + + Minimum corner of the axis-aligned bounding box for this + parcel + + + Maximum corner of the axis-aligned bounding box for this + parcel + + + Bitmap describing land layout in 4x4m squares across the + entire region + + + Total parcel land area + + + + + + Maximum primitives across the entire simulator owned by the same agent or group that owns this parcel that can be used + + + Total primitives across the entire simulator calculated by combining the allowed prim counts for each parcel + owned by the agent or group that owns this parcel + + + Maximum number of primitives this parcel supports + + + Total number of primitives on this parcel + + + For group-owned parcels this indicates the total number of prims deeded to the group, + for parcels owned by an individual this inicates the number of prims owned by the individual + + + Total number of primitives owned by the parcel group on + this parcel, or for parcels owned by an individual with a group set the + total number of prims set to that group. + + + Total number of prims owned by other avatars that are not set to group, or not the parcel owner + + + A bonus multiplier which allows parcel prim counts to go over times this amount, this does not affect + the max prims per simulator. e.g: 117 prim parcel limit x 1.5 bonus = 175 allowed + + + Autoreturn value in minutes for others' objects + + + + + + Sale price of the parcel, only useful if ForSale is set + The SalePrice will remain the same after an ownership + transfer (sale), so it can be used to see the purchase price after + a sale if the new owner has not changed it + + + Parcel Name + + + Parcel Description + + + URL For Music Stream + + + + + + Price for a temporary pass + + + How long is pass valid for + + + + + + Key of authorized buyer + + + Key of parcel snapshot + + + The landing point location + + + The landing point LookAt + + + The type of landing enforced from the enum + + + + + + + + + + + + Access list of who is whitelisted on this + parcel + + + Access list of who is blacklisted on this + parcel + + + TRUE of region denies access to age unverified users + + + true to obscure (hide) media url + + + true to obscure (hide) music url + + + A struct containing media details + + + + Displays a parcel object in string format + + string containing key=value pairs of a parcel object + + + + Defalt constructor + + Local ID of this parcel + + + + Update the simulator with any local changes to this Parcel object + + Simulator to send updates to + Whether we want the simulator to confirm + the update with a reply packet or not + + + + Set Autoreturn time + + Simulator to send the update to + + + + Parcel (subdivided simulator lots) subsystem + + + + The event subscribers. null if no subcribers + + + Raises the ParcelDwellReply event + A ParcelDwellReplyEventArgs object containing the + data returned from the simulator + + + Thread sync lock object + + + The event subscribers. null if no subcribers + + + Raises the ParcelInfoReply event + A ParcelInfoReplyEventArgs object containing the + data returned from the simulator + + + Thread sync lock object + + + The event subscribers. null if no subcribers + + + Raises the ParcelProperties event + A ParcelPropertiesEventArgs object containing the + data returned from the simulator + + + Thread sync lock object + + + The event subscribers. null if no subcribers + + + Raises the ParcelAccessListReply event + A ParcelAccessListReplyEventArgs object containing the + data returned from the simulator + + + Thread sync lock object + + + The event subscribers. null if no subcribers + + + Raises the ParcelObjectOwnersReply event + A ParcelObjectOwnersReplyEventArgs object containing the + data returned from the simulator + + + Thread sync lock object + + + The event subscribers. null if no subcribers + + + Raises the SimParcelsDownloaded event + A SimParcelsDownloadedEventArgs object containing the + data returned from the simulator + + + Thread sync lock object + + + The event subscribers. null if no subcribers + + + Raises the ForceSelectObjectsReply event + A ForceSelectObjectsReplyEventArgs object containing the + data returned from the simulator + + + Thread sync lock object + + + The event subscribers. null if no subcribers + + + Raises the ParcelMediaUpdateReply event + A ParcelMediaUpdateReplyEventArgs object containing the + data returned from the simulator + + + Thread sync lock object + + + The event subscribers. null if no subcribers + + + Raises the ParcelMediaCommand event + A ParcelMediaCommandEventArgs object containing the + data returned from the simulator + + + Thread sync lock object + + + + Default constructor + + A reference to the GridClient object + + + + Request basic information for a single parcel + + Simulator-local ID of the parcel + + + + Request properties of a single parcel + + Simulator containing the parcel + Simulator-local ID of the parcel + An arbitrary integer that will be returned + with the ParcelProperties reply, useful for distinguishing between + multiple simultaneous requests + + + + Request the access list for a single parcel + + Simulator containing the parcel + Simulator-local ID of the parcel + An arbitrary integer that will be returned + with the ParcelAccessList reply, useful for distinguishing between + multiple simultaneous requests + + + + + Request properties of parcels using a bounding box selection + + Simulator containing the parcel + Northern boundary of the parcel selection + Eastern boundary of the parcel selection + Southern boundary of the parcel selection + Western boundary of the parcel selection + An arbitrary integer that will be returned + with the ParcelProperties reply, useful for distinguishing between + different types of parcel property requests + A boolean that is returned with the + ParcelProperties reply, useful for snapping focus to a single + parcel + + + + Request all simulator parcel properties (used for populating the Simulator.Parcels + dictionary) + + Simulator to request parcels from (must be connected) + + + + Request all simulator parcel properties (used for populating the Simulator.Parcels + dictionary) + + Simulator to request parcels from (must be connected) + If TRUE, will force a full refresh + Number of milliseconds to pause in between each request + + + + Request the dwell value for a parcel + + Simulator containing the parcel + Simulator-local ID of the parcel + + + + Send a request to Purchase a parcel of land + + The Simulator the parcel is located in + The parcels region specific local ID + true if this parcel is being purchased by a group + The groups + true to remove tier contribution if purchase is successful + The parcels size + The purchase price of the parcel + + + + + Reclaim a parcel of land + + The simulator the parcel is in + The parcels region specific local ID + + + + Deed a parcel to a group + + The simulator the parcel is in + The parcels region specific local ID + The groups + + + + Request prim owners of a parcel of land. + + Simulator parcel is in + The parcels region specific local ID + + + + Return objects from a parcel + + Simulator parcel is in + The parcels region specific local ID + the type of objects to return, + A list containing object owners s to return + + + + Subdivide (split) a parcel + + + + + + + + + + Join two parcels of land creating a single parcel + + + + + + + + + + Get a parcels LocalID + + Simulator parcel is in + Vector3 position in simulator (Z not used) + 0 on failure, or parcel LocalID on success. + A call to Parcels.RequestAllSimParcels is required to populate map and + dictionary. + + + + Terraform (raise, lower, etc) an area or whole parcel of land + + Simulator land area is in. + LocalID of parcel, or -1 if using bounding box + From Enum, Raise, Lower, Level, Smooth, Etc. + Size of area to modify + true on successful request sent. + Settings.STORE_LAND_PATCHES must be true, + Parcel information must be downloaded using RequestAllSimParcels() + + + + Terraform (raise, lower, etc) an area or whole parcel of land + + Simulator land area is in. + west border of area to modify + south border of area to modify + east border of area to modify + north border of area to modify + From Enum, Raise, Lower, Level, Smooth, Etc. + Size of area to modify + true on successful request sent. + Settings.STORE_LAND_PATCHES must be true, + Parcel information must be downloaded using RequestAllSimParcels() + + + + Terraform (raise, lower, etc) an area or whole parcel of land + + Simulator land area is in. + LocalID of parcel, or -1 if using bounding box + west border of area to modify + south border of area to modify + east border of area to modify + north border of area to modify + From Enum, Raise, Lower, Level, Smooth, Etc. + Size of area to modify + How many meters + or - to lower, 1 = 1 meter + true on successful request sent. + Settings.STORE_LAND_PATCHES must be true, + Parcel information must be downloaded using RequestAllSimParcels() + + + + Terraform (raise, lower, etc) an area or whole parcel of land + + Simulator land area is in. + LocalID of parcel, or -1 if using bounding box + west border of area to modify + south border of area to modify + east border of area to modify + north border of area to modify + From Enum, Raise, Lower, Level, Smooth, Etc. + Size of area to modify + How many meters + or - to lower, 1 = 1 meter + Height at which the terraform operation is acting at + + + + Sends a request to the simulator to return a list of objects owned by specific owners + + Simulator local ID of parcel + Owners, Others, Etc + List containing keys of avatars objects to select; + if List is null will return Objects of type selectType + Response data is returned in the event + + + + Eject and optionally ban a user from a parcel + + target key of avatar to eject + true to also ban target + + + + Freeze or unfreeze an avatar over your land + + target key to freeze + true to freeze, false to unfreeze + + + + Abandon a parcel of land + + Simulator parcel is in + Simulator local ID of parcel + + + + Requests the UUID of the parcel in a remote region at a specified location + + Location of the parcel in the remote region + Remote region handle + Remote region UUID + If successful UUID of the remote parcel, UUID.Zero otherwise + + + + Retrieves information on resources used by the parcel + + UUID of the parcel + Should per object resource usage be requested + Callback invoked when the request is complete + + + Process an incoming packet and raise the appropriate events + The sender + The EventArgs object containing the packet data + Raises the event + + + Process an incoming packet and raise the appropriate events + The sender + The EventArgs object containing the packet data + Raises the event + + + Process an incoming packet and raise the appropriate events + The sender + The EventArgs object containing the packet data + Raises the event + + + Process an incoming packet and raise the appropriate events + The sender + The EventArgs object containing the packet data + Raises the event + + + Process an incoming packet and raise the appropriate events + The sender + The EventArgs object containing the packet data + Raises the event + + + Process an incoming packet and raise the appropriate events + The sender + The EventArgs object containing the packet data + + + Process an incoming packet and raise the appropriate events + The sender + The EventArgs object containing the packet data + Raises the event + + + Raised when the simulator responds to a request + + + Raised when the simulator responds to a request + + + Raised when the simulator responds to a request + + + Raised when the simulator responds to a request + + + Raised when the simulator responds to a request + + + Raised when the simulator responds to a request + + + Raised when the simulator responds to a request + + + Raised when the simulator responds to a Parcel Update request + + + Raised when the parcel your agent is located sends a ParcelMediaCommand + + + + Parcel Accesslist + + + + Agents + + + + + + Flags for specific entry in white/black lists + + + + Owners of primitives on parcel + + + + Prim Owners + + + True of owner is group + + + Total count of prims owned by OwnerID + + + true of OwnerID is currently online and is not a group + + + The date of the most recent prim left by OwnerID + + + + Called once parcel resource usage information has been collected + + Indicates if operation was successfull + Parcel resource usage information + + + Contains a parcels dwell data returned from the simulator in response to an + + + + Construct a new instance of the ParcelDwellReplyEventArgs class + + The global ID of the parcel + The simulator specific ID of the parcel + The calculated dwell for the parcel + + + Get the global ID of the parcel + + + Get the simulator specific ID of the parcel + + + Get the calculated dwell + + + Contains basic parcel information data returned from the + simulator in response to an request + + + + Construct a new instance of the ParcelInfoReplyEventArgs class + + The object containing basic parcel info + + + Get the object containing basic parcel info + + + Contains basic parcel information data returned from the simulator in response to an request + + + + Construct a new instance of the ParcelPropertiesEventArgs class + + The object containing the details + The object containing the details + The result of the request + The number of primitieves your agent is + currently selecting and or sitting on in this parcel + The user assigned ID used to correlate a request with + these results + TODO: + + + Get the simulator the parcel is located in + + + Get the object containing the details + If Result is NoData, this object will not contain valid data + + + Get the result of the request + + + Get the number of primitieves your agent is + currently selecting and or sitting on in this parcel + + + Get the user assigned ID used to correlate a request with + these results + + + TODO: + + + Contains blacklist and whitelist data returned from the simulator in response to an request + + + + Construct a new instance of the ParcelAccessListReplyEventArgs class + + The simulator the parcel is located in + The user assigned ID used to correlate a request with + these results + The simulator specific ID of the parcel + TODO: + The list containing the white/blacklisted agents for the parcel + + + Get the simulator the parcel is located in + + + Get the user assigned ID used to correlate a request with + these results + + + Get the simulator specific ID of the parcel + + + TODO: + + + Get the list containing the white/blacklisted agents for the parcel + + + Contains blacklist and whitelist data returned from the + simulator in response to an request + + + + Construct a new instance of the ParcelObjectOwnersReplyEventArgs class + + The simulator the parcel is located in + The list containing prim ownership counts + + + Get the simulator the parcel is located in + + + Get the list containing prim ownership counts + + + Contains the data returned when all parcel data has been retrieved from a simulator + + + + Construct a new instance of the SimParcelsDownloadedEventArgs class + + The simulator the parcel data was retrieved from + The dictionary containing the parcel data + The multidimensional array containing a x,y grid mapped + to each 64x64 parcel's LocalID. + + + Get the simulator the parcel data was retrieved from + + + A dictionary containing the parcel data where the key correlates to the ParcelMap entry + + + Get the multidimensional array containing a x,y grid mapped + to each 64x64 parcel's LocalID. + + + Contains the data returned when a request + + + + Construct a new instance of the ForceSelectObjectsReplyEventArgs class + + The simulator the parcel data was retrieved from + The list of primitive IDs + true if the list is clean and contains the information + only for a given request + + + Get the simulator the parcel data was retrieved from + + + Get the list of primitive IDs + + + true if the list is clean and contains the information + only for a given request + + + Contains data when the media data for a parcel the avatar is on changes + + + + Construct a new instance of the ParcelMediaUpdateReplyEventArgs class + + the simulator the parcel media data was updated in + The updated media information + + + Get the simulator the parcel media data was updated in + + + Get the updated media information + + + Contains the media command for a parcel the agent is currently on + + + + Construct a new instance of the ParcelMediaCommandEventArgs class + + The simulator the parcel media command was issued in + + + The media command that was sent + + + + Get the simulator the parcel media command was issued in + + + + + + + + + Get the media command that was sent + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + The ObservableDictionary class is used for storing key/value pairs. It has methods for firing + events to subscribers when items are added, removed, or changed. + + Key + Value + + + + A dictionary of callbacks to fire when specified action occurs + + + + + Register a callback to be fired when an action occurs + + The action + The callback to fire + + + + Unregister a callback + + The action + The callback to fire + + + + + + + + + + Internal dictionary that this class wraps around. Do not + modify or enumerate the contents of this dictionary without locking + + + + Initializes a new instance of the Class + with the specified key/value, has the default initial capacity. + + + + // initialize a new ObservableDictionary named testDict with a string as the key and an int as the value. + public ObservableDictionary<string, int> testDict = new ObservableDictionary<string, int>(); + + + + + + Initializes a new instance of the Class + with the specified key/value, With its initial capacity specified. + + Initial size of dictionary + + + // initialize a new ObservableDictionary named testDict with a string as the key and an int as the value, + // initially allocated room for 10 entries. + public ObservableDictionary<string, int> testDict = new ObservableDictionary<string, int>(10); + + + + + + Try to get entry from the with specified key + + Key to use for lookup + Value returned + if specified key exists, if not found + + + // find your avatar using the Simulator.ObjectsAvatars ObservableDictionary: + Avatar av; + if (Client.Network.CurrentSim.ObjectsAvatars.TryGetValue(Client.Self.AgentID, out av)) + Console.WriteLine("Found Avatar {0}", av.Name); + + + + + + + Finds the specified match. + + The match. + Matched value + + + // use a delegate to find a prim in the ObjectsPrimitives ObservableDictionary + // with the ID 95683496 + uint findID = 95683496; + Primitive findPrim = sim.ObjectsPrimitives.Find( + delegate(Primitive prim) { return prim.ID == findID; }); + + + + + Find All items in an + return matching items. + a containing found items. + + Find All prims within 20 meters and store them in a List + + int radius = 20; + List<Primitive> prims = Client.Network.CurrentSim.ObjectsPrimitives.FindAll( + delegate(Primitive prim) { + Vector3 pos = prim.Position; + return ((prim.ParentID == 0) && (pos != Vector3.Zero) && (Vector3.Distance(pos, location) < radius)); + } + ); + + + + + Find All items in an + return matching keys. + a containing found keys. + + Find All keys which also exist in another dictionary + + List<UUID> matches = myDict.FindAll( + delegate(UUID id) { + return myOtherDict.ContainsKey(id); + } + ); + + + + + Check if Key exists in Dictionary + Key to check for + if found, otherwise + + + Check if Value exists in Dictionary + Value to check for + if found, otherwise + + + + Adds the specified key to the dictionary, dictionary locking is not performed, + + + The key + The value + + + + Removes the specified key, dictionary locking is not performed + + The key. + if successful, otherwise + + + + Clear the contents of the dictionary + + + + + Enumerator for iterating dictionary entries + + + + + + Gets the number of Key/Value pairs contained in the + + + + + Indexer for the dictionary + + The key + The value + + + + Avatar group management + + + + Key of Group Member + + + Total land contribution + + + Online status information + + + Abilities that the Group Member has + + + Current group title + + + Is a group owner + + + + Role manager for a group + + + + Key of the group + + + Key of Role + + + Name of Role + + + Group Title associated with Role + + + Description of Role + + + Abilities Associated with Role + + + Returns the role's title + The role's title + + + + Class to represent Group Title + + + + Key of the group + + + ID of the role title belongs to + + + Group Title + + + Whether title is Active + + + Returns group title + + + + Represents a group on the grid + + + + Key of Group + + + Key of Group Insignia + + + Key of Group Founder + + + Key of Group Role for Owners + + + Name of Group + + + Text of Group Charter + + + Title of "everyone" role + + + Is the group open for enrolement to everyone + + + Will group show up in search + + + + + + + + + + + + Is the group Mature + + + Cost of group membership + + + + + + + + + The total number of current members this group has + + + The number of roles this group has configured + + + Show this group in agent's profile + + + Returns the name of the group + A string containing the name of the group + + + + A group Vote + + + + Key of Avatar who created Vote + + + Text of the Vote proposal + + + Total number of votes + + + + A group proposal + + + + The Text of the proposal + + + The minimum number of members that must vote before proposal passes or failes + + + The required ration of yes/no votes required for vote to pass + The three options are Simple Majority, 2/3 Majority, and Unanimous + TODO: this should be an enum + + + The duration in days votes are accepted + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Struct representing a group notice + + + + + + + + + + + + + + + + + + + + + + + Struct representing a group notice list entry + + + + Notice ID + + + Creation timestamp of notice + + + Agent name who created notice + + + Notice subject + + + Is there an attachment? + + + Attachment Type + + + + Struct representing a member of a group chat session and their settings + + + + The of the Avatar + + + True if user has voice chat enabled + + + True of Avatar has moderator abilities + + + True if a moderator has muted this avatars chat + + + True if a moderator has muted this avatars voice + + + + Role update flags + + + + + + + + + + + + + + + + + + + + + + + + + Can send invitations to groups default role + + + Can eject members from group + + + Can toggle 'Open Enrollment' and change 'Signup fee' + + + Member is visible in the public member list + + + Can create new roles + + + Can delete existing roles + + + Can change Role names, titles and descriptions + + + Can assign other members to assigners role + + + Can assign other members to any role + + + Can remove members from roles + + + Can assign and remove abilities in roles + + + Can change group Charter, Insignia, 'Publish on the web' and which + members are publicly visible in group member listings + + + Can buy land or deed land to group + + + Can abandon group owned land to Governor Linden on mainland, or Estate owner for + private estates + + + Can set land for-sale information on group owned parcels + + + Can subdivide and join parcels + + + Can join group chat sessions + + + Can use voice chat in Group Chat sessions + + + Can moderate group chat sessions + + + Can toggle "Show in Find Places" and set search category + + + Can change parcel name, description, and 'Publish on web' settings + + + Can set the landing point and teleport routing on group land + + + Can change music and media settings + + + Can toggle 'Edit Terrain' option in Land settings + + + Can toggle various About Land > Options settings + + + Can always terraform land, even if parcel settings have it turned off + + + Can always fly while over group owned land + + + Can always rez objects on group owned land + + + Can always create landmarks for group owned parcels + + + Can set home location on any group owned parcel + + + Can modify public access settings for group owned parcels + + + Can manager parcel ban lists on group owned land + + + Can manage pass list sales information + + + Can eject and freeze other avatars on group owned land + + + Can return objects set to group + + + Can return non-group owned/set objects + + + Can return group owned objects + + + Can landscape using Linden plants + + + Can deed objects to group + + + Can move group owned objects + + + Can set group owned objects for-sale + + + Pay group liabilities and receive group dividends + + + Can send group notices + + + Can receive group notices + + + Can create group proposals + + + Can vote on group proposals + + + + Handles all network traffic related to reading and writing group + information + + + + The event subscribers. null if no subcribers + + + Raises the CurrentGroups event + A CurrentGroupsEventArgs object containing the + data sent from the simulator + + + Thread sync lock object + + + The event subscribers. null if no subcribers + + + Raises the GroupNamesReply event + A GroupNamesEventArgs object containing the + data response from the simulator + + + Thread sync lock object + + + The event subscribers. null if no subcribers + + + Raises the GroupProfile event + An GroupProfileEventArgs object containing the + data returned from the simulator + + + Thread sync lock object + + + The event subscribers. null if no subcribers + + + Raises the GroupMembers event + A GroupMembersEventArgs object containing the + data returned from the simulator + + + Thread sync lock object + + + The event subscribers. null if no subcribers + + + Raises the GroupRolesDataReply event + A GroupRolesDataReplyEventArgs object containing the + data returned from the simulator + + + Thread sync lock object + + + The event subscribers. null if no subcribers + + + Raises the GroupRoleMembersReply event + A GroupRolesRoleMembersReplyEventArgs object containing the + data returned from the simulator + + + Thread sync lock object + + + The event subscribers. null if no subcribers + + + Raises the GroupTitlesReply event + A GroupTitlesReplyEventArgs object containing the + data returned from the simulator + + + Thread sync lock object + + + The event subscribers. null if no subcribers + + + Raises the GroupAccountSummary event + A GroupAccountSummaryReplyEventArgs object containing the + data returned from the simulator + + + Thread sync lock object + + + The event subscribers. null if no subcribers + + + Raises the GroupCreated event + An GroupCreatedEventArgs object containing the + data returned from the simulator + + + Thread sync lock object + + + The event subscribers. null if no subcribers + + + Raises the GroupJoined event + A GroupOperationEventArgs object containing the + result of the operation returned from the simulator + + + Thread sync lock object + + + The event subscribers. null if no subcribers + + + Raises the GroupLeft event + A GroupOperationEventArgs object containing the + result of the operation returned from the simulator + + + Thread sync lock object + + + The event subscribers. null if no subcribers + + + Raises the GroupDropped event + An GroupDroppedEventArgs object containing the + the group your agent left + + + Thread sync lock object + + + The event subscribers. null if no subcribers + + + Raises the GroupMemberEjected event + An GroupMemberEjectedEventArgs object containing the + data returned from the simulator + + + Thread sync lock object + + + The event subscribers. null if no subcribers + + + Raises the GroupNoticesListReply event + An GroupNoticesListReplyEventArgs object containing the + data returned from the simulator + + + Thread sync lock object + + + The event subscribers. null if no subcribers + + + Raises the GroupInvitation event + An GroupInvitationEventArgs object containing the + data returned from the simulator + + + Thread sync lock object + + + A reference to the current instance + + + Currently-active group members requests + + + Currently-active group roles requests + + + Currently-active group role-member requests + + + Dictionary keeping group members while request is in progress + + + Dictionary keeping mebmer/role mapping while request is in progress + + + Dictionary keeping GroupRole information while request is in progress + + + Caches group name lookups + + + + Construct a new instance of the GroupManager class + + A reference to the current instance + + + + Request a current list of groups the avatar is a member of. + + CAPS Event Queue must be running for this to work since the results + come across CAPS. + + + + Lookup name of group based on groupID + + groupID of group to lookup name for. + + + + Request lookup of multiple group names + + List of group IDs to request. + + + Lookup group profile data such as name, enrollment, founder, logo, etc + Subscribe to OnGroupProfile event to receive the results. + group ID (UUID) + + + Request a list of group members. + Subscribe to OnGroupMembers event to receive the results. + group ID (UUID) + UUID of the request, use to index into cache + + + Request group roles + Subscribe to OnGroupRoles event to receive the results. + group ID (UUID) + UUID of the request, use to index into cache + + + Request members (members,role) role mapping for a group. + Subscribe to OnGroupRolesMembers event to receive the results. + group ID (UUID) + UUID of the request, use to index into cache + + + Request a groups Titles + Subscribe to OnGroupTitles event to receive the results. + group ID (UUID) + UUID of the request, use to index into cache + + + Begin to get the group account summary + Subscribe to the OnGroupAccountSummary event to receive the results. + group ID (UUID) + How long of an interval + Which interval (0 for current, 1 for last) + + + Invites a user to a group + The group to invite to + A list of roles to invite a person to + Key of person to invite + + + Set a group as the current active group + group ID (UUID) + + + Change the role that determines your active title + Group ID to use + Role ID to change to + + + Set this avatar's tier contribution + Group ID to change tier in + amount of tier to donate + + + + Save wheather agent wants to accept group notices and list this group in their profile + + Group + Accept notices from this group + List this group in the profile + + + Request to join a group + Subscribe to OnGroupJoined event for confirmation. + group ID (UUID) to join. + + + + Request to create a new group. If the group is successfully + created, L$100 will automatically be deducted + + Subscribe to OnGroupCreated event to receive confirmation. + Group struct containing the new group info + + + Update a group's profile and other information + Groups ID (UUID) to update. + Group struct to update. + + + Eject a user from a group + Group ID to eject the user from + Avatar's key to eject + + + Update role information + Modified role to be updated + + + Create a new group role + Group ID to update + Role to create + + + Delete a group role + Group ID to update + Role to delete + + + Remove an avatar from a role + Group ID to update + Role ID to be removed from + Avatar's Key to remove + + + Assign an avatar to a role + Group ID to update + Role ID to assign to + Avatar's ID to assign to role + + + Request the group notices list + Group ID to fetch notices for + + + Request a group notice by key + ID of group notice + + + Send out a group notice + Group ID to update + GroupNotice structure containing notice data + + + Start a group proposal (vote) + The Group ID to send proposal to + GroupProposal structure containing the proposal + + + Request to leave a group + Subscribe to OnGroupLeft event to receive confirmation + The group to leave + + + Process an incoming packet and raise the appropriate events + The sender + The EventArgs object containing the packet data + + + Process an incoming packet and raise the appropriate events + The sender + The EventArgs object containing the packet data + + + Process an incoming packet and raise the appropriate events + The sender + The EventArgs object containing the packet data + + + Process an incoming packet and raise the appropriate events + The sender + The EventArgs object containing the packet data + + + Process an incoming packet and raise the appropriate events + The sender + The EventArgs object containing the packet data + + + Process an incoming packet and raise the appropriate events + The sender + The EventArgs object containing the packet data + + + Process an incoming packet and raise the appropriate events + The sender + The EventArgs object containing the packet data + + + Process an incoming packet and raise the appropriate events + The sender + The EventArgs object containing the packet data + + + Process an incoming packet and raise the appropriate events + The sender + The EventArgs object containing the packet data + + + Process an incoming packet and raise the appropriate events + The sender + The EventArgs object containing the packet data + + + Process an incoming packet and raise the appropriate events + The sender + The EventArgs object containing the packet data + + + Process an incoming packet and raise the appropriate events + The sender + The EventArgs object containing the packet data + + + Process an incoming packet and raise the appropriate events + The sender + The EventArgs object containing the packet data + + + Process an incoming packet and raise the appropriate events + The sender + The EventArgs object containing the packet data + + + Process an incoming packet and raise the appropriate events + The sender + The EventArgs object containing the packet data + + + Raised when the simulator sends us data containing + our current group membership + + + Raised when the simulator responds to a RequestGroupName + or RequestGroupNames request + + + Raised when the simulator responds to a request + + + Raised when the simulator responds to a request + + + Raised when the simulator responds to a request + + + Raised when the simulator responds to a request + + + Raised when the simulator responds to a request + + + Raised when a response to a RequestGroupAccountSummary is returned + by the simulator + + + Raised when a request to create a group is successful + + + Raised when a request to join a group either + fails or succeeds + + + Raised when a request to leave a group either + fails or succeeds + + + Raised when A group is removed from the group server + + + Raised when a request to eject a member from a group either + fails or succeeds + + + Raised when the simulator sends us group notices + + + + Raised when another agent invites our avatar to join a group + + + Contains the current groups your agent is a member of + + + Construct a new instance of the CurrentGroupsEventArgs class + The current groups your agent is a member of + + + Get the current groups your agent is a member of + + + A Dictionary of group names, where the Key is the groups ID and the value is the groups name + + + Construct a new instance of the GroupNamesEventArgs class + The Group names dictionary + + + Get the Group Names dictionary + + + Represents the members of a group + + + + Construct a new instance of the GroupMembersReplyEventArgs class + + The ID of the request + The ID of the group + The membership list of the group + + + Get the ID as returned by the request to correlate + this result set and the request + + + Get the ID of the group + + + Get the dictionary of members + + + Represents the roles associated with a group + + + Construct a new instance of the GroupRolesDataReplyEventArgs class + The ID as returned by the request to correlate + this result set and the request + The ID of the group + The dictionary containing the roles + + + Get the ID as returned by the request to correlate + this result set and the request + + + Get the ID of the group + + + Get the dictionary containing the roles + + + Represents the Role to Member mappings for a group + + + Construct a new instance of the GroupRolesMembersReplyEventArgs class + The ID as returned by the request to correlate + this result set and the request + The ID of the group + The member to roles map + + + Get the ID as returned by the request to correlate + this result set and the request + + + Get the ID of the group + + + Get the member to roles map + + + Represents the titles for a group + + + Construct a new instance of the GroupTitlesReplyEventArgs class + The ID as returned by the request to correlate + this result set and the request + The ID of the group + The titles + + + Get the ID as returned by the request to correlate + this result set and the request + + + Get the ID of the group + + + Get the titles + + + Represents the summary data for a group + + + Construct a new instance of the GroupAccountSummaryReplyEventArgs class + The ID of the group + The summary data + + + Get the ID of the group + + + Get the summary data + + + A response to a group create request + + + Construct a new instance of the GroupCreatedReplyEventArgs class + The ID of the group + the success or faulure of the request + A string containing additional information + + + Get the ID of the group + + + true of the group was created successfully + + + A string containing the message + + + Represents a response to a request + + + Construct a new instance of the GroupOperationEventArgs class + The ID of the group + true of the request was successful + + + Get the ID of the group + + + true of the request was successful + + + Represents your agent leaving a group + + + Construct a new instance of the GroupDroppedEventArgs class + The ID of the group + + + Get the ID of the group + + + Represents a list of active group notices + + + Construct a new instance of the GroupNoticesListReplyEventArgs class + The ID of the group + The list containing active notices + + + Get the ID of the group + + + Get the notices list + + + Represents the profile of a group + + + Construct a new instance of the GroupProfileEventArgs class + The group profile + + + Get the group profile + + + + Provides notification of a group invitation request sent by another Avatar + + The invitation is raised when another avatar makes an offer for our avatar + to join a group. + + + The ID of the Avatar sending the group invitation + + + The name of the Avatar sending the group invitation + + + A message containing the request information which includes + the name of the group, the groups charter and the fee to join details + + + The Simulator + + + Set to true to accept invitation, false to decline + + + + + + Looking direction, must be a normalized vector + Up direction, must be a normalized vector + + + + Align the coordinate frame X and Y axis with a given rotation + around the Z axis in radians + + Absolute rotation around the Z axis in + radians + + + Origin position of this coordinate frame + + + X axis of this coordinate frame, or Forward/At in grid terms + + + Y axis of this coordinate frame, or Left in grid terms + + + Z axis of this coordinate frame, or Up in grid terms + + + + Avatar profile flags + + + + + Represents an avatar (other than your own) + + + + Groups that this avatar is a member of + + + Positive and negative ratings + + + Avatar properties including about text, profile URL, image IDs and + publishing settings + + + Avatar interests including spoken languages, skills, and "want to" + choices + + + Movement control flags for avatars. Typically not set or used by + clients. To move your avatar, use Client.Self.Movement instead + + + + Contains the visual parameters describing the deformation of the avatar + + + + + Default constructor + + + + First name + + + Last name + + + Full name + + + Active group + + + + Positive and negative ratings + + + + Positive ratings for Behavior + + + Negative ratings for Behavior + + + Positive ratings for Appearance + + + Negative ratings for Appearance + + + Positive ratings for Building + + + Negative ratings for Building + + + Positive ratings given by this avatar + + + Negative ratings given by this avatar + + + + Avatar properties including about text, profile URL, image IDs and + publishing settings + + + + First Life about text + + + First Life image ID + + + + + + + + + + + + + + + Profile image ID + + + Flags of the profile + + + Web URL for this profile + + + Should this profile be published on the web + + + Avatar Online Status + + + Is this a mature profile + + + + + + + + + + Avatar interests including spoken languages, skills, and "want to" + choices + + + + Languages profile field + + + + + + + + + + + + + + + + Extract the avatar UUID encoded in a SIP URI + + + + + + + Permissions for control of object media + + + + + Style of cotrols that shold be displayed to the user + + + + + Class representing media data for a single face + + + + Is display of the alternative image enabled + + + Should media auto loop + + + Shoule media be auto played + + + Auto scale media to prim face + + + Should viewer automatically zoom in on the face when clicked + + + Should viewer interpret first click as interaction with the media + or when false should the first click be treated as zoom in commadn + + + Style of controls viewer should display when + viewer media on this face + + + Starting URL for the media + + + Currently navigated URL + + + Media height in pixes + + + Media width in pixels + + + Who can controls the media + + + Who can interact with the media + + + Is URL whitelist enabled + + + Array of URLs that are whitelisted + + + + Serialize to OSD + + OSDMap with the serialized data + + + + Deserialize from OSD data + + Serialized OSD data + Deserialized object + + + + Operation to apply when applying color to texture + + + + + Information needed to translate visual param value to RGBA color + + + + + Construct VisualColorParam + + Operation to apply when applying color to texture + Colors + + + + Represents alpha blending and bump infor for a visual parameter + such as sleive length + + + + Stregth of the alpha to apply + + + File containing the alpha channel + + + Skip blending if parameter value is 0 + + + Use miltiply insted of alpha blending + + + + Create new alhpa information for a visual param + + Stregth of the alpha to apply + File containing the alpha channel + Skip blending if parameter value is 0 + Use miltiply insted of alpha blending + + + + A single visual characteristic of an avatar mesh, such as eyebrow height + + + + Index of this visual param + + + Internal name + + + Group ID this parameter belongs to + + + Name of the wearable this parameter belongs to + + + Displayable label of this characteristic + + + Displayable label for the minimum value of this characteristic + + + Displayable label for the maximum value of this characteristic + + + Default value + + + Minimum value + + + Maximum value + + + Is this param used for creation of bump layer? + + + Alpha blending/bump info + + + Color information + + + Array of param IDs that are drivers for this parameter + + + + Set all the values through the constructor + + Index of this visual param + Internal name + + + Displayable label of this characteristic + Displayable label for the minimum value of this characteristic + Displayable label for the maximum value of this characteristic + Default value + Minimum value + Maximum value + Is this param used for creation of bump layer? + Array of param IDs that are drivers for this parameter + Alpha blending/bump info + Color information + + + + Holds the Params array of all the avatar appearance parameters + + + + + The InternalDictionary class is used through the library for storing key/value pairs. + It is intended to be a replacement for the generic Dictionary class and should + be used in its place. It contains several methods for allowing access to the data from + outside the library that are read only and thread safe. + + + Key + Value + + + Internal dictionary that this class wraps around. Do not + modify or enumerate the contents of this dictionary without locking + on this member + + + + Initializes a new instance of the Class + with the specified key/value, has the default initial capacity. + + + + // initialize a new InternalDictionary named testDict with a string as the key and an int as the value. + public InternalDictionary<string, int> testDict = new InternalDictionary<string, int>(); + + + + + + Initializes a new instance of the Class + with the specified key/value, has its initial valies copied from the specified + + + + to copy initial values from + + + // initialize a new InternalDictionary named testAvName with a UUID as the key and an string as the value. + // populates with copied values from example KeyNameCache Dictionary. + + // create source dictionary + Dictionary<UUID, string> KeyNameCache = new Dictionary<UUID, string>(); + KeyNameCache.Add("8300f94a-7970-7810-cf2c-fc9aa6cdda24", "Jack Avatar"); + KeyNameCache.Add("27ba1e40-13f7-0708-3e98-5819d780bd62", "Jill Avatar"); + + // Initialize new dictionary. + public InternalDictionary<UUID, string> testAvName = new InternalDictionary<UUID, string>(KeyNameCache); + + + + + + Initializes a new instance of the Class + with the specified key/value, With its initial capacity specified. + + Initial size of dictionary + + + // initialize a new InternalDictionary named testDict with a string as the key and an int as the value, + // initially allocated room for 10 entries. + public InternalDictionary<string, int> testDict = new InternalDictionary<string, int>(10); + + + + + + Try to get entry from with specified key + + Key to use for lookup + Value returned + if specified key exists, if not found + + + // find your avatar using the Simulator.ObjectsAvatars InternalDictionary: + Avatar av; + if (Client.Network.CurrentSim.ObjectsAvatars.TryGetValue(Client.Self.AgentID, out av)) + Console.WriteLine("Found Avatar {0}", av.Name); + + + + + + + Finds the specified match. + + The match. + Matched value + + + // use a delegate to find a prim in the ObjectsPrimitives InternalDictionary + // with the ID 95683496 + uint findID = 95683496; + Primitive findPrim = sim.ObjectsPrimitives.Find( + delegate(Primitive prim) { return prim.ID == findID; }); + + + + + Find All items in an + return matching items. + a containing found items. + + Find All prims within 20 meters and store them in a List + + int radius = 20; + List<Primitive> prims = Client.Network.CurrentSim.ObjectsPrimitives.FindAll( + delegate(Primitive prim) { + Vector3 pos = prim.Position; + return ((prim.ParentID == 0) && (pos != Vector3.Zero) && (Vector3.Distance(pos, location) < radius)); + } + ); + + + + + Find All items in an + return matching keys. + a containing found keys. + + Find All keys which also exist in another dictionary + + List<UUID> matches = myDict.FindAll( + delegate(UUID id) { + return myOtherDict.ContainsKey(id); + } + ); + + + + + Perform an on each entry in an + to perform + + + // Iterates over the ObjectsPrimitives InternalDictionary and prints out some information. + Client.Network.CurrentSim.ObjectsPrimitives.ForEach( + delegate(Primitive prim) + { + if (prim.Text != null) + { + Console.WriteLine("NAME={0} ID = {1} TEXT = '{2}'", + prim.PropertiesFamily.Name, prim.ID, prim.Text); + } + }); + + + + + Perform an on each key of an + to perform + + + + Perform an on each KeyValuePair of an + + to perform + + + Check if Key exists in Dictionary + Key to check for + if found, otherwise + + + Check if Value exists in Dictionary + Value to check for + if found, otherwise + + + + Adds the specified key to the dictionary, dictionary locking is not performed, + + + The key + The value + + + + Removes the specified key, dictionary locking is not performed + + The key. + if successful, otherwise + + + + Gets the number of Key/Value pairs contained in the + + + + + Indexer for the dictionary + + The key + The value + + + + This is used to initialize and stop the Connector as a whole. The Connector + Create call must be completed successfully before any other requests are made + (typically during application initialization). The shutdown should be called + when the application is shutting down to gracefully release resources + + A string value indicting the Application name + URL for the management server + LoggingSettings + + + + + + Shutdown Connector -- Should be called when the application is shutting down + to gracefully release resources + + Handle returned from successful Connector ‘create’ request + + + + Mute or unmute the microphone + + Handle returned from successful Connector ‘create’ request + true (mute) or false (unmute) + + + + Mute or unmute the speaker + + Handle returned from successful Connector ‘create’ request + true (mute) or false (unmute) + + + + Set microphone volume + + Handle returned from successful Connector ‘create’ request + The level of the audio, a number between -100 and 100 where + 0 represents ‘normal’ speaking volume + + + + Set local speaker volume + + Handle returned from successful Connector ‘create’ request + The level of the audio, a number between -100 and 100 where + 0 represents ‘normal’ speaking volume + + + + Starts a thread that keeps the daemon running + + + + + + + Stops the daemon and the thread keeping it running + + + + + + + + + + + + + This is used to get a list of audio devices that can be used for capture (input) of voice. + + + + + + This is used to get a list of audio devices that can be used for render (playback) of voice. + + + + + This command is used to select the render device. + + The name of the device as returned by the Aux.GetRenderDevices command. + + + + This command is used to select the capture device. + + The name of the device as returned by the Aux.GetCaptureDevices command. + + + + This command is used to start the audio capture process which will cause + AuxAudioProperty Events to be raised. These events can be used to display a + microphone VU meter for the currently selected capture device. This command + should not be issued if the user is on a call. + + (unused but required) + + + + + This command is used to stop the audio capture process. + + + + + + This command is used to set the mic volume while in the audio tuning process. + Once an acceptable mic level is attained, the application must issue a + connector set mic volume command to have that level be used while on voice + calls. + + the microphone volume (-100 to 100 inclusive) + + + + + This command is used to set the speaker volume while in the audio tuning + process. Once an acceptable speaker level is attained, the application must + issue a connector set speaker volume command to have that level be used while + on voice calls. + + the speaker volume (-100 to 100 inclusive) + + + + + Create a Session + Sessions typically represent a connection to a media session with one or more + participants. This is used to generate an ‘outbound’ call to another user or + channel. The specifics depend on the media types involved. A session handle is + required to control the local user functions within the session (or remote + users if the current account has rights to do so). Currently creating a + session automatically connects to the audio media, there is no need to call + Session.Connect at this time, this is reserved for future use. + + Handle returned from successful Connector ‘create’ request + This is the URI of the terminating point of the session (ie who/what is being called) + This is the display name of the entity being called (user or channel) + Only needs to be supplied when the target URI is password protected + This indicates the format of the password as passed in. This can either be + “ClearText” or “SHA1UserName”. If this element does not exist, it is assumed to be “ClearText”. If it is + “SHA1UserName”, the password as passed in is the SHA1 hash of the password and username concatenated together, + then base64 encoded, with the final “=” character stripped off. + + + + + + + Used to accept a call + + SessionHandle such as received from SessionNewEvent + "default" + + + + + This command is used to start the audio render process, which will then play + the passed in file through the selected audio render device. This command + should not be issued if the user is on a call. + + The fully qualified path to the sound file. + True if the file is to be played continuously and false if it is should be played once. + + + + + This command is used to stop the audio render process. + + The fully qualified path to the sound file issued in the start render command. + + + + + This is used to ‘end’ an established session (i.e. hang-up or disconnect). + + Handle returned from successful Session ‘create’ request or a SessionNewEvent + + + + + Set the combined speaking and listening position in 3D space. + + Handle returned from successful Session ‘create’ request or a SessionNewEvent + Speaking position + Listening position + + + + + Set User Volume for a particular user. Does not affect how other users hear that user. + + Handle returned from successful Session ‘create’ request or a SessionNewEvent + + The level of the audio, a number between -100 and 100 where 0 represents ‘normal’ speaking volume + + + + + Start up the Voice service. + + + + + Handle miscellaneous request status + + + + ///If something goes wrong, we log it. + + + + Cleanup oject resources + + + + + Request voice cap when changing regions + + + + + Handle a change in session state + + + + + Close a voice session + + + + + + Locate a Session context from its handle + + Creates the session context if it does not exist. + + + + Handle completion of main voice cap request. + + + + + + + + Daemon has started so connect to it. + + + + + The daemon TCP connection is open. + + + + + Handle creation of the Connector. + + + + + Handle response to audio output device query + + + + + Handle response to audio input device query + + + + + Set voice channel for new parcel + + + + + + Request info from a parcel capability Uri. + + + + + + Receive parcel voice cap + + + + + + + + Tell Vivox where we are standing + + This has to be called when we move or turn. + + + + Start and stop updating out position. + + + + + + This is used to login a specific user account(s). It may only be called after + Connector initialization has completed successfully + + Handle returned from successful Connector ‘create’ request + User's account name + User's account password + Values may be “AutoAnswer” or “VerifyAnswer” + "" + This is an integer that specifies how often + the daemon will send participant property events while in a channel. If this is not set + the default will be “on state change”, which means that the events will be sent when + the participant starts talking, stops talking, is muted, is unmuted. + The valid values are: + 0 – Never + 5 – 10 times per second + 10 – 5 times per second + 50 – 1 time per second + 100 – on participant state change (this is the default) + false + + + + + This is used to logout a user session. It should only be called with a valid AccountHandle. + + Handle returned from successful Connector ‘login’ request + + + + + Event for most mundane request reposnses. + + + + Response to Connector.Create request + + + Response to Aux.GetCaptureDevices request + + + Response to Aux.GetRenderDevices request + + + Audio Properties Events are sent after audio capture is started. + These events are used to display a microphone VU meter + + + Response to Account.Login request + + + This event message is sent whenever the login state of the + particular Account has transitioned from one value to another + + + + List of audio input devices + + + + + List of audio output devices + + + + + Set audio test mode + + + + Enable logging + + + The folder where any logs will be created + + + This will be prepended to beginning of each log file + + + The suffix or extension to be appended to each log file + + + + 0: NONE - No logging + 1: ERROR - Log errors only + 2: WARNING - Log errors and warnings + 3: INFO - Log errors, warnings and info + 4: DEBUG - Log errors, warnings, info and debug + + + + + Constructor for default logging settings + + + + Audio Properties Events are sent after audio capture is started. These events are used to display a microphone VU meter + + + + Abstract base for rendering plugins + + + + + Generates a basic mesh structure from a primitive + + Primitive to generate the mesh from + Level of detail to generate the mesh at + The generated mesh + + + + Generates a basic mesh structure from a sculpted primitive and + texture + + Sculpted primitive to generate the mesh from + Sculpt texture + Level of detail to generate the mesh at + The generated mesh + + + + Generates a series of faces, each face containing a mesh and + metadata + + Primitive to generate the mesh from + Level of detail to generate the mesh at + The generated mesh + + + + Generates a series of faces for a sculpted prim, each face + containing a mesh and metadata + + Sculpted primitive to generate the mesh from + Sculpt texture + Level of detail to generate the mesh at + The generated mesh + + + + Apply texture coordinate modifications from a + to a list of vertices + + Vertex list to modify texture coordinates for + Center-point of the face + Face texture parameters + + + + pre-defined built in sounds + + + + + + + + + + + + + + + + + + + + + + + + + + + + coins + + + cash register bell + + + + + + + + + rubber + + + plastic + + + flesh + + + wood splintering? + + + glass break + + + metal clunk + + + whoosh + + + shake + + + + + + ding + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + A dictionary containing all pre-defined sounds + + A dictionary containing the pre-defined sounds, + where the key is the sounds ID, and the value is a string + containing a name to identify the purpose of the sound + + + + Simulator (region) properties + + + + No flags set + + + Agents can take damage and be killed + + + Landmarks can be created here + + + Home position can be set in this sim + + + Home position is reset when an agent teleports away + + + Sun does not move + + + No object, land, etc. taxes + + + Disable heightmap alterations (agents can still plant + foliage) + + + Land cannot be released, sold, or purchased + + + All content is wiped nightly + + + Unknown: Related to the availability of an overview world map tile.(Think mainland images when zoomed out.) + + + Unknown: Related to region debug flags. Possibly to skip processing of agent interaction with world. + + + Region does not update agent prim interest lists. Internal debugging option. + + + No collision detection for non-agent objects + + + No scripts are ran + + + All physics processing is turned off + + + Region can be seen from other regions on world map. (Legacy world map option?) + + + Region can be seen from mainland on world map. (Legacy world map option?) + + + Agents not explicitly on the access list can visit the region. + + + Traffic calculations are not run across entire region, overrides parcel settings. + + + Flight is disabled (not currently enforced by the sim) + + + Allow direct (p2p) teleporting + + + Estate owner has temporarily disabled scripting + + + Restricts the usage of the LSL llPushObject function, applies to whole region. + + + Deny agents with no payment info on file + + + Deny agents with payment info on file + + + Deny agents who have made a monetary transaction + + + Parcels within the region may be joined or divided by anyone, not just estate owners/managers. + + + Abuse reports sent from within this region are sent to the estate owner defined email. + + + Region is Voice Enabled + + + Removes the ability from parcel owners to set their parcels to show in search. + + + Deny agents who have not been age verified from entering the region. + + + + Access level for a simulator + + + + Unknown or invalid access level + + + Trial accounts allowed + + + PG rating + + + Mature rating + + + Adult rating + + + Simulator is offline + + + Simulator does not exist + + + + + + + + + + + + + + Initialize the UDP packet handler in server mode + + Port to listening for incoming UDP packets on + + + + Initialize the UDP packet handler in client mode + + Remote UDP server to connect to + + + + + + + + + + + + + + + + + + A public reference to the client that this Simulator object + is attached to + + + A Unique Cache identifier for this simulator + + + The capabilities for this simulator + + + + + + The current version of software this simulator is running + + + + + + A 64x64 grid of parcel coloring values. The values stored + in this array are of the type + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + true if your agent has Estate Manager rights on this region + + + + + + + + + + + + Statistics information for this simulator and the + connection to the simulator, calculated by the simulator itself + and the library + + + The regions Unique ID + + + The physical data center the simulator is located + Known values are: + + Dallas + Chandler + SF + + + + + The CPU Class of the simulator + Most full mainland/estate sims appear to be 5, + Homesteads and Openspace appear to be 501 + + + The number of regions sharing the same CPU as this one + "Full Sims" appear to be 1, Homesteads appear to be 4 + + + The billing product name + Known values are: + + Mainland / Full Region (Sku: 023) + Estate / Full Region (Sku: 024) + Estate / Openspace (Sku: 027) + Estate / Homestead (Sku: 029) + Mainland / Homestead (Sku: 129) (Linden Owned) + Mainland / Linden Homes (Sku: 131) + + + + + The billing product SKU + Known values are: + + 023 Mainland / Full Region + 024 Estate / Full Region + 027 Estate / Openspace + 029 Estate / Homestead + 129 Mainland / Homestead (Linden Owned) + 131 Linden Homes / Full Region + + + + + The current sequence number for packets sent to this + simulator. Must be Interlocked before modifying. Only + useful for applications manipulating sequence numbers + + + + A thread-safe dictionary containing avatars in a simulator + + + + + A thread-safe dictionary containing primitives in a simulator + + + + + Provides access to an internal thread-safe dictionary containing parcel + information found in this simulator + + + + + Checks simulator parcel map to make sure it has downloaded all data successfully + + true if map is full (contains no 0's) + + + Used internally to track sim disconnections + + + Event that is triggered when the simulator successfully + establishes a connection + + + Whether this sim is currently connected or not. Hooked up + to the property Connected + + + Coarse locations of avatars in this simulator + + + AvatarPositions key representing TrackAgent target + + + Sequence numbers of packets we've received + (for duplicate checking) + + + Packets we sent out that need ACKs from the simulator + + + Sequence number for pause/resume + + + Indicates if UDP connection to the sim is fully established + + + + + + Reference to the GridClient object + IPEndPoint of the simulator + handle of the simulator + + + + Called when this Simulator object is being destroyed + + + + + Attempt to connect to this simulator + + Whether to move our agent in to this sim or not + True if the connection succeeded or connection status is + unknown, false if there was a failure + + + + Initiates connection to the simulator + + + + + Disconnect from this simulator + + + + + Instructs the simulator to stop sending update (and possibly other) packets + + + + + Instructs the simulator to resume sending update packets (unpause) + + + + + Retrieve the terrain height at a given coordinate + + Sim X coordinate, valid range is from 0 to 255 + Sim Y coordinate, valid range is from 0 to 255 + The terrain height at the given point if the + lookup was successful, otherwise 0.0f + True if the lookup was successful, otherwise false + + + + Sends a packet + + Packet to be sent + + + + + + + + + Returns Simulator Name as a String + + + + + + + + + + + + + + + + + + + Sends out pending acknowledgements + + Number of ACKs sent + + + + Resend unacknowledged packets + + + + + Provides access to an internal thread-safe multidimensional array containing a x,y grid mapped + to each 64x64 parcel's LocalID. + + + + The IP address and port of the server + + + Whether there is a working connection to the simulator or + not + + + Coarse locations of avatars in this simulator + + + AvatarPositions key representing TrackAgent target + + + Indicates if UDP connection to the sim is fully established + + + + Simulator Statistics + + + + Total number of packets sent by this simulator to this agent + + + Total number of packets received by this simulator to this agent + + + Total number of bytes sent by this simulator to this agent + + + Total number of bytes received by this simulator to this agent + + + Time in seconds agent has been connected to simulator + + + Total number of packets that have been resent + + + Total number of resent packets recieved + + + Total number of pings sent to this simulator by this agent + + + Total number of ping replies sent to this agent by this simulator + + + + Incoming bytes per second + + It would be nice to have this claculated on the fly, but + this is far, far easier + + + + Outgoing bytes per second + + It would be nice to have this claculated on the fly, but + this is far, far easier + + + Time last ping was sent + + + ID of last Ping sent + + + + + + + + + Current time dilation of this simulator + + + Current Frames per second of simulator + + + Current Physics frames per second of simulator + + + + + + + + + + + + + + + + + + + + + + + + + + + Total number of objects Simulator is simulating + + + Total number of Active (Scripted) objects running + + + Number of agents currently in this simulator + + + Number of agents in neighbor simulators + + + Number of Active scripts running in this simulator + + + + + + + + + + + + Number of downloads pending + + + Number of uploads pending + + + + + + + + + Number of local uploads pending + + + Unacknowledged bytes in queue + + + + Checks the instance back into the object pool + + + + + Returns an instance of the class that has been checked out of the Object Pool. + + + + + Creates a new instance of the ObjectPoolBase class. Initialize MUST be called + after using this constructor. + + + + + Creates a new instance of the ObjectPool Base class. + + The object pool is composed of segments, which + are allocated whenever the size of the pool is exceeded. The number of items + in a segment should be large enough that allocating a new segmeng is a rare + thing. For example, on a server that will have 10k people logged in at once, + the receive buffer object pool should have segment sizes of at least 1000 + byte arrays per segment. + + The minimun number of segments that may exist. + Perform a full GC.Collect whenever a segment is allocated, and then again after allocation to compact the heap. + The frequency which segments are checked to see if they're eligible for cleanup. + + + + Forces the segment cleanup algorithm to be run. This method is intended + primarly for use from the Unit Test libraries. + + + + + Responsible for allocate 1 instance of an object that will be stored in a segment. + + An instance of whatever objec the pool is pooling. + + + + Checks in an instance of T owned by the object pool. This method is only intended to be called + by the WrappedObject class. + + The segment from which the instance is checked out. + The instance of T to check back into the segment. + + + + Checks an instance of T from the pool. If the pool is not sufficient to + allow the checkout, a new segment is created. + + A WrappedObject around the instance of T. To check + the instance back into the segment, be sureto dispose the WrappedObject + when finished. + + + + The total number of segments created. Intended to be used by the Unit Tests. + + + + + The number of items that are in a segment. Items in a segment + are all allocated at the same time, and are hopefully close to + each other in the managed heap. + + + + + The minimum number of segments. When segments are reclaimed, + this number of segments will always be left alone. These + segments are allocated at startup. + + + + + The age a segment must be before it's eligible for cleanup. + This is used to prevent thrash, and typical values are in + the 5 minute range. + + + + + The frequence which the cleanup thread runs. This is typically + expected to be in the 5 minute range. + + + + + Exception class to identify inventory exceptions + + + + + Responsible for maintaining inventory structure. Inventory constructs nodes + and manages node children as is necessary to maintain a coherant hirarchy. + Other classes should not manipulate or create InventoryNodes explicitly. When + A node's parent changes (when a folder is moved, for example) simply pass + Inventory the updated InventoryFolder and it will make the appropriate changes + to its internal representation. + + + + The event subscribers, null of no subscribers + + + Raises the InventoryObjectUpdated Event + A InventoryObjectUpdatedEventArgs object containing + the data sent from the simulator + + + Thread sync lock object + + + The event subscribers, null of no subscribers + + + Raises the InventoryObjectRemoved Event + A InventoryObjectRemovedEventArgs object containing + the data sent from the simulator + + + Thread sync lock object + + + The event subscribers, null of no subscribers + + + Raises the InventoryObjectAdded Event + A InventoryObjectAddedEventArgs object containing + the data sent from the simulator + + + Thread sync lock object + + + + Returns the contents of the specified folder + + A folder's UUID + The contents of the folder corresponding to folder + When folder does not exist in the inventory + + + + Updates the state of the InventoryNode and inventory data structure that + is responsible for the InventoryObject. If the item was previously not added to inventory, + it adds the item, and updates structure accordingly. If it was, it updates the + InventoryNode, changing the parent node if item.parentUUID does + not match node.Parent.Data.UUID. + + You can not set the inventory root folder using this method + + The InventoryObject to store + + + + Removes the InventoryObject and all related node data from Inventory. + + The InventoryObject to remove. + + + + Used to find out if Inventory contains the InventoryObject + specified by uuid. + + The UUID to check. + true if inventory contains uuid, false otherwise + + + + Saves the current inventory structure to a cache file + + Name of the cache file to save to + + + + Loads in inventory cache file into the inventory structure. Note only valid to call after login has been successful. + + Name of the cache file to load + The number of inventory items sucessfully reconstructed into the inventory node tree + + + Raised when the simulator sends us data containing + ... + + + Raised when the simulator sends us data containing + ... + + + Raised when the simulator sends us data containing + ... + + + + The root folder of this avatars inventory + + + + + The default shared library folder + + + + + The root node of the avatars inventory + + + + + The root node of the default shared library + + + + + By using the bracket operator on this class, the program can get the + InventoryObject designated by the specified uuid. If the value for the corresponding + UUID is null, the call is equivelant to a call to RemoveNodeFor(this[uuid]). + If the value is non-null, it is equivelant to a call to UpdateNodeFor(value), + the uuid parameter is ignored. + + The UUID of the InventoryObject to get or set, ignored if set to non-null value. + The InventoryObject corresponding to uuid. + + + + Registers, unregisters, and fires events generated by incoming packets + + + + Reference to the GridClient object + + + + Default constructor + + + + + + Register an event handler + + Use PacketType.Default to fire this event on every + incoming packet + Packet type to register the handler for + Callback to be fired + True if this callback should be ran + asynchronously, false to run it synchronous + + + + Unregister an event handler + + Packet type to unregister the handler for + Callback to be unregistered + + + + Fire the events registered for this packet type + + Incoming packet type + Incoming packet + Simulator this packet was received from + + + + Object that is passed to worker threads in the ThreadPool for + firing packet callbacks + + + + Callback to fire for this packet + + + Reference to the simulator that this packet came from + + + The packet that needs to be processed + + + + Registers, unregisters, and fires events generated by the Capabilities + event queue + + + + Reference to the GridClient object + + + + Default constructor + + Reference to the GridClient object + + + + Register an new event handler for a capabilities event sent via the EventQueue + + Use String.Empty to fire this event on every CAPS event + Capability event name to register the + handler for + Callback to fire + + + + Unregister a previously registered capabilities handler + + Capability event name unregister the + handler for + Callback to unregister + + + + Fire the events registered for this event type synchronously + + Capability name + Decoded event body + Reference to the simulator that + generated this event + + + + Fire the events registered for this event type asynchronously + + Capability name + Decoded event body + Reference to the simulator that + generated this event + + + + Object that is passed to worker threads in the ThreadPool for + firing CAPS callbacks + + + + Callback to fire for this packet + + + Name of the CAPS event + + + Strongly typed decoded data + + + Reference to the simulator that generated this event + + + + Represends individual HTTP Download request + + + + URI of the item to fetch + + + Timout specified in milliseconds + + + Download progress callback + + + Download completed callback + + + Accept the following content type + + + Default constructor + + + Constructor + + + + Manages async HTTP downloads with a limit on maximum + concurrent downloads + + + + Default constructor + + + Cleanup method + + + Setup http download request + + + Check the queue for pending work + + + Enqueue a new HTPP download + + + Maximum number of parallel downloads from a single endpoint + + + Client certificate + + + Positional vector of the users position + + + Velocity vector of the position + + + At Orientation (X axis) of the position + + + Up Orientation (Y axis) of the position + + + Left Orientation (Z axis) of the position + + + + Represents Mesh asset + + + + Initializes a new instance of an AssetMesh object + + + Initializes a new instance of an AssetMesh object with parameters + A unique specific to this asset + A byte array containing the raw asset data + + + + TODO: Encodes a scripts contents into a LSO Bytecode file + + + + + TODO: Decode LSO Bytecode into a string + + true + + + Override the base classes AssetType + + + + Static helper functions and global variables + + + + This header flag signals that ACKs are appended to the packet + + + This header flag signals that this packet has been sent before + + + This header flags signals that an ACK is expected for this packet + + + This header flag signals that the message is compressed using zerocoding + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Given an X/Y location in absolute (grid-relative) terms, a region + handle is returned along with the local X/Y location in that region + + The absolute X location, a number such as + 255360.35 + The absolute Y location, a number such as + 255360.35 + The sim-local X position of the global X + position, a value from 0.0 to 256.0 + The sim-local Y position of the global Y + position, a value from 0.0 to 256.0 + A 64-bit region handle that can be used to teleport to + + + + Converts a floating point number to a terse string format used for + transmitting numbers in wearable asset files + + Floating point number to convert to a string + A terse string representation of the input number + + + + Convert a variable length field (byte array) to a string, with a + field name prepended to each line of the output + + If the byte array has unprintable characters in it, a + hex dump will be written instead + The StringBuilder object to write to + The byte array to convert to a string + A field name to prepend to each line of output + + + + Decode a zerocoded byte array, used to decompress packets marked + with the zerocoded flag + + Any time a zero is encountered, the next byte is a count + of how many zeroes to expand. One zero is encoded with 0x00 0x01, + two zeroes is 0x00 0x02, three zeroes is 0x00 0x03, etc. The + first four bytes are copied directly to the output buffer. + + The byte array to decode + The length of the byte array to decode. This + would be the length of the packet up to (but not including) any + appended ACKs + The output byte array to decode to + The length of the output buffer + + + + Encode a byte array with zerocoding. Used to compress packets marked + with the zerocoded flag. Any zeroes in the array are compressed down + to a single zero byte followed by a count of how many zeroes to expand + out. A single zero becomes 0x00 0x01, two zeroes becomes 0x00 0x02, + three zeroes becomes 0x00 0x03, etc. The first four bytes are copied + directly to the output buffer. + + The byte array to encode + The length of the byte array to encode + The output byte array to encode to + The length of the output buffer + + + + Calculates the CRC (cyclic redundancy check) needed to upload inventory. + + Creation date + Sale type + Inventory type + Type + Asset ID + Group ID + Sale price + Owner ID + Creator ID + Item ID + Folder ID + Everyone mask (permissions) + Flags + Next owner mask (permissions) + Group mask (permissions) + Owner mask (permissions) + The calculated CRC + + + + Attempts to load a file embedded in the assembly + + The filename of the resource to load + A Stream for the requested file, or null if the resource + was not successfully loaded + + + + Attempts to load a file either embedded in the assembly or found in + a given search path + + The filename of the resource to load + An optional path that will be searched if + the asset is not found embedded in the assembly + A Stream for the requested file, or null if the resource + was not successfully loaded + + + + Converts a list of primitives to an object that can be serialized + with the LLSD system + + Primitives to convert to a serializable object + An object that can be serialized with LLSD + + + + Deserializes OSD in to a list of primitives + + Structure holding the serialized primitive list, + must be of the SDMap type + A list of deserialized primitives + + + + Converts a struct or class object containing fields only into a key value separated string + + The struct object + A string containing the struct fields as the keys, and the field value as the value separated + + + // Add the following code to any struct or class containing only fields to override the ToString() + // method to display the values of the passed object + + /// Print the struct data as a string + ///A string containing the field name, and field value + public override string ToString() + { + return Helpers.StructToString(this); + } + + + + + + Passed to Logger.Log() to identify the severity of a log entry + + + + No logging information will be output + + + Non-noisy useful information, may be helpful in + debugging a problem + + + A non-critical error occurred. A warning will not + prevent the rest of the library from operating as usual, + although it may be indicative of an underlying issue + + + A critical error has occurred. Generally this will + be followed by the network layer shutting down, although the + stability of the library after an error is uncertain + + + Used for internal testing, this logging level can + generate very noisy (long and/or repetitive) messages. Don't + pass this to the Log() function, use DebugLog() instead. - Event name, this must match an actual - packet name for a Packet to be successfully built - LLSD to convert to a Packet - A Packet on success, otherwise null @@ -4804,55 +13376,58 @@ in to a single texture, for avatar appearances - - Reference to the GridClient object + + Final baked texture - - Finald baked texture + + Component layers - - Appearance parameters the drive the baking process - - - Wearable textures - - - Total number of textures in the bake - - + Width of the final baked image and scratchpad - + Height of the final baked image and scratchpad - + Bake type - + Default constructor - Reference to the GridClient object - - Total number of layers this layer set is - composed of - Appearance parameters the drive the - baking process + Bake type - + - Adds an image to this baking texture and potentially processes it, or - stores it for processing later + Adds layer for baking - The baking texture index of the image to be added - JPEG2000 compressed image to be - added to the baking texture - True if Decode() needs to be - called for the texture, otherwise false - True if this texture is completely baked and JPEG2000 data - is available, otherwise false + TexturaData struct that contains texture and its params - + + + Converts avatar texture index (face) to Bake type + + Face number (AvatarTextureIndex) + BakeType, layer to which this texture belongs to + + + + Make sure images exist, resize source if needed to match the destination + + Destination image + Source image + Sanitization was succefull + + + + Fills a baked layer as a solid *appearing* color. The colors are + subtly dithered on a 16x16 grid to prevent the JPEG2000 stage from + compressing it too far since it seems to cause upload failures if + the image is a pure solid color + + Color of the base of this layer + + Fills a baked layer as a solid *appearing* color. The colors are subtly dithered on a 16x16 grid to prevent the JPEG2000 stage from @@ -4863,92 +13438,23 @@ Green value Blue value - - - Represents an that represents an avatars body ie: Hair, Etc. - + + Final baked texture - - - Represents a Wearable Asset, Clothing, Hair, Skin, Etc - + + Component layers - - A string containing the name of the asset + + Width of the final baked image and scratchpad - - A string containing a short description of the asset + + Height of the final baked image and scratchpad - - The Assets WearableType + + Bake type - - The For-Sale status of the object - - - An Integer representing the purchase price of the asset - - - The of the assets creator - - - The of the assets current owner - - - The of the assets prior owner - - - The of the Group this asset is set to - - - True if the asset is owned by a - - - The Permissions mask of the asset - - - A Dictionary containing Key/Value pairs of the objects parameters - - - A Dictionary containing Key/Value pairs where the Key is the textures Index and the Value is the Textures - - - Initializes a new instance of an AssetWearable object - - - Initializes a new instance of an AssetWearable object with parameters - A unique specific to this asset - A byte array containing the raw asset data - - - Initializes a new instance of an AssetWearable object with parameters - A string containing the asset parameters - - - - Decode an assets byte encoded data to a string - - true if the asset data was decoded successfully - - - - Encode the assets string represantion into a format consumable by the asset server - - - - Initializes a new instance of an AssetBodyPart object - - - Initializes a new instance of an AssetBodyPart object with parameters - A unique specific to this asset - A byte array containing the raw asset data - - - Initializes a new instance of an AssetBodyPart object with parameters - A string representing the values of the Bodypart - - - Override the base classes AssetType + + Is this one of the 3 skin bakes @@ -4968,320 +13474,40 @@ Override the base classes AssetType - + - Holds group information for Avatars such as those you might find in a profile + Index of TextureEntry slots for avatar appearances - - true of Avatar accepts group notices - - - Groups Key - - - Texture Key for groups insignia - - - Name of the group - - - Powers avatar has in the group - - - Avatars Currently selected title - - - true of Avatar has chosen to list this in their profile - - + - Holds group information on an individual profile pick + Bake layers for avatar appearance - - - Retrieve friend status notifications, and retrieve avatar names and - profiles - + + Maximum number of concurrent downloads for wearable assets and textures - - - Represents other avatars - - + + Maximum number of concurrent uploads for baked textures - - Tracks the specified avatar on your map - Avatar ID to track + + Timeout for fetching inventory listings - - - Request a single avatar name - - The avatar key to retrieve a name for + + Timeout for fetching a single wearable, or receiving a single packet response - - - Request a list of avatar names - - The avatar keys to retrieve names for + + Timeout for fetching a single texture - - - Start a request for Avatar Properties - - + + Timeout for uploading a single baked texture - - - Search for an avatar (first name, last name, and uuid) - - The name to search for - An ID to associate with this query + + Number of times to retry bake upload - - - Start a request for Avatar Picks - - UUID of the avatar - - - - Start a request for Avatar Classifieds - - UUID of the avatar - - - - Start a request for details of a specific profile pick - - UUID of the avatar - UUID of the profile pick - - - - Start a request for details of a specific profile classified - - UUID of the avatar - UUID of the profile classified - - - - Process an incoming UUIDNameReply Packet and insert Full Names into the Avatars Dictionary - - Incoming Packet to process - Unused - - - - Process incoming avatar animations - - - - - - - Process incoming avatar appearance - - - - - - - Process incoming avatar properties (profile data) - - - - - - - Process incoming Avatar Interests information - - - - - Process an incoming effect - - - - - Process an incoming list of profile picks - - - - - Process an incoming details of a profile pick - - - - - Process an incoming list of profile classifieds - - - - - Process an incoming details of a profile Classified - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Triggered when an avatar animation signal is received - - UUID of the avatar sending the animation - UUID of the animation, and animation sequence number - - - - Triggered when AvatarAppearance is received - - - - - - - - - - Triggered when a UUIDNameReply is received - - - - - - Triggered when a response for avatar interests is returned - - - - - - - Triggered when avatar properties are received (AvatarPropertiesReply) - - - - - - - Triggered when an avatar group list is received (AvatarGroupsReply) - - - - - - - Triggered when a name search reply is received (AvatarPickerReply) - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Callback returning a dictionary of avatar's picks - - - - - - - Callback returning a details of a specifick pick - - - - - - - Callback returning a dictionary of avatar's Classified - - - - - - - Callback returning a details of a specifick Classified - - - - - - - Manager class to for agents appearance, both body parts and clothing - + + When changing outfit, kick off rebake after + 20 seconds has passed since the last change Total number of wearables for each avatar @@ -5292,130 +13518,127 @@ Total number of wearables per bake layer - - Total number of textures on an avatar, baked or not + + Mapping between BakeType and AvatarTextureIndex Map of what wearables are included in each bake - Secret values to finalize the cache check hashes for each + Magic values to finalize the cache check hashes for each bake Default avatar texture, used to detect when a custom texture is not set for a face + + The event subscribers. null if no subcribers + + + Raises the AgentWearablesReply event + An AgentWearablesReplyEventArgs object containing the + data returned from the data server + + + Thread sync lock object + + + The event subscribers. null if no subcribers + + + Raises the CachedBakesReply event + An AgentCachedBakesReplyEventArgs object containing the + data returned from the data server AgentCachedTextureResponse + + + Thread sync lock object + + + The event subscribers. null if no subcribers + + + Raises the AppearanceSet event + An AppearanceSetEventArgs object indicating if the operatin was successfull + + + Thread sync lock object + + + The event subscribers. null if no subcribers + + + Raises the RebakeAvatarRequested event + An RebakeAvatarTexturesEventArgs object containing the + data returned from the data server + + + Thread sync lock object + + A cache of wearables currently being worn + + + A cache of textures currently being worn + + + Incrementing serial number for AgentCachedTexture packets + + + Incrementing serial number for AgentSetAppearance packets + + + Indicates whether or not the appearance thread is currently + running, to prevent multiple appearance threads from running + simultaneously + + + Reference to our agent + + - An which keeps track of wearables data + Timer used for delaying rebake on changing outfit - + + + Main appearance thread + + + Default constructor - This agents Object - Reference to an AssetManager object - - - - Returns the assetID for a given WearableType - - the of the asset - The of the WearableType + A reference to our agent - Ask the server what we are wearing and set appearance based on that + Obsolete method for setting appearance. This function no longer does anything. + Use RequestSetAppearance() to manually start the appearance thread - + - Replace the current outfit with a list of wearables and set appearance + Obsolete method for setting appearance. This function no longer does anything. + Use RequestSetAppearance() to manually start the appearance thread - List of wearables that define the new outfit + Unused parameter - + - Replace the current outfit with a list of wearables and set appearance + Starts the appearance setting thread - List of wearables that define the new outfit - Whether to bake textures for the avatar or not - + - Add to the current outfit with the list supplied + Starts the appearance setting thread - List of wearables that will be added to the outfit - Whether to bake textures for the avatar or not + True to force rebaking, otherwise false - + - Replace the current outfit with a folder and set appearance + Ask the server what textures our agent is currently wearing - UUID of the inventory folder to wear - - - - Replace the current outfit with a folder and set appearance - - Inventory path of the folder to wear - - - - Replace the current outfit with a folder and set appearance - - Folder containing the new outfit - Whether to bake the avatar textures or not - - - - Replace the current outfit with a folder and set appearance - - Path of folder containing the new outfit - Whether to bake the avatar textures or not - - - - Adds a list of attachments to avatar - - A List containing the attachments to add - If true, tells simulator to remove existing attachment - first - - - - Attach an item to an avatar at a specific attach point - - A to attach - the on the avatar - to attach the item to - - - - Attach an item to an avatar specifying attachment details - - The of the item to attach - The attachments owner - The name of the attachment - The description of the attahment - The to apply when attached - The of the attachment - the on the avatar - to attach the item to - - - - Detach an item from avatar using an object - - An object - - - - Detach an Item from avatar by items - - The items ID to detach @@ -5423,53 +13646,3281 @@ ask the simulator whether it has cached copies of each baked texture - + - Force a rebake of the currently worn textures + Returns the AssetID of the asset that is currently being worn in a + given WearableType slot + + WearableType slot to get the AssetID for + The UUID of the asset being worn in the given slot, or + UUID.Zero if no wearable is attached to the given slot or wearables + have not been downloaded yet + + + + Add a wearable to the current outfit and set appearance + + Wearable to be added to the outfit + + + + Add a list of wearables to the current outfit and set appearance + + List of wearable inventory items to + be added to the outfit + + + + Remove a wearable from the current outfit and set appearance + + Wearable to be removed from the outfit + + + + Removes a list of wearables from the current outfit and set appearance + + List of wearable inventory items to + be removed from the outfit + + + + Replace the current outfit with a list of wearables and set appearance + + List of wearable inventory items that + define a new outfit + + + + Checks if an inventory item is currently being worn + + The inventory item to check against the agent + wearables + The WearableType slot that the item is being worn in, + or WearbleType.Invalid if it is not currently being worn + + + + Returns a copy of the agents currently worn wearables + + A copy of the agents currently worn wearables + Avoid calling this function multiple times as it will make + a copy of all of the wearable data each time + + + + Calls either or + depending on the value of + replaceItems + + List of wearable inventory items to add + to the outfit or become a new outfit + True to replace existing items with the + new list of items, false to add these items to the existing outfit + + + + Adds a list of attachments to our agent + + A List containing the attachments to add + If true, tells simulator to remove existing attachment + first + + + + Attach an item to our agent at a specific attach point + + A to attach + the on the avatar + to attach the item to + + + + Attach an item to our agent specifying attachment details + + The of the item to attach + The attachments owner + The name of the attachment + The description of the attahment + The to apply when attached + The of the attachment + The on the agent + to attach the item to + + + + Detach an item from our agent using an object + + An object + + + + Detach an item from our agent + + The inventory itemID of the item to detach + + + + Inform the sim which wearables are part of our current outfit - + - Ask the server what textures our avatar is currently wearing + Replaces the Wearables collection with a list of new wearable items + + Wearable items to replace the Wearables collection with + + + + Calculates base color/tint for a specific wearable + based on its params + + All the color info gathered from wearable's VisualParams + passed as list of ColorParamInfo tuples + Base color/tint for the wearable + + + + Blocking method to populate the Wearables dictionary + + True on success, otherwise false + + + + Blocking method to populate the Textures array with cached bakes + + True on success, otherwise false + + + + Populates textures and visual params from a decoded asset + + Wearable to decode + + + + Blocking method to download and parse currently worn wearable assets + + True on success, otherwise false + + + + Get a list of all of the textures that need to be downloaded for a + single bake layer + + Bake layer to get texture AssetIDs for + A list of texture AssetIDs to download + + + + Helper method to lookup the TextureID for a single layer and add it + to a list if it is not already present + + + + + + + Blocking method to download all of the textures needed for baking + the given bake layers + + A list of layers that need baking + No return value is given because the baking will happen + whether or not all textures are successfully downloaded + + + + Blocking method to create and upload baked textures for all of the + missing bakes + + True on success, otherwise false + + + + Blocking method to create and upload a baked texture for a single + bake layer + + Layer to bake + True on success, otherwise false + + + + Blocking method to upload a baked texture + + Five channel JPEG2000 texture data to upload + UUID of the newly created asset on success, otherwise UUID.Zero + + + + Creates a dictionary of visual param values from the downloaded wearables + + A dictionary of visual param indices mapping to visual param + values for our agent that can be fed to the Baker class + + + + Create an AgentSetAppearance packet from Wearables data and the + Textures array and send it - + - Terminate any wait handles when the network layer disconnects + Converts a WearableType to a bodypart or clothing WearableType + + A WearableType + AssetType.Bodypart or AssetType.Clothing or AssetType.Unknown + + + + Converts a BakeType to the corresponding baked texture slot in AvatarTextureIndex + + A BakeType + The AvatarTextureIndex slot that holds the given BakeType + + + + Gives the layer number that is used for morph mask + + >A BakeType + Which layer number as defined in BakeTypeToTextures is used for morph mask + + + + Converts a BakeType to a list of the texture slots that make up that bake + + A BakeType + A list of texture slots that are inputs for the given bake + + + Triggered when an AgentWearablesUpdate packet is received, + telling us what our avatar is currently wearing + request. + + + Raised when an AgentCachedTextureResponse packet is + received, giving a list of cached bakes that were found on the + simulator + request. + + + + Raised when appearance data is sent to the simulator, also indicates + the main appearance thread is finished. + + request. + + + + Triggered when the simulator requests the agent rebake its appearance. + + + + + + Returns true if AppearanceManager is busy and trying to set or change appearance will fail - + + + Contains information about a wearable inventory item + + + + Inventory ItemID of the wearable + + + AssetID of the wearable asset + + + WearableType of the wearable + + + AssetType of the wearable + + + Asset data for the wearable + + + + Data collected from visual params for each wearable + needed for the calculation of the color + + + + + Holds a texture assetID and the data needed to bake this layer into + an outfit texture. Used to keep track of currently worn textures + and baking data + + + + A texture AssetID + + + Asset data for the texture + + + Collection of alpha masks that needs applying + + + Tint that should be applied to the texture + + + Where on avatar does this texture belong + + + Contains the Event data returned from the data server from an AgentWearablesRequest + + + Construct a new instance of the AgentWearablesReplyEventArgs class + + + Contains the Event data returned from the data server from an AgentCachedTextureResponse + + + Construct a new instance of the AgentCachedBakesReplyEventArgs class + + + Contains the Event data returned from an AppearanceSetRequest + + + + Triggered when appearance data is sent to the sim and + the main appearance thread is done. + Indicates whether appearance setting was successful + + + Indicates whether appearance setting was successful + + + Contains the Event data returned from the data server from an RebakeAvatarTextures + + + + Triggered when the simulator sends a request for this agent to rebake + its appearance + + The ID of the Texture Layer to bake + + + The ID of the Texture Layer to bake + + + + The current status of a texture request as it moves through the pipeline or final result of a texture request. + + + + The initial state given to a request. Requests in this state + are waiting for an available slot in the pipeline + + + A request that has been added to the pipeline and the request packet + has been sent to the simulator + + + A request that has received one or more packets back from the simulator + + + A request that has received all packets back from the simulator + + + A request that has taken longer than + to download OR the initial packet containing the packet information was never received + + + The texture request was aborted by request of the agent + + + The simulator replied to the request that it was not able to find the requested texture + + + + A callback fired to indicate the status or final state of the requested texture. For progressive + downloads this will fire each time new asset data is returned from the simulator. + + The indicating either Progress for textures not fully downloaded, + or the final result of the request after it has been processed through the TexturePipeline + The object containing the Assets ID, raw data + and other information. For progressive rendering the will contain + the data from the beginning of the file. For failed, aborted and timed out requests it will contain + an empty byte array. + + + + Texture request download handler, allows a configurable number of download slots which manage multiple + concurrent texture downloads from the + + This class makes full use of the internal + system for full texture downloads. + + + A dictionary containing all pending and in-process transfer requests where the Key is both the RequestID + and also the Asset Texture ID, and the value is an object containing the current state of the request and also + the asset data as it is being re-assembled + + + Holds the reference to the client object + + + Maximum concurrent texture requests allowed at a time + + + An array of objects used to manage worker request threads + + + An array of worker slots which shows the availablity status of the slot + + + The primary thread which manages the requests. + + + true if the TexturePipeline is currently running + + + A synchronization object used by the primary thread + + + A refresh timer used to increase the priority of stalled requests + + + + Default constructor, Instantiates a new copy of the TexturePipeline class + + Reference to the instantiated object + + + + Initialize callbacks required for the TexturePipeline to operate + + + + + Shutdown the TexturePipeline and cleanup any callbacks or transfers + + + + + Request a texture asset from the simulator using the system to + manage the requests and re-assemble the image from the packets received from the simulator + + The of the texture asset to download + The of the texture asset. + Use for most textures, or for baked layer texture assets + A float indicating the requested priority for the transfer. Higher priority values tell the simulator + to prioritize the request before lower valued requests. An image already being transferred using the can have + its priority changed by resending the request with the new priority value + Number of quality layers to discard. + This controls the end marker of the data sent + The packet number to begin the request at. A value of 0 begins the request + from the start of the asset texture + The callback to fire when the image is retrieved. The callback + will contain the result of the request and the texture asset data + If true, the callback will be fired for each chunk of the downloaded image. + The callback asset parameter will contain all previously received chunks of the texture asset starting + from the beginning of the request + + + + Sends the actual request packet to the simulator + + The image to download + Type of the image to download, either a baked + avatar texture or a normal texture + Priority level of the download. Default is + 1,013,000.0f + Number of quality layers to discard. + This controls the end marker of the data sent + Packet number to start the download at. + This controls the start marker of the data sent + Sending a priority of 0 and a discardlevel of -1 aborts + download + + + + Cancel a pending or in process texture request + + The texture assets unique ID + + + + Master Download Thread, Queues up downloads in the threadpool + + + + + The worker thread that sends the request and handles timeouts + + A object containing the request details + + + + Handle responses from the simulator that tell us a texture we have requested is unable to be located + or no longer exists. This will remove the request from the pipeline and free up a slot if one is in use + + The sender + The EventArgs object containing the packet data + + + + Handles the remaining Image data that did not fit in the initial ImageData packet + + The sender + The EventArgs object containing the packet data + + + + Handle the initial ImageDataPacket sent from the simulator + + The sender + The EventArgs object containing the packet data + + + Current number of pending and in-process transfers + + + + A request task containing information and status of a request as it is processed through the + + + + The current which identifies the current status of the request + + + The Unique Request ID, This is also the Asset ID of the texture being requested + + + The slot this request is occupying in the threadpoolSlots array + + + The ImageType of the request. + + + The callback to fire when the request is complete, will include + the and the + object containing the result data + + + If true, indicates the callback will be fired whenever new data is returned from the simulator. + This is used to progressively render textures as portions of the texture are received. + + + An object that maintains the data of an request thats in-process. + + + + Wrapper around a byte array that allows bit to be packed and unpacked + one at a time or by a variable amount. Useful for very tightly packed + data like LayerData packets + + + - + + + Default constructor, initialize the bit packer / bit unpacker + with a byte array and starting position + + Byte array to pack bits in to or unpack from + Starting position in the byte array + + + + Pack a floating point value in to the data + + Floating point value to pack + + + + Pack part or all of an integer in to the data + + Integer containing the data to pack + Number of bits of the integer to pack + + + + Pack part or all of an unsigned integer in to the data + + Unsigned integer containing the data to pack + Number of bits of the integer to pack + + + + Pack a single bit in to the data + + Bit to pack + + + + + + + + + + + + + + + + + + + + + + + + + Unpacking a floating point value from the data + + Unpacked floating point value + + + + Unpack a variable number of bits from the data in to integer format + + Number of bits to unpack + An integer containing the unpacked bits + This function is only useful up to 32 bits + + + + Unpack a variable number of bits from the data in to unsigned + integer format + + Number of bits to unpack + An unsigned integer containing the unpacked bits + This function is only useful up to 32 bits + + + + Unpack a 16-bit signed integer + + 16-bit signed integer + + + + Unpack a 16-bit unsigned integer + + 16-bit unsigned integer + + + + Unpack a 32-bit signed integer + + 32-bit signed integer + + + + Unpack a 32-bit unsigned integer + + 32-bit unsigned integer + + - + + + + - + Class that handles the local asset cache - + - + Default constructor + + A reference to the GridClient object + + + + Disposes cleanup timer - + - + Only create timer when needed - + - + Return bytes read from the local asset cache, null if it does not exist + + UUID of the asset we want to get + Raw bytes of the asset, or null on failure + + + + Returns ImageDownload object of the + image from the local image cache, null if it does not exist + + UUID of the image we want to get + ImageDownload object containing the image, or null on failure + + + + Constructs a file name of the cached asset + + UUID of the asset + String with the file name of the cahced asset + + + + Saves an asset to the local cache + + UUID of the asset + Raw bytes the asset consists of + Weather the operation was successfull + + + + Get the file name of the asset stored with gived UUID + + UUID of the asset + Null if we don't have that UUID cached on disk, file name if found in the cache folder + + + + Checks if the asset exists in the local cache + + UUID of the asset + True is the asset is stored in the cache, otherwise false + + + + Wipes out entire cache + + + + + Brings cache size to the 90% of the max size + + + + + Asynchronously brings cache size to the 90% of the max size + + + + + Adds up file sizes passes in a FileInfo array + + + + + Checks whether caching is enabled + + + + + Periodically prune the cache + + + + + Nicely formats file sizes + + Byte size we want to output + String with humanly readable file size + + + + Allows setting weather to periodicale prune the cache if it grows too big + Default is enabled, when caching is enabled + + + + + How long (in ms) between cache checks (default is 5 min.) + + + + + Helper class for sorting files by their last accessed time - Capability to load TGAs to Bitmap + + + Represents a Sound Asset + + + + Initializes a new instance of an AssetSound object + + + Initializes a new instance of an AssetSound object with parameters + A unique specific to this asset + A byte array containing the raw asset data + + + + TODO: Encodes a sound file + + + + + TODO: Decode a sound file + + true + + + Override the base classes AssetType + + + + Represents an LSL Text object containing a string of UTF encoded characters + + + + A string of characters represting the script contents + + + Initializes a new AssetScriptText object + + + + Initializes a new AssetScriptText object with parameters + + A unique specific to this asset + A byte array containing the raw asset data + + + + Encode a string containing the scripts contents into byte encoded AssetData + + + + + Decode a byte array containing the scripts contents into a string + + true if decoding is successful + + + Override the base classes AssetType + + + + Represents a Landmark with RegionID and Position vector + + + + UUID of the Landmark target region + + + Local position of the target + + + Construct an Asset of type Landmark + + + + Construct an Asset object of type Landmark + + A unique specific to this asset + A byte array containing the raw asset data + + + + Encode the raw contents of a string with the specific Landmark format + + + + + Decode the raw asset data, populating the RegionID and Position + + true if the AssetData was successfully decoded to a UUID and Vector + + + Override the base classes AssetType + + + + Represents an that can be worn on an avatar + such as a Shirt, Pants, etc. + + + + Initializes a new instance of an AssetScriptBinary object + + + Initializes a new instance of an AssetScriptBinary object with parameters + A unique specific to this asset + A byte array containing the raw asset data + + + Override the base classes AssetType + + + + Main class to expose grid functionality to clients. All of the + classes needed for sending and receiving data are accessible through + this class. + + + + // Example minimum code required to instantiate class and + // connect to a simulator. + using System; + using System.Collections.Generic; + using System.Text; + using OpenMetaverse; + + namespace FirstBot + { + class Bot + { + public static GridClient Client; + static void Main(string[] args) + { + Client = new GridClient(); // instantiates the GridClient class + // to the global Client object + // Login to Simulator + Client.Network.Login("FirstName", "LastName", "Password", "FirstBot", "1.0"); + // Wait for a Keypress + Console.ReadLine(); + // Logout of simulator + Client.Network.Logout(); + } + } + } + + + + + Networking subsystem + + + Settings class including constant values and changeable + parameters for everything + + + Parcel (subdivided simulator lots) subsystem + + + Our own avatars subsystem + + + Other avatars subsystem + + + Estate subsystem + + + Friends list subsystem + + + Grid (aka simulator group) subsystem + + + Object subsystem + + + Group subsystem + + + Asset subsystem + + + Appearance subsystem + + + Inventory subsystem + + + Directory searches including classifieds, people, land + sales, etc + + + Handles land, wind, and cloud heightmaps + + + Handles sound-related networking + + + Throttling total bandwidth usage, or allocating bandwidth + for specific data stream types + + + + Default constructor + + + + + Return the full name of this instance + + Client avatars full name + + + + Attempts to convert an LLSD structure to a known Packet type + + Event name, this must match an actual + packet name for a Packet to be successfully built + LLSD to convert to a Packet + A Packet on success, otherwise null + + + + Image width + + + + + Image height + + + + + Image channel flags + + + + + Red channel data + + + + + Green channel data + + + + + Blue channel data + + + + + Alpha channel data + + + + + Bump channel data + + + + + Create a new blank image + + width + height + channel flags + + + + + + + + + + Convert the channels in the image. Channels are created or destroyed as required. + + new channel flags + + + + Resize or stretch the image using nearest neighbor (ugly) resampling + + new width + new height + + + + Create a byte array containing 32-bit RGBA data with a bottom-left + origin, suitable for feeding directly into OpenGL + + A byte array containing raw texture data + + + + Represents a texture + + + + A object containing image data + + + + + + + + + Initializes a new instance of an AssetTexture object + + + + Initializes a new instance of an AssetTexture object + + A unique specific to this asset + A byte array containing the raw asset data + + + + Initializes a new instance of an AssetTexture object + + A object containing texture data + + + + Populates the byte array with a JPEG2000 + encoded image created from the data in + + + + + Decodes the JPEG2000 data in AssetData to the + object + + True if the decoding was successful, otherwise false + + + + Decodes the begin and end byte positions for each quality layer in + the image + + + + + Override the base classes AssetType + + + + Temporary code to do the bare minimum required to read a tar archive for our purposes + + + + + Binary reader for the underlying stream + + + + + Used to trim off null chars + + + + + Used to trim off space chars + + + + + Generate a tar reader which reads from the given stream. + + + + + + Read the next entry in the tar file. + + + + the data for the entry. Returns null if there are no more entries + + + + Read the next 512 byte chunk of data as a tar header. + + A tar header struct. null if we have reached the end of the archive. + + + + Read data following a header + + + + + + + Convert octal bytes to a decimal representation + + + + + + + + X position of this patch + + + Y position of this patch + + + A 16x16 array of floats holding decompressed layer data + + + + Creates a LayerData packet for compressed land data given a full + simulator heightmap and an array of indices of patches to compress + + A 256 * 256 array of floating point values + specifying the height at each meter in the simulator + Array of indexes in the 16x16 grid of patches + for this simulator. For example if 1 and 17 are specified, patches + x=1,y=0 and x=1,y=1 are sent + + + + + Add a patch of terrain to a BitPacker + + BitPacker to write the patch to + Heightmap of the simulator, must be a 256 * + 256 float array + X offset of the patch to create, valid values are + from 0 to 15 + Y offset of the patch to create, valid values are + from 0 to 15 + + + + + + + + No report + + + Unknown report type + + + Bug report + + + Complaint report + + + Customer service report + + + + Bitflag field for ObjectUpdateCompressed data blocks, describing + which options are present for each object + + + + Unknown + + + Whether the object has a TreeSpecies + + + Whether the object has floating text ala llSetText + + + Whether the object has an active particle system + + + Whether the object has sound attached to it + + + Whether the object is attached to a root object or not + + + Whether the object has texture animation settings + + + Whether the object has an angular velocity + + + Whether the object has a name value pairs string + + + Whether the object has a Media URL set + + + + Specific Flags for MultipleObjectUpdate requests + + + + None + + + Change position of prims + + + Change rotation of prims + + + Change size of prims + + + Perform operation on link set + + + Scale prims uniformly, same as selecing ctrl+shift in the + viewer. Used in conjunction with Scale + + + + Special values in PayPriceReply. If the price is not one of these + literal value of the price should be use + + + + + Indicates that this pay option should be hidden + + + + + Indicates that this pay option should have the default value + + + + + Contains the variables sent in an object update packet for objects. + Used to track position and movement of prims and avatars + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Handles all network traffic related to prims and avatar positions and + movement. + + + + The event subscribers, null of no subscribers + + + Thread sync lock object + + + The event subscribers, null of no subscribers + + + Raises the ObjectProperties Event + A ObjectPropertiesEventArgs object containing + the data sent from the simulator + + + Thread sync lock object + + + The event subscribers, null of no subscribers + + + Raises the ObjectPropertiesUpdated Event + A ObjectPropertiesUpdatedEventArgs object containing + the data sent from the simulator + + + Thread sync lock object + + + The event subscribers, null of no subscribers + + + Raises the ObjectPropertiesFamily Event + A ObjectPropertiesFamilyEventArgs object containing + the data sent from the simulator + + + Thread sync lock object + + + The event subscribers, null of no subscribers + + + Raises the AvatarUpdate Event + A AvatarUpdateEventArgs object containing + the data sent from the simulator + + + Thread sync lock object + + + The event subscribers, null of no subscribers + + + Thread sync lock object + + + The event subscribers, null of no subscribers + + + Raises the ObjectDataBlockUpdate Event + A ObjectDataBlockUpdateEventArgs object containing + the data sent from the simulator + + + Thread sync lock object + + + The event subscribers, null of no subscribers + + + Raises the KillObject Event + A KillObjectEventArgs object containing + the data sent from the simulator + + + Thread sync lock object + + + The event subscribers, null of no subscribers + + + Raises the AvatarSitChanged Event + A AvatarSitChangedEventArgs object containing + the data sent from the simulator + + + Thread sync lock object + + + The event subscribers, null of no subscribers + + + Raises the PayPriceReply Event + A PayPriceReplyEventArgs object containing + the data sent from the simulator + + + Thread sync lock object + + + Reference to the GridClient object + + + Does periodic dead reckoning calculation to convert + velocity and acceleration to new positions for objects + + + + Construct a new instance of the ObjectManager class + + A reference to the instance + + + + Request information for a single object from a + you are currently connected to + + The the object is located + The Local ID of the object + + + + Request information for multiple objects contained in + the same simulator + + The the objects are located + An array containing the Local IDs of the objects + + + + Attempt to purchase an original object, a copy, or the contents of + an object + + The the object is located + The Local ID of the object + Whether the original, a copy, or the object + contents are on sale. This is used for verification, if the this + sale type is not valid for the object the purchase will fail + Price of the object. This is used for + verification, if it does not match the actual price the purchase + will fail + Group ID that will be associated with the new + purchase + Inventory folder UUID where the object or objects + purchased should be placed + + + BuyObject(Client.Network.CurrentSim, 500, SaleType.Copy, + 100, UUID.Zero, Client.Self.InventoryRootFolderUUID); + + + + + + Request prices that should be displayed in pay dialog. This will triggger the simulator + to send us back a PayPriceReply which can be handled by OnPayPriceReply event + + The the object is located + The ID of the object + The result is raised in the event + + + + Select a single object. This will cause the to send us + an which will raise the event + + The the object is located + The Local ID of the object + + + + + Select a single object. This will cause the to send us + an which will raise the event + + The the object is located + The Local ID of the object + if true, a call to is + made immediately following the request + + + + + Select multiple objects. This will cause the to send us + an which will raise the event + + The the objects are located + An array containing the Local IDs of the objects + Should objects be deselected immediately after selection + + + + + Select multiple objects. This will cause the to send us + an which will raise the event + + The the objects are located + An array containing the Local IDs of the objects + + + + + Update the properties of an object + + The the object is located + The Local ID of the object + true to turn the objects physical property on + true to turn the objects temporary property on + true to turn the objects phantom property on + true to turn the objects cast shadows property on + + + + Sets the sale properties of a single object + + The the object is located + The Local ID of the object + One of the options from the enum + The price of the object + + + + Sets the sale properties of multiple objects + + The the objects are located + An array containing the Local IDs of the objects + One of the options from the enum + The price of the object + + + + Deselect a single object + + The the object is located + The Local ID of the object + + + + Deselect multiple objects. + + The the objects are located + An array containing the Local IDs of the objects + + + + Perform a click action on an object + + The the object is located + The Local ID of the object + + + + Perform a click action (Grab) on a single object + + The the object is located + The Local ID of the object + The texture coordinates to touch + The surface coordinates to touch + The face of the position to touch + The region coordinates of the position to touch + The surface normal of the position to touch (A normal is a vector perpindicular to the surface) + The surface binormal of the position to touch (A binormal is a vector tangen to the surface + pointing along the U direction of the tangent space + + + + Create (rez) a new prim object in a simulator + + A reference to the object to place the object in + Data describing the prim object to rez + Group ID that this prim will be set to, or UUID.Zero if you + do not want the object to be associated with a specific group + An approximation of the position at which to rez the prim + Scale vector to size this prim + Rotation quaternion to rotate this prim + Due to the way client prim rezzing is done on the server, + the requested position for an object is only close to where the prim + actually ends up. If you desire exact placement you'll need to + follow up by moving the object after it has been created. This + function will not set textures, light and flexible data, or other + extended primitive properties + + + + Create (rez) a new prim object in a simulator + + A reference to the object to place the object in + Data describing the prim object to rez + Group ID that this prim will be set to, or UUID.Zero if you + do not want the object to be associated with a specific group + An approximation of the position at which to rez the prim + Scale vector to size this prim + Rotation quaternion to rotate this prim + Specify the + Due to the way client prim rezzing is done on the server, + the requested position for an object is only close to where the prim + actually ends up. If you desire exact placement you'll need to + follow up by moving the object after it has been created. This + function will not set textures, light and flexible data, or other + extended primitive properties + + + + Rez a Linden tree + + A reference to the object where the object resides + The size of the tree + The rotation of the tree + The position of the tree + The Type of tree + The of the group to set the tree to, + or UUID.Zero if no group is to be set + true to use the "new" Linden trees, false to use the old + + + + Rez grass and ground cover + + A reference to the object where the object resides + The size of the grass + The rotation of the grass + The position of the grass + The type of grass from the enum + The of the group to set the tree to, + or UUID.Zero if no group is to be set + + + + Set the textures to apply to the faces of an object + + A reference to the object where the object resides + The objects ID which is local to the simulator the object is in + The texture data to apply + + + + Set the textures to apply to the faces of an object + + A reference to the object where the object resides + The objects ID which is local to the simulator the object is in + The texture data to apply + A media URL (not used) + + + + Set the Light data on an object + + A reference to the object where the object resides + The objects ID which is local to the simulator the object is in + A object containing the data to set + + + + Set the flexible data on an object + + A reference to the object where the object resides + The objects ID which is local to the simulator the object is in + A object containing the data to set + + + + Set the sculptie texture and data on an object + + A reference to the object where the object resides + The objects ID which is local to the simulator the object is in + A object containing the data to set + + + + Unset additional primitive parameters on an object + + A reference to the object where the object resides + The objects ID which is local to the simulator the object is in + The extra parameters to set + + + + Link multiple prims into a linkset + + A reference to the object where the objects reside + An array which contains the IDs of the objects to link + The last object in the array will be the root object of the linkset TODO: Is this true? + + + + Delink/Unlink multiple prims from a linkset + + A reference to the object where the objects reside + An array which contains the IDs of the objects to delink + + + + Change the rotation of an object + + A reference to the object where the object resides + The objects ID which is local to the simulator the object is in + The new rotation of the object + + + + Set the name of an object + + A reference to the object where the object resides + The objects ID which is local to the simulator the object is in + A string containing the new name of the object + + + + Set the name of multiple objects + + A reference to the object where the objects reside + An array which contains the IDs of the objects to change the name of + An array which contains the new names of the objects + + + + Set the description of an object + + A reference to the object where the object resides + The objects ID which is local to the simulator the object is in + A string containing the new description of the object + + + + Set the descriptions of multiple objects + + A reference to the object where the objects reside + An array which contains the IDs of the objects to change the description of + An array which contains the new descriptions of the objects + + + + Attach an object to this avatar + + A reference to the object where the object resides + The objects ID which is local to the simulator the object is in + The point on the avatar the object will be attached + The rotation of the attached object + + + + Drop an attached object from this avatar + + A reference to the + object where the objects reside. This will always be the simulator the avatar is currently in + + The object's ID which is local to the simulator the object is in + + + + Detach an object from yourself + + A reference to the + object where the objects reside + + This will always be the simulator the avatar is currently in + + An array which contains the IDs of the objects to detach + + + + Change the position of an object, Will change position of entire linkset + + A reference to the object where the object resides + The objects ID which is local to the simulator the object is in + The new position of the object + + + + Change the position of an object + + A reference to the object where the object resides + The objects ID which is local to the simulator the object is in + The new position of the object + if true, will change position of (this) child prim only, not entire linkset + + + + Change the Scale (size) of an object + + A reference to the object where the object resides + The objects ID which is local to the simulator the object is in + The new scale of the object + If true, will change scale of this prim only, not entire linkset + True to resize prims uniformly + + + + Change the Rotation of an object that is either a child or a whole linkset + + A reference to the object where the object resides + The objects ID which is local to the simulator the object is in + The new scale of the object + If true, will change rotation of this prim only, not entire linkset + + + + Send a Multiple Object Update packet to change the size, scale or rotation of a primitive + + A reference to the object where the object resides + The objects ID which is local to the simulator the object is in + The new rotation, size, or position of the target object + The flags from the Enum + + + + Deed an object (prim) to a group, Object must be shared with group which + can be accomplished with SetPermissions() + + A reference to the object where the object resides + The objects ID which is local to the simulator the object is in + The of the group to deed the object to + + + + Deed multiple objects (prims) to a group, Objects must be shared with group which + can be accomplished with SetPermissions() + + A reference to the object where the object resides + An array which contains the IDs of the objects to deed + The of the group to deed the object to + + + + Set the permissions on multiple objects + + A reference to the object where the objects reside + An array which contains the IDs of the objects to set the permissions on + The new Who mask to set + The new Permissions mark to set + TODO: What does this do? + + + + Request additional properties for an object + + A reference to the object where the object resides + + + + + Request additional properties for an object + + A reference to the object where the object resides + Absolute UUID of the object + Whether to require server acknowledgement of this request + + + + Set the ownership of a list of objects to the specified group + + A reference to the object where the objects reside + An array which contains the IDs of the objects to set the group id on + The Groups ID + + + + Update current URL of the previously set prim media + + UUID of the prim + Set current URL to this + Prim face number + Simulator in which prim is located + + + + Set object media + + UUID of the prim + Array the length of prims number of faces. Null on face indexes where there is + no media, on faces which contain the media + Simulatior in which prim is located + + + + Retrieve information about object media + + UUID of the primitive + Simulator where prim is located + Call this callback when done + + + Process an incoming packet and raise the appropriate events + The sender + The EventArgs object containing the packet data + + + + A terse object update, used when a transformation matrix or + velocity/acceleration for an object changes but nothing else + (scale/position/rotation/acceleration/velocity) + + The sender + The EventArgs object containing the packet data + + + Process an incoming packet and raise the appropriate events + The sender + The EventArgs object containing the packet data + + + Process an incoming packet and raise the appropriate events + The sender + The EventArgs object containing the packet data + + + Process an incoming packet and raise the appropriate events + The sender + The EventArgs object containing the packet data + + + Process an incoming packet and raise the appropriate events + The sender + The EventArgs object containing the packet data + + + Process an incoming packet and raise the appropriate events + The sender + The EventArgs object containing the packet data + + + Process an incoming packet and raise the appropriate events + The sender + The EventArgs object containing the packet data + + + + Setup construction data for a basic primitive shape + + Primitive shape to construct + Construction data that can be plugged into a + + + + + + + + + + + + + + + + + + + + Set the Shape data of an object + + A reference to the object where the object resides + The objects ID which is local to the simulator the object is in + Data describing the prim shape + + + + Set the Material data of an object + + A reference to the object where the object resides + The objects ID which is local to the simulator the object is in + The new material of the object + + + + + + + + + + + + + + + + + + + + + Raised when the simulator sends us data containing + A , Foliage or Attachment + + + + + Raised when the simulator sends us data containing + additional information + + + + + Raised when the simulator sends us data containing + Primitive.ObjectProperties for an object we are currently tracking + + + Raised when the simulator sends us data containing + additional and details + + + + Raised when the simulator sends us data containing + updated information for an + + + Raised when the simulator sends us data containing + and movement changes + + + Raised when the simulator sends us data containing + updates to an Objects DataBlock + + + Raised when the simulator informs us an + or is no longer within view + + + Raised when the simulator sends us data containing + updated sit information for our + + + Raised when the simulator sends us data containing + purchase price information for a + + + + Callback for getting object media data via CAP + + Indicates if the operation was succesfull + Object media version string + Array indexed on prim face of media entry data + + + Provides data for the event + The event occurs when the simulator sends + an containing a Primitive, Foliage or Attachment data + Note 1: The event will not be raised when the object is an Avatar + Note 2: It is possible for the to be + raised twice for the same object if for example the primitive moved to a new simulator, then returned to the current simulator or + if an Avatar crosses the border into a new simulator and returns to the current simulator + + + The following code example uses the , , and + properties to display new Primitives and Attachments on the window. + + // Subscribe to the event that gives us prim and foliage information + Client.Objects.ObjectUpdate += Objects_ObjectUpdate; + + + private void Objects_ObjectUpdate(object sender, PrimEventArgs e) + { + Console.WriteLine("Primitive {0} {1} in {2} is an attachment {3}", e.Prim.ID, e.Prim.LocalID, e.Simulator.Name, e.IsAttachment); + } + + + + + + + + + Construct a new instance of the PrimEventArgs class + + The simulator the object originated from + The Primitive + The simulator time dilation + The prim was not in the dictionary before this update + true if the primitive represents an attachment to an agent + + + Get the simulator the originated from + + + Get the details + + + true if the did not exist in the dictionary before this update (always true if object tracking has been disabled) + + + true if the is attached to an + + + Get the simulator Time Dilation + + + Provides data for the event + The event occurs when the simulator sends + an containing Avatar data + Note 1: The event will not be raised when the object is an Avatar + Note 2: It is possible for the to be + raised twice for the same avatar if for example the avatar moved to a new simulator, then returned to the current simulator + + + The following code example uses the property to make a request for the top picks + using the method in the class to display the names + of our own agents picks listings on the window. + + // subscribe to the AvatarUpdate event to get our information + Client.Objects.AvatarUpdate += Objects_AvatarUpdate; + Client.Avatars.AvatarPicksReply += Avatars_AvatarPicksReply; + + private void Objects_AvatarUpdate(object sender, AvatarUpdateEventArgs e) + { + // we only want our own data + if (e.Avatar.LocalID == Client.Self.LocalID) + { + // Unsubscribe from the avatar update event to prevent a loop + // where we continually request the picks every time we get an update for ourselves + Client.Objects.AvatarUpdate -= Objects_AvatarUpdate; + // make the top picks request through AvatarManager + Client.Avatars.RequestAvatarPicks(e.Avatar.ID); + } + } + + private void Avatars_AvatarPicksReply(object sender, AvatarPicksReplyEventArgs e) + { + // we'll unsubscribe from the AvatarPicksReply event since we now have the data + // we were looking for + Client.Avatars.AvatarPicksReply -= Avatars_AvatarPicksReply; + // loop through the dictionary and extract the names of the top picks from our profile + foreach (var pickName in e.Picks.Values) + { + Console.WriteLine(pickName); + } + } + + + + + + + + Construct a new instance of the AvatarUpdateEventArgs class + + The simulator the packet originated from + The data + The simulator time dilation + The avatar was not in the dictionary before this update + + + Get the simulator the object originated from + + + Get the data + + + Get the simulator time dilation + + + true if the did not exist in the dictionary before this update (always true if avatar tracking has been disabled) + + + Provides additional primitive data for the event + The event occurs when the simulator sends + an containing additional details for a Primitive, Foliage data or Attachment data + The event is also raised when a request is + made. + + + The following code example uses the , and + + properties to display new attachments and send a request for additional properties containing the name of the + attachment then display it on the window. + + // Subscribe to the event that provides additional primitive details + Client.Objects.ObjectProperties += Objects_ObjectProperties; + + // handle the properties data that arrives + private void Objects_ObjectProperties(object sender, ObjectPropertiesEventArgs e) + { + Console.WriteLine("Primitive Properties: {0} Name is {1}", e.Properties.ObjectID, e.Properties.Name); + } + + + + + + Construct a new instance of the ObjectPropertiesEventArgs class + + The simulator the object is located + The primitive Properties + + + Get the simulator the object is located + + + Get the primitive properties + + + Provides additional primitive data for the event + The event occurs when the simulator sends + an containing additional details for a Primitive or Foliage data that is currently + being tracked in the dictionary + The event is also raised when a request is + made and is enabled + + + + + Construct a new instance of the ObjectPropertiesUpdatedEvenrArgs class + + The simulator the object is located + The Primitive + The primitive Properties + + + Get the simulator the object is located + + + Get the primitive details + + + Get the primitive properties + + + Provides additional primitive data, permissions and sale info for the event + The event occurs when the simulator sends + an containing additional details for a Primitive, Foliage data or Attachment. This includes + Permissions, Sale info, and other basic details on an object + The event is also raised when a request is + made, the viewer equivalent is hovering the mouse cursor over an object + + + + Get the simulator the object is located + + + + + + + + + Provides primitive data containing updated location, velocity, rotation, textures for the event + The event occurs when the simulator sends updated location, velocity, rotation, etc + + + + Get the simulator the object is located + + + Get the primitive details + + + + + + + + + + + + + + Get the simulator the object is located + + + Get the primitive details + + + + + + + + + + + + + + + Provides notification when an Avatar, Object or Attachment is DeRezzed or moves out of the avatars view for the + event + + + Get the simulator the object is located + + + The LocalID of the object + + + + Provides updates sit position data + + + + Get the simulator the object is located + + + + + + + + + + + + + + + + + Get the simulator the object is located + + + + + + + + + + + + + Indicates if the operation was successful + + + + + Media version string + + + + + Array of media entries indexed by face number + + + + + + + + + + + + + + + + De-serialization constructor for the InventoryNode Class + + + + + Serialization handler for the InventoryNode Class + + + + + De-serialization handler for the InventoryNode Class + + + + + + + + + + + + + + + + + + + + + + + For inventory folder nodes specifies weather the folder needs to be + refreshed from the server + + + + + + + + + The avatar has no rights + + + The avatar can see the online status of the target avatar + + + The avatar can see the location of the target avatar on the map + + + The avatar can modify the ojects of the target avatar + + + + This class holds information about an avatar in the friends list. There are two ways + to interface to this class. The first is through the set of boolean properties. This is the typical + way clients of this class will use it. The second interface is through two bitflag properties, + TheirFriendsRights and MyFriendsRights + + + + + Used internally when building the initial list of friends at login time + + System ID of the avatar being prepesented + Rights the friend has to see you online and to modify your objects + Rights you have to see your friend online and to modify their objects + + + + FriendInfo represented as a string + + A string reprentation of both my rights and my friends rights + + + + System ID of the avatar + + + + + full name of the avatar + + + + + True if the avatar is online + + + + + True if the friend can see if I am online + + + + + True if the friend can see me on the map + + + + + True if the freind can modify my objects + + + + + True if I can see if my friend is online + + + + + True if I can see if my friend is on the map + + + + + True if I can modify my friend's objects + + + + + My friend's rights represented as bitmapped flags + + + + + My rights represented as bitmapped flags + + + + + This class is used to add and remove avatars from your friends list and to manage their permission. + + + + The event subscribers. null if no subcribers + + + Raises the FriendOnline event + A FriendInfoEventArgs object containing the + data returned from the data server + + + Thread sync lock object + + + The event subscribers. null if no subcribers + + + Raises the FriendOffline event + A FriendInfoEventArgs object containing the + data returned from the data server + + + Thread sync lock object + + + The event subscribers. null if no subcribers + + + Raises the FriendRightsUpdate event + A FriendInfoEventArgs object containing the + data returned from the data server + + + Thread sync lock object + + + The event subscribers. null if no subcribers + + + Raises the FriendNames event + A FriendNamesEventArgs object containing the + data returned from the data server + + + Thread sync lock object + + + The event subscribers. null if no subcribers + + + Raises the FriendshipOffered event + A FriendshipOfferedEventArgs object containing the + data returned from the data server + + + Thread sync lock object + + + The event subscribers. null if no subcribers + + + Raises the FriendshipResponse event + A FriendshipResponseEventArgs object containing the + data returned from the data server + + + Thread sync lock object + + + The event subscribers. null if no subcribers + + + Raises the FriendshipTerminated event + A FriendshipTerminatedEventArgs object containing the + data returned from the data server + + + Thread sync lock object + + + The event subscribers. null if no subcribers + + + Raises the FriendFoundReply event + A FriendFoundReplyEventArgs object containing the + data returned from the data server + + + Thread sync lock object + + + + A dictionary of key/value pairs containing known friends of this avatar. + + The Key is the of the friend, the value is a + object that contains detailed information including permissions you have and have given to the friend + + + + + A Dictionary of key/value pairs containing current pending frienship offers. + + The key is the of the avatar making the request, + the value is the of the request which is used to accept + or decline the friendship offer + + + + + Internal constructor + + A reference to the GridClient Object + + + + Accept a friendship request + + agentID of avatatar to form friendship with + imSessionID of the friendship request message + + + + Decline a friendship request + + of friend + imSessionID of the friendship request message + + + + Overload: Offer friendship to an avatar. + + System ID of the avatar you are offering friendship to + + + + Offer friendship to an avatar. + + System ID of the avatar you are offering friendship to + A message to send with the request + + + + Terminate a friendship with an avatar + + System ID of the avatar you are terminating the friendship with + + + Process an incoming packet and raise the appropriate events + The sender + The EventArgs object containing the packet data + + + + Change the rights of a friend avatar. + + the of the friend + the new rights to give the friend + This method will implicitly set the rights to those passed in the rights parameter. + + + + Use to map a friends location on the grid. + + Friends UUID to find + + + + + Use to track a friends movement on the grid + + Friends Key + + + + Ask for a notification of friend's online status + + Friend's UUID + + + + This handles the asynchronous response of a RequestAvatarNames call. + + + names cooresponding to the the list of IDs sent the the RequestAvatarNames call. + + + Process an incoming packet and raise the appropriate events + The sender + The EventArgs object containing the packet data + + + Process an incoming packet and raise the appropriate events + The sender + The EventArgs object containing the packet data + + + Process an incoming packet and raise the appropriate events + The sender + The EventArgs object containing the packet data + + + Process an incoming packet and raise the appropriate events + The sender + The EventArgs object containing the packet data + + + + Populate FriendList with data from the login reply + + true if login was successful + true if login request is requiring a redirect + A string containing the response to the login request + A string containing the reason for the request + A object containing the decoded + reply from the login server + + + Raised when the simulator sends notification one of the members in our friends list comes online + + + Raised when the simulator sends notification one of the members in our friends list goes offline + + + Raised when the simulator sends notification one of the members in our friends list grants or revokes permissions + + + Raised when the simulator sends us the names on our friends list + + + Raised when the simulator sends notification another agent is offering us friendship + + + Raised when a request we sent to friend another agent is accepted or declined + + + Raised when the simulator sends notification one of the members in our friends list has terminated + our friendship + + + Raised when the simulator sends the location of a friend we have + requested map location info for + + + Contains information on a member of our friends list + + + + Construct a new instance of the FriendInfoEventArgs class + + The FriendInfo + + + Get the FriendInfo + + + Contains Friend Names + + + + Construct a new instance of the FriendNamesEventArgs class + + A dictionary where the Key is the ID of the Agent, + and the Value is a string containing their name + + + A dictionary where the Key is the ID of the Agent, + and the Value is a string containing their name + + + Sent when another agent requests a friendship with our agent + + + + Construct a new instance of the FriendshipOfferedEventArgs class + + The ID of the agent requesting friendship + The name of the agent requesting friendship + The ID of the session, used in accepting or declining the + friendship offer + + + Get the ID of the agent requesting friendship + + + Get the name of the agent requesting friendship + + + Get the ID of the session, used in accepting or declining the + friendship offer + + + A response containing the results of our request to form a friendship with another agent + + + + Construct a new instance of the FriendShipResponseEventArgs class + + The ID of the agent we requested a friendship with + The name of the agent we requested a friendship with + true if the agent accepted our friendship offer + + + Get the ID of the agent we requested a friendship with + + + Get the name of the agent we requested a friendship with + + + true if the agent accepted our friendship offer + + + Contains data sent when a friend terminates a friendship with us + + + + Construct a new instance of the FrindshipTerminatedEventArgs class + + The ID of the friend who terminated the friendship with us + The name of the friend who terminated the friendship with us + + + Get the ID of the agent that terminated the friendship with us + + + Get the name of the agent that terminated the friendship with us + + + + Data sent in response to a request which contains the information to allow us to map the friends location + + + + + Construct a new instance of the FriendFoundReplyEventArgs class + + The ID of the agent we have requested location information for + The region handle where our friend is located + The simulator local position our friend is located + + + Get the ID of the agent we have received location information for + + + Get the region handle where our mapped friend is located + + + Get the simulator local position where our friend is located + + + + Reads in a byte array of an Animation Asset created by the SecondLife(tm) client. + + + + + Rotation Keyframe count (used internally) + + + + + Position Keyframe count (used internally) + + + + + Animation Priority + + + + + The animation length in seconds. + + + + + Expression set in the client. Null if [None] is selected + + + + + The time in seconds to start the animation + + + + + The time in seconds to end the animation + + + + + Loop the animation + + + + + Meta data. Ease in Seconds. + + + + + Meta data. Ease out seconds. + + + + + Meta Data for the Hand Pose + + + + + Number of joints defined in the animation + + + + + Contains an array of joints + + + + + Searialize an animation asset into it's joints/keyframes/meta data + + + + + + Variable length strings seem to be null terminated in the animation asset.. but.. + use with caution, home grown. + advances the index. + + The animation asset byte array + The offset to start reading + a string + + + + Read in a Joint from an animation asset byte array + Variable length Joint fields, yay! + Advances the index + + animation asset byte array + Byte Offset of the start of the joint + The Joint data serialized into the binBVHJoint structure + + + + Read Keyframes of a certain type + advance i + + Animation Byte array + Offset in the Byte Array. Will be advanced + Number of Keyframes + Scaling Min to pass to the Uint16ToFloat method + Scaling Max to pass to the Uint16ToFloat method + + + + + A Joint and it's associated meta data and keyframes + + + + + Name of the Joint. Matches the avatar_skeleton.xml in client distros + + + + + Joint Animation Override? Was the same as the Priority in testing.. + + + + + Array of Rotation Keyframes in order from earliest to latest + + + + + Array of Position Keyframes in order from earliest to latest + This seems to only be for the Pelvis? + + + + + A Joint Keyframe. This is either a position or a rotation. + + + + + Either a Vector3 position or a Vector3 Euler rotation + + + + + Poses set in the animation metadata for the hands. + + + + + The type of bump-mapping applied to a face + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + The level of shininess applied to a face + + + + + + + + + + + + + + + + + The texture mapping style used for a face + + + + + + + + + + + + + + + + + Flags in the TextureEntry block that describe which properties are + set + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Represents an AssetScriptBinary object containing the + LSO compiled bytecode of an LSL script + + + + Initializes a new instance of an AssetScriptBinary object + + + Initializes a new instance of an AssetScriptBinary object with parameters + A unique specific to this asset + A byte array containing the raw asset data + + + + TODO: Encodes a scripts contents into a LSO Bytecode file + + + + + TODO: Decode LSO Bytecode into a string + + true + + + Override the base classes AssetType + + + + Temporary code to produce a tar archive in tar v7 format + + + + + Binary writer for the underlying stream + + + + + Write a directory entry to the tar archive. We can only handle one path level right now! + + + + + + Write a file to the tar archive + + + + + + + Write a file to the tar archive + + + + + + + Finish writing the raw tar archive data to a stream. The stream will be closed on completion. + + + + + Write a particular entry + + + + + + + + + + + + + + + + + + + Thrown when a packet could not be successfully deserialized @@ -6577,12 +18028,6 @@ - - - - - - @@ -6700,12 +18145,6 @@ - - - - - - @@ -7582,18 +19021,6 @@ - - - - - - - - - - - - @@ -7726,12 +19153,6 @@ - - - - - - @@ -8389,21 +19810,6 @@ - - - - - - - - - - - - - - - @@ -8476,15 +19882,6 @@ - - - - - - - - - @@ -8614,6 +20011,15 @@ + + + + + + + + + @@ -8956,6 +20362,12 @@ + + + + + + @@ -8974,2040 +20386,80 @@ - + - + Represents a single Voice Session to the Vivox service. - - The avatar has no rights - - - The avatar can see the online status of the target avatar - - - The avatar can see the location of the target avatar on the map - - - The avatar can modify the ojects of the target avatar - - - - This class holds information about an avatar in the friends list. There are two ways - to interface to this class. The first is through the set of boolean properties. This is the typical - way clients of this class will use it. The second interface is through two bitflag properties, - TheirFriendsRights and MyFriendsRights - - - - - Used internally when building the initial list of friends at login time - - System ID of the avatar being prepesented - Rights the friend has to see you online and to modify your objects - Rights you have to see your friend online and to modify their objects - - - - FriendInfo represented as a string - - A string reprentation of both my rights and my friends rights - - - - System ID of the avatar - - - - - full name of the avatar - - - - - True if the avatar is online - - - - - True if the friend can see if I am online - - - - - True if the friend can see me on the map - - - - - True if the freind can modify my objects - - - - - True if I can see if my friend is online - - - - - True if I can see if my friend is on the map - - - - - True if I can modify my friend's objects - - - - - My friend's rights represented as bitmapped flags - - - - - My rights represented as bitmapped flags - - - - - This class is used to add and remove avatars from your friends list and to manage their permission. - - - - - A dictionary of key/value pairs containing known friends of this avatar. - - The Key is the of the friend, the value is a - object that contains detailed information including permissions you have and have given to the friend - - - - - A Dictionary of key/value pairs containing current pending frienship offers. - - The key is the of the avatar making the request, - the value is the of the request which is used to accept - or decline the friendship offer - - - - - Internal constructor - - A reference to the GridClient Object - - - - Accept a friendship request - - agentID of avatatar to form friendship with - imSessionID of the friendship request message - - - - Decline a friendship request - - of friend - imSessionID of the friendship request message - - - - Overload: Offer friendship to an avatar. - - System ID of the avatar you are offering friendship to - - - - Offer friendship to an avatar. - - System ID of the avatar you are offering friendship to - A message to send with the request - - - - Terminate a friendship with an avatar - - System ID of the avatar you are terminating the friendship with - - - - Fired when another friend terminates friendship. We need to remove them from - our cached list. - - - - - - - Change the rights of a friend avatar. - - the of the friend - the new rights to give the friend - This method will implicitly set the rights to those passed in the rights parameter. - - - - Use to map a friends location on the grid. - - Friends UUID to find - - - - - Use to track a friends movement on the grid - - Friends Key - - - - Called when a connection to the SL server is established. The list of friend avatars - is populated from XML returned by the login server. That list contains the avatar's id - and right, but no names. Here is where those names are requested. - - - - - - This handles the asynchronous response of a RequestAvatarNames call. - - names cooresponding to the the list of IDs sent the the RequestAvatarNames call. - - - - Handle notifications sent when a friends has come online. - - - - - - - Handle notifications sent when a friends has gone offline. - - - - - - - Handle notifications sent when a friend rights change. This notification is also received - when my own rights change. - - - - - - - Handle friend location updates - - The Packet - The Simulator - - - - Handles relevant messages from the server encapsulated in instant messages. - - InstantMessage object containing encapsalated instant message - Originating Simulator - - - - Populate FriendList with data from the login reply - - true if login was successful - true if login request is requiring a redirect - A string containing the response to the login request - A string containing the reason for the request - A object containing the decoded - reply from the login server - - - - Triggered when an avatar in your friends list comes online - - System ID of the avatar - - - - Triggered when an avatar in your friends list goes offline - - System ID of the avatar - - - - Triggered in response to a call to the FriendRights() method, or when a friend changes your rights - - System ID of the avatar you changed the right of - - - - Triggered when names on the friend list are received after the initial request upon login - - - - - - Triggered when someone offers you friendship - - System ID of the agent offering friendship - full name of the agent offereing friendship - session ID need when accepting/declining the offer - Return true to accept the friendship, false to deny it - - - - Trigger when your friendship offer has been accepted or declined - - System ID of the avatar who accepted your friendship offer - Full name of the avatar who accepted your friendship offer - Whether the friendship request was accepted or declined - - - - Trigger when someone terminates your friendship. - - System ID of the avatar who terminated your friendship - Full name of the avatar who terminated your friendship - - - - Triggered in response to a FindFriend request - - Friends Key - region handle friend is in - X/Y location of friend - - - - - - Looking direction, must be a normalized vector - Up direction, must be a normalized vector - - - - Align the coordinate frame X and Y axis with a given rotation - around the Z axis in radians - - Absolute rotation around the Z axis in - radians - - - Origin position of this coordinate frame - - - X axis of this coordinate frame, or Forward/At in grid terms - - - Y axis of this coordinate frame, or Left in grid terms - - - Z axis of this coordinate frame, or Up in grid terms - - - - Manager class for our own avatar - - - - Reference to the GridClient instance - - - Used for movement and camera tracking - - - Currently playing animations for the agent. Can be used to - check the current movement status such as walking, hovering, aiming, - etc. by checking for system animations in the Animations class - - - Dictionary containing current Group Chat sessions and members - - - - Constructor, setup callbacks for packets related to our avatar - - A reference to the Class - - - - Send a text message from the Agent to the Simulator - - A containing the message - The channel to send the message on, 0 is the public channel. Channels above 0 - can be used however only scripts listening on the specified channel will see the message - Denotes the type of message being sent, shout, whisper, etc. - - - - Request any instant messages sent while the client was offline to be resent. - - - - - Send an Instant Message to another Avatar - - The recipients - A containing the message to send - - - - Send an Instant Message to an existing group chat or conference chat - - The recipients - A containing the message to send - IM session ID (to differentiate between IM windows) - - - - Send an Instant Message - - The name this IM will show up as being from - Key of Avatar - Text message being sent - IM session ID (to differentiate between IM windows) - IDs of sessions for a conference - - - - Send an Instant Message - - The name this IM will show up as being from - Key of Avatar - Text message being sent - IM session ID (to differentiate between IM windows) - Type of instant message to send - Whether to IM offline avatars as well - Senders Position - RegionID Sender is In - Packed binary data that is specific to - the dialog type - - - - Send an Instant Message to a group - - of the group to send message to - Text Message being sent. - - - - Send an Instant Message to a group the agent is a member of - - The name this IM will show up as being from - of the group to send message to - Text message being sent - - - - Send a request to join a group chat session - - of Group to leave - - - - Exit a group chat session. This will stop further Group chat messages - from being sent until session is rejoined. - - of Group chat session to leave - - - - Reply to script dialog questions. - - Channel initial request came on - Index of button you're "clicking" - Label of button you're "clicking" - of Object that sent the dialog request - - - - - Accept invite for to a chatterbox session - - of session to accept invite to - - - - Start a friends conference - - List of UUIDs to start a conference with - the temportary session ID returned in the callback> - - - - Start a particle stream between an agent and an object - - Key of the source agent - Key of the target object - - The type from the enum - A unique for this effect - - - - Start a particle stream between an agent and an object - - Key of the source agent - Key of the target object - A representing the beams offset from the source - A which sets the avatars lookat animation - of the Effect - - - - Create a particle beam between an avatar and an primitive - - of sources avatar - of the target - global offset - Color values of beam - a float representing the duration the beam will last - of the Effect - - - - Create a particle swirl around a target position - - Target's global position - Color values of beam - A float representing the duration the swirl will last - of the Effect - - - - Sends a request to sit on the specified object - - of the object to sit on - Sit at offset - - - - Follows a call to to actually sit on the object - - - - Stands up from sitting on a prim or the ground - true of AgentUpdate was sent - - - - Does a "ground sit" at the avatar's current position - - - - - Starts or stops flying - - True to start flying, false to stop flying - - - - Starts or stops crouching - - True to start crouching, false to stop crouching - - - - Starts a jump (begin holding the jump key) - - - - - Use the autopilot sim function to move the avatar to a new - position. Uses double precision to get precise movements - - The z value is currently not handled properly by the simulator - Global X coordinate to move to - Global Y coordinate to move to - Z coordinate to move to - - - - Use the autopilot sim function to move the avatar to a new position - - The z value is currently not handled properly by the simulator - Integer value for the global X coordinate to move to - Integer value for the global Y coordinate to move to - Floating-point value for the Z coordinate to move to - - - - Use the autopilot sim function to move the avatar to a new position - - The z value is currently not handled properly by the simulator - Integer value for the local X coordinate to move to - Integer value for the local Y coordinate to move to - Floating-point value for the Z coordinate to move to - - - Macro to cancel autopilot sim function - Not certain if this is how it is really done - true if control flags were set and AgentUpdate was sent to the simulator - - - - Grabs an object - - an unsigned integer of the objects ID within the simulator - - - - - Overload: Grab a simulated object - - an unsigned integer of the objects ID within the simulator - - - - - - - - - - - Drag an object - - of the object to drag - Drag target in region coordinates - - - - Overload: Drag an object - - of the object to drag - Drag target in region coordinates - - - - - - - - - - - Release a grabbed object - - The Objects Simulator Local ID - - - - - - - Release a grabbed object - - The Objects Simulator Local ID - - - - - - - - - - Touches an object - - an unsigned integer of the objects ID within the simulator - - - - - Request the current L$ balance - - - - - Give Money to destination Avatar - - UUID of the Target Avatar - Amount in L$ - - - - Give Money to destination Avatar - - UUID of the Target Avatar - Amount in L$ - Description that will show up in the - recipients transaction history - - - - Give L$ to an object - - object to give money to - amount of L$ to give - name of object - - - - Give L$ to a group - - group to give money to - amount of L$ to give - - - - Give L$ to a group - - group to give money to - amount of L$ to give - description of transaction - - - - Pay texture/animation upload fee - - - - - Pay texture/animation upload fee - - description of the transaction - - - - Give Money to destionation Object or Avatar - - UUID of the Target Object/Avatar - Amount in L$ - Reason (Optional normally) - The type of transaction - Transaction flags, mostly for identifying group - transactions - - - - Plays a gesture - - Asset of the gesture - - - - Mark gesture active - - Inventory of the gesture - Asset of the gesture - - - - Mark gesture inactive - - Inventory of the gesture - - - - Send an AgentAnimation packet that toggles a single animation on - - The of the animation to start playing - Whether to ensure delivery of this packet or not - - - - Send an AgentAnimation packet that toggles a single animation off - - The of a - currently playing animation to stop playing - Whether to ensure delivery of this packet or not - - - - Send an AgentAnimation packet that will toggle animations on or off - - A list of animation s, and whether to - turn that animation on or off - Whether to ensure delivery of this packet or not - - - - Teleports agent to their stored home location - - true on successful teleport to home location - - - - Teleport agent to a landmark - - of the landmark to teleport agent to - true on success, false on failure - - - - Attempt to look up a simulator name and teleport to the discovered - destination - - Region name to look up - Position to teleport to - True if the lookup and teleport were successful, otherwise - false - - - - Attempt to look up a simulator name and teleport to the discovered - destination - - Region name to look up - Position to teleport to - Target to look at - True if the lookup and teleport were successful, otherwise - false - - - - Teleport agent to another region - - handle of region to teleport agent to - position in destination sim to teleport to - true on success, false on failure - This call is blocking - - - - Teleport agent to another region - - handle of region to teleport agent to - position in destination sim to teleport to - direction in destination sim agent will look at - true on success, false on failure - This call is blocking - - - - Request teleport to a another simulator - - handle of region to teleport agent to - position in destination sim to teleport to - - - - Request teleport to a another simulator - - handle of region to teleport agent to - position in destination sim to teleport to - direction in destination sim agent will look at - - - - Teleport agent to a landmark - - of the landmark to teleport agent to - - - - Send a teleport lure to another avatar with default "Join me in ..." invitation message - - target avatars to lure - - - - Send a teleport lure to another avatar with custom invitation message - - target avatars to lure - custom message to send with invitation - - - - Respond to a teleport lure by either accepting it and initiating - the teleport, or denying it - - of the avatar sending the lure - true to accept the lure, false to decline it - - - - Update agent profile - - struct containing updated - profile information - - - - Update agents profile interests - - selection of interests from struct - - - - Set the height and the width of the client window. This is used - by the server to build a virtual camera frustum for our avatar - - New height of the viewer window - New width of the viewer window - - - - Request the list of muted objects and avatars for this agent - - - - - Sets home location to agents current position - - will fire an AlertMessage () with - success or failure message - - - - Move an agent in to a simulator. This packet is the last packet - needed to complete the transition in to a new simulator - - Object - - - - Reply to script permissions request - - Object - of the itemID requesting permissions - of the taskID requesting permissions - list of permissions to allow - - - - Respond to a group invitation by either accepting or denying it - - UUID of the group (sent in the AgentID field of the invite message) - IM Session ID from the group invitation message - Accept the group invitation or deny it - - - - Requests script detection of objects and avatars - - name of the object/avatar to search for - UUID of the object or avatar to search for - Type of search from ScriptSensorTypeFlags - range of scan (96 max?) - the arc in radians to search within - an user generated ID to correlate replies with - Simulator to perform search in - - - - Create or update profile pick - - UUID of the pick to update, or random UUID to create a new pick - Is this a top pick? (typically false) - UUID of the parcel (UUID.Zero for the current parcel) - Name of the pick - Global position of the pick landmark - UUID of the image displayed with the pick - Long description of the pick - - - - Delete profile pick - - UUID of the pick to delete - - - - Create or update profile Classified - - UUID of the classified to update, or random UUID to create a new classified - Defines what catagory the classified is in - UUID of the image displayed with the classified - Price that the classified will cost to place for a week - Global position of the classified landmark - Name of the classified - Long description of the classified - if true, auto renew classified after expiration - - - - Delete a classified ad - - The classified ads ID - - - - Take an incoming ImprovedInstantMessage packet, auto-parse, and if - OnInstantMessage is defined call that with the appropriate arguments - - Incoming ImprovedInstantMessagePacket - Unused - - - - Take an incoming Chat packet, auto-parse, and if OnChat is defined call - that with the appropriate arguments. - - Incoming ChatFromSimulatorPacket - Unused - - - - Used for parsing llDialogs - - Incoming ScriptDialog packet - Unused - - - - Used for parsing llRequestPermissions dialogs - - Incoming ScriptDialog packet - Unused - - - - Handles Script Control changes when Script with permissions releases or takes a control - - - - - - - Used for parsing llLoadURL Dialogs - - - - - - - Update client's Position, LookAt and region handle from incoming packet - - Incoming AgentMovementCompletePacket - Unused - This occurs when after an avatar moves into a new sim - - - - Update Client Avatar's health via incoming packet - - Incoming HealthMessagePacket - Unused - - - - Update Client Avatar's L$ balance from incoming packet - - Incoming MoneyBalanceReplyPacket - Unused - - - - Process TeleportFailed message sent via EventQueue, informs agent its last teleport has failed and why. - - The Message Key - An IMessage object Deserialized from the recieved message event - The simulator originating the event message - - - - Process TeleportFinish from Event Queue and pass it onto our TeleportHandler - - The message system key for this event - IMessage object containing decoded data from OSD - The simulator originating the event message - - - - Handler for teleport Requests - - Incoming TeleportHandler packet - Simulator sending teleport information - - - - - - - - - - - Crossed region handler for message that comes across the EventQueue. Sent to an agent - when the agent crosses a sim border into a new region. - - The message key - the IMessage object containing the deserialized data sent from the simulator - The which originated the packet - - - - Allows agent to cross over (walk, fly, vehicle) in to neighboring - simulators - - This packet is now being sent via the EventQueue - - - - Group Chat event handler - - The capability Key - IMessage object containing decoded data from OSD - - - - - Response from request to join a group chat - - - IMessage object containing decoded data from OSD - - - - - Someone joined or left group chat - - - IMessage object containing decoded data from OSD - - - - - Handle a group chat Invitation - - Caps Key - IMessage object containing decoded data from OSD - Originating Simulator - - - - Moderate a chat session - - the of the session to moderate, for group chats this will be the groups UUID - the of the avatar to moderate - Either "voice" to moderate users voice, or "text" to moderate users text session - true to moderate (silence user), false to allow avatar to speak - - - - Alert Message packet handler - - AlertMessagePacket - not used - - - - detects camera constraint collisions - - - - - - - Packet handler for ScriptSensorReply packet - - - - - - - Packet handler for AvatarSitResponse packet - - - - - - Fired when a is received from the simulator, Contains - Any Whisper, Shout, or Say within range of avatar - - - Fired when a is received, use - to respond to dialog - - - Fired when a is received in response to a - scripted object requesting permissions, Use to reply - - - Fired when a is received, contains a URL pasted in Chat - - - Fired when a or a ChatterBoxInvitation is received - - - Fired when a is received, occurs when a - or is called - - - Fired when a indicating the agents - balance has changed by spending, sending, or receiving L$, Contains the Avatars new balance - - - Fired when a is received, contains L$ balance and additional - details of the transaction - - - Fired when a is received, caused by changing the - Agents active group with - - - Fired when a is received, will contain a Dictionary - of animations currently being played - - - Callback for an object or avatar forcefully colliding - with the agent - - - Callback for the agent moving in to a neighboring sim - - - Callback for when agent is confirmed joined group chat session. - - - Callback for when agent is confirmed to have left group chat session. - - - Alert messages sent to client from simulator - - - Fired when a script wants to take or release control of your avatar. - - - Fired when our avatar camera reaches the maximum possible point - - - Fired when a script sensor reply is received - - - Fired in response to a sit request - - - Fired when a new member joins an active ChatterBoxSession session - - - Fired when a member of an active ChatterBoxSession leaves the session - - - Your (client) avatars - "client", "agent", and "avatar" all represent the same thing - - - Temporary assigned to this session, used for - verifying our identity in packets - - - Shared secret that is never sent over the wire - - - Your (client) avatar ID, local to the current region/sim - - - Where the avatar started at login. Can be "last", "home" - or a login - - - The access level of this agent, usually M or PG - - - The CollisionPlane of Agent - - - An representing the velocity of our agent - - - An representing the acceleration of our agent - - - A which specifies the angular speed, and axis about which an Avatar is rotating. - - - Position avatar client will goto when login to 'home' or during - teleport request to 'home' region. - - - LookAt point saved/restored with HomePosition - - - Avatar First Name (i.e. Philip) - - - Avatar Last Name (i.e. Linden) - - - Avatar Full Name (i.e. Philip Linden) - - - Gets the health of the agent - - - Gets the current balance of the agent - - - Gets the local ID of the prim the agent is sitting on, - zero if the avatar is not currently sitting - - - Gets the of the agents active group. - - - Gets the Agents powers in the currently active group - - - Current status message for teleporting - - - Current position of the agent as a relative offset from - the simulator, or the parent object if we are sitting on something - - - Current rotation of the agent as a relative rotation from - the simulator, or the parent object if we are sitting on something - - - Current position of the agent in the simulator - - - - A representing the agents current rotation - - - - Returns the global grid position of the avatar - - - - Agent movement and camera control - - Agent movement is controlled by setting specific - After the control flags are set, An AgentUpdate is required to update the simulator of the specified flags - This is most easily accomplished by setting one or more of the AgentMovement properties - - Movement of an avatar is always based on a compass direction, for example AtPos will move the - agent from West to East or forward on the X Axis, AtNeg will of course move agent from - East to West or backward on the X Axis, LeftPos will be South to North or forward on the Y Axis - The Z axis is Up, finer grained control of movements can be done using the Nudge properties - - - - Agent camera controls - - - Currently only used for hiding your group title - - - Action state of the avatar, which can currently be - typing and editing - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Timer for sending AgentUpdate packets - - - Default constructor - - - - Send an AgentUpdate with the camera set at the current agent - position and pointing towards the heading specified - - Camera rotation in radians - Whether to send the AgentUpdate reliable - or not - - - - Rotates the avatar body and camera toward a target position. - This will also anchor the camera position on the avatar - - Region coordinates to turn toward - - - - Send new AgentUpdate packet to update our current camera - position and rotation - - - - - Send new AgentUpdate packet to update our current camera - position and rotation - - Whether to require server acknowledgement - of this packet - - - - Send new AgentUpdate packet to update our current camera - position and rotation - - Whether to require server acknowledgement - of this packet - Simulator to send the update to - - - - Builds an AgentUpdate packet entirely from parameters. This - will not touch the state of Self.Movement or - Self.Movement.Camera in any way - - - - - - - - - - - - - - - Move agent positive along the X axis - - - Move agent negative along the X axis - - - Move agent positive along the Y axis - - - Move agent negative along the Y axis - - - Move agent positive along the Z axis - - - Move agent negative along the Z axis - - - - - - - - - - - - - - - - - - - - - - - - Causes simulator to make agent fly - - - Stop movement - - - Finish animation - - - Stand up from a sit - - - Tells simulator to sit agent on ground - - - Place agent into mouselook mode - - - Nudge agent positive along the X axis - - - Nudge agent negative along the X axis - - - Nudge agent positive along the Y axis - - - Nudge agent negative along the Y axis - - - Nudge agent positive along the Z axis - - - Nudge agent negative along the Z axis - - - - - - - - - Tell simulator to mark agent as away - - - - - - - - - - - - - - - - Returns "always run" value, or changes it by sending a SetAlwaysRunPacket - - - - The current value of the agent control flags - - - Gets or sets the interval in milliseconds at which - AgentUpdate packets are sent to the current simulator. Setting - this to a non-zero value will also enable the packet sending if - it was previously off, and setting it to zero will disable - - - Gets or sets whether AgentUpdate packets are sent to - the current simulator - - - Reset movement controls every time we send an update - - - - Camera controls for the agent, mostly a thin wrapper around - CoordinateFrame. This class is only responsible for state - tracking and math, it does not send any packets - - - - - - - The camera is a local frame of reference inside of - the larger grid space. This is where the math happens - - - - Default constructor - - - - - - - - - - - - - - - - - Used to specify movement actions for your agent - - - - Empty flag - - - Move Forward (SL Keybinding: W/Up Arrow) - - - Move Backward (SL Keybinding: S/Down Arrow) - - - Move Left (SL Keybinding: Shift-(A/Left Arrow)) - - - Move Right (SL Keybinding: Shift-(D/Right Arrow)) - - - Not Flying: Jump/Flying: Move Up (SL Keybinding: E) - - - Not Flying: Croutch/Flying: Move Down (SL Keybinding: C) - - - Unused - - - Unused - - - Unused - - - Unused - - - ORed with AGENT_CONTROL_AT_* if the keyboard is being used - - - ORed with AGENT_CONTROL_LEFT_* if the keyboard is being used - - - ORed with AGENT_CONTROL_UP_* if the keyboard is being used - - - Fly - - - - - - Finish our current animation - - - Stand up from the ground or a prim seat - - - Sit on the ground at our current location - - - Whether mouselook is currently enabled - - - Legacy, used if a key was pressed for less than a certain amount of time - - - Legacy, used if a key was pressed for less than a certain amount of time - - - Legacy, used if a key was pressed for less than a certain amount of time - - - Legacy, used if a key was pressed for less than a certain amount of time - - - Legacy, used if a key was pressed for less than a certain amount of time - - - Legacy, used if a key was pressed for less than a certain amount of time - - - - - - - - - Set when the avatar is idled or set to away. Note that the away animation is - activated separately from setting this flag - - - - - - - - - - - - - - - - Triggered on incoming chat messages - - Text of chat message - Audible level of this chat message - Type of chat (whisper, shout, status, etc.) - Source of the chat message - Name of the sending object - Key of source - Key of the sender - Senders position - - - - Triggered when a script pops up a dialog box - - The dialog box message - Name of the object that sent the dialog - Image to be displayed in the dialog - ID of the object that sent the dialog - First name of the object owner - Last name of the object owner - Chat channel that the object is communicating on - List of button labels - - - - Triggered when a script asks for permissions - - Simulator object this request comes from - Task ID of the script requesting permissions - ID of the object containing the script - Name of the object containing the script - Name of the object's owner - Bitwise value representing the requested permissions - - - - Triggered when a script displays a URL via llLoadURL - - Name of the scripted object - ID of the scripted object - ID of the object's owner - Whether or not ownerID is a group - Message displayed along with URL - Offered URL - - - - Triggered when the L$ account balance for this avatar changes - - The new account balance - - - - Triggered on Money Balance Reply - - ID provided in Request Money Balance, or auto-generated by system events - Was the transaction successful - Current balance - Land use credits you have - Tier committed to group(s) - Description of the transaction - - - - Triggered on incoming instant messages - - Instant message data structure - Simulator where this IM was received from - - - - Triggered for any status updates of a teleport (progress, failed, succeeded) - - A message about the current teleport status - The current status of the teleport - Various flags describing the teleport - - + - Reply to a request to join a group, informs whether it was successful or not + Close this session. - The group we attempted to join - Whether we joined the group or not - - - - Reply to a request to leave a group, informs whether it was successful or not - - The group we attempted to leave - Whether we left the group or not - - - - Informs the avatar that it is no longer a member of a group - - The group Key we are no longer a member of - - - - Reply to an AgentData request - - First name of Avatar - Last name of Avatar - Key of Group Avatar has active - Avatars Active Title - Powers Avatar has in group - Name of the Group - - - - Triggered when the current agent animations change - - A convenience reference to the - SignaledAnimations collection - - - - Triggered when an object or avatar forcefully collides with our - agent - - Collision type - Colliding object or avatar ID - Victim ID, should be our own AgentID - Velocity or total force of the collision - Time the collision occurred - - - - Triggered when the agent physically moves in to a neighboring region - - Simulator agent was previously occupying - Simulator agent is now currently occupying - - - - Fired when group chat session confirmed joined - Key of Session (groups UUID) - Temporary session Key - A string representation of the session name - if session start successful, - otherwise - - - Fired when agent group chat session terminated - Key of Session (groups UUID) - - - - Fired when alert message received from simulator - - the message sent from the grid to our avatar. - - - - Fired when a script wants to give or release controls. - - Control to give or take - true of passing control to agent - true of taking control from agent - - - - Fired when camera tries to view beyond its view limits - - representing plane where constraints were hit - - - - Fired when script sensor reply is received - - requestors UUID - Sources Group UUID - Sources Name - Objects UUID - Object owners UUID - Position of Object - Range of Object - Rotation of object - Objects Type - representing the velocity of object - TODO: this should probably be a struct, and there should be an enum added for type - - - - Fired in response to a RequestSit() - - ID of primitive avatar will be sitting on - true of avatar autopiloted there - Camera offset when avatar is seated - Camera eye offset when avatar is seated - true of sitting on this object will force mouselook - position avatar will be in when seated - rotation avatar will be in when seated - - - - Fired when a new member joins a Group chat session - - the ID of the session - the ID of the avatar that joined - - - - Fired when a member of a Group chat leaves the session - - the ID of the session - the ID of the avatar that joined - - - - Represents a string of characters encoded with specific formatting properties - - - - A text string containing main text of the notecard - - - List of s embedded on the notecard - - - Construct an Asset of type Notecard - - - - Construct an Asset object of type Notecard - - A unique specific to this asset - A byte array containing the raw asset data - - - - Construct an Asset object of type Notecard - - A text string containing the main body text of the notecard - - - - Encode the raw contents of a string with the specific Linden Text properties - - - - - Decode the raw asset data including the Linden Text properties - - true if the AssetData was successfully decoded to a string - - - Override the base classes AssetType - - - X position of this patch - - - Y position of this patch - - - A 16x16 array of floats holding decompressed layer data - + - Creates a LayerData packet for compressed land data given a full - simulator heightmap and an array of indices of patches to compress + Look up an existing Participants in this session - A 256 * 256 array of floating point values - specifying the height at each meter in the simulator - Array of indexes in the 16x16 grid of patches - for this simulator. For example if 1 and 17 are specified, patches - x=1,y=0 and x=1,y=1 are sent + - + - Add a patch of terrain to a BitPacker - - BitPacker to write the patch to - Heightmap of the simulator, must be a 256 * - 256 float array - X offset of the patch to create, valid values are - from 0 to 15 - Y offset of the patch to create, valid values are - from 0 to 15 - - - - Add a custom decoder callback - - The key of the field to decode - The custom decode handler - - - - Remove a custom decoder callback - - The key of the field to decode - The custom decode handler - - - - Creates a formatted string containing the values of a Packet - - The Packet - A formatted string of values of the nested items in the Packet object - - - - A custom decoder callback - - The key of the object - the data to decode - A string represending the fieldData - - - - Throttles the network traffic for various different traffic types. - Access this class through GridClient.Throttle + - + - Default constructor, uses a default high total of 1500 KBps (1536000) + An instance of DelegateWrapper which calls InvokeWrappedDelegate, + which in turn calls the DynamicInvoke method of the wrapped + delegate - + - Constructor that decodes an existing AgentThrottle packet in to - individual values - - Reference to the throttle data in an AgentThrottle - packet - Offset position to start reading at in the - throttle data - This is generally not needed in clients as the server will - never send a throttle packet to the client - - - - Send an AgentThrottle packet to the current server using the - current values + Callback used to call EndInvoke on the asynchronously + invoked DelegateWrapper - + - Send an AgentThrottle packet to the specified server using the - current values + Executes the specified delegate with the specified arguments + asynchronously on a thread pool thread + + - + - Convert the current throttle values to a byte array that can be put - in an AgentThrottle packet + Invokes the wrapped delegate synchronously - Byte array containing all the throttle values + + - - Maximum bits per second for resending unacknowledged packets + + + Calls EndInvoke on the wrapper and Close on the resulting WaitHandle + to prevent resource leaks + + - - Maximum bits per second for LayerData terrain + + + Delegate to wrap another delegate and its arguments + + + - - Maximum bits per second for LayerData wind data + + The event subscribers. null if no subcribers - - Maximum bits per second for LayerData clouds + + Raises the LandPatchReceived event + A LandPatchReceivedEventArgs object containing the + data returned from the simulator - - Unknown, includes object data - - - Maximum bits per second for textures - - - Maximum bits per second for downloaded assets - - - Maximum bits per second the entire connection, divided up - between invidiual streams using default multipliers + + Thread sync lock object @@ -11015,259 +20467,2139 @@ - - - Retrieve the terrain height at a given coordinate - - The region that the point of interest is in - Sim X coordinate, valid range is from 0 to 255 - Sim Y coordinate, valid range is from 0 to 255 - The terrain height at the given point if the - lookup was successful, otherwise 0.0f - True if the lookup was successful, otherwise false + + Raised when the simulator responds sends - + + Simulator from that sent tha data + + + Sim coordinate of the patch + + + Sim coordinate of the patch + + + Size of tha patch + + + Heightmap for the patch + + + + + + + + + + + + - + + + + + + + + + + + + + + + + - - - - - - + + Size of the byte array used to store raw packet data + + + Raw packet data buffer + + + Length of the data to transmit + + + EndPoint of the remote host + + - Main class to expose grid functionality to clients. All of the - classes needed for sending and receiving data are accessible through - this class. + Create an allocated UDP packet buffer for receiving a packet - - - // Example minimum code required to instantiate class and - // connect to a simulator. - using System; - using System.Collections.Generic; - using System.Text; - using OpenMetaverse; - - namespace FirstBot - { - class Bot - { - public static GridClient Client; - static void Main(string[] args) - { - Client = new GridClient(); // instantiates the GridClient class - // to the global Client object - // Login to Simulator - Client.Network.Login("FirstName", "LastName", "Password", "FirstBot", "1.0"); - // Wait for a Keypress - Console.ReadLine(); - // Logout of simulator - Client.Network.Logout(); - } - } - } - - - - Networking subsystem + + + Create an allocated UDP packet buffer for sending a packet + + EndPoint of the remote host - - Settings class including constant values and changeable - parameters for everything + + + Create an allocated UDP packet buffer for sending a packet + + EndPoint of the remote host + Size of the buffer to allocate for packet data - - Parcel (subdivided simulator lots) subsystem + + + Object pool for packet buffers. This is used to allocate memory for all + incoming and outgoing packets, and zerocoding buffers for those packets + - - Our own avatars subsystem + + + Initialize the object pool in client mode + + Server to connect to + + - - Other avatars subsystem + + + Initialize the object pool in server mode + + + - - Estate subsystem + + + Returns a packet buffer with EndPoint set if the buffer is in + client mode, or with EndPoint set to null in server mode + + Initialized UDPPacketBuffer object - - Friends list subsystem - - - Grid (aka simulator group) subsystem - - - Object subsystem - - - Group subsystem - - - Asset subsystem - - - Appearance subsystem - - - Inventory subsystem - - - Directory searches including classifieds, people, land - sales, etc - - - Handles land, wind, and cloud heightmaps - - - Handles sound-related networking - - - Throttling total bandwidth usage, or allocating bandwidth - for specific data stream types - - + Default constructor - + - Return the full name of this instance + Check a packet buffer out of the pool - Client avatars full name + A packet buffer object - + - Registers, unregisters, and fires events generated by incoming packets + Singleton logging class for the entire library - - Reference to the GridClient object + + log4net logging engine - + Default constructor - - + - Register an event handler + Send a log message to the logging engine - Use PacketType.Default to fire this event on every - incoming packet - Packet type to register the handler for - Callback to be fired + The log message + The severity of the log entry - + - Unregister an event handler + Send a log message to the logging engine - Packet type to unregister the handler for - Callback to be unregistered + The log message + The severity of the log entry + Instance of the client - + - Fire the events registered for this packet type synchronously + Send a log message to the logging engine - Incoming packet type - Incoming packet - Simulator this packet was received from + The log message + The severity of the log entry + Exception that was raised - + - Fire the events registered for this packet type asynchronously + Send a log message to the logging engine - Incoming packet type - Incoming packet - Simulator this packet was received from + The log message + The severity of the log entry + Instance of the client + Exception that was raised - + - Object that is passed to worker threads in the ThreadPool for - firing packet callbacks + If the library is compiled with DEBUG defined, an event will be + fired if an OnLogMessage handler is registered and the + message will be sent to the logging engine + + The message to log at the DEBUG level to the + current logging engine + + + + If the library is compiled with DEBUG defined and + GridClient.Settings.DEBUG is true, an event will be + fired if an OnLogMessage handler is registered and the + message will be sent to the logging engine + + The message to log at the DEBUG level to the + current logging engine + Instance of the client + + + Triggered whenever a message is logged. If this is left + null, log messages will go to the console + + + + Callback used for client apps to receive log messages from + the library + + Data being logged + The severity of the log entry from + + + Sort by name + + + Sort by date + + + Sort folders by name, regardless of whether items are + sorted by name or date + + + Place system folders at the top + + + + Possible destinations for DeRezObject request - - Callback to fire for this packet + + - - Reference to the simulator that this packet came from + + Copy from in-world to agent inventory - - The packet that needs to be processed + + Derez to TaskInventory - + + + + + Take Object + + + + + + Delete Object + + + Put an avatar attachment into agent inventory + + + + + + Return an object back to the owner's inventory + + + Return a deeded object back to the last owner's inventory + + - Registers, unregisters, and fires events generated by the Capabilities - event queue + Upper half of the Flags field for inventory items - - Reference to the GridClient object + + Indicates that the NextOwner permission will be set to the + most restrictive set of permissions found in the object set + (including linkset items and object inventory items) on next rez - + + Indicates that the object sale information has been + changed + + + If set, and a slam bit is set, indicates BaseMask will be overwritten on Rez + + + If set, and a slam bit is set, indicates OwnerMask will be overwritten on Rez + + + If set, and a slam bit is set, indicates GroupMask will be overwritten on Rez + + + If set, and a slam bit is set, indicates EveryoneMask will be overwritten on Rez + + + If set, and a slam bit is set, indicates NextOwnerMask will be overwritten on Rez + + + Indicates whether this object is composed of multiple + items or not + + + Indicates that the asset is only referenced by this + inventory item. If this item is deleted or updated to reference a + new assetID, the asset can be deleted + + + + Base Class for Inventory Items + + + + of item/folder + + + of parent folder + + + Name of item/folder + + + Item/Folder Owners + + + + Constructor, takes an itemID as a parameter + + The of the item + + + + + + + + + + + + + + + + Generates a number corresponding to the value of the object to support the use of a hash table, + suitable for use in hashing algorithms and data structures such as a hash table + + A Hashcode of all the combined InventoryBase fields + + + + Determine whether the specified object is equal to the current object + + InventoryBase object to compare against + true if objects are the same + + + + Determine whether the specified object is equal to the current object + + InventoryBase object to compare against + true if objects are the same + + + + An Item in Inventory + + + + The of this item + + + The combined of this item + + + The type of item from + + + The type of item from the enum + + + The of the creator of this item + + + A Description of this item + + + The s this item is set to or owned by + + + If true, item is owned by a group + + + The price this item can be purchased for + + + The type of sale from the enum + + + Combined flags from + + + Time and date this inventory item was created, stored as + UTC (Coordinated Universal Time) + + + Used to update the AssetID in requests sent to the server + + + The of the previous owner of the item + + + + Construct a new InventoryItem object + + The of the item + + + + Construct a new InventoryItem object of a specific Type + + The type of item from + of the item + + + + Indicates inventory item is a link + + True if inventory item is a link to another inventory item + + + + + + + + + + + + + + + + Generates a number corresponding to the value of the object to support the use of a hash table. + Suitable for use in hashing algorithms and data structures such as a hash table + + A Hashcode of all the combined InventoryItem fields + + + + Compares an object + + The object to compare + true if comparison object matches + + + + Determine whether the specified object is equal to the current object + + The object to compare against + true if objects are the same + + + + Determine whether the specified object is equal to the current object + + The object to compare against + true if objects are the same + + + + InventoryTexture Class representing a graphical image + + + + + + Construct an InventoryTexture object + + A which becomes the + objects AssetUUID + + + + Construct an InventoryTexture object from a serialization stream + + + + + InventorySound Class representing a playable sound + + + + + Construct an InventorySound object + + A which becomes the + objects AssetUUID + + + + Construct an InventorySound object from a serialization stream + + + + + InventoryCallingCard Class, contains information on another avatar + + + + + Construct an InventoryCallingCard object + + A which becomes the + objects AssetUUID + + + + Construct an InventoryCallingCard object from a serialization stream + + + + + InventoryLandmark Class, contains details on a specific location + + + + + Construct an InventoryLandmark object + + A which becomes the + objects AssetUUID + + + + Construct an InventoryLandmark object from a serialization stream + + + + + Landmarks use the InventoryItemFlags struct and will have a flag of 1 set if they have been visited + + + + + InventoryObject Class contains details on a primitive or coalesced set of primitives + + + + + Construct an InventoryObject object + + A which becomes the + objects AssetUUID + + + + Construct an InventoryObject object from a serialization stream + + + + + Gets or sets the upper byte of the Flags value + + + + + Gets or sets the object attachment point, the lower byte of the Flags value + + + + + InventoryNotecard Class, contains details on an encoded text document + + + + + Construct an InventoryNotecard object + + A which becomes the + objects AssetUUID + + + + Construct an InventoryNotecard object from a serialization stream + + + + + InventoryCategory Class + + TODO: Is this even used for anything? + + + + Construct an InventoryCategory object + + A which becomes the + objects AssetUUID + + + + Construct an InventoryCategory object from a serialization stream + + + + + InventoryLSL Class, represents a Linden Scripting Language object + + + + + Construct an InventoryLSL object + + A which becomes the + objects AssetUUID + + + + Construct an InventoryLSL object from a serialization stream + + + + + InventorySnapshot Class, an image taken with the viewer + + + + + Construct an InventorySnapshot object + + A which becomes the + objects AssetUUID + + + + Construct an InventorySnapshot object from a serialization stream + + + + + InventoryAttachment Class, contains details on an attachable object + + + + + Construct an InventoryAttachment object + + A which becomes the + objects AssetUUID + + + + Construct an InventoryAttachment object from a serialization stream + + + + + Get the last AttachmentPoint this object was attached to + + + + + InventoryWearable Class, details on a clothing item or body part + + + + + Construct an InventoryWearable object + + A which becomes the + objects AssetUUID + + + + Construct an InventoryWearable object from a serialization stream + + + + + The , Skin, Shape, Skirt, Etc + + + + + InventoryAnimation Class, A bvh encoded object which animates an avatar + + + + + Construct an InventoryAnimation object + + A which becomes the + objects AssetUUID + + + + Construct an InventoryAnimation object from a serialization stream + + + + + InventoryGesture Class, details on a series of animations, sounds, and actions + + + + + Construct an InventoryGesture object + + A which becomes the + objects AssetUUID + + + + Construct an InventoryGesture object from a serialization stream + + + + + A folder contains s and has certain attributes specific + to itself + + + + The Preferred for a folder. + + + The Version of this folder + + + Number of child items this folder contains. + + + + Constructor + + UUID of the folder + + + + + + + + + + Get Serilization data for this InventoryFolder object + + + + + Construct an InventoryFolder object from a serialization stream + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Tools for dealing with agents inventory + + + + Used for converting shadow_id to asset_id + + + The event subscribers, null of no subscribers + + + Raises the ItemReceived Event + A ItemReceivedEventArgs object containing + the data sent from the simulator + + + Thread sync lock object + + + The event subscribers, null of no subscribers + + + Raises the FolderUpdated Event + A FolderUpdatedEventArgs object containing + the data sent from the simulator + + + Thread sync lock object + + + The event subscribers, null of no subscribers + + + Raises the InventoryObjectOffered Event + A InventoryObjectOfferedEventArgs object containing + the data sent from the simulator + + + Thread sync lock object + + + The event subscribers, null of no subscribers + + + Raises the TaskItemReceived Event + A TaskItemReceivedEventArgs object containing + the data sent from the simulator + + + Thread sync lock object + + + The event subscribers, null of no subscribers + + + Raises the FindObjectByPath Event + A FindObjectByPathEventArgs object containing + the data sent from the simulator + + + Thread sync lock object + + + The event subscribers, null of no subscribers + + + Raises the TaskInventoryReply Event + A TaskInventoryReplyEventArgs object containing + the data sent from the simulator + + + Thread sync lock object + + + The event subscribers, null of no subscribers + + + Raises the SaveAssetToInventory Event + A SaveAssetToInventoryEventArgs object containing + the data sent from the simulator + + + Thread sync lock object + + + The event subscribers, null of no subscribers + + + Raises the ScriptRunningReply Event + A ScriptRunningReplyEventArgs object containing + the data sent from the simulator + + + Thread sync lock object + + + Partial mapping of AssetTypes to folder names + + Default constructor Reference to the GridClient object - + - Register an new event handler for a capabilities event sent via the EventQueue + Fetch an inventory item from the dataserver - Use String.Empty to fire this event on every CAPS event - Capability event name to register the - handler for - Callback to fire + The items + The item Owners + a integer representing the number of milliseconds to wait for results + An object on success, or null if no item was found + Items will also be sent to the event - + - Unregister a previously registered capabilities handler + Request A single inventory item - Capability event name unregister the - handler for - Callback to unregister + The items + The item Owners + - + - Fire the events registered for this event type synchronously + Request inventory items - Capability name - Decoded event body - Reference to the simulator that - generated this event + Inventory items to request + Owners of the inventory items + - + - Fire the events registered for this event type asynchronously + Get contents of a folder - Capability name - Decoded event body - Reference to the simulator that - generated this event + The of the folder to search + The of the folders owner + true to retrieve folders + true to retrieve items + sort order to return results in + a integer representing the number of milliseconds to wait for results + A list of inventory items matching search criteria within folder + + InventoryFolder.DescendentCount will only be accurate if both folders and items are + requested - + - Object that is passed to worker threads in the ThreadPool for - firing CAPS callbacks + Request the contents of an inventory folder + + The folder to search + The folder owners + true to return s contained in folder + true to return s containd in folder + the sort order to return items in + + + + + Returns the UUID of the folder (category) that defaults to + containing 'type'. The folder is not necessarily only for that + type + + This will return the root folder if one does not exist + + The UUID of the desired folder if found, the UUID of the RootFolder + if not found, or UUID.Zero on failure + + + + Find an object in inventory using a specific path to search + + The folder to begin the search in + The object owners + A string path to search + milliseconds to wait for a reply + Found items or if + timeout occurs or item is not found + + + + Find inventory items by path + + The folder to begin the search in + The object owners + A string path to search, folders/objects separated by a '/' + Results are sent to the event + + + + Search inventory Store object for an item or folder + + The folder to begin the search in + An array which creates a path to search + Number of levels below baseFolder to conduct searches + if True, will stop searching after first match is found + A list of inventory items found + + + + Move an inventory item or folder to a new location + + The item or folder to move + The to move item or folder to + + + + Move an inventory item or folder to a new location and change its name + + The item or folder to move + The to move item or folder to + The name to change the item or folder to + + + + Move and rename a folder + + The source folders + The destination folders + The name to change the folder to + + + + Update folder properties + + of the folder to update + Sets folder's parent to + Folder name + Folder type + + + + Move a folder + + The source folders + The destination folders + + + + Move multiple folders, the keys in the Dictionary parameter, + to a new parents, the value of that folder's key. + + A Dictionary containing the + of the source as the key, and the + of the destination as the value + + + + Move an inventory item to a new folder + + The of the source item to move + The of the destination folder + + + + Move and rename an inventory item + + The of the source item to move + The of the destination folder + The name to change the folder to + + + + Move multiple inventory items to new locations + + A Dictionary containing the + of the source item as the key, and the + of the destination folder as the value + + + + Remove descendants of a folder + + The of the folder + + + + Remove a single item from inventory + + The of the inventory item to remove + + + + Remove a folder from inventory + + The of the folder to remove + + + + Remove multiple items or folders from inventory + + A List containing the s of items to remove + A List containing the s of the folders to remove + + + + Empty the Lost and Found folder - - Callback to fire for this packet + + + Empty the Trash folder + - - Name of the CAPS event + + + + + + + + + Proper use is to upload the inventory's asset first, then provide the Asset's TransactionID here. + + + - - Strongly typed decoded data + + + + + + + + + Proper use is to upload the inventory's asset first, then provide the Asset's TransactionID here. + + + + - - Reference to the simulator that generated this event + + + Creates a new inventory folder + + ID of the folder to put this folder in + Name of the folder to create + The UUID of the newly created folder + + + + Creates a new inventory folder + + ID of the folder to put this folder in + Name of the folder to create + Sets this folder as the default folder + for new assets of the specified type. Use AssetType.Unknown + to create a normal folder, otherwise it will likely create a + duplicate of an existing folder type + The UUID of the newly created folder + If you specify a preferred type of AsseType.Folder + it will create a new root folder which may likely cause all sorts + of strange problems + + + + Create an inventory item and upload asset data + + Asset data + Inventory item name + Inventory item description + Asset type + Inventory type + Put newly created inventory in this folder + Delegate that will receive feedback on success or failure + + + + Create an inventory item and upload asset data + + Asset data + Inventory item name + Inventory item description + Asset type + Inventory type + Put newly created inventory in this folder + Permission of the newly created item + (EveryoneMask, GroupMask, and NextOwnerMask of Permissions struct are supported) + Delegate that will receive feedback on success or failure + + + + Creates inventory link to another inventory item or folder + + Put newly created link in folder with this UUID + Inventory item or folder + Method to call upon creation of the link + + + + Creates inventory link to another inventory item + + Put newly created link in folder with this UUID + Original inventory item + Method to call upon creation of the link + + + + Creates inventory link to another inventory folder + + Put newly created link in folder with this UUID + Original inventory folder + Method to call upon creation of the link + + + + Creates inventory link to another inventory item or folder + + Put newly created link in folder with this UUID + Original item's UUID + Name + Description + Asset Type + Inventory Type + Transaction UUID + Method to call upon creation of the link + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Request a copy of an asset embedded within a notecard + + Usually UUID.Zero for copying an asset from a notecard + UUID of the notecard to request an asset from + Target folder for asset to go to in your inventory + UUID of the embedded asset + callback to run when item is copied to inventory + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Save changes to notecard embedded in object contents + + Encoded notecard asset data + Notecard UUID + Object's UUID + Called upon finish of the upload with status information + + + + Upload new gesture asset for an inventory gesture item + + Encoded gesture asset + Gesture inventory UUID + Callback whick will be called when upload is complete + + + + Update an existing script in an agents Inventory + + A byte[] array containing the encoded scripts contents + the itemID of the script + if true, sets the script content to run on the mono interpreter + + + + + Update an existing script in an task Inventory + + A byte[] array containing the encoded scripts contents + the itemID of the script + UUID of the prim containting the script + if true, sets the script content to run on the mono interpreter + if true, sets the script to running + + + + + Rez an object from inventory + + Simulator to place object in + Rotation of the object when rezzed + Vector of where to place object + InventoryItem object containing item details + + + + Rez an object from inventory + + Simulator to place object in + Rotation of the object when rezzed + Vector of where to place object + InventoryItem object containing item details + UUID of group to own the object + + + + Rez an object from inventory + + Simulator to place object in + Rotation of the object when rezzed + Vector of where to place object + InventoryItem object containing item details + UUID of group to own the object + User defined queryID to correlate replies + If set to true, the CreateSelected flag + will be set on the rezzed object + + + + DeRez an object from the simulator to the agents Objects folder in the agents Inventory + + The simulator Local ID of the object + If objectLocalID is a child primitive in a linkset, the entire linkset will be derezzed + + + + DeRez an object from the simulator and return to inventory + + The simulator Local ID of the object + The type of destination from the enum + The destination inventory folders -or- + if DeRezzing object to a tasks Inventory, the Tasks + The transaction ID for this request which + can be used to correlate this request with other packets + If objectLocalID is a child primitive in a linkset, the entire linkset will be derezzed + + + + Rez an item from inventory to its previous simulator location + + + + + + + + + Give an inventory item to another avatar + + The of the item to give + The name of the item + The type of the item from the enum + The of the recipient + true to generate a beameffect during transfer + + + + Give an inventory Folder with contents to another avatar + + The of the Folder to give + The name of the folder + The type of the item from the enum + The of the recipient + true to generate a beameffect during transfer + + + + Copy or move an from agent inventory to a task (primitive) inventory + + The target object + The item to copy or move from inventory + + For items with copy permissions a copy of the item is placed in the tasks inventory, + for no-copy items the object is moved to the tasks inventory + + + + Retrieve a listing of the items contained in a task (Primitive) + + The tasks + The tasks simulator local ID + milliseconds to wait for reply from simulator + A list containing the inventory items inside the task or null + if a timeout occurs + This request blocks until the response from the simulator arrives + or timeoutMS is exceeded + + + + Request the contents of a tasks (primitives) inventory from the + current simulator + + The LocalID of the object + + + + + Request the contents of a tasks (primitives) inventory + + The simulator Local ID of the object + A reference to the simulator object that contains the object + + + + + Move an item from a tasks (Primitive) inventory to the specified folder in the avatars inventory + + LocalID of the object in the simulator + UUID of the task item to move + The ID of the destination folder in this agents inventory + Simulator Object + Raises the event + + + + Remove an item from an objects (Prim) Inventory + + LocalID of the object in the simulator + UUID of the task item to remove + Simulator Object + You can confirm the removal by comparing the tasks inventory serial before and after the + request with the request combined with + the event + + + + Copy an InventoryScript item from the Agents Inventory into a primitives task inventory + + An unsigned integer representing a primitive being simulated + An which represents a script object from the agents inventory + true to set the scripts running state to enabled + A Unique Transaction ID + + The following example shows the basic steps necessary to copy a script from the agents inventory into a tasks inventory + and assumes the script exists in the agents inventory. + + uint primID = 95899503; // Fake prim ID + UUID scriptID = UUID.Parse("92a7fe8a-e949-dd39-a8d8-1681d8673232"); // Fake Script UUID in Inventory + + Client.Inventory.FolderContents(Client.Inventory.FindFolderForType(AssetType.LSLText), Client.Self.AgentID, + false, true, InventorySortOrder.ByName, 10000); + + Client.Inventory.RezScript(primID, (InventoryItem)Client.Inventory.Store[scriptID]); + + + + + + Request the running status of a script contained in a task (primitive) inventory + + The ID of the primitive containing the script + The ID of the script + The event can be used to obtain the results of the + request + + + + + Send a request to set the running state of a script contained in a task (primitive) inventory + + The ID of the primitive containing the script + The ID of the script + true to set the script running, false to stop a running script + To verify the change you can use the method combined + with the event + + + + Create a CRC from an InventoryItem + + The source InventoryItem + A uint representing the source InventoryItem as a CRC + + + + Reverses a cheesy XORing with a fixed UUID to convert a shadow_id to an asset_id + + Obfuscated shadow_id value + Deobfuscated asset_id value + + + + Does a cheesy XORing with a fixed UUID to convert an asset_id to a shadow_id + + asset_id value to obfuscate + Obfuscated shadow_id value + + + + Wrapper for creating a new object + + The type of item from the enum + The of the newly created object + An object with the type and id passed + + + + Parse the results of a RequestTaskInventory() response + + A string which contains the data from the task reply + A List containing the items contained within the tasks inventory + + + Process an incoming packet and raise the appropriate events + The sender + The EventArgs object containing the packet data + + + Process an incoming packet and raise the appropriate events + The sender + The EventArgs object containing the packet data + + + + UpdateCreateInventoryItem packets are received when a new inventory item + is created. This may occur when an object that's rezzed in world is + taken into inventory, when an item is created using the CreateInventoryItem + packet, or when an object is purchased + + The sender + The EventArgs object containing the packet data + + + Process an incoming packet and raise the appropriate events + The sender + The EventArgs object containing the packet data + + + Process an incoming packet and raise the appropriate events + The sender + The EventArgs object containing the packet data + + + Process an incoming packet and raise the appropriate events + The sender + The EventArgs object containing the packet data + + + Process an incoming packet and raise the appropriate events + The sender + The EventArgs object containing the packet data + + + Raised when the simulator sends us data containing + ... + + + Raised when the simulator sends us data containing + ... + + + Raised when the simulator sends us data containing + an inventory object sent by another avatar or primitive + + + Raised when the simulator sends us data containing + ... + + + Raised when the simulator sends us data containing + ... + + + Raised when the simulator sends us data containing + ... + + + Raised when the simulator sends us data containing + ... + + + Raised when the simulator sends us data containing + ... + + + + Get this agents Inventory data + + + + + Callback for inventory item creation finishing + + Whether the request to create an inventory + item succeeded or not + Inventory item being created. If success is + false this will be null + + + + Callback for an inventory item being create from an uploaded asset + + true if inventory item creation was successful + + + + + + + + + + + + + Reply received when uploading an inventory asset + + Has upload been successful + Error message if upload failed + Inventory asset UUID + New asset UUID + + + + Delegate that is invoked when script upload is completed + + Has upload succeded (note, there still might be compile errors) + Upload status message + Is compilation successful + If compilation failed, list of error messages, null on compilation success + Script inventory UUID + Script's new asset UUID + + + Set to true to accept offer, false to decline it + + + The folder to accept the inventory into, if null default folder for will be used + + + + Callback when an inventory object is accepted and received from a + task inventory. This is the callback in which you actually get + the ItemID, as in ObjectOfferedCallback it is null when received + from a task. + + + + + Map layer request type + + + + Objects and terrain are shown + + + Only the terrain is shown, no objects + + + Overlay showing land for sale and for auction + + + + Type of grid item, such as telehub, event, populator location, etc. + + + + Telehub + + + PG rated event + + + Mature rated event + + + Popular location + + + Locations of avatar groups in a region + + + Land for sale + + + Classified ad + + + Adult rated event + + + Adult land for sale + + + + Information about a region on the grid map + + + + Sim X position on World Map + + + Sim Y position on World Map + + + Sim Name (NOTE: In lowercase!) + + + + + + Appears to always be zero (None) + + + Sim's defined Water Height + + + + + + UUID of the World Map image + + + Unique identifier for this region, a combination of the X + and Y position + + + + + + + + + + + + + + + + + + + + + + + Visual chunk of the grid map + + + + + Base class for Map Items + + + + The Global X position of the item + + + The Global Y position of the item + + + Get the Local X position of the item + + + Get the Local Y position of the item + + + Get the Handle of the region + + + + Represents an agent or group of agents location + + + + + Represents a Telehub location + + + + + Represents a non-adult parcel of land for sale + + + + + Represents an Adult parcel of land for sale + + + + + Represents a PG Event + + + + + Represents a Mature event + + + + + Represents an Adult event + + + + + Manages grid-wide tasks such as the world map + + + + The event subscribers. null if no subcribers + + + Raises the CoarseLocationUpdate event + A CoarseLocationUpdateEventArgs object containing the + data sent by simulator + + + Thread sync lock object + + + The event subscribers. null if no subcribers + + + Raises the GridRegion event + A GridRegionEventArgs object containing the + data sent by simulator + + + Thread sync lock object + + + The event subscribers. null if no subcribers + + + Raises the GridLayer event + A GridLayerEventArgs object containing the + data sent by simulator + + + Thread sync lock object + + + The event subscribers. null if no subcribers + + + Raises the GridItems event + A GridItemEventArgs object containing the + data sent by simulator + + + Thread sync lock object + + + The event subscribers. null if no subcribers + + + Raises the RegionHandleReply event + A RegionHandleReplyEventArgs object containing the + data sent by simulator + + + Thread sync lock object + + + A dictionary of all the regions, indexed by region name + + + A dictionary of all the regions, indexed by region handle + + + + Constructor + + Instance of GridClient object to associate with this GridManager instance + + + + + + + + + + Request a map layer + + The name of the region + The type of layer + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Request data for all mainland (Linden managed) simulators + + + + + Request the region handle for the specified region UUID + + UUID of the region to look up + + + + Get grid region information using the region name, this function + will block until it can find the region or gives up + + Name of sim you're looking for + Layer that you are requesting + Will contain a GridRegion for the sim you're + looking for if successful, otherwise an empty structure + True if the GridRegion was successfully fetched, otherwise + false + + + Process an incoming packet and raise the appropriate events + The sender + The EventArgs object containing the packet data + + + Process an incoming packet and raise the appropriate events + The sender + The EventArgs object containing the packet data + + + Process an incoming packet and raise the appropriate events + The sender + The EventArgs object containing the packet data + + + Process an incoming packet and raise the appropriate events + The sender + The EventArgs object containing the packet data + + + Process an incoming packet and raise the appropriate events + The sender + The EventArgs object containing the packet data + + + Raised when the simulator sends a + containing the location of agents in the simulator + + + Raised when the simulator sends a Region Data in response to + a Map request + + + Raised when the simulator sends GridLayer object containing + a map tile coordinates and texture information + + + Raised when the simulator sends GridItems object containing + details on events, land sales at a specific location + + + Raised in response to a Region lookup + + + Unknown + + + Current direction of the sun + + + Current angular velocity of the sun + + + Current world time + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Login Request Parameters + + + + The URL of the Login Server + + + The number of milliseconds to wait before a login is considered + failed due to timeout + + + The request method + login_to_simulator is currently the only supported method + + + The Agents First name + + + The Agents Last name + + + A md5 hashed password + plaintext password will be automatically hashed + + + The agents starting location once logged in + Either "last", "home", or a string encoded URI + containing the simulator name and x/y/z coordinates e.g: uri:hooper&128&152&17 + + + A string containing the client software channel information + Second Life Release + + + The client software version information + The official viewer uses: Second Life Release n.n.n.n + where n is replaced with the current version of the viewer + + + A string containing the platform information the agent is running on + + + A string hash of the network cards Mac Address + + + Unknown or deprecated + + + A string hash of the first disk drives ID used to identify this clients uniqueness + + + A string containing the viewers Software, this is not directly sent to the login server but + instead is used to generate the Version string + + + A string representing the software creator. This is not directly sent to the login server but + is used by the library to generate the Version information + + + If true, this agent agrees to the Terms of Service of the grid its connecting to + + + Unknown + + + An array of string sent to the login server to enable various options + + + A randomly generated ID to distinguish between login attempts. This value is only used + internally in the library and is never sent over the wire + + + + Default constuctor, initializes sane default values + + + + + Instantiates new LoginParams object and fills in the values + + Instance of GridClient to read settings from + Login first name + Login last name + Password + Login channnel (application name) + Client version, should be application name + version number + + + + Instantiates new LoginParams object and fills in the values + + Instance of GridClient to read settings from + Login first name + Login last name + Password + Login channnel (application name) + Client version, should be application name + version number + URI of the login server + + + + The decoded data returned from the login server after a successful login + + + + true, false, indeterminate + + + Login message of the day + + + M or PG, also agent_region_access and agent_access_max + + + + Parse LLSD Login Reply Data + + An + contaning the login response data + XML-RPC logins do not require this as XML-RPC.NET + automatically populates the struct properly using attributes @@ -11407,6 +22739,64 @@ + + Number of milliseconds to wait for a transfer header packet if out of order data was received + + + The event subscribers. null if no subcribers + + + Raises the XferReceived event + A XferReceivedEventArgs object containing the + data returned from the simulator + + + Thread sync lock object + + + The event subscribers. null if no subcribers + + + Raises the AssetUploaded event + A AssetUploadedEventArgs object containing the + data returned from the simulator + + + Thread sync lock object + + + The event subscribers. null if no subcribers + + + Raises the UploadProgress event + A UploadProgressEventArgs object containing the + data returned from the simulator + + + Thread sync lock object + + + The event subscribers. null if no subcribers + + + Raises the InitiateDownload event + A InitiateDownloadEventArgs object containing the + data returned from the simulator + + + Thread sync lock object + + + The event subscribers. null if no subcribers + + + Raises the ImageReceiveProgress event + A ImageReceiveProgressEventArgs object containing the + data returned from the simulator + + + Thread sync lock object + Texture download cache @@ -11435,6 +22825,17 @@ Source location of the requested asset The callback to fire when the simulator responds with the asset data + + + Request an asset download + + Asset UUID + Asset type, must be correct for the transfer to succeed + Whether to give this transfer an elevated priority + Source location of the requested asset + UUID of the transaction + The callback to fire when the simulator responds with the asset data + Request an asset download through the almost deprecated Xfer system @@ -11463,6 +22864,7 @@ The owner of this asset Asset type Whether to prioritize this asset download or not + @@ -11528,7 +22930,10 @@ to prioritize the request before lower valued requests. An image already being transferred using the can have its priority changed by resending the request with the new priority value Number of quality layers to discard. - This controls the end marker of the data sent + This controls the end marker of the data sent. Sending with value -1 combined with priority of 0 cancels an in-progress + transfer. + A bug exists in the Linden Simulator where a -1 will occasionally be sent with a non-zero priority + indicating an off-by-one error. The packet number to begin the request at. A value of 0 begins the request from the start of the asset texture The callback to fire when the image is retrieved. The callback @@ -11625,6 +23030,13 @@ The texture assets + + + Requests download of a mesh asset + + UUID of the mesh asset + Callback when the request completes + Lets TexturePipeline class fire the progress event @@ -11633,3578 +23045,101 @@ the number of bytes transferred the total number of bytes expected - - - Packet Handler for InitiateDownloadPacket, sent in response to EstateOwnerMessage - requesting download of simulators RAW terrain file. - - The InitiateDownloadPacket packet - The simulator originating the packet - Only the Estate Owner will receive this when he/she makes the request + + Process an incoming packet and raise the appropriate events + The sender + The EventArgs object containing the packet data - - + + Process an incoming packet and raise the appropriate events + The sender + The EventArgs object containing the packet data - - + + Process an incoming packet and raise the appropriate events + The sender + The EventArgs object containing the packet data - - + + Process an incoming packet and raise the appropriate events + The sender + The EventArgs object containing the packet data - + + Process an incoming packet and raise the appropriate events + The sender + The EventArgs object containing the packet data + + + Process an incoming packet and raise the appropriate events + The sender + The EventArgs object containing the packet data + + + Process an incoming packet and raise the appropriate events + The sender + The EventArgs object containing the packet data + + + Process an incoming packet and raise the appropriate events + The sender + The EventArgs object containing the packet data + + + Raised when the simulator responds sends + + + Raised during upload completes + + + Raised during upload with progres update + + Fired when the simulator sends an InitiateDownloadPacket, used to download terrain .raw files - - Fired when during texture downloads to indicate the progress of the download + + Fired when a texture is in the process of being downloaded by the TexturePipeline class - + Callback used for various asset download requests - - + Transfer information + Downloaded asset, null on fail - + - + Callback used upon competition of baked texture upload - + Asset UUID of the newly uploaded baked texture - + - + A callback that fires upon the completition of the RequestMesh call - + Was the download successfull + Resulting mesh or null on problems - - - - - - - - - Callback fired when an InitiateDownload packet is received - - The filename on the simulator - The name of the file the viewer requested - - - - Fired when a texture is in the process of being downloaded by the TexturePipeline class - - The asset textures - The total number of bytes received - The total number of bytes expected - - - - Class that handles the local asset cache - - - - - Default constructor - - A reference to the GridClient object - - - - Disposes cleanup timer - - - - - Only create timer when needed - - - - - Return bytes read from the local asset cache, null if it does not exist - - UUID of the asset we want to get - Raw bytes of the asset, or null on failure - - - - Returns ImageDownload object of the - image from the local image cache, null if it does not exist - - UUID of the image we want to get - ImageDownload object containing the image, or null on failure - - - - Constructs a file name of the cached asset - - UUID of the asset - String with the file name of the cahced asset - - - - Saves an asset to the local cache - - UUID of the asset - Raw bytes the asset consists of - Weather the operation was successfull - - - - Get the file name of the asset stored with gived UUID - - UUID of the asset - Null if we don't have that UUID cached on disk, file name if found in the cache folder - - - - Checks if the asset exists in the local cache - - UUID of the asset - True is the asset is stored in the cache, otherwise false - - - - Wipes out entire cache - - - - - Brings cache size to the 90% of the max size - - - - - Asynchronously brings cache size to the 90% of the max size - - - - - Adds up file sizes passes in a FileInfo array - - - - - Checks whether caching is enabled - - - - - Periodically prune the cache - - - - - Nicely formats file sizes - - Byte size we want to output - String with humanly readable file size - - - - Allows setting weather to periodicale prune the cache if it grows too big - Default is enabled, when caching is enabled - - - - - How long (in ms) between cache checks (default is 5 min.) - - - - - Helper class for sorting files by their last accessed time - - - - - - - - - - Initialize the UDP packet handler in server mode - - Port to listening for incoming UDP packets on - - - - Initialize the UDP packet handler in client mode - - Remote UDP server to connect to - - - - - - - - - - - - - - - - - - - Reads in a byte array of an Animation Asset created by the SecondLife(tm) client. - - - - - Rotation Keyframe count (used internally) - - - - - Position Keyframe count (used internally) - - - - - Animation Priority - - - - - The animation length in seconds. - - - - - Expression set in the client. Null if [None] is selected - - - - - The time in seconds to start the animation - - - - - The time in seconds to end the animation - - - - - Loop the animation - - - - - Meta data. Ease in Seconds. - - - - - Meta data. Ease out seconds. - - - - - Meta Data for the Hand Pose - - - - - Number of joints defined in the animation - - - - - Contains an array of joints - - - - - Searialize an animation asset into it's joints/keyframes/meta data - - - - - - Variable length strings seem to be null terminated in the animation asset.. but.. - use with caution, home grown. - advances the index. - - The animation asset byte array - The offset to start reading - a string - - - - Read in a Joint from an animation asset byte array - Variable length Joint fields, yay! - Advances the index - - animation asset byte array - Byte Offset of the start of the joint - The Joint data serialized into the binBVHJoint structure - - - - Read Keyframes of a certain type - advance i - - Animation Byte array - Offset in the Byte Array. Will be advanced - Number of Keyframes - Scaling Min to pass to the Uint16ToFloat method - Scaling Max to pass to the Uint16ToFloat method - - - - - A Joint and it's associated meta data and keyframes - - - - - Name of the Joint. Matches the avatar_skeleton.xml in client distros - - - - - Joint Animation Override? Was the same as the Priority in testing.. - - - - - Array of Rotation Keyframes in order from earliest to latest - - - - - Array of Position Keyframes in order from earliest to latest - This seems to only be for the Pelvis? - - - - - A Joint Keyframe. This is either a position or a rotation. - - - - - Either a Vector3 position or a Vector3 Euler rotation - - - - - Poses set in the animation metadata for the hands. - - - - - Image width - - - - - Image height - - - - - Image channel flags - - - - - Red channel data - - - - - Green channel data - - - - - Blue channel data - - - - - Alpha channel data - - - - - Bump channel data - - - - - Create a new blank image - - width - height - channel flags - - - - - - - - - - Convert the channels in the image. Channels are created or destroyed as required. - - new channel flags - - - - Resize or stretch the image using nearest neighbor (ugly) resampling - - new width - new height - - - - Create a byte array containing 32-bit RGBA data with a bottom-left - origin, suitable for feeding directly into OpenGL - - A byte array containing raw texture data - - - - Plays a sound in the current region at full volume from avatar position - - UUID of the sound to be played - - - - Plays a sound in the current region at full volume - - UUID of the sound to be played. - position for the sound to be played at. Normally the avatar. - - - - Plays a sound in the current region - - UUID of the sound to be played. - position for the sound to be played at. Normally the avatar. - volume of the sound, from 0.0 to 1.0 - - - - Plays a sound in the specified sim - - UUID of the sound to be played. - UUID of the sound to be played. - position for the sound to be played at. Normally the avatar. - volume of the sound, from 0.0 to 1.0 - - - - Plays a sound - - UUID of the sound to be played. - handle id for the sim to be played in. - position for the sound to be played at. Normally the avatar. - volume of the sound, from 0.0 to 1.0 - - - - Type of return to use when returning objects from a parcel - - - - - - - Return objects owned by parcel owner - - - Return objects set to group - - - Return objects not owned by parcel owner or set to group - - - Return a specific list of objects on parcel - - - Return objects that are marked for-sale - - - - Blacklist/Whitelist flags used in parcels Access List - - - - Agent is denied access - - - Agent is granted access - - - - The result of a request for parcel properties - - - - No matches were found for the request - - - Request matched a single parcel - - - Request matched multiple parcels - - - - Flags used in the ParcelAccessListRequest packet to specify whether - we want the access list (whitelist), ban list (blacklist), or both - - - - Request the access list - - - Request the ban list - - - Request both White and Black lists - - - - Sequence ID in ParcelPropertiesReply packets (sent when avatar - tries to cross a parcel border) - - - - Parcel is currently selected - - - Parcel restricted to a group the avatar is not a - member of - - - Avatar is banned from the parcel - - - Parcel is restricted to an access list that the - avatar is not on - - - Response to hovering over a parcel - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Reasons agent is denied access to a parcel on the simulator - - - - Agent is not denied, access is granted - - - Agent is not a member of the group set for the parcel, or which owns the parcel - - - Agent is not on the parcels specific allow list - - - Agent is on the parcels ban list - - - Unknown - - - Agent is not age verified and parcel settings deny access to non age verified avatars - - - - Parcel overlay type. This is used primarily for highlighting and - coloring which is why it is a single integer instead of a set of - flags - - These values seem to be poorly thought out. The first three - bits represent a single value, not flags. For example Auction (0x05) is - not a combination of OwnedByOther (0x01) and ForSale(0x04). However, - the BorderWest and BorderSouth values are bit flags that get attached - to the value stored in the first three bits. Bits four, five, and six - are unused - - - Public land - - - Land is owned by another avatar - - - Land is owned by a group - - - Land is owned by the current avatar - - - Land is for sale - - - Land is being auctioned - - - To the west of this area is a parcel border - - - To the south of this area is a parcel border - - - - Various parcel properties - - - - No flags set - - - Allow avatars to fly (a client-side only restriction) - - - Allow foreign scripts to run - - - This parcel is for sale - - - Allow avatars to create a landmark on this parcel - - - Allows all avatars to edit the terrain on this parcel - - - Avatars have health and can take damage on this parcel. - If set, avatars can be killed and sent home here - - - Foreign avatars can create objects here - - - All objects on this parcel can be purchased - - - Access is restricted to a group - - - Access is restricted to a whitelist - - - Ban blacklist is enabled - - - Unknown - - - List this parcel in the search directory - - - Allow personally owned parcels to be deeded to group - - - If Deeded, owner contributes required tier to group parcel is deeded to - - - Restrict sounds originating on this parcel to the - parcel boundaries - - - Objects on this parcel are sold when the land is - purchsaed - - - Allow this parcel to be published on the web - - - The information for this parcel is mature content - - - The media URL is an HTML page - - - The media URL is a raw HTML string - - - Restrict foreign object pushes - - - Ban all non identified/transacted avatars - - - Allow group-owned scripts to run - - - Allow object creation by group members or group - objects - - - Allow all objects to enter this parcel - - - Only allow group and owner objects to enter this parcel - - - Voice Enabled on this parcel - - - Use Estate Voice channel for Voice on this parcel - - - Deny Age Unverified Users - - - - Parcel ownership status - - - - Placeholder - - - Parcel is leased (owned) by an avatar or group - - - Parcel is in process of being leased (purchased) by an avatar or group - - - Parcel has been abandoned back to Governor Linden - - - - Category parcel is listed in under search - - - - No assigned category - - - Linden Infohub or public area - - - Adult themed area - - - Arts and Culture - - - Business - - - Educational - - - Gaming - - - Hangout or Club - - - Newcomer friendly - - - Parks and Nature - - - Residential - - - Shopping - - - Not Used? - - - Other - - - Not an actual category, only used for queries - - - - Type of teleport landing for a parcel - - - - Unset, simulator default - - - Specific landing point set for this parcel - - - No landing point set, direct teleports enabled for - this parcel - - - - Parcel Media Command used in ParcelMediaCommandMessage - - - - Stop the media stream and go back to the first frame - - - Pause the media stream (stop playing but stay on current frame) - - - Start the current media stream playing and stop when the end is reached - - - Start the current media stream playing, - loop to the beginning when the end is reached and continue to play - - - Specifies the texture to replace with video - If passing the key of a texture, it must be explicitly typecast as a key, - not just passed within double quotes. - - - Specifies the movie URL (254 characters max) - - - Specifies the time index at which to begin playing - - - Specifies a single agent to apply the media command to - - - Unloads the stream. While the stop command sets the texture to the first frame of the movie, - unload resets it to the real texture that the movie was replacing. - - - Turn on/off the auto align feature, similar to the auto align checkbox in the parcel media properties - (NOT to be confused with the "align" function in the textures view of the editor!) Takes TRUE or FALSE as parameter. - - - Allows a Web page or image to be placed on a prim (1.19.1 RC0 and later only). - Use "text/html" for HTML. - - - Resizes a Web page to fit on x, y pixels (1.19.1 RC0 and later only). - This might still not be working - - - Sets a description for the media being displayed (1.19.1 RC0 and later only). - - - - Some information about a parcel of land returned from a DirectoryManager search - - - - Global Key of record - - - Parcel Owners - - - Name field of parcel, limited to 128 characters - - - Description field of parcel, limited to 256 characters - - - Total Square meters of parcel - - - Total area billable as Tier, for group owned land this will be 10% less than ActualArea - - - True of parcel is in Mature simulator - - - Grid global X position of parcel - - - Grid global Y position of parcel - - - Grid global Z position of parcel (not used) - - - Name of simulator parcel is located in - - - Texture of parcels display picture - - - Float representing calculated traffic based on time spent on parcel by avatars - - - Sale price of parcel (not used) - - - Auction ID of parcel - - - - Parcel Media Information - - - - A byte, if 0x1 viewer should auto scale media to fit object - - - A boolean, if true the viewer should loop the media - - - The Asset UUID of the Texture which when applied to a - primitive will display the media - - - A URL which points to any Quicktime supported media type - - - A description of the media - - - An Integer which represents the height of the media - - - An integer which represents the width of the media - - - A string which contains the mime type of the media - - - - Parcel of land, a portion of virtual real estate in a simulator - - - - - - - - - - - - - Simulator-local ID of this parcel - - - UUID of the owner of this parcel - - - Whether the land is deeded to a group or not - - - - - - Date land was claimed - - - Appears to always be zero - - - This field is no longer used - - - Minimum corner of the axis-aligned bounding box for this - parcel - - - Maximum corner of the axis-aligned bounding box for this - parcel - - - Bitmap describing land layout in 4x4m squares across the - entire region - - - Total parcel land area - - - - - - Maximum primitives across the entire simulator - - - Total primitives across the entire simulator - - - Maximum number of primitives this parcel supports - - - Total number of primitives on this parcel - - - Total number of primitives owned by the parcel owner on - this parcel - - - Total number of primitives owned by the parcel group on - this parcel - - - Total number of other primitives on this parcel - - - - - - Autoreturn value in minutes for others' objects - - - - - - Sale price of the parcel, only useful if ForSale is set - The SalePrice will remain the same after an ownership - transfer (sale), so it can be used to see the purchase price after - a sale if the new owner has not changed it - - - Parcel Name - - - Parcel Description - - - URL For Music Stream - - - - - - Price for a temporary pass - - - How long is pass valid for - - - - - - Key of authorized buyer - - - Key of parcel snapshot - - - - - - - - - - - - - - - - - - - - - Access list of who is whitelisted on this - parcel - - - Access list of who is blacklisted on this - parcel - - - TRUE of region denies access to age unverified users - - - true to obscure (hide) media url - - - true to obscure (hide) music url - - - A struct containing media details - - - - Displays a parcel object in string format - - string containing key=value pairs of a parcel object - - - - Defalt constructor - - Local ID of this parcel - - - - Update the simulator with any local changes to this Parcel object - - Simulator to send updates to - Whether we want the simulator to confirm - the update with a reply packet or not - - - - Set Autoreturn time - - Simulator to send the update to - - - - Parcel (subdivided simulator lots) subsystem - - - - - Default constructor - - A reference to the GridClient object - - - - Request basic information for a single parcel - - Simulator-local ID of the parcel - - - - Request properties of a single parcel - - Simulator containing the parcel - Simulator-local ID of the parcel - An arbitrary integer that will be returned - with the ParcelProperties reply, useful for distinguishing between - multiple simultaneous requests - - - - Request the access list for a single parcel - - Simulator containing the parcel - Simulator-local ID of the parcel - An arbitrary integer that will be returned - with the ParcelAccessList reply, useful for distinguishing between - multiple simultaneous requests - - - - - Request properties of parcels using a bounding box selection - - Simulator containing the parcel - Northern boundary of the parcel selection - Eastern boundary of the parcel selection - Southern boundary of the parcel selection - Western boundary of the parcel selection - An arbitrary integer that will be returned - with the ParcelProperties reply, useful for distinguishing between - different types of parcel property requests - A boolean that is returned with the - ParcelProperties reply, useful for snapping focus to a single - parcel - - - - Request all simulator parcel properties (used for populating the Simulator.Parcels - dictionary) - - Simulator to request parcels from (must be connected) - - - - Request all simulator parcel properties (used for populating the Simulator.Parcels - dictionary) - - Simulator to request parcels from (must be connected) - If TRUE, will force a full refresh - Number of milliseconds to pause in between each request - - - - Request the dwell value for a parcel - - Simulator containing the parcel - Simulator-local ID of the parcel - - - - Send a request to Purchase a parcel of land - - The Simulator the parcel is located in - The parcels region specific local ID - true if this parcel is being purchased by a group - The groups - true to remove tier contribution if purchase is successful - The parcels size - The purchase price of the parcel - - - - - Reclaim a parcel of land - - The simulator the parcel is in - The parcels region specific local ID - - - - Deed a parcel to a group - - The simulator the parcel is in - The parcels region specific local ID - The groups - - - - Request prim owners of a parcel of land. - - Simulator parcel is in - The parcels region specific local ID - - - - Return objects from a parcel - - Simulator parcel is in - The parcels region specific local ID - the type of objects to return, - A list containing object owners s to return - - - - Subdivide (split) a parcel - - - - - - - - - - Join two parcels of land creating a single parcel - - - - - - - - - - Get a parcels LocalID - - Simulator parcel is in - Vector3 position in simulator (Z not used) - 0 on failure, or parcel LocalID on success. - A call to Parcels.RequestAllSimParcels is required to populate map and - dictionary. - - - - Terraform (raise, lower, etc) an area or whole parcel of land - - Simulator land area is in. - LocalID of parcel, or -1 if using bounding box - From Enum, Raise, Lower, Level, Smooth, Etc. - Size of area to modify - true on successful request sent. - Settings.STORE_LAND_PATCHES must be true, - Parcel information must be downloaded using RequestAllSimParcels() - - - - Terraform (raise, lower, etc) an area or whole parcel of land - - Simulator land area is in. - west border of area to modify - south border of area to modify - east border of area to modify - north border of area to modify - From Enum, Raise, Lower, Level, Smooth, Etc. - Size of area to modify - true on successful request sent. - Settings.STORE_LAND_PATCHES must be true, - Parcel information must be downloaded using RequestAllSimParcels() - - - - Terraform (raise, lower, etc) an area or whole parcel of land - - Simulator land area is in. - LocalID of parcel, or -1 if using bounding box - west border of area to modify - south border of area to modify - east border of area to modify - north border of area to modify - From Enum, Raise, Lower, Level, Smooth, Etc. - Size of area to modify - How many meters + or - to lower, 1 = 1 meter - true on successful request sent. - Settings.STORE_LAND_PATCHES must be true, - Parcel information must be downloaded using RequestAllSimParcels() - - - - Terraform (raise, lower, etc) an area or whole parcel of land - - Simulator land area is in. - LocalID of parcel, or -1 if using bounding box - west border of area to modify - south border of area to modify - east border of area to modify - north border of area to modify - From Enum, Raise, Lower, Level, Smooth, Etc. - Size of area to modify - How many meters + or - to lower, 1 = 1 meter - Height at which the terraform operation is acting at - - - - Sends a request to the simulator to return a list of objects owned by specific owners - - Simulator local ID of parcel - Owners, Others, Etc - List containing keys of avatars objects to select; - if List is null will return Objects of type selectType - Response data is returned in the event - - - - Eject and optionally ban a user from a parcel - - target key of avatar to eject - true to also ban target - - - - Freeze or unfreeze an avatar over your land - - target key to freeze - true to freeze, false to unfreeze - - - - Abandon a parcel of land - - Simulator parcel is in - Simulator local ID of parcel - - - - Requests the UUID of the parcel in a remote region at a specified location - - Location of the parcel in the remote region - Remote region handle - Remote region UUID - If successful UUID of the remote parcel, UUID.Zero otherwise - - - - ParcelProperties replies sent over CAPS - - Not used (will always be ParcelProperties) - IMessage object containing decoded data from OSD - Object representing simulator - - - - - - - - - - - Decode the prim owner information, send the decoded object to any event subscribers - - - IMessage object containing decoded data from OSD - - - - - - - - - - - Fired when a is received, - in response to a - - - Fired when a is received, - in response to a - - - Fired when a ParcelProperties Packet is received over the subsystem, - in response to a - - - Fired when a is received, - in response to a - - - Fired when the Agent receives a , - in response to - - - Fired when the simulator parcel dictionary is populated in response - to a request - - - Fired when the Agent receives a , - in response to a request - - - Fired when the Agent receives a which - occurs when the parcel media information is changed for the current parcel the Agent is over - - - Fired when the Agent receives a which - occurs when the parcel media has a specialized event like starting and looping command on the media is raised - for the current parcel the Agent is over - - - - Parcel Accesslist - - - - Agents - - - - - - Flags for specific entry in white/black lists - - - - Owners of primitives on parcel - - - - Prim Owners - - - True of owner is group - - - Total count of prims owned by OwnerID - - - true of OwnerID is currently online and is not a group - - - The date of the most recent prim left by OwnerID - - - - - - UUID of the requested parcel - Simulator-local ID of the requested parcel - Dwell value of the requested parcel - - - - - - - - - - - - Simulator the parcel is in - Full properties for a single parcel. If result - is NoData this will be incomplete or incorrect data - Success of the query - Number of primitives your avatar is currently - selecting and sitting on in this parcel - User-assigned identifier for the query - User-assigned boolean for the query - - - - - - Simulator the parcel is in - - - - - - - - Responses to a request for prim owners on a parcel - - simulator parcel is in - List containing details or prim ownership - - - - Fired when all parcels are downloaded from simulator - - Simulator the parcel is in - Read-only dictionary containing parcel details for the simulator - 64,64 array containing sim position to localID mapping - - - - Fired in response to SelectParcelObjects - - simulator the objects are in - Local IDs of the selected objects - If true, list is start of a new selection - - - - Fired when a ParcelMediaUpdate packet is received, this occurs when the media on the parcel an avatar - is over changes - - A reference to the simulator object - A struct containing updated media information - - - - Fired when a ParcelMediaCommandMessage packet is received, this occurs when the media on the parcel sends a specialized event - - A reference to the simulator object - The sequence the parcel command belongs to - Updated parcel information - The command executed on the Parcel - The time operand for some parcel commands - - - - A Name Value pair with additional settings, used in the protocol - primarily to transmit avatar names and active group in object packets - - - - - - - - - - - - - - - - - - - - Constructor that takes all the fields as parameters - - - - - - - - - - Constructor that takes a single line from a NameValue field - - - - - Type of the value - - - Unknown - - - String value - - - - - - - - - - - - - - - Deprecated - - - String value, but designated as an asset - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Singleton logging class for the entire library - - - - log4net logging engine - - - - Default constructor - - - - - Send a log message to the logging engine - - The log message - The severity of the log entry - - - - Send a log message to the logging engine - - The log message - The severity of the log entry - Instance of the client - - - - Send a log message to the logging engine - - The log message - The severity of the log entry - Exception that was raised - - - - Send a log message to the logging engine - - The log message - The severity of the log entry - Instance of the client - Exception that was raised - - - - If the library is compiled with DEBUG defined, an event will be - fired if an OnLogMessage handler is registered and the - message will be sent to the logging engine - - The message to log at the DEBUG level to the - current logging engine - - - - If the library is compiled with DEBUG defined and - GridClient.Settings.DEBUG is true, an event will be - fired if an OnLogMessage handler is registered and the - message will be sent to the logging engine - - The message to log at the DEBUG level to the - current logging engine - Instance of the client - - - Triggered whenever a message is logged. If this is left - null, log messages will go to the console - - - - Callback used for client apps to receive log messages from - the library - - Data being logged - The severity of the log entry from - - - - Static helper functions and global variables - - - - This header flag signals that ACKs are appended to the packet - - - This header flag signals that this packet has been sent before - - - This header flags signals that an ACK is expected for this packet - - - This header flag signals that the message is compressed using zerocoding - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Given an X/Y location in absolute (grid-relative) terms, a region - handle is returned along with the local X/Y location in that region - - The absolute X location, a number such as - 255360.35 - The absolute Y location, a number such as - 255360.35 - The sim-local X position of the global X - position, a value from 0.0 to 256.0 - The sim-local Y position of the global Y - position, a value from 0.0 to 256.0 - A 64-bit region handle that can be used to teleport to - - - - Converts a floating point number to a terse string format used for - transmitting numbers in wearable asset files - - Floating point number to convert to a string - A terse string representation of the input number - - - - Convert a variable length field (byte array) to a string, with a - field name prepended to each line of the output - - If the byte array has unprintable characters in it, a - hex dump will be written instead - The StringBuilder object to write to - The byte array to convert to a string - A field name to prepend to each line of output - - - - Decode a zerocoded byte array, used to decompress packets marked - with the zerocoded flag - - Any time a zero is encountered, the next byte is a count - of how many zeroes to expand. One zero is encoded with 0x00 0x01, - two zeroes is 0x00 0x02, three zeroes is 0x00 0x03, etc. The - first four bytes are copied directly to the output buffer. - - The byte array to decode - The length of the byte array to decode. This - would be the length of the packet up to (but not including) any - appended ACKs - The output byte array to decode to - The length of the output buffer - - - - Encode a byte array with zerocoding. Used to compress packets marked - with the zerocoded flag. Any zeroes in the array are compressed down - to a single zero byte followed by a count of how many zeroes to expand - out. A single zero becomes 0x00 0x01, two zeroes becomes 0x00 0x02, - three zeroes becomes 0x00 0x03, etc. The first four bytes are copied - directly to the output buffer. - - The byte array to encode - The length of the byte array to encode - The output byte array to encode to - The length of the output buffer - - - - Calculates the CRC (cyclic redundancy check) needed to upload inventory. - - Creation date - Sale type - Inventory type - Type - Asset ID - Group ID - Sale price - Owner ID - Creator ID - Item ID - Folder ID - Everyone mask (permissions) - Flags - Next owner mask (permissions) - Group mask (permissions) - Owner mask (permisions) - The calculated CRC - - - - Attempts to load a file embedded in the assembly - - The filename of the resource to load - A Stream for the requested file, or null if the resource - was not successfully loaded - - - - Attempts to load a file either embedded in the assembly or found in - a given search path - - The filename of the resource to load - An optional path that will be searched if - the asset is not found embedded in the assembly - A Stream for the requested file, or null if the resource - was not successfully loaded - - - - Converts a list of primitives to an object that can be serialized - with the LLSD system - - Primitives to convert to a serializable object - An object that can be serialized with LLSD - - - - Deserializes OSD in to a list of primitives - - Structure holding the serialized primitive list, - must be of the SDMap type - A list of deserialized primitives - - - - Passed to Logger.Log() to identify the severity of a log entry - - - - No logging information will be output - - - Non-noisy useful information, may be helpful in - debugging a problem - - - A non-critical error occurred. A warning will not - prevent the rest of the library from operating as usual, - although it may be indicative of an underlying issue - - - A critical error has occurred. Generally this will - be followed by the network layer shutting down, although the - stability of the library after an error is uncertain - - - Used for internal testing, this logging level can - generate very noisy (long and/or repetitive) messages. Don't - pass this to the Log() function, use DebugLog() instead. - - - - - Represents a primitive asset - - - - Initializes a new instance of an AssetPrim object - - - - - - - - - - - - - - Override the base classes AssetType - - - - Only used internally for XML serialization/deserialization - - - - - The current status of a texture request as it moves through the pipeline or final result of a texture request. - - - - The initial state given to a request. Requests in this state - are waiting for an available slot in the pipeline - - - A request that has been added to the pipeline and the request packet - has been sent to the simulator - - - A request that has received one or more packets back from the simulator - - - A request that has received all packets back from the simulator - - - A request that has taken longer than - to download OR the initial packet containing the packet information was never received - - - The texture request was aborted by request of the agent - - - The simulator replied to the request that it was not able to find the requested texture - - - - A callback fired to indicate the status or final state of the requested texture. For progressive - downloads this will fire each time new asset data is returned from the simulator. - - The indicating either Progress for textures not fully downloaded, - or the final result of the request after it has been processed through the TexturePipeline - The object containing the Assets ID, raw data - and other information. For progressive rendering the will contain - the data from the beginning of the file. For failed, aborted and timed out requests it will contain - an empty byte array. - - - - Texture request download handler, allows a configurable number of download slots which manage multiple - concurrent texture downloads from the - - This class makes full use of the internal - system for full texture downloads. - - - A dictionary containing all pending and in-process transfer requests where the Key is both the RequestID - and also the Asset Texture ID, and the value is an object containing the current state of the request and also - the asset data as it is being re-assembled - - - Holds the reference to the client object - - - Maximum concurrent texture requests allowed at a time - - - An array of objects used to manage worker request threads - - - An array of worker slots which shows the availablity status of the slot - - - The primary thread which manages the requests. - - - true if the TexturePipeline is currently running - - - A synchronization object used by the primary thread - - - A refresh timer used to increase the priority of stalled requests - - - - Default constructor, Instantiates a new copy of the TexturePipeline class - - Reference to the instantiated object - - - - Initialize callbacks required for the TexturePipeline to operate - - - - - Shutdown the TexturePipeline and cleanup any callbacks or transfers - - - - - Request a texture asset from the simulator using the system to - manage the requests and re-assemble the image from the packets received from the simulator - - The of the texture asset to download - The of the texture asset. - Use for most textures, or for baked layer texture assets - A float indicating the requested priority for the transfer. Higher priority values tell the simulator - to prioritize the request before lower valued requests. An image already being transferred using the can have - its priority changed by resending the request with the new priority value - Number of quality layers to discard. - This controls the end marker of the data sent - The packet number to begin the request at. A value of 0 begins the request - from the start of the asset texture - The callback to fire when the image is retrieved. The callback - will contain the result of the request and the texture asset data - If true, the callback will be fired for each chunk of the downloaded image. - The callback asset parameter will contain all previously received chunks of the texture asset starting - from the beginning of the request - - - - Sends the actual request packet to the simulator - - The image to download - Type of the image to download, either a baked - avatar texture or a normal texture - Priority level of the download. Default is - 1,013,000.0f - Number of quality layers to discard. - This controls the end marker of the data sent - Packet number to start the download at. - This controls the start marker of the data sent - Sending a priority of 0 and a discardlevel of -1 aborts - download - - - - Cancel a pending or in process texture request - - The texture assets unique ID - - - - Master Download Thread, Queues up downloads in the threadpool - - - - - The worker thread that sends the request and handles timeouts - - A object containing the request details - - - - Handle responses from the simulator that tell us a texture we have requested is unable to be located - or no longer exists. This will remove the request from the pipeline and free up a slot if one is in use - - The - The sending this packet - - - - Handles the remaining Image data that did not fit in the initial ImageData packet - - - - - Handle the initial ImageDataPacket sent from the simulator - - - - - - Current number of pending and in-process transfers - - - - A request task containing information and status of a request as it is processed through the - - - - The current which identifies the current status of the request - - - The Unique Request ID, This is also the Asset ID of the texture being requested - - - The slot this request is occupying in the threadpoolSlots array - - - The ImageType of the request. - - - The callback to fire when the request is complete, will include - the and the - object containing the result data - - - If true, indicates the callback will be fired whenever new data is returned from the simulator. - This is used to progressively render textures as portions of the texture are received. - - - An object that maintains the data of an request thats in-process. - - - - Wrapper around a byte array that allows bit to be packed and unpacked - one at a time or by a variable amount. Useful for very tightly packed - data like LayerData packets - - - - - - - - Default constructor, initialize the bit packer / bit unpacker - with a byte array and starting position - - Byte array to pack bits in to or unpack from - Starting position in the byte array - - - - Pack a floating point value in to the data - - Floating point value to pack - - - - Pack part or all of an integer in to the data - - Integer containing the data to pack - Number of bits of the integer to pack - - - - Pack part or all of an unsigned integer in to the data - - Unsigned integer containing the data to pack - Number of bits of the integer to pack - - - - - - - - - - - - - - - - - - - - - - - - - Unpacking a floating point value from the data - - Unpacked floating point value - - - - Unpack a variable number of bits from the data in to integer format - - Number of bits to unpack - An integer containing the unpacked bits - This function is only useful up to 32 bits - - - - Unpack a variable number of bits from the data in to unsigned - integer format - - Number of bits to unpack - An unsigned integer containing the unpacked bits - This function is only useful up to 32 bits - - - - Unpack a 16-bit signed integer - - 16-bit signed integer - - - - Unpack a 16-bit unsigned integer - - 16-bit unsigned integer - - - - Unpack a 32-bit signed integer - - 32-bit signed integer - - - - Unpack a 32-bit unsigned integer - - 32-bit unsigned integer - - - - - - - - - - Represents a texture - - - - A object containing image data - - - - - - - - - Initializes a new instance of an AssetTexture object - - - - Initializes a new instance of an AssetTexture object - - A unique specific to this asset - A byte array containing the raw asset data - - - - Initializes a new instance of an AssetTexture object - - A object containing texture data - - - - Populates the byte array with a JPEG2000 - encoded image created from the data in - - - - - Decodes the JPEG2000 data in AssetData to the - object - - True if the decoding was successful, otherwise false - - - - Decodes the begin and end byte positions for each quality layer in - the image - - - - - Override the base classes AssetType - - - - Represents a Sound Asset - - - - Initializes a new instance of an AssetSound object - - - Initializes a new instance of an AssetSound object with parameters - A unique specific to this asset - A byte array containing the raw asset data - - - - TODO: Encodes a sound file - - - - - TODO: Decode a sound file - - true - - - Override the base classes AssetType - - - - Represents an LSL Text object containing a string of UTF encoded characters - - - - A string of characters represting the script contents - - - Initializes a new AssetScriptText object - - - - Initializes a new AssetScriptText object with parameters - - A unique specific to this asset - A byte array containing the raw asset data - - - - Initializes a new AssetScriptText object with parameters - - A string containing the scripts contents - - - - Encode a string containing the scripts contents into byte encoded AssetData - - - - - Decode a byte array containing the scripts contents into a string - - true if decoding is successful - - - Override the base classes AssetType - - - - A single visual characteristic of an avatar mesh, such as eyebrow height - - - - Index of this visual param - - - Internal name - - - Group ID this parameter belongs to - - - Name of the wearable this parameter belongs to - - - Displayable label of this characteristic - - - Displayable label for the minimum value of this characteristic - - - Displayable label for the maximum value of this characteristic - - - Default value - - - Minimum value - - - Maximum value - - - - Set all the values through the constructor - - Index of this visual param - Internal name - - - Displayable label of this characteristic - Displayable label for the minimum value of this characteristic - Displayable label for the maximum value of this characteristic - Default value - Minimum value - Maximum value - - - - Holds the Params array of all the avatar appearance parameters - - - - - Viewer Params Array Element for AgentSetAppearance - - - - - Brow Size - Small 0--+255 Large - - - - - Nose Size - Small 0--+255 Large - - - - - Nostril Width - Narrow 0--+255 Broad - - - - - Chin Cleft - Round 0--+255 Cleft - - - - - Nose Tip Shape - Pointy 0--+255 Bulbous - - - - - Chin Angle - Chin Out 0--+255 Chin In - - - - - Chin-Neck - Tight Chin 0--+255 Double Chin - - - - - Lower Cheeks - Well-Fed 0--+255 Sunken - - - - - Upper Bridge - Low 0--+255 High - - - - - - Less 0--+255 More - - - - - Upper Chin Cleft - Round 0--+255 Cleft - - - - - Cheek Bones - Low 0--+255 High - - - - - Ear Angle - In 0--+255 Out - - - - - Eyebrow Points - Smooth 0--+255 Pointy - - - - - Jaw Shape - Pointy 0--+255 Square - - - - - Upper Cheeks - Thin 0--+255 Puffy - - - - - Nose Tip Angle - Downturned 0--+255 Upturned - - - - - Nose Thickness - Thin Nose 0--+255 Bulbous Nose - - - - - Upper Eyelid Fold - Uncreased 0--+255 Creased - - - - - Attached Earlobes - Unattached 0--+255 Attached - - - - - Eye Bags - Smooth 0--+255 Baggy - - - - - Eye Opening - Narrow 0--+255 Wide - - - - - Lip Cleft - Narrow 0--+255 Wide - - - - - Bridge Width - Narrow 0--+255 Wide - - - - - Eyebrow Arc - Flat 0--+255 Arced - - - - - Height - Short 0--+255 Tall - - - - - Body Thickness - Body Thin 0--+255 Body Thick - - - - - Ear Size - Small 0--+255 Large - - - - - Shoulders - Narrow 0--+255 Broad - - - - - Hip Width - Narrow 0--+255 Wide - - - - - - Short Torso 0--+255 Long Torso - - - - - - Short 0--+255 Long - - - - - - Darker 0--+255 Lighter - - - - - - Natural 0--+255 Unnatural - - - - - - Small 0--+255 Large - - - - - - None 0--+255 Wild - - - - - Ruddiness - Pale 0--+255 Ruddy - - - - - - Light 0--+255 Dark - - - - - - No Red 0--+255 Very Red - - - - - - Black 0--+255 Blonde - - - - - - No White 0--+255 All White - - - - - - Less Rosy 0--+255 More Rosy - - - - - - Darker 0--+255 Pinker - - - - - - Thin Eyebrows 0--+255 Bushy Eyebrows - - - - - - Short 0--+255 Long - - - - - - Short 0--+255 Long - - - - - - Short 0--+255 Long - - - - - - Short 0--+255 Long - - - - - - Short 0--+255 Long - - - - - - Short 0--+255 Long - - - - - - Sweep Forward 0--+255 Sweep Back - - - - - - Left 0--+255 Right - - - - - Middle Part - No Part 0--+255 Part - - - - - Right Part - No Part 0--+255 Part - - - - - Left Part - No Part 0--+255 Part - - - - - Full Hair Sides - Mowhawk 0--+255 Full Sides - - - - - - Less 0--+255 More - - - - - Lip Width - Narrow Lips 0--+255 Wide Lips - - - - - - Small 0--+255 Big - - - - - - Less 0--+255 More - - - - - - Less 0--+255 More - - - - - - Less 0--+255 More - - - - - - Short Sideburns 0--+255 Mutton Chops - - - - - - Chaplin 0--+255 Handlebars - - - - - - Less soul 0--+255 More soul - - - - - - Less Curtains 0--+255 More Curtains - - - - - Rumpled Hair - Smooth Hair 0--+255 Rumpled Hair - - - - - Big Hair Front - Less 0--+255 More - - - - - Big Hair Top - Less 0--+255 More - - - - - Big Hair Back - Less 0--+255 More - - - - - Spiked Hair - No Spikes 0--+255 Big Spikes - - - - - Chin Depth - Shallow 0--+255 Deep - - - - - Part Bangs - No Part 0--+255 Part Bangs - - - - - Head Shape - More Square 0--+255 More Round - - - - - Eye Spacing - Close Set Eyes 0--+255 Far Set Eyes - - - - - - Low Heels 0--+255 High Heels - - - - - - Low Platforms 0--+255 High Platforms - - - - - - Thin Lips 0--+255 Fat Lips - - - - - Mouth Position - High 0--+255 Low - - - - - Breast Buoyancy - Less Gravity 0--+255 More Gravity - - - - - Platform Width - Narrow 0--+255 Wide - - - - - - Pointy Heels 0--+255 Thick Heels - - - - - - Pointy 0--+255 Square - - - - - Foot Size - Small 0--+255 Big - - - - - Nose Width - Narrow 0--+255 Wide - - - - - Eyelash Length - Short 0--+255 Long - - - - - - Short 0--+255 Long - - - - - - Short 0--+255 Long - - - - - - Low 0--+255 High - - - - - Jacket Length - Short 0--+255 Long - - - - - Open Front - Open 0--+255 Closed - - - - - - Short 0--+255 Tall - - - - - - Short 0--+255 Long - - - - - - Short 0--+255 Long - - - - - - Low 0--+255 High - - - - - Cuff Flare - Tight Cuffs 0--+255 Flared Cuffs - - - - - - More Vertical 0--+255 More Sloped - - - - - - Less Body Fat 0--+255 More Body Fat - - - - - Pants Crotch - High and Tight 0--+255 Low and Loose - - - - - Egg Head - Chin Heavy 0--+255 Forehead Heavy - - - - - Head Stretch - Squash Head 0--+255 Stretch Head - - - - - Torso Muscles - Less Muscular 0--+255 More Muscular - - - - - Outer Eye Corner - Corner Down 0--+255 Corner Up - - - - - - Less Muscular 0--+255 More Muscular - - - - - Lip Fullness - Less Full 0--+255 More Full - - - - - Toe Thickness - Flat Toe 0--+255 Thick Toe - - - - - Crooked Nose - Nose Left 0--+255 Nose Right - - - - - - Corner Down 0--+255 Corner Up - - - - - - Shear Right Up 0--+255 Shear Left Up - - - - - Shift Mouth - Shift Left 0--+255 Shift Right - - - - - Eye Pop - Pop Right Eye 0--+255 Pop Left Eye - - - - - Jaw Jut - Overbite 0--+255 Underbite - - - - - Shear Back - Full Back 0--+255 Sheared Back - - - - - - Small Hands 0--+255 Large Hands - - - - - Love Handles - Less Love 0--+255 More Love - - - - - Head Size - Small Head 0--+255 Big Head - - - - - - Skinny Neck 0--+255 Thick Neck - - - - - Breast Cleavage - Separate 0--+255 Join - - - - - Pectorals - Big Pectorals 0--+255 Sunken Chest - - - - - Eye Size - Beady Eyes 0--+255 Anime Eyes - + + Xfer data - - - - Short Legs 0--+255 Long Legs - - - - - - Short Arms 0--+255 Long arms - - - - - - Pink 0--+255 Black - - - - - - No Lipstick 0--+255 More Lipstick - - - - - - No Lipgloss 0--+255 Glossy - - - - - - No Eyeliner 0--+255 Full Eyeliner - - - - - - No Blush 0--+255 More Blush - - - - - - Pink 0--+255 Orange - - - - - - Clear 0--+255 Opaque - - - - - - No Eyeshadow 0--+255 More Eyeshadow - - - - - - Light 0--+255 Dark - - - - - - No Eyeshadow 0--+255 More Eyeshadow - - - - - - No Polish 0--+255 Painted Nails - - - - - - Clear 0--+255 Opaque - - - - - - Light 0--+255 Dark - - - - - - Clear 0--+255 Opaque - - - - - - Dark Green 0--+255 Black - - - - - - Pink 0--+255 Black - - - - - - Sparse 0--+255 Dense - - - - - - 5 O'Clock Shadow 0--+255 Bushy Hair - - - - - Saddle Bags - Less Saddle 0--+255 More Saddle - - - - - Taper Back - Wide Back 0--+255 Narrow Back - - - - - Taper Front - Wide Front 0--+255 Narrow Front - - - - - - Short Neck 0--+255 Long Neck - - - - - Eyebrow Height - Higher 0--+255 Lower - - - - - Lower Bridge - Low 0--+255 High - - - - - Nostril Division - High 0--+255 Low - - - - - Jaw Angle - Low Jaw 0--+255 High Jaw - - - - - Shear Front - Full Front 0--+255 Sheared Front - - - - - - Less Volume 0--+255 More Volume - - - - - Lip Cleft Depth - Shallow 0--+255 Deep - - - - - Puffy Eyelids - Flat 0--+255 Puffy - - - - - - Sunken Eyes 0--+255 Bugged Eyes - - - - - - Flat Head 0--+255 Long Head - - - - - - Less Freckles 0--+255 More Freckles - - - - - - Low 0--+255 High - - - - - - Short Pigtails 0--+255 Long Pigtails - - - - - - Short Ponytail 0--+255 Long Ponytail - - - - - Butt Size - Flat Butt 0--+255 Big Butt - - - - - Ear Tips - Flat 0--+255 Pointy - - - - - Lip Ratio - More Upper Lip 0--+255 More Lower Lip - - - - - - Short 0--+255 Long - - - - - - Low 0--+255 High - + + Upload data - - - Pants Fit - Tight Pants 0--+255 Loose Pants - - - - - Shirt Fit - Tight Shirt 0--+255 Loose Shirt - - - - - Sleeve Looseness - Tight Sleeves 0--+255 Loose Sleeves - - - - - Knee Angle - Knock Kneed 0--+255 Bow Legged - - - - - - Short hips 0--+255 Long Hips - - - - - - Fingerless 0--+255 Fingers - - - - - bustle skirt - no bustle 0--+255 more bustle - - - - - - Short 0--+255 Long - - - - - - Open Front 0--+255 Closed Front - - - - - - Open Back 0--+255 Closed Back - - - - - - Open Left 0--+255 Closed Left - - - - - - Open Right 0--+255 Closed Right - - - - - Skirt Fit - Tight Skirt 0--+255 Poofy Skirt - - - - - Jacket Wrinkles - No Wrinkles 0--+255 Wrinkles - - - - - Package - Coin Purse 0--+255 Duffle Bag - - - - - Inner Eye Corner - Corner Down 0--+255 Corner Up - - - - - - - - - - An instance of DelegateWrapper which calls InvokeWrappedDelegate, - which in turn calls the DynamicInvoke method of the wrapped - delegate - - - - - Callback used to call EndInvoke on the asynchronously - invoked DelegateWrapper - - - - - Executes the specified delegate with the specified arguments - asynchronously on a thread pool thread - - - - - - - Invokes the wrapped delegate synchronously - - - - - - - Calls EndInvoke on the wrapper and Close on the resulting WaitHandle - to prevent resource leaks - - - - - - Delegate to wrap another delegate and its arguments - - - - - - Size of the byte array used to store raw packet data - - - Raw packet data buffer - - - Length of the data to transmit - - - EndPoint of the remote host - - - - Create an allocated UDP packet buffer for receiving a packet - - - - - Create an allocated UDP packet buffer for sending a packet - - EndPoint of the remote host - - - - Create an allocated UDP packet buffer for sending a packet - - EndPoint of the remote host - Size of the buffer to allocate for packet data - - - - Object pool for packet buffers. This is used to allocate memory for all - incoming and outgoing packets, and zerocoding buffers for those packets - - - - - Creates a new instance of the ObjectPoolBase class. Initialize MUST be called - after using this constructor. - - - - - Creates a new instance of the ObjectPool Base class. - - The object pool is composed of segments, which - are allocated whenever the size of the pool is exceeded. The number of items - in a segment should be large enough that allocating a new segmeng is a rare - thing. For example, on a server that will have 10k people logged in at once, - the receive buffer object pool should have segment sizes of at least 1000 - byte arrays per segment. - - The minimun number of segments that may exist. - Perform a full GC.Collect whenever a segment is allocated, and then again after allocation to compact the heap. - The frequency which segments are checked to see if they're eligible for cleanup. - - - - Forces the segment cleanup algorithm to be run. This method is intended - primarly for use from the Unit Test libraries. - - - - - Responsible for allocate 1 instance of an object that will be stored in a segment. - - An instance of whatever objec the pool is pooling. + + Filename used on the simulator - - - Checks in an instance of T owned by the object pool. This method is only intended to be called - by the WrappedObject class. - - The segment from which the instance is checked out. - The instance of T to check back into the segment. - - - - Checks an instance of T from the pool. If the pool is not sufficient to - allow the checkout, a new segment is created. - - A WrappedObject around the instance of T. To check - the instance back into the segment, be sureto dispose the WrappedObject - when finished. - - - - The total number of segments created. Intended to be used by the Unit Tests. - - - - - The number of items that are in a segment. Items in a segment - are all allocated at the same time, and are hopefully close to - each other in the managed heap. - - - - - The minimum number of segments. When segments are reclaimed, - this number of segments will always be left alone. These - segments are allocated at startup. - - - - - The age a segment must be before it's eligible for cleanup. - This is used to prevent thrash, and typical values are in - the 5 minute range. - - - - - The frequence which the cleanup thread runs. This is typically - expected to be in the 5 minute range. - - - - - Initialize the object pool in client mode - - Server to connect to - - - - - - Initialize the object pool in server mode - - - + + Filename used by the client - - - Returns a packet buffer with EndPoint set if the buffer is in - client mode, or with EndPoint set to null in server mode - - Initialized UDPPacketBuffer object + + UUID of the image that is in progress - - - Default constructor - + + Number of bytes received so far - - - Check a packet buffer out of the pool - - A packet buffer object + + Image size in bytes @@ -15616,6400 +23551,1518 @@ Agent floating with legs and arms crossed - + - Represents an that can be worn on an avatar - such as a Shirt, Pants, etc. + A dictionary containing all pre-defined animations - - - Initializes a new instance of an AssetScriptBinary object - - - Initializes a new instance of an AssetScriptBinary object with parameters - A unique specific to this asset - A byte array containing the raw asset data - - - Initializes a new instance of an AssetScriptBinary object with parameters - A string containing the Clothings data - - - Override the base classes AssetType - - - - Temporary code to produce a tar archive in tar v7 format - - - - - Binary writer for the underlying stream - - - - - Write a directory entry to the tar archive. We can only handle one path level right now! - - - - - - Write a file to the tar archive - - - - - - - Write a file to the tar archive - - - - - - - Finish writing the raw tar archive data to a stream. The stream will be closed on completion. - - - - - Write a particular entry - - - - - - - - Temporary code to do the bare minimum required to read a tar archive for our purposes - - - - - Binary reader for the underlying stream - - - - - Used to trim off null chars - - - - - Used to trim off space chars - - - - - Generate a tar reader which reads from the given stream. - - - - - - Read the next entry in the tar file. - - - - the data for the entry. Returns null if there are no more entries - - - - Read the next 512 byte chunk of data as a tar header. - - A tar header struct. null if we have reached the end of the archive. - - - - Read data following a header - - - - - - - Convert octal bytes to a decimal representation - - - - - - - - Sort by name - - - Sort by date - - - Sort folders by name, regardless of whether items are - sorted by name or date - - - Place system folders at the top - - - - Possible destinations for DeRezObject request - - - - - - - Copy from in-world to agent inventory - - - Derez to TaskInventory - - - - - - Take Object - - - - - - Delete Object - - - Put an avatar attachment into agent inventory - - - - - - Return an object back to the owner's inventory - - - Return a deeded object back to the last owner's inventory - - - - Upper half of the Flags field for inventory items - - - - Indicates that the NextOwner permission will be set to the - most restrictive set of permissions found in the object set - (including linkset items and object inventory items) on next rez - - - Indicates that the object sale information has been - changed - - - If set, and a slam bit is set, indicates BaseMask will be overwritten on Rez - - - If set, and a slam bit is set, indicates OwnerMask will be overwritten on Rez - - - If set, and a slam bit is set, indicates GroupMask will be overwritten on Rez - - - If set, and a slam bit is set, indicates EveryoneMask will be overwritten on Rez - - - If set, and a slam bit is set, indicates NextOwnerMask will be overwritten on Rez - - - Indicates whether this object is composed of multiple - items or not - - - Indicates that the asset is only referenced by this - inventory item. If this item is deleted or updated to reference a - new assetID, the asset can be deleted - - - - Base Class for Inventory Items - - - - of item/folder - - - of parent folder - - - Name of item/folder - - - Item/Folder Owners - - - - Constructor, takes an itemID as a parameter - - The of the item - - - - - - - - - - - - - - - - Generates a number corresponding to the value of the object to support the use of a hash table, - suitable for use in hashing algorithms and data structures such as a hash table - - A Hashcode of all the combined InventoryBase fields - - - - Determine whether the specified object is equal to the current object - - InventoryBase object to compare against - true if objects are the same - - - - Determine whether the specified object is equal to the current object - - InventoryBase object to compare against - true if objects are the same - - - - An Item in Inventory - - - - The of this item - - - The combined of this item - - - The type of item from - - - The type of item from the enum - - - The of the creator of this item - - - A Description of this item - - - The s this item is set to or owned by - - - If true, item is owned by a group - - - The price this item can be purchased for - - - The type of sale from the enum - - - Combined flags from - - - Time and date this inventory item was created, stored as - UTC (Coordinated Universal Time) - - - Used to update the AssetID in requests sent to the server - - - The of the previous owner of the item - - - - Construct a new InventoryItem object - - The of the item - - - - Construct a new InventoryItem object of a specific Type - - The type of item from - of the item - - - - - - - - - - - - - - - - Generates a number corresponding to the value of the object to support the use of a hash table. - Suitable for use in hashing algorithms and data structures such as a hash table - - A Hashcode of all the combined InventoryItem fields - - - - Compares an object - - The object to compare - true if comparison object matches - - - - Determine whether the specified object is equal to the current object - - The object to compare against - true if objects are the same - - - - Determine whether the specified object is equal to the current object - - The object to compare against - true if objects are the same - - - - InventoryTexture Class representing a graphical image - - - - - - Construct an InventoryTexture object - - A which becomes the - objects AssetUUID - - - - Construct an InventoryTexture object from a serialization stream - - - - - InventorySound Class representing a playable sound - - - - - Construct an InventorySound object - - A which becomes the - objects AssetUUID - - - - Construct an InventorySound object from a serialization stream - - - - - InventoryCallingCard Class, contains information on another avatar - - - - - Construct an InventoryCallingCard object - - A which becomes the - objects AssetUUID - - - - Construct an InventoryCallingCard object from a serialization stream - - - - - InventoryLandmark Class, contains details on a specific location - - - - - Construct an InventoryLandmark object - - A which becomes the - objects AssetUUID - - - - Construct an InventoryLandmark object from a serialization stream - - - - - Landmarks use the InventoryItemFlags struct and will have a flag of 1 set if they have been visited - - - - - InventoryObject Class contains details on a primitive or coalesced set of primitives - - - - - Construct an InventoryObject object - - A which becomes the - objects AssetUUID - - - - Construct an InventoryObject object from a serialization stream - - - - - Gets or sets the upper byte of the Flags value - - - - - Gets or sets the object attachment point, the lower byte of the Flags value - - - - - InventoryNotecard Class, contains details on an encoded text document - - - - - Construct an InventoryNotecard object - - A which becomes the - objects AssetUUID - - - - Construct an InventoryNotecard object from a serialization stream - - - - - InventoryCategory Class - - TODO: Is this even used for anything? - - - - Construct an InventoryCategory object - - A which becomes the - objects AssetUUID - - - - Construct an InventoryCategory object from a serialization stream - - - - - InventoryLSL Class, represents a Linden Scripting Language object - - - - - Construct an InventoryLSL object - - A which becomes the - objects AssetUUID - - - - Construct an InventoryLSL object from a serialization stream - - - - - InventorySnapshot Class, an image taken with the viewer - - - - - Construct an InventorySnapshot object - - A which becomes the - objects AssetUUID - - - - Construct an InventorySnapshot object from a serialization stream - - - - - InventoryAttachment Class, contains details on an attachable object - - - - - Construct an InventoryAttachment object - - A which becomes the - objects AssetUUID - - - - Construct an InventoryAttachment object from a serialization stream - - - - - Get the last AttachmentPoint this object was attached to - - - - - InventoryWearable Class, details on a clothing item or body part - - - - - Construct an InventoryWearable object - - A which becomes the - objects AssetUUID - - - - Construct an InventoryWearable object from a serialization stream - - - - - The , Skin, Shape, Skirt, Etc - - - - - InventoryAnimation Class, A bvh encoded object which animates an avatar - - - - - Construct an InventoryAnimation object - - A which becomes the - objects AssetUUID - - - - Construct an InventoryAnimation object from a serialization stream - - - - - InventoryGesture Class, details on a series of animations, sounds, and actions - - - - - Construct an InventoryGesture object - - A which becomes the - objects AssetUUID - - - - Construct an InventoryGesture object from a serialization stream - - - - - A folder contains s and has certain attributes specific - to itself - - - - The Preferred for a folder. - - - The Version of this folder - - - Number of child items this folder contains. - - - - Constructor - - UUID of the folder - - - - - - - - - - Get Serilization data for this InventoryFolder object - - - - - Construct an InventoryFolder object from a serialization stream - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Tools for dealing with agents inventory - - - - Used for converting shadow_id to asset_id - - - Partial mapping of AssetTypes to folder names - - - - Default constructor - - Reference to the GridClient object - - - - Fetch an inventory item from the dataserver - - The items - The item Owners - a integer representing the number of milliseconds to wait for results - An object on success, or null if no item was found - Items will also be sent to the event - - - - Request A single inventory item - - The items - The item Owners - - - - - Request inventory items - - Inventory items to request - Owners of the inventory items - - - - - Get contents of a folder - - The of the folder to search - The of the folders owner - true to retrieve folders - true to retrieve items - sort order to return results in - a integer representing the number of milliseconds to wait for results - A list of inventory items matching search criteria within folder - - InventoryFolder.DescendentCount will only be accurate if both folders and items are - requested - - - - Request the contents of an inventory folder - - The folder to search - The folder owners - true to return s contained in folder - true to return s containd in folder - the sort order to return items in - - - - - Returns the UUID of the folder (category) that defaults to - containing 'type'. The folder is not necessarily only for that - type - - This will return the root folder if one does not exist - - The UUID of the desired folder if found, the UUID of the RootFolder - if not found, or UUID.Zero on failure - - - - Find an object in inventory using a specific path to search - - The folder to begin the search in - The object owners - A string path to search - milliseconds to wait for a reply - Found items or if - timeout occurs or item is not found - - - - Find inventory items by path - - The folder to begin the search in - The object owners - A string path to search, folders/objects separated by a '/' - Results are sent to the event - - - - Search inventory Store object for an item or folder - - The folder to begin the search in - An array which creates a path to search - Number of levels below baseFolder to conduct searches - if True, will stop searching after first match is found - A list of inventory items found - - - - Move an inventory item or folder to a new location - - The item or folder to move - The to move item or folder to - - - - Move an inventory item or folder to a new location and change its name - - The item or folder to move - The to move item or folder to - The name to change the item or folder to - - - - Move and rename a folder - - The source folders - The destination folders - The name to change the folder to - - - - Move a folder - - The source folders - The destination folders - - - - Move multiple folders, the keys in the Dictionary parameter, - to a new parents, the value of that folder's key. - - A Dictionary containing the - of the source as the key, and the - of the destination as the value - - - - Move an inventory item to a new folder - - The of the source item to move - The of the destination folder - - - - Move and rename an inventory item - - The of the source item to move - The of the destination folder - The name to change the folder to - - - - Move multiple inventory items to new locations - - A Dictionary containing the - of the source item as the key, and the - of the destination folder as the value - - - - Remove descendants of a folder - - The of the folder - - - - Remove a single item from inventory - - The of the inventory item to remove - - - - Remove a folder from inventory - - The of the folder to remove - - - - Remove multiple items or folders from inventory - - A List containing the s of items to remove - A List containing the s of the folders to remove - - - - Empty the Lost and Found folder - - - - - Empty the Trash folder - - - - - - - - - - - Proper use is to upload the inventory's asset first, then provide the Asset's TransactionID here. - - - - - - - - - - - - - Proper use is to upload the inventory's asset first, then provide the Asset's TransactionID here. - - - - - - - - Creates a new inventory folder - - ID of the folder to put this folder in - Name of the folder to create - The UUID of the newly created folder - - - - Creates a new inventory folder - - ID of the folder to put this folder in - Name of the folder to create - Sets this folder as the default folder - for new assets of the specified type. Use AssetType.Unknown - to create a normal folder, otherwise it will likely create a - duplicate of an existing folder type - The UUID of the newly created folder - If you specify a preferred type of AsseType.Folder - it will create a new root folder which may likely cause all sorts - of strange problems - - - - Create an inventory item and upload asset data - - Asset data - Inventory item name - Inventory item description - Asset type - Inventory type - Put newly created inventory in this folder - Delegate that will receive feedback on success or failure - - - - Create an inventory item and upload asset data - - Asset data - Inventory item name - Inventory item description - Asset type - Inventory type - Put newly created inventory in this folder - Permission of the newly created item - (EveryoneMask, GroupMask, and NextOwnerMask of Permissions struct are supported) - Delegate that will receive feedback on success or failure - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Request a copy of an asset embedded within a notecard - - Usually UUID.Zero for copying an asset from a notecard - UUID of the notecard to request an asset from - Target folder for asset to go to in your inventory - UUID of the embedded asset - callback to run when item is copied to inventory - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Upload new gesture asset for an inventory gesture item - - Encoded gesture asset - Gesture inventory UUID - Callback whick will be called when upload is complete - - - - Update an existing script in an agents Inventory - - A byte[] array containing the encoded scripts contents - the itemID of the script - if true, sets the script content to run on the mono interpreter - - - - - Rez an object from inventory - - Simulator to place object in - Rotation of the object when rezzed - Vector of where to place object - InventoryItem object containing item details - - - - Rez an object from inventory - - Simulator to place object in - Rotation of the object when rezzed - Vector of where to place object - InventoryItem object containing item details - UUID of group to own the object - - - - Rez an object from inventory - - Simulator to place object in - Rotation of the object when rezzed - Vector of where to place object - InventoryItem object containing item details - UUID of group to own the object - User defined queryID to correlate replies - if set to true the simulator - will automatically send object detail packet(s) back to the client - - - - DeRez an object from the simulator to the agents Objects folder in the agents Inventory - - The simulator Local ID of the object - - - - DeRez an object from the simulator and return to inventory - - The simulator Local ID of the object - The type of destination from the enum - The destination inventory folders -or- - if DeRezzing object to a tasks Inventory, the Tasks - The transaction ID for this request which - can be used to correlate this request with other packets - - - - Rez an item from inventory to its previous simulator location - - - - - - - - - Give an inventory item to another avatar - - The of the item to give - The name of the item - The type of the item from the enum - The of the recipient - true to generate a beameffect during transfer - - - - Give an inventory Folder with contents to another avatar - - The of the Folder to give - The name of the folder - The type of the item from the enum - The of the recipient - true to generate a beameffect during transfer - - - - - - - - - - - - Get the inventory of a Task (Primitive) - - The tasks - The tasks simulator local ID - milliseconds to wait for reply from simulator - A List containing the inventory items inside the task - - - - - - - - - - Request the contents of a tasks (primitives) inventory - - The simulator Local ID of the object - A reference to the simulator object that contains the object - - - - Moves an Item from an objects (Prim) Inventory to the specified folder in the avatars inventory - - LocalID of the object in the simulator - UUID of the task item to move - UUID of the folder to move the item to - Simulator Object - - - - Remove an item from an objects (Prim) Inventory - - LocalID of the object in the simulator - UUID of the task item to remove - Simulator Object - - - - Copy an InventoryScript item from the Agents Inventory into a primitives task inventory - - An unsigned integer representing a primitive being simulated - An which represents a script object from the agents inventory - true to set the scripts running state to enabled - A Unique Transaction ID - - - uint Prim = 95899503; // Fake prim ID - UUID Script = UUID.Parse("92a7fe8a-e949-dd39-a8d8-1681d8673232"); // Fake Script UUID in Inventory - - Client.Inventory.FolderContents(Client.Inventory.FindFolderForType(AssetType.LSLText), Client.Self.AgentID, - false, true, InventorySortOrder.ByName, 10000); - - UUID Transaction = Client.Inventory.RezScript(Prim, (InventoryItem)Client.Inventory.Store[Script]); - - - - - - Send a request to the simulator to get the running status of a script. The reply will come back via the EventQueue - in a ScriptRunningReply message - - The object containing the script - The script contained in the task inventorys - - - - Sets a script running state which is in a task inventory - - The object containing the script - The script contained in the task inventorys - true to set the script running, false to stop a running script - - - - Create a CRC from an InventoryItem - - The source InventoryItem - A uint representing the source InventoryItem as a CRC - - - - Reverses a cheesy XORing with a fixed UUID to convert a shadow_id to an asset_id - - Obfuscated shadow_id value - Deobfuscated asset_id value - - - - Wrapper for creating a new object - - The type of item from the enum - The of the newly created object - An object with the type and id passed - - - - Parse the results of a RequestTaskInventory() response - - A string which contains the data from the task reply - A List containing the items contained within the tasks inventory - - - - UpdateCreateInventoryItem packets are received when a new inventory item - is created. This may occur when an object that's rezzed in world is - taken into inventory, when an item is created using the CreateInventoryItem - packet, or when an object is purchased - - - - - - - - - - - - - Fired when a reply to a RequestFetchInventory() is received - - - - - - Fired when a response to a RequestFolderContents() is received - - - - - - Fired when an object or another avatar offers us an inventory item - - - - - Fired when a response to FindObjectByPath() is received - - - - - - Fired when a task inventory item is received - - This may occur when an object that's rezzed in world is - taken into inventory, when an item is created using the CreateInventoryItem - packet, or when an object is purchased - - - - - Fired in response to a request for a tasks (primitive) inventory - - - - - - - Fired when a SaveAssetToInventory packet is received, generally after the logout reply handler - - - - - Fired in response to a GetScriptRunning request - - - - - Get this agents Inventory data - - - - - Callback for inventory item creation finishing - - Whether the request to create an inventory - item succeeded or not - Inventory item being created. If success is - false this will be null - - - - Callback for an inventory item being create from an uploaded asset - - true if inventory item creation was successful - - - - - - - - - - - - - - - - - - - Callback for an inventory folder updating - - UUID of the folder that was updated - - - - Callback for when an inventory item is offered to us by another avatar or an object - - A object containing specific - details on the item being offered, eg who its from - The AssetType being offered - Will be null if item is offered from an object - will be true of item is offered from an object - Return true to accept the offer, or false to decline it - - - - Callback when an inventory object is accepted and received from a - task inventory. This is the callback in which you actually get - the ItemID, as in ObjectOfferedCallback it is null when received - from a task. - - - - - - - - - - - - - - - - - Reply received after calling RequestTaskInventory, - contains a filename that can be used in an asset download request - - UUID of the inventory item - Version number of the task inventory asset - Filename of the task inventory asset - - - - Reply received when uploading an inventory asset - - Has upload been successful - Error message if upload failed - Inventory asset UUID - New asset UUID - - - - Fired when local inventory store needs to be updated. Generally at logout to update a local cache - - the assets UUID - The new AssetID of the item, or UUID.Zero - - - - - - - - - - - - - - - - - - + A dictionary containing the pre-defined animations, + where the key is the animations ID, and the value is a string + containing a name to identify the purpose of the animation Level of Detail mesh - + - The type of bump-mapping applied to a face + A linkset asset, containing a parent primitive and zero or more children - - + + Initializes a new instance of an AssetPrim object - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + - The level of shininess applied to a face - - - - - - - - - - - - - - - - - The texture mapping style used for a face - - - - - - - - - - - Flags in the TextureEntry block that describe which properties are - set - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Represents a Landmark with RegionID and Position vector - - - - UUID of the Landmark target region - - - Local position of the target - - - Construct an Asset of type Landmark - - - - Construct an Asset object of type Landmark + Initializes a new instance of an AssetPrim object A unique specific to this asset A byte array containing the raw asset data - - - Constuct an asset of type Landmark - - UUID of the target region - Local position of landmark - - - - Encode the raw contents of a string with the specific Landmark format - - - - - Decode the raw asset data, populating the RegionID and Position - - true if the AssetData was successfully decoded to a UUID and Vector - - - Override the base classes AssetType - - - - This exception is thrown whenever a network operation is attempted - without a network connection. - - - - - NetworkManager is responsible for managing the network layer of - OpenMetaverse. It tracks all the server connections, serializes - outgoing traffic and deserializes incoming traffic, and provides - instances of delegates for network-related events. - - - Login Routines - - - - All of the simulators we are currently connected to - - - Handlers for incoming capability events - - - Handlers for incoming packets - - - Incoming packets that are awaiting handling - - - Outgoing packets that are awaiting handling - - - - Default constructor - - Reference to the GridClient object - - - - Register an event handler for a packet. This is a low level event - interface and should only be used if you are doing something not - supported in the library - - Packet type to trigger events for - Callback to fire when a packet of this type - is received - - - - Unregister an event handler for a packet. This is a low level event - interface and should only be used if you are doing something not - supported in the library - - Packet type this callback is registered with - Callback to stop firing events for - - - - Register a CAPS event handler. This is a low level event interface - and should only be used if you are doing something not supported in - the library - - Name of the CAPS event to register a handler for - Callback to fire when a CAPS event is received - - - - Unregister a CAPS event handler. This is a low level event interface - and should only be used if you are doing something not supported in - the library - - Name of the CAPS event this callback is - registered with - Callback to stop firing events for - - - - Send a packet to the simulator the avatar is currently occupying - - Packet to send - - - - Send a packet to a specified simulator - - Packet to send - Simulator to send the packet to - - - - Connect to a simulator - - IP address to connect to - Port to connect to - Handle for this simulator, to identify its - location in the grid - Whether to set CurrentSim to this new - connection, use this if the avatar is moving in to this simulator - URL of the capabilities server to use for - this sim connection - A Simulator object on success, otherwise null - - - - Connect to a simulator - - IP address and port to connect to - Handle for this simulator, to identify its - location in the grid - Whether to set CurrentSim to this new - connection, use this if the avatar is moving in to this simulator - URL of the capabilities server to use for - this sim connection - A Simulator object on success, otherwise null - - - - Initiate a blocking logout request. This will return when the logout - handshake has completed or when Settings.LOGOUT_TIMEOUT - has expired and the network layer is manually shut down - - - - - Initiate the logout process. Check if logout succeeded with the - OnLogoutReply event, and if this does not fire the - Shutdown() function needs to be manually called - - - - - - - - - - - - Shutdown will disconnect all the sims except for the current sim - first, and then kill the connection to CurrentSim. This should only - be called if the logout process times out on RequestLogout - - - - - Searches through the list of currently connected simulators to find - one attached to the given IPEndPoint - - IPEndPoint of the Simulator to search for - A Simulator reference on success, otherwise null - - - - Fire an event when an event queue connects for capabilities - - Simulator the event queue is attached to - - - - Called to deal with LogoutReply packet and fires off callback - - Full packet of type LogoutReplyPacket - - - - Seed CAPS URL returned from the login server - - - A list of packets obtained during the login process which networkmanager will log but not process - - - - Generate sane default values for a login request - - Account first name - Account last name - Account password - Client application name - Client application version - A populated struct containing - sane defaults - - - - Simplified login that takes the most common and required fields - - Account first name - Account last name - Account password - Client application name - Client application version - Whether the login was successful or not. On failure the - LoginErrorKey string will contain the error code and LoginMessage - will contain a description of the error - - - - Simplified login that takes the most common fields along with a - starting location URI, and can accept an MD5 string instead of a - plaintext password - - Account first name - Account last name - Account password or MD5 hash of the password - such as $1$1682a1e45e9f957dcdf0bb56eb43319c - Client application name - Starting location URI that can be built with - StartLocation() - Client application version - Whether the login was successful or not. On failure the - LoginErrorKey string will contain the error code and LoginMessage - will contain a description of the error - - - - Login that takes a struct of all the values that will be passed to - the login server - - The values that will be passed to the login - server, all fields must be set even if they are String.Empty - Whether the login was successful or not. On failure the - LoginErrorKey string will contain the error code and LoginMessage - will contain a description of the error - - - - Build a start location URI for passing to the Login function - - Name of the simulator to start in - X coordinate to start at - Y coordinate to start at - Z coordinate to start at - String with a URI that can be used to login to a specified - location - - - - Handles response from XML-RPC login replies - - - - - Handle response from LLSD login replies - - - - - - - - Get current OS - - Either "Win" or "Linux" - - - - Get clients default Mac Address - - A string containing the first found Mac Address - - - - Event raised when an outgoing packet is sent to a simulator - - - - - Event raised when the client was able to connected successfully. - - Uses the ConnectedCallback delegate. - - - - - Event raised when a before a connection to a simulator is - initialized - - - - - Event raised when a connection to a simulator is established - - - - - An event for the connection to a simulator other than the currently - occupied one disconnecting - - The Simulators list is locked when this event is - triggered, do not attempt to modify the collection or acquire a - lock on it when this callback is fired - - - - An event for being logged out either through client request, server - forced, or network error - - - - - An event for when CurrentSim changes - - - - - Triggered when an event queue makes the initial connection - - - - Unique identifier associated with our connections to - simulators - - - The simulator that the logged in avatar is currently - occupying - - - Shows whether the network layer is logged in to the - grid or not - - - Number of packets in the incoming queue - - - Number of packets in the outgoing queue - - - Called any time the login status changes, will eventually - return LoginStatus.Success or LoginStatus.Failure - - - Called when a reply is received from the login server, the - login sequence will block until this event returns - - - Current state of logging in - - - Upon login failure, contains a short string key for the - type of login error that occurred - - - The raw XML-RPC reply from the login server, exactly as it - was received (minus the HTTP header) - - - During login this contains a descriptive version of - LoginStatusCode. After a successful login this will contain the - message of the day, and after a failed login a descriptive error - message will be returned - - - - Explains why a simulator or the grid disconnected from us - - - - The client requested the logout or simulator disconnect - - - The server notified us that it is disconnecting - - - Either a socket was closed or network traffic timed out - - - The last active simulator shut down - - - - Holds a simulator reference and a decoded packet, these structs are put in - the packet inbox for event handling - - - - Reference to the simulator that this packet came from - - - Packet that needs to be processed - - - - Holds a simulator reference and a serialized packet, these structs are put in - the packet outbox for sending - - - - Reference to the simulator this packet is destined for - - - Packet that needs to be sent - - - Sequence number of the wrapped packet - - - Number of times this packet has been resent - - - Environment.TickCount when this packet was last sent over the wire - - - - Coupled with RegisterCallback(), this is triggered whenever a packet - of a registered type is received - - - - - - - Triggered whenever an outgoing packet is sent - - Buffer holding the outgoing packet payload - Number of bytes of the data buffer that were sent - Simulator this packet was sent to - - - - Assigned by the OnConnected event. Raised when login was a success - - Reference to the GridClient object that called the event - - - - Assigned by the OnLogoutReply callback. Raised upone receipt of a LogoutReply packet during logout process. - - - - - - Triggered before a new connection to a simulator is established - - The connection to the new simulator won't be established - until this callback returns - The simulator that is being connected to - Whether to continue connecting to the simulator or abort - the connection - - - - Triggered when a new connection to a simulator is established - - The simulator that is being connected to - - - - Triggered when a simulator other than the simulator that is currently - being occupied disconnects for whatever reason - - The simulator that disconnected, which will become a null - reference after the callback is finished - Enumeration explaining the reason for the disconnect - - - - Triggered when we are logged out of the grid due to a simulator request, - client request, network timeout, or any other cause - - Enumeration explaining the reason for the disconnect - If we were logged out by the simulator, this - is a message explaining why - - - - Triggered when CurrentSim changes - - A reference to the old value of CurrentSim - - - - Triggered when an event queue makes the initial connection - - Simulator this event queue is tied to - - - - Fired when a login request is successful or not - - - - - - - - - - - - - - - - - Permission request flags, asked when a script wants to control an Avatar - - - - Placeholder for empty values, shouldn't ever see this - - - Script wants ability to take money from you - - - Script wants to take camera controls for you - - - Script wants to remap avatars controls - - - Script wants to trigger avatar animations - This function is not implemented on the grid - - - Script wants to attach or detach the prim or primset to your avatar - - - Script wants permission to release ownership - This function is not implemented on the grid - The concept of "public" objects does not exist anymore. - - - Script wants ability to link/delink with other prims - - - Script wants permission to change joints - This function is not implemented on the grid - - - Script wants permissions to change permissions - This function is not implemented on the grid - - - Script wants to track avatars camera position and rotation - - - Script wants to control your camera - - - - Special commands used in Instant Messages - - - - Indicates a regular IM from another agent - - - Simple notification box with an OK button - - - You've been invited to join a group. - - - Inventory offer - - - Accepted inventory offer - - - Declined inventory offer - - - Group vote - - - An object is offering its inventory - - - Accept an inventory offer from an object - - - Decline an inventory offer from an object - - - Unknown - - - Start a session, or add users to a session - - - Start a session, but don't prune offline users - - - Start a session with your group - - - Start a session without a calling card (finder or objects) - - - Send a message to a session - - - Leave a session - - - Indicates that the IM is from an object - - - Sent an IM to a busy user, this is the auto response - - - Shows the message in the console and chat history - - - Send a teleport lure - - - Response sent to the agent which inititiated a teleport invitation - - - Response sent to the agent which inititiated a teleport invitation - - - Only useful if you have Linden permissions - - - A placeholder type for future expansion, currently not - used - - - IM to tell the user to go to an URL - - - IM for help - - - IM sent automatically on call for help, sends a lure - to each Helper reached - - - Like an IM but won't go to email - - - IM from a group officer to all group members - - - Unknown - - - Unknown - - - Accept a group invitation - - - Decline a group invitation - - - Unknown - - - An avatar is offering you friendship - - - An avatar has accepted your friendship offer - - - An avatar has declined your friendship offer - - - Indicates that a user has started typing - - - Indicates that a user has stopped typing - - - - Flag in Instant Messages, whether the IM should be delivered to - offline avatars as well - - - - Only deliver to online avatars - - - If the avatar is offline the message will be held until - they login next, and possibly forwarded to their e-mail account - - - - Conversion type to denote Chat Packet types in an easier-to-understand format - - - - Whisper (5m radius) - - - Normal chat (10/20m radius), what the official viewer typically sends - - - Shouting! (100m radius) - - - Event message when an Avatar has begun to type - - - Event message when an Avatar has stopped typing - - - Unknown - - - Event message when an object uses llOwnerSay - - - Special value to support llRegionSay, never sent to the client - - - - Identifies the source of a chat message - - - - Chat from the grid or simulator - - - Chat from another avatar - - - Chat from an object - - + - - - - - - - - - - - - Effect type used in ViewerEffect packets - - - - - - - - - - - - - - - - - - - - - - - - - Project a beam from a source to a destination, such as - the one used when editing an object - - - - - - - - - - - - Create a swirl of particles around an object - - - - - - - - - Cause an avatar to look at an object - - - Cause an avatar to point at an object - - - - The action an avatar is doing when looking at something, used in - ViewerEffect packets for the LookAt effect - - - - - - - - - - - - - - - - - - - - - - Deprecated - - - - - - - - - - - - - - - - The action an avatar is doing when pointing at something, used in - ViewerEffect packets for the PointAt effect - - - - - - - - - - - - - - - - - Money transaction types - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Flags sent when a script takes or releases a control - - NOTE: (need to verify) These might be a subset of the ControlFlags enum in Movement, - - - No Flags set - - - Forward (W or up Arrow) - - - Back (S or down arrow) - - - Move left (shift+A or left arrow) - - - Move right (shift+D or right arrow) - - - Up (E or PgUp) - - - Down (C or PgDown - - - Rotate left (A or left arrow) - - - Rotate right (D or right arrow) - - - Left Mouse Button - - - Left Mouse button in MouseLook - - - - Currently only used to hide your group title - - - - No flags set - - - Hide your group title - - - - Action state of the avatar, which can currently be typing and - editing - - - - - - - - - - - - - - Current teleport status - - - - Unknown status - - - Teleport initialized - - - Teleport in progress - - - Teleport failed - - - Teleport completed - - - Teleport cancelled - - - - - - - - No flags set, or teleport failed - - - Set when newbie leaves help island for first time - - - - - - Via Lure - - - Via Landmark - - - Via Location - - - Via Home - - - Via Telehub - - - Via Login - - - Linden Summoned - - - Linden Forced me - - - - - - Agent Teleported Home via Script - - - - - - - - - - - - forced to new location for example when avatar is banned or ejected - - - Teleport Finished via a Lure - - - Finished, Sim Changed - - - Finished, Same Sim - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Instant Message - - - - Key of sender - - - Name of sender - - - Key of destination avatar - - - ID of originating estate - - - Key of originating region - - - Coordinates in originating region - - - Instant message type - - - Group IM session toggle - - - Key of IM session, for Group Messages, the groups UUID - - - Timestamp of the instant message - - - Instant message text - - - Whether this message is held for offline avatars - - - Context specific packed data - - - - Avatar group management - - - - Key of Group Member - - - Total land contribution - - - Online status information - - - Abilities that the Group Member has - - - Current group title - - - Is a group owner - - - - Role manager for a group - - - - Key of the group - - - Key of Role - - - Name of Role - - - Group Title associated with Role - - - Description of Role - - - Abilities Associated with Role - - - Returns the role's title - The role's title - - - - Class to represent Group Title - - - - Key of the group - - - ID of the role title belongs to - - - Group Title - - - Whether title is Active - - - Returns group title - - - - Represents a group on the grid - - - - Key of Group - - - Key of Group Insignia - - - Key of Group Founder - - - Key of Group Role for Owners - - - Name of Group - - - Text of Group Charter - - - Title of "everyone" role - - - Is the group open for enrolement to everyone - - - Will group show up in search - - - - - - - - - - - - Is the group Mature - - - Cost of group membership - - - - - - - - - The total number of current members this group has - - - The number of roles this group has configured - - - Show this group in agent's profile - - - Returns the name of the group - A string containing the name of the group - - - - A group Vote - - - - Key of Avatar who created Vote - - - Text of the Vote proposal - - - Total number of votes - - - - A group proposal - - - - The Text of the proposal - - - The minimum number of members that must vote before proposal passes or failes - - - The required ration of yes/no votes required for vote to pass - The three options are Simple Majority, 2/3 Majority, and Unanimous - TODO: this should be an enum - - - The duration in days votes are accepted - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Struct representing a group notice - - - - - - - - - - - - - - - + - + + Override the base classes AssetType + + - Struct representing a group notice list entry + Only used internally for XML serialization/deserialization - - Notice ID - - - Creation timestamp of notice - - - Agent name who created notice - - - Notice subject - - - Is there an attachment? - - - Attachment Type - - + - Struct representing a member of a group chat session and their settings + The deserialized form of a single primitive in a linkset asset - - The of the Avatar - - - True if user has voice chat enabled - - - True of Avatar has moderator abilities - - - True if a moderator has muted this avatars chat - - - True if a moderator has muted this avatars voice - - + - Role update flags - - - - - - - - - - - - - - - - - - - - - - - - - Can send invitations to groups default role - - - Can eject members from group - - - Can toggle 'Open Enrollment' and change 'Signup fee' - - - Member is visible in the public member list - - - Can create new roles - - - Can delete existing roles - - - Can change Role names, titles and descriptions - - - Can assign other members to assigners role - - - Can assign other members to any role - - - Can remove members from roles - - - Can assign and remove abilities in roles - - - Can change group Charter, Insignia, 'Publish on the web' and which - members are publicly visible in group member listings - - - Can buy land or deed land to group - - - Can abandon group owned land to Governor Linden on mainland, or Estate owner for - private estates - - - Can set land for-sale information on group owned parcels - - - Can subdivide and join parcels - - - Can join group chat sessions - - - Can use voice chat in Group Chat sessions - - - Can moderate group chat sessions - - - Can toggle "Show in Find Places" and set search category - - - Can change parcel name, description, and 'Publish on web' settings - - - Can set the landing point and teleport routing on group land - - - Can change music and media settings - - - Can toggle 'Edit Terrain' option in Land settings - - - Can toggle various About Land > Options settings - - - Can always terraform land, even if parcel settings have it turned off - - - Can always fly while over group owned land - - - Can always rez objects on group owned land - - - Can always create landmarks for group owned parcels - - - Can set home location on any group owned parcel - - - Can modify public access settings for group owned parcels - - - Can manager parcel ban lists on group owned land - - - Can manage pass list sales information - - - Can eject and freeze other avatars on group owned land - - - Can return objects set to group - - - Can return non-group owned/set objects - - - Can return group owned objects - - - Can landscape using Linden plants - - - Can deed objects to group - - - Can move group owned objects - - - Can set group owned objects for-sale - - - Pay group liabilities and receive group dividends - - - Can send group notices - - - Can receive group notices - - - Can create group proposals - - - Can vote on group proposals - - - - Handles all network traffic related to reading and writing group - information - - - - A reference to the current instance - - - Currently-active group members requests - - - Currently-active group roles requests - - - Currently-active group role-member requests - - - Dictionary keeping group members while request is in progress - - - Dictionary keeping mebmer/role mapping while request is in progress - - - Dictionary keeping GroupRole information while request is in progress - - - Caches group name lookups - - - - Group Management Routines, Methods and Packet Handlers - - A reference to the current instance - - - - Request a current list of groups the avatar is a member of. - - CAPS Event Queue must be running for this to work since the results - come across CAPS. - - - - Lookup name of group based on groupID - - groupID of group to lookup name for. - - - - Request lookup of multiple group names - - List of group IDs to request. - - - Lookup group profile data such as name, enrollment, founder, logo, etc - Subscribe to OnGroupProfile event to receive the results. - group ID (UUID) - - - Request a list of group members. - Subscribe to OnGroupMembers event to receive the results. - group ID (UUID) - UUID of the request, use to index into cache - - - Request group roles - Subscribe to OnGroupRoles event to receive the results. - group ID (UUID) - UUID of the request, use to index into cache - - - Request members (members,role) role mapping for a group. - Subscribe to OnGroupRolesMembers event to receive the results. - group ID (UUID) - UUID of the request, use to index into cache - - - Request a groups Titles - Subscribe to OnGroupTitles event to receive the results. - group ID (UUID) - UUID of the request, use to index into cache - - - Begin to get the group account summary - Subscribe to the OnGroupAccountSummary event to receive the results. - group ID (UUID) - How long of an interval - Which interval (0 for current, 1 for last) - - - Invites a user to a group - The group to invite to - A list of roles to invite a person to - Key of person to invite - - - Set a group as the current active group - group ID (UUID) - - - Change the role that determines your active title - Group ID to use - Role ID to change to - - - Set this avatar's tier contribution - Group ID to change tier in - amount of tier to donate - - - - Save wheather agent wants to accept group notices and list this group in their profile - - Group - Accept notices from this group - List this group in the profile - - - Request to join a group - Subscribe to OnGroupJoined event for confirmation. - group ID (UUID) to join. - - - - Request to create a new group. If the group is successfully - created, L$100 will automatically be deducted - - Subscribe to OnGroupCreated event to receive confirmation. - Group struct containing the new group info - - - Update a group's profile and other information - Groups ID (UUID) to update. - Group struct to update. - - - Eject a user from a group - Group ID to eject the user from - Avatar's key to eject - - - Update role information - Modified role to be updated - - - Create a new group role - Group ID to update - Role to create - - - Remove an avatar from a role - Group ID to update - Role ID to be removed from - Avatar's Key to remove - - - Assign an avatar to a role - Group ID to update - Role ID to assign to - Avatar's ID to assign to role - - - Request the group notices list - Group ID to fetch notices for - - - Request a group notice by key - ID of group notice - - - Send out a group notice - Group ID to update - GroupNotice structure containing notice data - - - Start a group proposal (vote) - The Group ID to send proposal to - GroupProposal structure containing the proposal - - - Request to leave a group - Subscribe to OnGroupLeft event to receive confirmation - The group to leave - - - - Packet Handler for EjectGroupMemberReply, fired when an avatar is ejected from - a group. - - The EjectGroupMemberReply packet - The simulator where the message originated - This is a silly packet, it doesn't provide you with the ejectees UUID - - - Fired when a is received, contains a list of - groups avatar is currently a member of - - - Fired when a UUIDGroupNameReply packet is receiived, - contains name of group requested - - - Fired when a GroupProfileReply packet is received, - contains group profile information for requested group. - - - Fired when a GroupMembersReply packet is received, - contains a list of group members for requested group - - - Fired when a GroupRoleDataReply packet is received, - contains details on roles for requested group - - - Fired when a is received, - Contains group member to group role mappings - - - Fired when a GroupTitlesReply packet is received, - sets the active role title for the current Agent - - - Fired when a GroupAccountSummaryReply packet is received, - Contains a summary of group financial information - - - Fired when a CreateGroupReply packet is received, indicates - the successful creation of a new group - - - Fired when a JoinGroupReply packet is received, indicates - the Avatar has successfully joined a new group either by - or by accepting a group join invitation with - - - Fired when a LeaveGroupReply packet is received, indicates - the Avatar has successfully left a group - - - - Fired when a AgentDropGroup packet is received, contains - the of the group dropped - - - Fired when a GroupMemberEjected packet is received, - indicates a member of a group has been ejected - - - Fired when the list of group notices is recievied - - - - Callback for the list of groups the avatar is currently a member of - - A dictionary containing the groups an avatar is a member of, - where the Key is the group , and the values are the groups - - - - Callback for a list of group names - - A dictionary containing the the group names requested - where the Key is the group , and the values are the names - - - - Callback for the profile of a group - - The group profile - - - - Callback for the member list of a group - - returned by RequestGroupMembers - of the group - A dictionary containing the members of a group - where key is member and value is struct - - - - Callback for retrieving group roles - - of the request returned from RequestGroupRoles - of the group - A dictionary containing role s as the key - and structs as values - - - - Callback for a pairing of roles to members - - of the request returned from RequestGroupRolesMembers - of the group - List containing role/member pairs - - - - Callback for the title list of a group - - of the request returned from RequestGroupTitles - Group - A dictionary containing the titles of a group - where the Key is the role , and the values are the title details - - - - Callback fired when group account summary information is received - - Group - The group account summary information - - - - Callback fired after an attempt to create a group - - The new groups - True of creation was successful - A string, containing a message from the simulator - - - - Callback fired when the avatar has joined a group - - The of the group joined - True if the join was successful - - - - Callback fired when the avatar leaves a group - - The of the group joined - True if the part was successful - - - - Fired when a group is dropped, likely because it did not keep the required (2) avatar - minimum - - The of the group which was dropped - - - - Fired when a member of a group is ejected, - Does not provide member information, only - group ID and whether it was successful or not - - The Group UUID the member was ejected from - true of member was successfully ejected - - - - Fired when the list of group notices is recievied - - The of the group for which the notice list entry was recievied - The Notice list entry - - - - The InternalDictionary class is used through the library for storing key/value pairs. - It is intended to be a replacement for the generic Dictionary class and should - be used in its place. It contains several methods for allowing access to the data from - outside the library that are read only and thread safe. - Key - Value - - Internal dictionary that this class wraps around. Do not - modify or enumerate the contents of this dictionary without locking - on this member + + The event subscribers, null of no subscribers - + + Raises the AttachedSound Event + A AttachedSoundEventArgs object containing + the data sent from the simulator + + + Thread sync lock object + + + The event subscribers, null of no subscribers + + + Raises the AttachedSoundGainChange Event + A AttachedSoundGainChangeEventArgs object containing + the data sent from the simulator + + + Thread sync lock object + + + The event subscribers, null of no subscribers + + + Raises the SoundTrigger Event + A SoundTriggerEventArgs object containing + the data sent from the simulator + + + Thread sync lock object + + + The event subscribers, null of no subscribers + + + Raises the PreloadSound Event + A PreloadSoundEventArgs object containing + the data sent from the simulator + + + Thread sync lock object + + - Initializes a new instance of the Class - with the specified key/value, has the default initial capacity. + Construct a new instance of the SoundManager class, used for playing and receiving + sound assets + A reference to the current GridClient instance + + + + Plays a sound in the current region at full volume from avatar position + + UUID of the sound to be played + + + + Plays a sound in the current region at full volume + + UUID of the sound to be played. + position for the sound to be played at. Normally the avatar. + + + + Plays a sound in the current region + + UUID of the sound to be played. + position for the sound to be played at. Normally the avatar. + volume of the sound, from 0.0 to 1.0 + + + + Plays a sound in the specified sim + + UUID of the sound to be played. + UUID of the sound to be played. + position for the sound to be played at. Normally the avatar. + volume of the sound, from 0.0 to 1.0 + + + + Play a sound asset + + UUID of the sound to be played. + handle id for the sim to be played in. + position for the sound to be played at. Normally the avatar. + volume of the sound, from 0.0 to 1.0 + + + Process an incoming packet and raise the appropriate events + The sender + The EventArgs object containing the packet data + + + Process an incoming packet and raise the appropriate events + The sender + The EventArgs object containing the packet data + + + Process an incoming packet and raise the appropriate events + The sender + The EventArgs object containing the packet data + + + Process an incoming packet and raise the appropriate events + The sender + The EventArgs object containing the packet data + + + Raised when the simulator sends us data containing + sound + + + Raised when the simulator sends us data containing + ... + + + Raised when the simulator sends us data containing + ... + + + Raised when the simulator sends us data containing + ... + + + Provides data for the event + The event occurs when the simulator sends + the sound data which emits from an agents attachment + The following code example shows the process to subscribe to the event + and a stub to handle the data passed from the simulator - // initialize a new InternalDictionary named testDict with a string as the key and an int as the value. - public InternalDictionary<string, int> testDict = new InternalDictionary<string, int>(); + // Subscribe to the AttachedSound event + Client.Sound.AttachedSound += Sound_AttachedSound; + + // process the data raised in the event here + private void Sound_AttachedSound(object sender, AttachedSoundEventArgs e) + { + // ... Process AttachedSoundEventArgs here ... + } - + - Initializes a new instance of the Class - with the specified key/value, has its initial valies copied from the specified - + Construct a new instance of the SoundTriggerEventArgs class - - to copy initial values from - - - // initialize a new InternalDictionary named testAvName with a UUID as the key and an string as the value. - // populates with copied values from example KeyNameCache Dictionary. + Simulator where the event originated + The sound asset id + The ID of the owner + The ID of the object + The volume level + The + + + Simulator where the event originated + + + Get the sound asset id + + + Get the ID of the owner + + + Get the ID of the Object + + + Get the volume level + + + Get the + + + Provides data for the event + The event occurs when an attached sound + changes its volume level + + + + Construct a new instance of the AttachedSoundGainChangedEventArgs class + + Simulator where the event originated + The ID of the Object + The new volume level + + + Simulator where the event originated + + + Get the ID of the Object + + + Get the volume level + + + Provides data for the event + The event occurs when the simulator forwards + a request made by yourself or another agent to play either an asset sound or a built in sound + + Requests to play sounds where the is not one of the built-in + will require sending a request to download the sound asset before it can be played + + + The following code example uses the , + and + properties to display some information on a sound request on the window. + + // subscribe to the event + Client.Sound.SoundTrigger += Sound_SoundTrigger; - // create source dictionary - Dictionary<UUID, string> KeyNameCache = new Dictionary<UUID, string>(); - KeyNameCache.Add("8300f94a-7970-7810-cf2c-fc9aa6cdda24", "Jack Avatar"); - KeyNameCache.Add("27ba1e40-13f7-0708-3e98-5819d780bd62", "Jill Avatar"); - - // Initialize new dictionary. - public InternalDictionary<UUID, string> testAvName = new InternalDictionary<UUID, string>(KeyNameCache); - - - - - - Initializes a new instance of the Class - with the specified key/value, With its initial capacity specified. - - Initial size of dictionary - - - // initialize a new InternalDictionary named testDict with a string as the key and an int as the value, - // initially allocated room for 10 entries. - public InternalDictionary<string, int> testDict = new InternalDictionary<string, int>(10); - - - - - - Try to get entry from with specified key - - Key to use for lookup - Value returned - if specified key exists, if not found - - - // find your avatar using the Simulator.ObjectsAvatars InternalDictionary: - Avatar av; - if (Client.Network.CurrentSim.ObjectsAvatars.TryGetValue(Client.Self.AgentID, out av)) - Console.WriteLine("Found Avatar {0}", av.Name); - - - - - - - Finds the specified match. - - The match. - Matched value - - - // use a delegate to find a prim in the ObjectsPrimitives InternalDictionary - // with the ID 95683496 - uint findID = 95683496; - Primitive findPrim = sim.ObjectsPrimitives.Find( - delegate(Primitive prim) { return prim.ID == findID; }); - - - - - Find All items in an - return matching items. - a containing found items. - - Find All prims within 20 meters and store them in a List - - int radius = 20; - List<Primitive> prims = Client.Network.CurrentSim.ObjectsPrimitives.FindAll( - delegate(Primitive prim) { - Vector3 pos = prim.Position; - return ((prim.ParentID == 0) && (pos != Vector3.Zero) && (Vector3.Distance(pos, location) < radius)); - } - ); - - - - - Find All items in an - return matching keys. - a containing found keys. - - Find All keys which also exist in another dictionary - - List<UUID> matches = myDict.FindAll( - delegate(UUID id) { - return myOtherDict.ContainsKey(id); - } - ); - - - - - Perform an on each entry in an - to perform - - - // Iterates over the ObjectsPrimitives InternalDictionary and prints out some information. - Client.Network.CurrentSim.ObjectsPrimitives.ForEach( - delegate(Primitive prim) + // play the pre-defined BELL_TING sound + Client.Sound.SendSoundTrigger(Sounds.BELL_TING); + + // handle the response data + private void Sound_SoundTrigger(object sender, SoundTriggerEventArgs e) { - if (prim.Text != null) - { - Console.WriteLine("NAME={0} ID = {1} TEXT = '{2}'", - prim.PropertiesFamily.Name, prim.ID, prim.Text); - } - }); + Console.WriteLine("{0} played the sound {1} at volume {2}", + e.OwnerID, e.SoundID, e.Gain); + } + + + + + + Construct a new instance of the SoundTriggerEventArgs class + + Simulator where the event originated + The sound asset id + The ID of the owner + The ID of the object + The ID of the objects parent + The volume level + The regionhandle + The source position + + + Simulator where the event originated + + + Get the sound asset id + + + Get the ID of the owner + + + Get the ID of the Object + + + Get the ID of the objects parent + + + Get the volume level + + + Get the regionhandle + + + Get the source position + + + Provides data for the event + The event occurs when the simulator sends + the appearance data for an avatar + + The following code example uses the and + properties to display the selected shape of an avatar on the window. + + // subscribe to the event + Client.Avatars.AvatarAppearance += Avatars_AvatarAppearance; + + // handle the data when the event is raised + void Avatars_AvatarAppearance(object sender, AvatarAppearanceEventArgs e) + { + Console.WriteLine("The Agent {0} is using a {1} shape.", e.AvatarID, (e.VisualParams[31] > 0) : "male" ? "female") + } - - Perform an on each key of an - to perform - - - - Perform an on each KeyValuePair of an - - to perform - - - Check if Key exists in Dictionary - Key to check for - if found, otherwise - - - Check if Value exists in Dictionary - Value to check for - if found, otherwise - - - - Adds the specified key to the dictionary, dictionary locking is not performed, - - - The key - The value - - - - Removes the specified key, dictionary locking is not performed - - The key. - if successful, otherwise - - - - Gets the number of Key/Value pairs contained in the - - - - - Indexer for the dictionary - - The key - The value - - - - Access to the Linden dataserver which allows searching for land, events, people, etc - - - - - Starts a search for land sales using the directory - - What type of land to search for. Auction, - estate, mainland, "first land", etc - A unique identifier that can identify packets associated - with this query from other queries - The OnDirLandReply event handler must be registered before - calling this function. There is no way to determine how many - results will be returned, or how many times the callback will be - fired other than you won't get more than 100 total parcels from - each query. - - - - Starts a search for land sales using the directory - - What type of land to search for. Auction, - estate, mainland, "first land", etc - Maximum price to search for - Maximum area to search for - Each request is limited to 100 parcels - being returned. To get the first 100 parcels of a request use 0, - from 100-199 use 1, 200-299 use 2, etc. - A unique identifier that can identify packets associated - with this query from other queries - The OnDirLandReply event handler must be registered before - calling this function. There is no way to determine how many - results will be returned, or how many times the callback will be - fired other than you won't get more than 100 total parcels from - each query. - - - - Starts a search for land sales using the directory - - A flags parameter that can modify the way - search results are returned, for example changing the ordering of - results or limiting based on price or area - What type of land to search for. Auction, - estate, mainland, "first land", etc - Maximum price to search for, the - DirFindFlags.LimitByPrice flag must be set - Maximum area to search for, the - DirFindFlags.LimitByArea flag must be set - Each request is limited to 100 parcels - being returned. To get the first 100 parcels of a request use 0, - from 100-199 use 100, 200-299 use 200, etc. - A unique identifier that can identify packets associated - with this query from other queries - The OnDirLandReply event handler must be registered before - calling this function. There is no way to determine how many - results will be returned, or how many times the callback will be - fired other than you won't get more than 100 total parcels from - each query. - - - - Starts a search for a Group in the directory manager - - - The text to search for - Each request is limited to 100 parcels - being returned. To get the first 100 parcels of a request use 0, - from 100-199 use 100, 200-299 use 200, etc. - A unique identifier that can identify packets associated - with this query from other queries - The OnDirLandReply event handler must be registered before - calling this function. There is no way to determine how many - results will be returned, or how many times the callback will be - fired other than you won't get more than 100 total parcels from - each query. - - - - Search "places" for Land you personally own - - - - - Searches Places for Land owned by a specific user or group - - One of the Values from the DirFindFlags struct, ie: AgentOwned, GroupOwned, etc. - LLUID of group you want to recieve land list for (You must be in group), or - LLUID.Zero for Your own land - Transaction (Query) ID which can be associated with results from your request. - - - - Search Places - - One of the Values from the DirFindFlags struct, ie: AgentOwned, GroupOwned, etc. - One of the values from the SearchCategory Struct, ie: Any, Linden, Newcomer - LLUID of group you want to recieve results for - Transaction (Query) ID which can be associated with results from your request. - Transaction (Query) ID which can be associated with results from your request. - - - - Search Places - All Options - - One of the Values from the DirFindFlags struct, ie: AgentOwned, GroupOwned, etc. - One of the values from the SearchCategory Struct, ie: Any, Linden, Newcomer - String Text to search for - String Simulator Name to search in - LLUID of group you want to recieve results for - Transaction (Query) ID which can be associated with results from your request. - Transaction (Query) ID which can be associated with results from your request. - - - - Search All Events with specifid searchText in all categories, includes Mature - - Text to search for - UUID of query to correlate results in callback. - - - - Search Events with Options to specify category and Mature events. - - Text to search for - true to include Mature events - category to search - UUID of query to correlate results in callback. - - - - Search Events - ALL options - - string text to search for e.g.: live music - Include mature events in results - "u" for now and upcoming events, -or- number of days since/until event is scheduled - For example "0" = Today, "1" = tomorrow, "2" = following day, "-1" = yesterday, etc. - Page # to show, 0 for First Page - EventCategory event is listed under. - a UUID that can be used to track queries with results. - UUID of query to correlate results in callback. - - - Requests Event Details - ID of Event returned from Places Search - - - - - - - - - - - - - - The different categories a classified ad can be placed in - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Land types to search dataserver for - - - - Do not search - - - Land which is currently up for auction - - - Parcels which are on the mainland (Linden owned) continents - - - Parcels which are on privately owned simulators - - - - A classified ad on the grid - - - - UUID for this ad, useful for looking up detailed - information about it - - - The title of this classified ad - - - Unknown - - - Creation date of the ad - - - Expiration date of the ad - - - Price that was paid for this ad - - - - A parcel retrieved from the dataserver such as results from the - "For-Sale" listings - - - - - - - - - - - - - - - - - - - - - - - An Avatar returned from the dataserver - - - - Online status of agent - - - Agents first name - - - Agents last name - - - Agents - - - - Response to a "Groups" Search - - - - - Response to a "Places" Search, e.g. My Land, Group Land, etc. - Note: This is not DirPlacesReply - - - - - Response to "Events" search - - - - - an Event returned from the dataserver - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Capabilities is the name of the bi-directional HTTP REST protocol - used to communicate non real-time transactions such as teleporting or - group messaging - - - - Reference to the simulator this system is connected to - - - - Default constructor - - - - - - - Request the URI of a named capability - - Name of the capability to request - The URI of the requested capability, or String.Empty if - the capability does not exist - - - - Process any incoming events, check to see if we have a message created for the event, - - - - - - Capabilities URI this system was initialized with - - - Whether the capabilities event queue is connected and - listening for incoming events - - - - Triggered when an event is received via the EventQueueGet - capability - - Event name - Decoded event data - The simulator that generated the event - - - - Represents an AssetScriptBinary object containing the - LSO compiled bytecode of an LSL script - - - - Initializes a new instance of an AssetScriptBinary object - - - Initializes a new instance of an AssetScriptBinary object with parameters - A unique specific to this asset - A byte array containing the raw asset data - - - - TODO: Encodes a scripts contents into a LSO Bytecode file - - - - - TODO: Decode LSO Bytecode into a string - - true - - - Override the base classes AssetType - - - - Simulator (region) properties - - - - No flags set - - - Agents can take damage and be killed - - - Landmarks can be created here - - - Home position can be set in this sim - - - Home position is reset when an agent teleports away - - - Sun does not move - - - No object, land, etc. taxes - - - Disable heightmap alterations (agents can still plant - foliage) - - - Land cannot be released, sold, or purchased - - - All content is wiped nightly - - - - - - - - - - - - No collision detection for non-agent objects - - - No scripts are ran - - - All physics processing is turned off - - - - - - - - - - - - - - - Flight is disabled (not currently enforced by the sim) - - - Allow direct (p2p) teleporting - - - Estate owner has temporarily disabled scripting - - - - - - Deny agents with no payment info on file - - - Deny agents with payment info on file - - - Deny agents who have made a monetary transaction - - - - - - - - - Region is Voice Enabled - - - - Access level for a simulator - - - - Minimum access level, no additional checks - - - Trial accounts allowed - - - PG rating - - - Mature rating - - - Simulator is offline - - - Simulator does not exist - - - - - - - - A public reference to the client that this Simulator object - is attached to - - - A Unique Cache identifier for this simulator - - - The capabilities for this simulator - - - - - - The current version of software this simulator is running - - - - - - A 64x64 grid of parcel coloring values. The values stored - in this array are of the type - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - true if your agent has Estate Manager rights on this region - - - - - - - - - - - - Statistics information for this simulator and the - connection to the simulator, calculated by the simulator itself - and the library - - - The regions Unique ID - - - The physical data center the simulator is located - Known values are: - - Dallas - Chandler - SF - - - - - The CPU Class of the simulator - Most full mainland/estate sims appear to be 5, - Homesteads and Openspace appear to be 501 - - - The number of regions sharing the same CPU as this one - "Full Sims" appear to be 1, Homesteads appear to be 4 - - - The billing product name - Known values are: - - Mainland / Full Region (Sku: 023) - Estate / Full Region (Sku: 024) - Estate / Openspace (Sku: 027) - Estate / Homestead (Sku: 029) - Mainland / Homestead (Sku: 129) (Linden Owned) - - - - - The billing product SKU - Known values are: - - 023 Mainland / Full Region - 024 Estate / Full Region - 027 Estate / Openspace - 029 Estate / Homestead - 129 Mainland / Homestead (Linden Owned) - - - - - Provides access to two thread-safe dictionaries containing - avatars and primitives found in this simulator - - - The current sequence number for packets sent to this - simulator. Must be Interlocked before modifying. Only - useful for applications manipulating sequence numbers - - - - Provides access to an internal thread-safe dictionary containing parcel - information found in this simulator - - - - - Checks simulator parcel map to make sure it has downloaded all data successfully - - true if map is full (contains no 0's) - - - Used internally to track sim disconnections - - - Event that is triggered when the simulator successfully - establishes a connection - - - Whether this sim is currently connected or not. Hooked up - to the property Connected - - - Coarse locations of avatars in this simulator - - - AvatarPositions key representing TrackAgent target - - - Sequence numbers of packets we've received - (for duplicate checking) - - - Packets we sent out that need ACKs from the simulator - - - Sequence number for pause/resume - - - - - - Reference to the GridClient object - IPEndPoint of the simulator - handle of the simulator - - - - Called when this Simulator object is being destroyed - - - - - Attempt to connect to this simulator - - Whether to move our agent in to this sim or not - True if the connection succeeded or connection status is - unknown, false if there was a failure - - - - Disconnect from this simulator - - - - - Instructs the simulator to stop sending update (and possibly other) packets - - - - - Instructs the simulator to resume sending update packets (unpause) - - - - - Sends a packet - - Packet to be sent - - - - - - - - - Returns Simulator Name as a String - - - - - - - - - - - - - - - - - - - Sends out pending acknowledgements - - - - - Resend unacknowledged packets - - - - - Provides access to an internal thread-safe multidimensional array containing a x,y grid mapped - each 64x64 parcel's LocalID. - - - - The IP address and port of the server - - - Whether there is a working connection to the simulator or - not - - - Coarse locations of avatars in this simulator - - - AvatarPositions key representing TrackAgent target - - - - Simulator Statistics - - - - Total number of packets sent by this simulator to this agent - - - Total number of packets received by this simulator to this agent - - - Total number of bytes sent by this simulator to this agent - - - Total number of bytes received by this simulator to this agent - - - Time in seconds agent has been connected to simulator - - - Total number of packets that have been resent - - - Total number of resent packets recieved - - - Total number of pings sent to this simulator by this agent - - - Total number of ping replies sent to this agent by this simulator - - - - Incoming bytes per second - - It would be nice to have this claculated on the fly, but - this is far, far easier - - - - Outgoing bytes per second - - It would be nice to have this claculated on the fly, but - this is far, far easier - - - Time last ping was sent - - - ID of last Ping sent - - - - - - - - - Current time dilation of this simulator - - - Current Frames per second of simulator - - - Current Physics frames per second of simulator - - - - - - - - - - - - - - - - - - - - - - - - - - - Total number of objects Simulator is simulating - - - Total number of Active (Scripted) objects running - - - Number of agents currently in this simulator - - - Number of agents in neighbor simulators - - - Number of Active scripts running in this simulator - - - - - - - - - - - - Number of downloads pending - - - Number of uploads pending - - - - - - - - - Number of local uploads pending - - - Unacknowledged bytes in queue - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Checks the instance back into the object pool - - - - - Returns an instance of the class that has been checked out of the Object Pool. - - - - - - - - - No report - - - Unknown report type - - - Bug report - - - Complaint report - - - Customer service report - - - - Bitflag field for ObjectUpdateCompressed data blocks, describing - which options are present for each object - - - - Unknown - - - Whether the object has a TreeSpecies - - - Whether the object has floating text ala llSetText - - - Whether the object has an active particle system - - - Whether the object has sound attached to it - - - Whether the object is attached to a root object or not - - - Whether the object has texture animation settings - - - Whether the object has an angular velocity - - - Whether the object has a name value pairs string - - - Whether the object has a Media URL set - - - - Specific Flags for MultipleObjectUpdate requests - - - - None - - - Change position of prims - - - Change rotation of prims - - - Change size of prims - - - Perform operation on link set - - - Scale prims uniformly, same as selecing ctrl+shift in the - viewer. Used in conjunction with Scale - - - - Special values in PayPriceReply. If the price is not one of these - literal value of the price should be use - - - - - Indicates that this pay option should be hidden - - - - - Indicates that this pay option should have the default value - - - - - Contains the variables sent in an object update packet for objects. - Used to track position and movement of prims and avatars - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Handles all network traffic related to prims and avatar positions and - movement. - - - - Reference to the GridClient object - - - Does periodic dead reckoning calculation to convert - velocity and acceleration to new positions for objects - - - - Instantiates a new ObjectManager class - - A reference to the client - - - - Instantiates a new ObjectManager class - - A reference to the client - If false, the ObjectManager won't - register any packet callbacks and won't decode incoming object - packets - - - - Request object information from the sim, primarily used for stale - or missing cache entries - - The simulator containing the object you're - looking for - The objects ID which is local to the simulator the object is in - - - - Request object information for multiple objects all contained in - the same sim, primarily used for stale or missing cache entries - - A reference to the object where the objects reside - An array which contains the IDs of the objects to request - - - - Attempt to purchase an original object, a copy, or the contents of - an object - - A reference to the object where the objects reside - The objects ID which is local to the simulator the object is in - Whether the original, a copy, or the object - contents are on sale. This is used for verification, if the this - sale type is not valid for the object the purchase will fail - Price of the object. This is used for - verification, if it does not match the actual price the purchase - will fail - Group ID that will be associated with the new - purchase - Inventory folder UUID where the object or objects - purchased should be placed - - - BuyObject(Client.Network.CurrentSim, 500, SaleType.Copy, - 100, UUID.Zero, Client.Self.InventoryRootFolderUUID); - - - - - - Request prices that should be displayed in pay dialog. This will triggger the simulator - to send us back a PayPriceReply which can be handled by OnPayPriceReply event - - A reference to the object where the object resides - of the object we are requesting pay price - - - - Select a single object. This will trigger the simulator to send us back - an ObjectProperties packet so we can get the full information for - this object - - A reference to the object where the object resides - The objects ID which is local to the simulator the object is in - Should objects be deselected immediately after selection - - - - Select a single object. This will trigger the simulator to send us back - an ObjectProperties packet so we can get the full information for - this object - - A reference to the object where the object resides - The objects ID which is local to the simulator the object is in - - + - Select multiple objects. This will trigger the simulator to send us - back ObjectProperties for each object + Construct a new instance of the PreloadSoundEventArgs class - A reference to the object where the objects reside - An array which contains the IDs of the objects to select - Should objects be deselected immediately after selection + Simulator where the event originated + The sound asset id + The ID of the owner + The ID of the object - - - Select multiple objects. This will trigger the simulator to send us - back ObjectProperties for each object - - A reference to the object where the objects reside - An array which contains the IDs of the objects to select - - - - Sets and object's flags (physical, temporary, phantom, casts shadow) - - - - - - - - - - Sets an object's sale information - - - - - - - - Sets sale info for multiple objects - - - - - - - - Deselect an object - - A reference to the object where the object resides - The objects ID which is local to the simulator the object is in - - - - Deselect multiple objects. - - A reference to the object where the objects reside - An array which contains the IDs of the objects to select - - - - Perform a click action on an object - - A reference to the object where the object resides - The objects ID which is local to the simulator the object is in - - - - Perform a click action on an object - - A reference to the object where the object resides - The objects ID which is local to the simulator the object is in - - - - - - - - - - Create, or "rez" a new prim object in a simulator - - A reference to the object to place the object in - Data describing the prim object to rez - Group ID that this prim will be set to, or UUID.Zero if you - do not want the object to be associated with a specific group - An approximation of the position at which to rez the prim - Scale vector to size this prim - Rotation quaternion to rotate this prim - Due to the way client prim rezzing is done on the server, - the requested position for an object is only close to where the prim - actually ends up. If you desire exact placement you'll need to - follow up by moving the object after it has been created. This - function will not set textures, light and flexible data, or other - extended primitive properties - - - - Create, or "rez" a new prim object in a simulator - - A reference to the object to place the object in - Data describing the prim object to rez - Group ID that this prim will be set to, or UUID.Zero if you - do not want the object to be associated with a specific group - An approximation of the position at which to rez the prim - Scale vector to size this prim - Rotation quaternion to rotate this prim - Specify the - Due to the way client prim rezzing is done on the server, - the requested position for an object is only close to where the prim - actually ends up. If you desire exact placement you'll need to - follow up by moving the object after it has been created. This - function will not set textures, light and flexible data, or other - extended primitive properties - - - - Rez a Linden tree - - A reference to the object where the object resides - The size of the tree - The rotation of the tree - The position of the tree - The Type of tree - The of the group to set the tree to, - or UUID.Zero if no group is to be set - true to use the "new" Linden trees, false to use the old - - - - Rez grass and ground cover - - A reference to the object where the object resides - The size of the grass - The rotation of the grass - The position of the grass - The type of grass from the enum - The of the group to set the tree to, - or UUID.Zero if no group is to be set - - - - Set the textures to apply to the faces of an object - - A reference to the object where the object resides - The objects ID which is local to the simulator the object is in - The texture data to apply - - - - Set the textures to apply to the faces of an object - - A reference to the object where the object resides - The objects ID which is local to the simulator the object is in - The texture data to apply - A media URL (not used) - - - - Set the Light data on an object - - A reference to the object where the object resides - The objects ID which is local to the simulator the object is in - A object containing the data to set - - - - Set the flexible data on an object - - A reference to the object where the object resides - The objects ID which is local to the simulator the object is in - A object containing the data to set - - - - Set the sculptie texture and data on an object - - A reference to the object where the object resides - The objects ID which is local to the simulator the object is in - A object containing the data to set - - - - Set additional primitive parameters on an object - - A reference to the object where the object resides - The objects ID which is local to the simulator the object is in - The extra parameters to set - - - - Link multiple prims into a linkset - - A reference to the object where the objects reside - An array which contains the IDs of the objects to link - The last object in the array will be the root object of the linkset TODO: Is this true? - - - - Change the rotation of an object - - A reference to the object where the object resides - The objects ID which is local to the simulator the object is in - The new rotation of the object - - - - Set the name of an object - - A reference to the object where the object resides - The objects ID which is local to the simulator the object is in - A string containing the new name of the object - - - - Set the name of multiple objects - - A reference to the object where the objects reside - An array which contains the IDs of the objects to change the name of - An array which contains the new names of the objects - - - - Set the description of an object - - A reference to the object where the object resides - The objects ID which is local to the simulator the object is in - A string containing the new description of the object - - - - Set the descriptions of multiple objects - - A reference to the object where the objects reside - An array which contains the IDs of the objects to change the description of - An array which contains the new descriptions of the objects - - - - Attach an object to this avatar - - A reference to the object where the object resides - The objects ID which is local to the simulator the object is in - The point on the avatar the object will be attached - The rotation of the attached object - - - - Drop an attached object from this avatar - - A reference to the - object where the objects reside. This will always be the simulator the avatar is currently in - - The object's ID which is local to the simulator the object is in - - - - Detach an object from yourself - - A reference to the - object where the objects reside - - This will always be the simulator the avatar is currently in - - An array which contains the IDs of the objects to detach - - - - Change the position of an object, Will change position of entire linkset - - A reference to the object where the object resides - The objects ID which is local to the simulator the object is in - The new position of the object - - - - Change the position of an object - - A reference to the object where the object resides - The objects ID which is local to the simulator the object is in - The new position of the object - if true, will change position of (this) child prim only, not entire linkset - - - - Change the Scale (size) of an object - - A reference to the object where the object resides - The objects ID which is local to the simulator the object is in - The new scale of the object - If true, will change scale of this prim only, not entire linkset - True to resize prims uniformly - - - - Change the Rotation of an object that is either a child or a whole linkset - - A reference to the object where the object resides - The objects ID which is local to the simulator the object is in - The new scale of the object - If true, will change rotation of this prim only, not entire linkset - - - - Send a Multiple Object Update packet to change the size, scale or rotation of a primitive - - A reference to the object where the object resides - The objects ID which is local to the simulator the object is in - The new rotation, size, or position of the target object - The flags from the Enum - - - - Deed an object (prim) to a group, Object must be shared with group which - can be accomplished with SetPermissions() - - A reference to the object where the object resides - The objects ID which is local to the simulator the object is in - The of the group to deed the object to - - - - Deed multiple objects (prims) to a group, Objects must be shared with group which - can be accomplished with SetPermissions() - - A reference to the object where the object resides - An array which contains the IDs of the objects to deed - The of the group to deed the object to - - - - Set the permissions on multiple objects - - A reference to the object where the objects reside - An array which contains the IDs of the objects to set the permissions on - The new Who mask to set - The new Permissions mark to set - TODO: What does this do? - - - - Request additional properties for an object - - A reference to the object where the object resides - - - - - Request additional properties for an object - - A reference to the object where the object resides - Absolute UUID of the object - Whether to require server acknowledgement of this request - - - - Used for new prims, or significant changes to existing prims - - - - - - - A terse object update, used when a transformation matrix or - velocity/acceleration for an object changes but nothing else - (scale/position/rotation/acceleration/velocity) - - - - - - - - - - - - - - Handles cached object update packets from the simulator - - The packet containing the object data - The simulator sending the data - - - - Handle KillObject packets from the simulator - - The packet containing the object data - The simulator sending the data - - - - Setup construction data for a basic primitive shape - - Primitive shape to construct - Construction data that can be plugged into a + + Simulator where the event originated - - - - - - - - - - - - - - - - - - - Set the Shape data of an object - - A reference to the object where the object resides - The objects ID which is local to the simulator the object is in - Data describing the prim shape - - - - Set the Material data of an object - - A reference to the object where the object resides - The objects ID which is local to the simulator the object is in - The new material of the object - - - - - - - - - - - - - - - - - - - - - - This event will be raised for every ObjectUpdate block that - contains a prim that isn't attached to an avatar. - - Depending on the circumstances a client could - receive two or more of these events for the same object, if you - or the object left the current sim and returned for example. Client - applications are responsible for tracking and storing objects. - - - - - This event will be raised for every ObjectUpdate block that - contains an avatar attachment. - - Depending on the circumstances a client could - receive two or more of these events for the same object, if you - or the object left the current sim and returned for example. Client - applications are responsible for tracking and storing objects. - - - - - This event will be raised for every ObjectUpdate block that - contains a new avatar. - - Depending on the circumstances a client - could receive two or more of these events for the same avatar, if - you or the other avatar left the current sim and returned for - example. Client applications are responsible for tracking and - storing objects. - - - - - This event will be raised when a terse object update packet is - received, containing the updated position, rotation, and - movement-related vectors - - - - - This event will be raised when a terse object update packet is - received, containing the updated position, rotation, and - movement-related vectors - - - - - Triggers the OnObjectDataBlockUpdate event. - - - - - This event will be raised when an avatar sits on an object - or stands up, with a local ID of the current seat or zero. - - - - - This event will be raised when an object is removed from a - simulator. - - - - - This event will be raised when an objects properties are received - from the simulator - - - - - This event will be raised when an objects properties are updated - from the simulator - - - - - Thie event will be raised when an objects properties family - information is recieved from the simulator. ObjectPropertiesFamily - is a subset of the fields found in ObjectProperties - - - - - This event will be fired when we recieve pay price information - for the object after having asked for them with RequestPayPrice - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Called whenever an object terse update is received - - - - - - - - - Called whenever an object terse update is received - This is different than the above in that the update to the prim has not happened yet - - - - + + Get the sound asset id - - - Called whenever an major object update is received - This is when major changes are happening to the contructionData changing the shape of an object - - - - - - - - - - - Called whenever an object disappears - - - - - - - Called whenever the client avatar sits down or stands up - - Simulator the packet was received from - - The local ID of the object that is being sat - - on. If this is zero the avatar is not sitting on an object + + Get the ID of the owner - - - Called when we get PayPriceReply packet after calling RequestPayPrice - - Simulator the packet was received from - Object - Default pay price for the object, -1 means control should be disabled, -2 it should be empty - Array of 4 prices, -1 means button should be disabled + + Get the ID of the Object - + - + A Name Value pair with additional settings, used in the protocol + primarily to transmit avatar names and active group in object packets - - - - + - + - + - + - + - - - - - - Login Request Parameters - - - - The URL of the Login Server - - - The number of milliseconds to wait before a login is considered - failed due to timeout - - - The request method - login_to_server is currently the only supported method - - - The Agents First name - - - The Agents Last name - - - A md5 hashed password - plaintext password will be automatically hashed - - - The agents starting location once logged in - Either "last", "home", or a string encoded URI - containing the simulator name and x/y/z coordinates e.g: uri:hooper&128&152&17 - - - A string containing the client software channel information - Second Life Release - - - The client software version information - The official viewer uses: Second Life Release n.n.n.n - where n is replaced with the current version of the viewer - - - A string containing the platform information the agent is running on - - - A string hash of the network cards Mac Address - - - Unknown or deprecated - - - A string hash of the first disk drives ID used to identify this clients uniqueness - - - A string containing the viewers Software, this is not directly sent to the login server but - instead is used to generate the Version string - - - A string representing the software creator. This is not directly sent to the login server but - is used by the library to generate the Version information - - - If true, this agent agrees to the Terms of Service of the grid its connecting to - - - Unknown - - - An array of string sent to the login server to enable various options - - - A randomly generated ID to distinguish between login attempts. This value is only used - internally in the library and is never sent over the wire - - - - The decoded data returned from the login server after a successful login - - - - true, false, indeterminate - - - Login message of the day - - - M or PG, also agent_region_access and agent_access_max - - - - Parse LLSD Login Reply Data - - An - contaning the login response data - XML-RPC logins do not require this as XML-RPC.NET - automatically populates the struct properly using attributes - - - - Overrides SSL certificate validation check for Mono - - Remove me when MONO can handle ServerCertificateValidationCallback - - + - + Constructor that takes all the fields as parameters + + + + + - + - + Constructor that takes a single line from a NameValue field - - - De-serialization constructor for the InventoryNode Class - + + Type of the value - - - Serialization handler for the InventoryNode Class - - - - - De-serialization handler for the InventoryNode Class - - - - - - - - - - - - - - - - - - - - - - - For inventory folder nodes specifies weather the folder needs to be - refreshed from the server - - - - - Exception class to identify inventory exceptions - - - - - Responsible for maintaining inventory structure. Inventory constructs nodes - and manages node children as is necessary to maintain a coherant hirarchy. - Other classes should not manipulate or create InventoryNodes explicitly. When - A node's parent changes (when a folder is moved, for example) simply pass - Inventory the updated InventoryFolder and it will make the appropriate changes - to its internal representation. - - - - - Returns the contents of the specified folder - - A folder's UUID - The contents of the folder corresponding to folder - When folder does not exist in the inventory - - - - Updates the state of the InventoryNode and inventory data structure that - is responsible for the InventoryObject. If the item was previously not added to inventory, - it adds the item, and updates structure accordingly. If it was, it updates the - InventoryNode, changing the parent node if item.parentUUID does - not match node.Parent.Data.UUID. - - You can not set the inventory root folder using this method - - The InventoryObject to store - - - - Removes the InventoryObject and all related node data from Inventory. - - The InventoryObject to remove. - - - - Used to find out if Inventory contains the InventoryObject - specified by uuid. - - The UUID to check. - true if inventory contains uuid, false otherwise - - - - Saves the current inventory structure to a cache file - - Name of the cache file to save to - - - - Loads in inventory cache file into the inventory structure. Note only valid to call after login has been successful. - - Name of the cache file to load - The number of inventory items sucessfully reconstructed into the inventory node tree - - - - Called when an InventoryObject's state is changed. - - - - - Called when an item or folder is removed from inventory. - - - - - Called when an item is first added to the local inventory store. - This will occur most frequently when we're initially downloading - the inventory from the server. - - This will also fire when another avatar or object offers us inventory - - - - - The root folder of this avatars inventory - - - - - The default shared library folder - - - - - The root node of the avatars inventory - - - - - The root node of the default shared library - - - - - By using the bracket operator on this class, the program can get the - InventoryObject designated by the specified uuid. If the value for the corresponding - UUID is null, the call is equivelant to a call to RemoveNodeFor(this[uuid]). - If the value is non-null, it is equivelant to a call to UpdateNodeFor(value), - the uuid parameter is ignored. - - The UUID of the InventoryObject to get or set, ignored if set to non-null value. - The InventoryObject corresponding to uuid. - - - - Delegate to use for the OnInventoryObjectUpdated event. - - The state of the InventoryObject before the update occured. - The state of the InventoryObject after the update occured. - - - - Delegate to use for the OnInventoryObjectRemoved event. - - The InventoryObject that was removed. - - - - Delegate to use for the OnInventoryObjectUpdated event. - - The InventoryObject that has been stored. - - - - Map layer request type - - - - Objects and terrain are shown - - - Only the terrain is shown, no objects - - - Overlay showing land for sale and for auction - - - - Type of grid item, such as telehub, event, populator location, etc. - - - - Telehub - - - PG rated event - - - Mature rated event - - - Popular location - - - Locations of avatar groups in a region - - - Land for sale - - - Classified ad - - - - Information about a region on the grid map - - - - Sim X position on World Map - - - Sim Y position on World Map - - - Sim Name (NOTE: In lowercase!) - - - - - - Appears to always be zero (None) - - - Sim's defined Water Height - - - - - - UUID of the World Map image - - - Unique identifier for this region, a combination of the X - and Y position - - - - - - - - - - - - - - - - - - - - - - - Visual chunk of the grid map - - - - - Manages grid-wide tasks such as the world map - - - - A dictionary of all the regions, indexed by region name - - - A dictionary of all the regions, indexed by region handle - - - - Constructor - - Instance of GridClient object to associate with this GridManager instance - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Request data for all mainland (Linden managed) simulators - - - - - Request the region handle for the specified region UUID - - UUID of the region to look up - - - - Get grid region information using the region name, this function - will block until it can find the region or gives up - - Name of sim you're looking for - Layer that you are requesting - Will contain a GridRegion for the sim you're - looking for if successful, otherwise an empty structure - True if the GridRegion was successfully fetched, otherwise - false - - - - Populate Grid info based on data from MapBlockReplyPacket - - Incoming MapBlockReplyPacket packet - Unused - - - - Get sim time from the appropriate packet - - Incoming SimulatorViewerTimeMessagePacket from SL - Unused - - - Triggered when coarse locations (minimap dots) are updated by the simulator - - - Triggered when a new region is discovered through GridManager - - - - - - - - - - - + Unknown - - Current direction of the sun + + String value - - Current angular velocity of the sun + + - - Current world time + + - + + + + + + + + Deprecated + + + String value, but designated as an asset + + + + + - - - - + + + + + + + + + + + + + - - + + + + + + + + + + + + + + + + + Describes tasks returned in LandStatReply + + + + Estate level administration and utilities + + + + Textures for each of the four terrain height levels + + + Upper/lower texture boundaries for each corner of the sim + + + + Constructor for EstateTools class + + + + + The event subscribers. null if no subcribers + + + Raises the TopCollidersReply event + A TopCollidersReplyEventArgs object containing the + data returned from the data server + + + Thread sync lock object + + + The event subscribers. null if no subcribers + + + Raises the TopScriptsReply event + A TopScriptsReplyEventArgs object containing the + data returned from the data server + + + Thread sync lock object + + + The event subscribers. null if no subcribers + + + Raises the EstateUsersReply event + A EstateUsersReplyEventArgs object containing the + data returned from the data server + + + Thread sync lock object + + + The event subscribers. null if no subcribers + + + Raises the EstateGroupsReply event + A EstateGroupsReplyEventArgs object containing the + data returned from the data server + + + Thread sync lock object + + + The event subscribers. null if no subcribers + + + Raises the EstateManagersReply event + A EstateManagersReplyEventArgs object containing the + data returned from the data server + + + Thread sync lock object + + + The event subscribers. null if no subcribers + + + Raises the EstateBansReply event + A EstateBansReplyEventArgs object containing the + data returned from the data server + + + Thread sync lock object + + + The event subscribers. null if no subcribers + + + Raises the EstateCovenantReply event + A EstateCovenantReplyEventArgs object containing the + data returned from the data server + + + Thread sync lock object + + + The event subscribers. null if no subcribers + + + Raises the EstateUpdateInfoReply event + A EstateUpdateInfoReplyEventArgs object containing the + data returned from the data server + + + Thread sync lock object + + + + Requests estate information such as top scripts and colliders + + + + + + + + Requests estate settings, including estate manager and access/ban lists + + + Requests the "Top Scripts" list for the current region + + + Requests the "Top Colliders" list for the current region + + + + Set several estate specific configuration variables + + The Height of the waterlevel over the entire estate. Defaults to 20 + The maximum height change allowed above the baked terrain. Defaults to 4 + The minimum height change allowed below the baked terrain. Defaults to -4 + true to use + if True forces the sun position to the position in SunPosition + The current position of the sun on the estate, or when FixedSun is true the static position + the sun will remain. 6.0 = Sunrise, 30.0 = Sunset + + + + Request return of objects owned by specified avatar + + The Agents owning the primitives to return + specify the coverage and type of objects to be included in the return + true to perform return on entire estate + + + + + + + + + Used for setting and retrieving various estate panel settings + + EstateOwnerMessage Method field + List of parameters to include + + + + Kick an avatar from an estate + + Key of Agent to remove + + + + Ban an avatar from an estate + Key of Agent to remove + Ban user from this estate and all others owned by the estate owner + + + Unban an avatar from an estate + Key of Agent to remove + /// Unban user from this estate and all others owned by the estate owner + + + + Send a message dialog to everyone in an entire estate + + Message to send all users in the estate + + + + Send a message dialog to everyone in a simulator + + Message to send all users in the simulator + + + + Send an avatar back to their home location + + Key of avatar to send home + + + + Begin the region restart process + + + + + Cancels a region restart + + + + Estate panel "Region" tab settings + + + Estate panel "Debug" tab settings + + + Used for setting the region's terrain textures for its four height levels + + + + + + + Used for setting sim terrain texture heights + + + Requests the estate covenant + + + + Upload a terrain RAW file + + A byte array containing the encoded terrain data + The name of the file being uploaded + The Id of the transfer request + + + + Teleports all users home in current Estate + + + + + Remove estate manager + Key of Agent to Remove + removes manager to this estate and all others owned by the estate owner + + + + Add estate manager + Key of Agent to Add + Add agent as manager to this estate and all others owned by the estate owner + + + + Add's an agent to the estate Allowed list + Key of Agent to Add + Add agent as an allowed reisdent to All estates if true + + + + Removes an agent from the estate Allowed list + Key of Agent to Remove + Removes agent as an allowed reisdent from All estates if true + + + + + Add's a group to the estate Allowed list + Key of Group to Add + Add Group as an allowed group to All estates if true + + + + + Removes a group from the estate Allowed list + Key of Group to Remove + Removes Group as an allowed Group from All estates if true + + + Process an incoming packet and raise the appropriate events + The sender + The EventArgs object containing the packet data + + + Process an incoming packet and raise the appropriate events + The sender + The EventArgs object containing the packet data + + + Process an incoming packet and raise the appropriate events + The sender + The EventArgs object containing the packet data + + + Raised when the data server responds to a request. + + + Raised when the data server responds to a request. + + + Raised when the data server responds to a request. + + + Raised when the data server responds to a request. + + + Raised when the data server responds to a request. + + + Raised when the data server responds to a request. + + + Raised when the data server responds to a request. + + + Raised when the data server responds to a request. + + + Used in the ReportType field of a LandStatRequest + + + Used by EstateOwnerMessage packets + + + Used by EstateOwnerMessage packets + + - - - - - - - + + No flags set - + + Only return targets scripted objects + + + Only return targets objects if on others land + + + Returns target's scripted objects and objects on other parcels + + + Ground texture settings for each corner of the region + + + Used by GroundTextureHeightSettings + + + The high and low texture thresholds for each corner of the sim + + + Raised on LandStatReply when the report type is for "top colliders" + + + Construct a new instance of the TopCollidersReplyEventArgs class + The number of returned items in LandStatReply + Dictionary of Object UUIDs to tasks returned in LandStatReply + + - + The number of returned items in LandStatReply - - + + + + A Dictionary of Object UUIDs to tasks returned in LandStatReply + + + + Raised on LandStatReply when the report type is for "top Scripts" + + + Construct a new instance of the TopScriptsReplyEventArgs class + The number of returned items in LandStatReply + Dictionary of Object UUIDs to tasks returned in LandStatReply + + + + The number of scripts returned in LandStatReply + + + + + A Dictionary of Object UUIDs to tasks returned in LandStatReply + + + + Returned, along with other info, upon a successful .RequestInfo() + + + Construct a new instance of the EstateBansReplyEventArgs class + The estate's identifier on the grid + The number of returned items in LandStatReply + User UUIDs banned + + + + The identifier of the estate + + + + + The number of returned itmes + + + + + List of UUIDs of Banned Users + + + + Returned, along with other info, upon a successful .RequestInfo() + + + Construct a new instance of the EstateUsersReplyEventArgs class + The estate's identifier on the grid + The number of users + Allowed users UUIDs + + + + The identifier of the estate + + + + + The number of returned items + + + + + List of UUIDs of Allowed Users + + + + Returned, along with other info, upon a successful .RequestInfo() + + + Construct a new instance of the EstateGroupsReplyEventArgs class + The estate's identifier on the grid + The number of Groups + Allowed Groups UUIDs + + + + The identifier of the estate + + + + + The number of returned items + + + + + List of UUIDs of Allowed Groups + + + + Returned, along with other info, upon a successful .RequestInfo() + + + Construct a new instance of the EstateManagersReplyEventArgs class + The estate's identifier on the grid + The number of Managers + Managers UUIDs + + + + The identifier of the estate + + + + + The number of returned items + + + + + List of UUIDs of the Estate's Managers + + + + Returned, along with other info, upon a successful .RequestInfo() + + + Construct a new instance of the EstateCovenantReplyEventArgs class + The Covenant ID + The timestamp + The estate's name + The Estate Owner's ID (can be a GroupID) + + + + The Covenant + + + + + The timestamp + + + + + The Estate name + + + + + The Estate Owner's ID (can be a GroupID) + + + + Returned, along with other info, upon a successful .RequestInfo() + + + Construct a new instance of the EstateUpdateInfoReplyEventArgs class + The estate's name + The Estate Owners ID (can be a GroupID) + The estate's identifier on the grid + + + + + The estate's name + + + + + The Estate Owner's ID (can be a GroupID) + + + + + The identifier of the estate on the grid + + + + + + + + Holds group information for Avatars such as those you might find in a profile + + + + true of Avatar accepts group notices + + + Groups Key + + + Texture Key for groups insignia + + + Name of the group + + + Powers avatar has in the group + + + Avatars Currently selected title + + + true of Avatar has chosen to list this in their profile + + + + Contains an animation currently being played by an agent + + + + The ID of the animation asset + + + A number to indicate start order of currently playing animations + On Linden Grids this number is unique per region, with OpenSim it is per client + + + + + + + Holds group information on an individual profile pick + + + + + Retrieve friend status notifications, and retrieve avatar names and + profiles + + + + The event subscribers, null of no subscribers + + + Raises the AvatarAnimation Event + An AvatarAnimationEventArgs object containing + the data sent from the simulator + + + Thread sync lock object + + + The event subscribers, null of no subscribers + + + Raises the AvatarAppearance Event + A AvatarAppearanceEventArgs object containing + the data sent from the simulator + + + Thread sync lock object + + + The event subscribers, null of no subscribers + + + Raises the UUIDNameReply Event + A UUIDNameReplyEventArgs object containing + the data sent from the simulator + + + Thread sync lock object + + + The event subscribers, null of no subscribers + + + Raises the AvatarInterestsReply Event + A AvatarInterestsReplyEventArgs object containing + the data sent from the simulator + + + Thread sync lock object + + + The event subscribers, null of no subscribers + + + Raises the AvatarPropertiesReply Event + A AvatarPropertiesReplyEventArgs object containing + the data sent from the simulator + + + Thread sync lock object + + + The event subscribers, null of no subscribers + + + Raises the AvatarGroupsReply Event + A AvatarGroupsReplyEventArgs object containing + the data sent from the simulator + + + Thread sync lock object + + + The event subscribers, null of no subscribers + + + Raises the AvatarPickerReply Event + A AvatarPickerReplyEventArgs object containing + the data sent from the simulator + + + Thread sync lock object + + + The event subscribers, null of no subscribers + + + Raises the ViewerEffectPointAt Event + A ViewerEffectPointAtEventArgs object containing + the data sent from the simulator + + + Thread sync lock object + + + The event subscribers, null of no subscribers + + + Raises the ViewerEffectLookAt Event + A ViewerEffectLookAtEventArgs object containing + the data sent from the simulator + + + Thread sync lock object + + + The event subscribers, null of no subscribers + + + Raises the ViewerEffect Event + A ViewerEffectEventArgs object containing + the data sent from the simulator + + + Thread sync lock object + + + The event subscribers, null of no subscribers + + + Raises the AvatarPicksReply Event + A AvatarPicksReplyEventArgs object containing + the data sent from the simulator + + + Thread sync lock object + + + The event subscribers, null of no subscribers + + + Raises the PickInfoReply Event + A PickInfoReplyEventArgs object containing + the data sent from the simulator + + + Thread sync lock object + + + The event subscribers, null of no subscribers + + + Raises the AvatarClassifiedReply Event + A AvatarClassifiedReplyEventArgs object containing + the data sent from the simulator + + + Thread sync lock object + + + The event subscribers, null of no subscribers + + + Raises the ClassifiedInfoReply Event + A ClassifiedInfoReplyEventArgs object containing + the data sent from the simulator + + + Thread sync lock object + + + + Represents other avatars + + + + + Tracks the specified avatar on your map + Avatar ID to track + + + + Request a single avatar name + + The avatar key to retrieve a name for + + + + Request a list of avatar names + + The avatar keys to retrieve names for + + + + Start a request for Avatar Properties + + + + + + Search for an avatar (first name, last name) + + The name to search for + An ID to associate with this query + + + + Start a request for Avatar Picks + + UUID of the avatar + + + + Start a request for Avatar Classifieds + + UUID of the avatar + + + + Start a request for details of a specific profile pick + + UUID of the avatar + UUID of the profile pick + + + + Start a request for details of a specific profile classified + + UUID of the avatar + UUID of the profile classified + + + Process an incoming packet and raise the appropriate events + The sender + The EventArgs object containing the packet data + + + Process an incoming packet and raise the appropriate events + The sender + The EventArgs object containing the packet data + + + Process an incoming packet and raise the appropriate events + The sender + The EventArgs object containing the packet data + + + Process an incoming packet and raise the appropriate events + The sender + The EventArgs object containing the packet data + + + Process an incoming packet and raise the appropriate events + The sender + The EventArgs object containing the packet data + + + + Crossed region handler for message that comes across the EventQueue. Sent to an agent + when the agent crosses a sim border into a new region. + + The message key + the IMessage object containing the deserialized data sent from the simulator + The which originated the packet + + + Process an incoming packet and raise the appropriate events + The sender + The EventArgs object containing the packet data + + + Process an incoming packet and raise the appropriate events + The sender + The EventArgs object containing the packet data + + + Process an incoming packet and raise the appropriate events + The sender + The EventArgs object containing the packet data + + + Process an incoming packet and raise the appropriate events + The sender + The EventArgs object containing the packet data + + + Process an incoming packet and raise the appropriate events + The sender + The EventArgs object containing the packet data + + + Process an incoming packet and raise the appropriate events + The sender + The EventArgs object containing the packet data + + + Process an incoming packet and raise the appropriate events + The sender + The EventArgs object containing the packet data + + + Raised when the simulator sends us data containing + an agents animation playlist + + + Raised when the simulator sends us data containing + the appearance information for an agent + + + Raised when the simulator sends us data containing + agent names/id values + + + Raised when the simulator sends us data containing + the interests listed in an agents profile + + + Raised when the simulator sends us data containing + profile property information for an agent + + + Raised when the simulator sends us data containing + the group membership an agent is a member of + + + Raised when the simulator sends us data containing + name/id pair + + + Raised when the simulator sends us data containing + the objects and effect when an agent is pointing at + + + Raised when the simulator sends us data containing + the objects and effect when an agent is looking at + + + Raised when the simulator sends us data containing + an agents viewer effect information + + + Raised when the simulator sends us data containing + the top picks from an agents profile + + + Raised when the simulator sends us data containing + the Pick details + + + Raised when the simulator sends us data containing + the classified ads an agent has placed + + + Raised when the simulator sends us data containing + the details of a classified ad + + + Provides data for the event + The event occurs when the simulator sends + the animation playlist for an agent + + The following code example uses the and + properties to display the animation playlist of an avatar on the window. + + // subscribe to the event + Client.Avatars.AvatarAnimation += Avatars_AvatarAnimation; + + private void Avatars_AvatarAnimation(object sender, AvatarAnimationEventArgs e) + { + // create a dictionary of "known" animations from the Animations class using System.Reflection + Dictionary<UUID, string> systemAnimations = new Dictionary<UUID, string>(); + Type type = typeof(Animations); + System.Reflection.FieldInfo[] fields = type.GetFields(System.Reflection.BindingFlags.Public | System.Reflection.BindingFlags.Static); + foreach (System.Reflection.FieldInfo field in fields) + { + systemAnimations.Add((UUID)field.GetValue(type), field.Name); + } + + // find out which animations being played are known animations and which are assets + foreach (Animation animation in e.Animations) + { + if (systemAnimations.ContainsKey(animation.AnimationID)) + { + Console.WriteLine("{0} is playing {1} ({2}) sequence {3}", e.AvatarID, + systemAnimations[animation.AnimationID], animation.AnimationSequence); + } + else + { + Console.WriteLine("{0} is playing {1} (Asset) sequence {2}", e.AvatarID, + animation.AnimationID, animation.AnimationSequence); + } + } + } + + + + + + Construct a new instance of the AvatarAnimationEventArgs class + + The ID of the agent + The list of animations to start + + + Get the ID of the agent + + + Get the list of animations to start + + + Provides data for the event + The event occurs when the simulator sends + the appearance data for an avatar + + The following code example uses the and + properties to display the selected shape of an avatar on the window. + + // subscribe to the event + Client.Avatars.AvatarAppearance += Avatars_AvatarAppearance; + + // handle the data when the event is raised + void Avatars_AvatarAppearance(object sender, AvatarAppearanceEventArgs e) + { + Console.WriteLine("The Agent {0} is using a {1} shape.", e.AvatarID, (e.VisualParams[31] > 0) : "male" ? "female") + } + + + + + + Construct a new instance of the AvatarAppearanceEventArgs class + + The simulator request was from + The ID of the agent + true of the agent is a trial account + The default agent texture + The agents appearance layer textures + The for the agent + + + Get the Simulator this request is from of the agent + + + Get the ID of the agent + + + true if the agent is a trial account + + + Get the default agent texture + + + Get the agents appearance layer textures + + + Get the for the agent + + + Represents the interests from the profile of an agent + + + Get the ID of the agent + + + The properties of an agent + + + Get the ID of the agent + + + Get the ID of the agent + + + Get the ID of the agent + + + Get the ID of the avatar diff --git a/bin/OpenMetaverse.dll b/bin/OpenMetaverse.dll index 8751bfc71e..69c4e9b9df 100644 Binary files a/bin/OpenMetaverse.dll and b/bin/OpenMetaverse.dll differ diff --git a/bin/OpenMetaverseTypes.XML b/bin/OpenMetaverseTypes.XML index 2dc28aea7c..befc8d4ef4 100644 --- a/bin/OpenMetaverseTypes.XML +++ b/bin/OpenMetaverseTypes.XML @@ -4,411 +4,6 @@ OpenMetaverseTypes - - - A hierarchical token bucket for bandwidth throttling. See - http://en.wikipedia.org/wiki/Token_bucket for more information - - - - Parent bucket to this bucket, or null if this is a root - bucket - - - Size of the bucket in bytes. If zero, the bucket has - infinite capacity - - - Rate that the bucket fills, in bytes per millisecond. If - zero, the bucket always remains full - - - Number of tokens currently in the bucket - - - Time of the last drip, in system ticks - - - - Default constructor - - Parent bucket if this is a child bucket, or - null if this is a root bucket - Maximum size of the bucket in bytes, or - zero if this bucket has no maximum capacity - Rate that the bucket fills, in bytes per - second. If zero, the bucket always remains full - - - - Remove a given number of tokens from the bucket - - Number of tokens to remove from the bucket - True if the requested number of tokens were removed from - the bucket, otherwise false - - - - Remove a given number of tokens from the bucket - - Number of tokens to remove from the bucket - True if tokens were added to the bucket - during this call, otherwise false - True if the requested number of tokens were removed from - the bucket, otherwise false - - - - Add tokens to the bucket over time. The number of tokens added each - call depends on the length of time that has passed since the last - call to Drip - - True if tokens were added to the bucket, otherwise false - - - - The parent bucket of this bucket, or null if this bucket has no - parent. The parent bucket will limit the aggregate bandwidth of all - of its children buckets - - - - - Maximum burst rate in bytes per second. This is the maximum number - of tokens that can accumulate in the bucket at any one time - - - - - The speed limit of this bucket in bytes per second. This is the - number of tokens that are added to the bucket per second - - Tokens are added to the bucket any time - is called, at the granularity of - the system tick interval (typically around 15-22ms) - - - - The number of bytes that can be sent at this moment. This is the - current number of tokens in the bucket - If this bucket has a parent bucket that does not have - enough tokens for a request, will - return false regardless of the content of this bucket - - - - - Same as Queue except Dequeue function blocks until there is an object to return. - Note: This class does not need to be synchronized - - - - - Create new BlockingQueue. - - The System.Collections.ICollection to copy elements from - - - - Create new BlockingQueue. - - The initial number of elements that the queue can contain - - - - Create new BlockingQueue. - - - - - BlockingQueue Destructor (Close queue, resume any waiting thread). - - - - - Remove all objects from the Queue. - - - - - Remove all objects from the Queue, resume all dequeue threads. - - - - - Removes and returns the object at the beginning of the Queue. - - Object in queue. - - - - Removes and returns the object at the beginning of the Queue. - - time to wait before returning - Object in queue. - - - - Removes and returns the object at the beginning of the Queue. - - time to wait before returning (in milliseconds) - Object in queue. - - - - Adds an object to the end of the Queue - - Object to put in queue - - - - Open Queue. - - - - - Gets flag indicating if queue has been closed. - - - - - Convert this matrix to euler rotations - - X euler angle - Y euler angle - Z euler angle - - - - Convert this matrix to a quaternion rotation - - A quaternion representation of this rotation matrix - - - - Construct a matrix from euler rotation values in radians - - X euler angle in radians - Y euler angle in radians - Z euler angle in radians - - - - Get a formatted string representation of the vector - - A string representation of the vector - - - A 4x4 matrix containing all zeroes - - - A 4x4 identity matrix - - - - An 8-bit color structure including an alpha channel - - - - Red - - - Green - - - Blue - - - Alpha - - - - - - - - - - - - - Builds a color from a byte array - - Byte array containing a 16 byte color - Beginning position in the byte array - True if the byte array stores inverted values, - otherwise false. For example the color black (fully opaque) inverted - would be 0xFF 0xFF 0xFF 0x00 - - - - Returns the raw bytes for this vector - - Byte array containing a 16 byte color - Beginning position in the byte array - True if the byte array stores inverted values, - otherwise false. For example the color black (fully opaque) inverted - would be 0xFF 0xFF 0xFF 0x00 - True if the alpha value is inverted in - addition to whatever the inverted parameter is. Setting inverted true - and alphaInverted true will flip the alpha value back to non-inverted, - but keep the other color bytes inverted - A 16 byte array containing R, G, B, and A - - - - Copy constructor - - Color to copy - - - - IComparable.CompareTo implementation - - Sorting ends up like this: |--Grayscale--||--Color--|. - Alpha is only used when the colors are otherwise equivalent - - - - Builds a color from a byte array - - Byte array containing a 16 byte color - Beginning position in the byte array - True if the byte array stores inverted values, - otherwise false. For example the color black (fully opaque) inverted - would be 0xFF 0xFF 0xFF 0x00 - True if the alpha value is inverted in - addition to whatever the inverted parameter is. Setting inverted true - and alphaInverted true will flip the alpha value back to non-inverted, - but keep the other color bytes inverted - - - - Writes the raw bytes for this color to a byte array - - Destination byte array - Position in the destination array to start - writing. Must be at least 16 bytes before the end of the array - - - - Serializes this color into four bytes in a byte array - - Destination byte array - Position in the destination array to start - writing. Must be at least 4 bytes before the end of the array - True to invert the output (1.0 becomes 0 - instead of 255) - - - - Writes the raw bytes for this color to a byte array - - Destination byte array - Position in the destination array to start - writing. Must be at least 16 bytes before the end of the array - - - - Create an RGB color from a hue, saturation, value combination - - Hue - Saturation - Value - An fully opaque RGB color (alpha is 1.0) - - - A Color4 with zero RGB values and fully opaque (alpha 1.0) - - - A Color4 with full RGB values (1.0) and fully opaque (alpha 1.0) - - - X value - - - Y value - - - Z value - - - W value - - - - Constructor, builds a vector from a byte array - - Byte array containing four four-byte floats - Beginning position in the byte array - - - - Test if this vector is equal to another vector, within a given - tolerance range - - Vector to test against - The acceptable magnitude of difference - between the two vectors - True if the magnitude of difference between the two vectors - is less than the given tolerance, otherwise false - - - - IComparable.CompareTo implementation - - - - - Test if this vector is composed of all finite numbers - - - - - Builds a vector from a byte array - - Byte array containing a 16 byte vector - Beginning position in the byte array - - - - Returns the raw bytes for this vector - - A 16 byte array containing X, Y, Z, and W - - - - Writes the raw bytes for this vector to a byte array - - Destination byte array - Position in the destination array to start - writing. Must be at least 16 bytes before the end of the array - - - - Get a string representation of the vector elements with up to three - decimal digits and separated by spaces only - - Raw string representation of the vector - - - A vector with a value of 0,0,0,0 - - - A vector with a value of 1,1,1,1 - - - A vector with a value of 1,0,0,0 - - - A vector with a value of 0,1,0,0 - - - A vector with a value of 0,0,1,0 - - - A vector with a value of 0,0,0,1 - A three-dimensional vector with doubleing-point values @@ -517,221 +112,742 @@ A unit vector facing up (Z axis), value of 0,0,1 - - For thread safety - - - For thread safety - - + - Purges expired objects from the cache. Called automatically by the purge timer. + Attribute class that allows extra attributes to be attached to ENUMs - + + Text used when presenting ENUM to user + + + Default initializer + + + Text used when presenting ENUM to user + + - A three-dimensional vector with floating-point values + The different types of grid assets - - X value + + Unknown asset type - - Y value + + Texture asset, stores in JPEG2000 J2C stream format - - Z value + + Sound asset - + + Calling card for another avatar + + + Link to a location in world + + + Collection of textures and parameters that can be + worn by an avatar + + + Primitive that can contain textures, sounds, + scripts and more + + + Notecard asset + + + Holds a collection of inventory items + + + Root inventory folder + + + Linden scripting language script + + + LSO bytecode for a script + + + Uncompressed TGA texture + + + Collection of textures and shape parameters that can + be worn + + + Trash folder + + + Snapshot folder + + + Lost and found folder + + + Uncompressed sound + + + Uncompressed TGA non-square image, not to be used as a + texture + + + Compressed JPEG non-square image, not to be used as a + texture + + + Animation + + + Sequence of animations, sounds, chat, and pauses + + + Simstate file + + + Contains landmarks for favorites + + + Asset is a link to another inventory item + + + Asset is a link to another inventory folder + + + Beginning of the range reserved for ensembles + + + End of the range reserved for ensembles + + + Folder containing inventory links to wearables and attachments + that are part of the current outfit + + + Folder containing inventory items or links to + inventory items of wearables and attachments + together make a full outfit + + + Root folder for the folders of type OutfitFolder + + + Linden mesh format + + - Constructor, builds a vector from a byte array + Inventory Item Types, eg Script, Notecard, Folder, etc - Byte array containing three four-byte floats + + + Unknown + + + Texture + + + Sound + + + Calling Card + + + Landmark + + + Notecard + + + + + + Folder + + + + + + an LSL Script + + + + + + + + + + + + + + + + + + + + + + Item Sale Status + + + + Not for sale + + + The original is for sale + + + Copies are for sale + + + The contents of the object are for sale + + + + Types of wearable assets + + + + Body shape + + + Skin textures and attributes + + + Hair + + + Eyes + + + Shirt + + + Pants + + + Shoes + + + Socks + + + Jacket + + + Gloves + + + Undershirt + + + Underpants + + + Skirt + + + Alpha mask to hide parts of the avatar + + + Tattoo + + + Invalid wearable asset + + + + A hierarchical token bucket for bandwidth throttling. See + http://en.wikipedia.org/wiki/Token_bucket for more information + + + + Parent bucket to this bucket, or null if this is a root + bucket + + + Size of the bucket in bytes. If zero, the bucket has + infinite capacity + + + Rate that the bucket fills, in bytes per millisecond. If + zero, the bucket always remains full + + + Number of tokens currently in the bucket + + + Time of the last drip, in system ticks + + + + Default constructor + + Parent bucket if this is a child bucket, or + null if this is a root bucket + Maximum size of the bucket in bytes, or + zero if this bucket has no maximum capacity + Rate that the bucket fills, in bytes per + second. If zero, the bucket always remains full + + + + Remove a given number of tokens from the bucket + + Number of tokens to remove from the bucket + True if the requested number of tokens were removed from + the bucket, otherwise false + + + + Remove a given number of tokens from the bucket + + Number of tokens to remove from the bucket + True if tokens were added to the bucket + during this call, otherwise false + True if the requested number of tokens were removed from + the bucket, otherwise false + + + + Add tokens to the bucket over time. The number of tokens added each + call depends on the length of time that has passed since the last + call to Drip + + True if tokens were added to the bucket, otherwise false + + + + The parent bucket of this bucket, or null if this bucket has no + parent. The parent bucket will limit the aggregate bandwidth of all + of its children buckets + + + + + Maximum burst rate in bytes per second. This is the maximum number + of tokens that can accumulate in the bucket at any one time + + + + + The speed limit of this bucket in bytes per second. This is the + number of tokens that are added to the bucket per second + + Tokens are added to the bucket any time + is called, at the granularity of + the system tick interval (typically around 15-22ms) + + + + The number of bytes that can be sent at this moment. This is the + current number of tokens in the bucket + If this bucket has a parent bucket that does not have + enough tokens for a request, will + return false regardless of the content of this bucket + + + + + A thread-safe lockless queue that supports multiple readers and + multiple writers + + + + Queue head + + + Queue tail + + + Queue item count + + + + Constructor + + + + + Enqueue an item + + Item to enqeue + + + + Try to dequeue an item + + Dequeued item if the dequeue was successful + True if an item was successfully deqeued, otherwise false + + + Gets the current number of items in the queue. Since this + is a lockless collection this value should be treated as a close + estimate + + + + Provides a node container for data in a singly linked list + + + + Pointer to the next node in list + + + The data contained by the node + + + + Constructor + + + + + Constructor + + + + + An 8-bit color structure including an alpha channel + + + + Red + + + Green + + + Blue + + + Alpha + + + + + + + + + + + + + Builds a color from a byte array + + Byte array containing a 16 byte color Beginning position in the byte array + True if the byte array stores inverted values, + otherwise false. For example the color black (fully opaque) inverted + would be 0xFF 0xFF 0xFF 0x00 - + - Test if this vector is equal to another vector, within a given - tolerance range + Returns the raw bytes for this vector - Vector to test against - The acceptable magnitude of difference - between the two vectors - True if the magnitude of difference between the two vectors - is less than the given tolerance, otherwise false + Byte array containing a 16 byte color + Beginning position in the byte array + True if the byte array stores inverted values, + otherwise false. For example the color black (fully opaque) inverted + would be 0xFF 0xFF 0xFF 0x00 + True if the alpha value is inverted in + addition to whatever the inverted parameter is. Setting inverted true + and alphaInverted true will flip the alpha value back to non-inverted, + but keep the other color bytes inverted + A 16 byte array containing R, G, B, and A - + + + Copy constructor + + Color to copy + + + + IComparable.CompareTo implementation + + Sorting ends up like this: |--Grayscale--||--Color--|. + Alpha is only used when the colors are otherwise equivalent + + + + Builds a color from a byte array + + Byte array containing a 16 byte color + Beginning position in the byte array + True if the byte array stores inverted values, + otherwise false. For example the color black (fully opaque) inverted + would be 0xFF 0xFF 0xFF 0x00 + True if the alpha value is inverted in + addition to whatever the inverted parameter is. Setting inverted true + and alphaInverted true will flip the alpha value back to non-inverted, + but keep the other color bytes inverted + + + + Writes the raw bytes for this color to a byte array + + Destination byte array + Position in the destination array to start + writing. Must be at least 16 bytes before the end of the array + + + + Serializes this color into four bytes in a byte array + + Destination byte array + Position in the destination array to start + writing. Must be at least 4 bytes before the end of the array + True to invert the output (1.0 becomes 0 + instead of 255) + + + + Writes the raw bytes for this color to a byte array + + Destination byte array + Position in the destination array to start + writing. Must be at least 16 bytes before the end of the array + + + + Ensures that values are in range 0-1 + + + + + Create an RGB color from a hue, saturation, value combination + + Hue + Saturation + Value + An fully opaque RGB color (alpha is 1.0) + + + + Performs linear interpolation between two colors + + Color to start at + Color to end at + Amount to interpolate + The interpolated color + + + A Color4 with zero RGB values and fully opaque (alpha 1.0) + + + A Color4 with full RGB values (1.0) and fully opaque (alpha 1.0) + + + + Determines the appropriate events to set, leaves the locks, and sets the events. + + + + + A routine for lazily creating a event outside the lock (so if errors + happen they are outside the lock and that we don't do much work + while holding a spin lock). If all goes well, reenter the lock and + set 'waitEvent' + + + + + Waits on 'waitEvent' with a timeout of 'millisceondsTimeout. + Before the wait 'numWaiters' is incremented and is restored before leaving this routine. + + + + + Copy constructor + + Circular queue to copy + + + + A 128-bit Universally Unique Identifier, used throughout the Second + Life networking protocol + + + + The System.Guid object this struct wraps around + + + + Constructor that takes a string UUID representation + + A string representation of a UUID, case + insensitive and can either be hyphenated or non-hyphenated + UUID("11f8aa9c-b071-4242-836b-13b7abe0d489") + + + + Constructor that takes a System.Guid object + + A Guid object that contains the unique identifier + to be represented by this UUID + + + + Constructor that takes a byte array containing a UUID + + Byte array containing a 16 byte UUID + Beginning offset in the array + + + + Constructor that takes an unsigned 64-bit unsigned integer to + convert to a UUID + + 64-bit unsigned integer to convert to a UUID + + + + Copy constructor + + UUID to copy + + IComparable.CompareTo implementation - + - Test if this vector is composed of all finite numbers + Assigns this UUID from 16 bytes out of a byte array + Byte array containing the UUID to assign this UUID to + Starting position of the UUID in the byte array - + - Builds a vector from a byte array + Returns a copy of the raw bytes for this UUID - Byte array containing a 12 byte vector - Beginning position in the byte array + A 16 byte array containing this UUID - + - Returns the raw bytes for this vector - - A 12 byte array containing X, Y, and Z - - - - Writes the raw bytes for this vector to a byte array + Writes the raw bytes for this UUID to a byte array Destination byte array Position in the destination array to start - writing. Must be at least 12 bytes before the end of the array + writing. Must be at least 16 bytes before the end of the array - + - Parse a vector from a string + Calculate an LLCRC (cyclic redundancy check) for this UUID - A string representation of a 3D vector, enclosed - in arrow brackets and separated by commas + The CRC checksum for this UUID - + - Calculate the rotation between two vectors + Create a 64-bit integer representation from the second half of this UUID - Normalized directional vector (such as 1,0,0 for forward facing) - Normalized target vector + An integer created from the last eight bytes of this UUID - + - Interpolates between two vectors using a cubic equation + Generate a UUID from a string + A string representation of a UUID, case + insensitive and can either be hyphenated or non-hyphenated + UUID.Parse("11f8aa9c-b071-4242-836b-13b7abe0d489") - + - Get a formatted string representation of the vector + Generate a UUID from a string - A string representation of the vector + A string representation of a UUID, case + insensitive and can either be hyphenated or non-hyphenated + Will contain the parsed UUID if successful, + otherwise null + True if the string was successfully parse, otherwise false + UUID.TryParse("11f8aa9c-b071-4242-836b-13b7abe0d489", result) - + - Get a string representation of the vector elements with up to three - decimal digits and separated by spaces only + Combine two UUIDs together by taking the MD5 hash of a byte array + containing both UUIDs - Raw string representation of the vector + First UUID to combine + Second UUID to combine + The UUID product of the combination - + - Cross product between two vectors + + - - A vector with a value of 0,0,0 - - - A vector with a value of 1,1,1 - - - A unit vector facing forward (X axis), value 1,0,0 - - - A unit vector facing left (Y axis), value 0,1,0 - - - A unit vector facing up (Z axis), value 0,0,1 - - + - A two-dimensional vector with floating-point values + Return a hash code for this UUID, used by .NET for hash tables + An integer composed of all the UUID bytes XORed together - - X value - - - Y value - - + - Test if this vector is equal to another vector, within a given - tolerance range + Comparison function - Vector to test against - The acceptable magnitude of difference - between the two vectors - True if the magnitude of difference between the two vectors - is less than the given tolerance, otherwise false + An object to compare to this UUID + True if the object is a UUID and both UUIDs are equal - + - Test if this vector is composed of all finite numbers + Comparison function + UUID to compare to + True if the UUIDs are equal, otherwise false - + - IComparable.CompareTo implementation + Get a hyphenated string representation of this UUID + A string representation of this UUID, lowercase and + with hyphens + 11f8aa9c-b071-4242-836b-13b7abe0d489 - + - Builds a vector from a byte array + Equals operator - Byte array containing two four-byte floats - Beginning position in the byte array + First UUID for comparison + Second UUID for comparison + True if the UUIDs are byte for byte equal, otherwise false - + - Returns the raw bytes for this vector + Not equals operator - An eight-byte array containing X and Y + First UUID for comparison + Second UUID for comparison + True if the UUIDs are not equal, otherwise true - + - Writes the raw bytes for this vector to a byte array + XOR operator - Destination byte array - Position in the destination array to start - writing. Must be at least 8 bytes before the end of the array + First UUID + Second UUID + A UUID that is a XOR combination of the two input UUIDs - + - Parse a vector from a string + String typecasting operator - A string representation of a 2D vector, enclosed - in arrow brackets and separated by commas + A UUID in string form. Case insensitive, + hyphenated or non-hyphenated + A UUID built from the string representation - - - Interpolates between two vectors using a cubic equation - + + An UUID with a value of all zeroes - - - Get a formatted string representation of the vector - - A string representation of the vector - - - - Get a string representation of the vector elements with up to three - decimal digits and separated by spaces only - - Raw string representation of the vector - - - A vector with a value of 0,0 - - - A vector with a value of 1,1 - - - A vector with a value of 1,0 - - - A vector with a value of 0,1 + + A cache of UUID.Zero as a string to optimize a common path Used for converting degrees to radians @@ -739,6 +855,145 @@ Used for converting radians to degrees + + Provide a single instance of the CultureInfo class to + help parsing in situations where the grid assumes an en-us + culture + + + UNIX epoch in DateTime format + + + Provide a single instance of the MD5 class to avoid making + duplicate copies and handle thread safety + + + Provide a single instance of the SHA-1 class to avoid + making duplicate copies and handle thread safety + + + Provide a single instance of a random number generator + to avoid making duplicate copies and handle thread safety + + + + Clamp a given value between a range + + Value to clamp + Minimum allowable value + Maximum allowable value + A value inclusively between lower and upper + + + + Clamp a given value between a range + + Value to clamp + Minimum allowable value + Maximum allowable value + A value inclusively between lower and upper + + + + Clamp a given value between a range + + Value to clamp + Minimum allowable value + Maximum allowable value + A value inclusively between lower and upper + + + + Round a floating-point value to the nearest integer + + Floating point number to round + Integer + + + + Test if a single precision float is a finite number + + + + + Test if a double precision float is a finite number + + + + + Get the distance between two floating-point values + + First value + Second value + The distance between the two values + + + + Compute the MD5 hash for a byte array + + Byte array to compute the hash for + MD5 hash of the input data + + + + Compute the SHA1 hash for a byte array + + Byte array to compute the hash for + SHA1 hash of the input data + + + + Calculate the SHA1 hash of a given string + + The string to hash + The SHA1 hash as a string + + + + Compute the SHA256 hash for a byte array + + Byte array to compute the hash for + SHA256 hash of the input data + + + + Calculate the SHA256 hash of a given string + + The string to hash + The SHA256 hash as a string + + + + Calculate the MD5 hash of a given string + + The password to hash + An MD5 hash in string format, with $1$ prepended + + + + Calculate the MD5 hash of a given string + + The string to hash + The MD5 hash as a string + + + + Generate a random double precision floating point value + + Random value of type double + + + + Get the current running platform + + Enumeration of the current platform we are running on + + + + Get the current running runtime + + Enumeration of the current runtime we are running on + Convert the first two bytes starting in the byte array in @@ -1011,6 +1266,15 @@ Resulting integer True if the parse was successful, otherwise false + + + Returns text specified in EnumInfo attribute of the enumerator + To add the text use [EnumInfo(Text = "Some nice text here")] before declaration + of enum values + + Enum value + Text representation of the enum + Takes an AssetType and returns the string representation @@ -1053,6 +1317,13 @@ A string representation of the SaleType to convert A SaleType object which matched the type + + + Converts a string used in LLSD to AttachmentPoint type + + String representation of AttachmentPoint to convert + AttachmentPoint enum + Copy a byte array @@ -1148,145 +1419,6 @@ Converted IP address object, or null if the conversion failed - - Provide a single instance of the CultureInfo class to - help parsing in situations where the grid assumes an en-us - culture - - - UNIX epoch in DateTime format - - - Provide a single instance of the MD5 class to avoid making - duplicate copies and handle thread safety - - - Provide a single instance of the SHA-1 class to avoid - making duplicate copies and handle thread safety - - - Provide a single instance of a random number generator - to avoid making duplicate copies and handle thread safety - - - - Clamp a given value between a range - - Value to clamp - Minimum allowable value - Maximum allowable value - A value inclusively between lower and upper - - - - Clamp a given value between a range - - Value to clamp - Minimum allowable value - Maximum allowable value - A value inclusively between lower and upper - - - - Clamp a given value between a range - - Value to clamp - Minimum allowable value - Maximum allowable value - A value inclusively between lower and upper - - - - Round a floating-point value to the nearest integer - - Floating point number to round - Integer - - - - Test if a single precision float is a finite number - - - - - Test if a double precision float is a finite number - - - - - Get the distance between two floating-point values - - First value - Second value - The distance between the two values - - - - Compute the MD5 hash for a byte array - - Byte array to compute the hash for - MD5 hash of the input data - - - - Compute the SHA1 hash for a byte array - - Byte array to compute the hash for - SHA1 hash of the input data - - - - Calculate the SHA1 hash of a given string - - The string to hash - The SHA1 hash as a string - - - - Compute the SHA256 hash for a byte array - - Byte array to compute the hash for - SHA256 hash of the input data - - - - Calculate the SHA256 hash of a given string - - The string to hash - The SHA256 hash as a string - - - - Calculate the MD5 hash of a given string - - The password to hash - An MD5 hash in string format, with $1$ prepended - - - - Calculate the MD5 hash of a given string - - The string to hash - The MD5 hash as a string - - - - Generate a random double precision floating point value - - Random value of type double - - - - Get the current running platform - - Enumeration of the current platform we are running on - - - - Get the current running runtime - - Enumeration of the current runtime we are running on - Operating system @@ -1318,25 +1450,6 @@ Mono runtime: http://www.mono-project.com/ - - - Determines the appropriate events to set, leaves the locks, and sets the events. - - - - - A routine for lazily creating a event outside the lock (so if errors - happen they are outside the lock and that we don't do much work - while holding a spin lock). If all goes well, reenter the lock and - set 'waitEvent' - - - - - Waits on 'waitEvent' with a timeout of 'millisceondsTimeout. - Before the wait 'numWaiters' is incremented and is restored before leaving this routine. - - X value @@ -1470,383 +1583,1020 @@ A quaternion with a value of 0,0,0,1 - + - The different types of grid assets + Same as Queue except Dequeue function blocks until there is an object to return. + Note: This class does not need to be synchronized - - Unknown asset type - - - Texture asset, stores in JPEG2000 J2C stream format - - - Sound asset - - - Calling card for another avatar - - - Link to a location in world - - - Collection of textures and parameters that can be - worn by an avatar - - - Primitive that can contain textures, sounds, - scripts and more - - - Notecard asset - - - Holds a collection of inventory items - - - Root inventory folder - - - Linden scripting language script - - - LSO bytecode for a script - - - Uncompressed TGA texture - - - Collection of textures and shape parameters that can - be worn - - - Trash folder - - - Snapshot folder - - - Lost and found folder - - - Uncompressed sound - - - Uncompressed TGA non-square image, not to be used as a - texture - - - Compressed JPEG non-square image, not to be used as a - texture - - - Animation - - - Sequence of animations, sounds, chat, and pauses - - - Simstate file - - + - Inventory Item Types, eg Script, Notecard, Folder, etc + Create new BlockingQueue. + + The System.Collections.ICollection to copy elements from + + + + Create new BlockingQueue. + + The initial number of elements that the queue can contain + + + + Create new BlockingQueue. - - Unknown - - - Texture - - - Sound - - - Calling Card - - - Landmark - - - Notecard - - - - - - Folder - - - - - - an LSL Script - - - - - - - - - - - - - - - - - + - Item Sale Status + BlockingQueue Destructor (Close queue, resume any waiting thread). - - Not for sale - - - The original is for sale - - - Copies are for sale - - - The contents of the object are for sale - - + - Types of wearable assets + Remove all objects from the Queue. - - Body shape - - - Skin textures and attributes - - - Hair - - - Eyes - - - Shirt - - - Pants - - - Shoes - - - Socks - - - Jacket - - - Gloves - - - Undershirt - - - Underpants - - - Skirt - - - Invalid wearable asset - - + - Copy constructor - - Circular queue to copy - - - - A 128-bit Universally Unique Identifier, used throughout the Second - Life networking protocol + Remove all objects from the Queue, resume all dequeue threads. - - The System.Guid object this struct wraps around - - + - Constructor that takes a string UUID representation + Removes and returns the object at the beginning of the Queue. - A string representation of a UUID, case - insensitive and can either be hyphenated or non-hyphenated - UUID("11f8aa9c-b071-4242-836b-13b7abe0d489") + Object in queue. - + - Constructor that takes a System.Guid object + Removes and returns the object at the beginning of the Queue. - A Guid object that contains the unique identifier - to be represented by this UUID + time to wait before returning + Object in queue. - + - Constructor that takes a byte array containing a UUID + Removes and returns the object at the beginning of the Queue. - Byte array containing a 16 byte UUID - Beginning offset in the array + time to wait before returning (in milliseconds) + Object in queue. - + - Constructor that takes an unsigned 64-bit unsigned integer to - convert to a UUID + Adds an object to the end of the Queue - 64-bit unsigned integer to convert to a UUID + Object to put in queue - + - Copy constructor + Open Queue. - UUID to copy - + + + Gets flag indicating if queue has been closed. + + + + + Provides helper methods for parallelizing loops + + + + + Executes a for loop in which iterations may run in parallel + + The loop will be started at this index + The loop will be terminated before this index is reached + Method body to run for each iteration of the loop + + + + Executes a for loop in which iterations may run in parallel + + The number of concurrent execution threads to run + The loop will be started at this index + The loop will be terminated before this index is reached + Method body to run for each iteration of the loop + + + + Executes a foreach loop in which iterations may run in parallel + + Object type that the collection wraps + An enumerable collection to iterate over + Method body to run for each object in the collection + + + + Executes a foreach loop in which iterations may run in parallel + + Object type that the collection wraps + The number of concurrent execution threads to run + An enumerable collection to iterate over + Method body to run for each object in the collection + + + + Executes a series of tasks in parallel + + A series of method bodies to execute + + + + Executes a series of tasks in parallel + + The number of concurrent execution threads to run + A series of method bodies to execute + + + + Convert this matrix to euler rotations + + X euler angle + Y euler angle + Z euler angle + + + + Convert this matrix to a quaternion rotation + + A quaternion representation of this rotation matrix + + + + Construct a matrix from euler rotation values in radians + + X euler angle in radians + Y euler angle in radians + Z euler angle in radians + + + + Get a formatted string representation of the vector + + A string representation of the vector + + + A 4x4 matrix containing all zeroes + + + A 4x4 identity matrix + + + X value + + + Y value + + + Z value + + + W value + + + + Constructor, builds a vector from a byte array + + Byte array containing four four-byte floats + Beginning position in the byte array + + + + Test if this vector is equal to another vector, within a given + tolerance range + + Vector to test against + The acceptable magnitude of difference + between the two vectors + True if the magnitude of difference between the two vectors + is less than the given tolerance, otherwise false + + IComparable.CompareTo implementation - + - Assigns this UUID from 16 bytes out of a byte array + Test if this vector is composed of all finite numbers - Byte array containing the UUID to assign this UUID to - Starting position of the UUID in the byte array - + - Returns a copy of the raw bytes for this UUID + Builds a vector from a byte array - A 16 byte array containing this UUID + Byte array containing a 16 byte vector + Beginning position in the byte array - + - Writes the raw bytes for this UUID to a byte array + Returns the raw bytes for this vector + + A 16 byte array containing X, Y, Z, and W + + + + Writes the raw bytes for this vector to a byte array Destination byte array Position in the destination array to start writing. Must be at least 16 bytes before the end of the array - + - Calculate an LLCRC (cyclic redundancy check) for this UUID + Get a string representation of the vector elements with up to three + decimal digits and separated by spaces only - The CRC checksum for this UUID + Raw string representation of the vector - + + A vector with a value of 0,0,0,0 + + + A vector with a value of 1,1,1,1 + + + A vector with a value of 1,0,0,0 + + + A vector with a value of 0,1,0,0 + + + A vector with a value of 0,0,1,0 + + + A vector with a value of 0,0,0,1 + + + For thread safety + + + For thread safety + + - Create a 64-bit integer representation from the second half of this UUID + Purges expired objects from the cache. Called automatically by the purge timer. - An integer created from the last eight bytes of this UUID - + - Generate a UUID from a string + A three-dimensional vector with floating-point values - A string representation of a UUID, case - insensitive and can either be hyphenated or non-hyphenated - UUID.Parse("11f8aa9c-b071-4242-836b-13b7abe0d489") - + + X value + + + Y value + + + Z value + + - Generate a UUID from a string + Constructor, builds a vector from a byte array - A string representation of a UUID, case - insensitive and can either be hyphenated or non-hyphenated - Will contain the parsed UUID if successful, - otherwise null - True if the string was successfully parse, otherwise false - UUID.TryParse("11f8aa9c-b071-4242-836b-13b7abe0d489", result) + Byte array containing three four-byte floats + Beginning position in the byte array - + - Combine two UUIDs together by taking the MD5 hash of a byte array - containing both UUIDs + Test if this vector is equal to another vector, within a given + tolerance range - First UUID to combine - Second UUID to combine - The UUID product of the combination + Vector to test against + The acceptable magnitude of difference + between the two vectors + True if the magnitude of difference between the two vectors + is less than the given tolerance, otherwise false - + + + IComparable.CompareTo implementation + + + + + Test if this vector is composed of all finite numbers + + + + + Builds a vector from a byte array + + Byte array containing a 12 byte vector + Beginning position in the byte array + + + + Returns the raw bytes for this vector + + A 12 byte array containing X, Y, and Z + + + + Writes the raw bytes for this vector to a byte array + + Destination byte array + Position in the destination array to start + writing. Must be at least 12 bytes before the end of the array + + + + Parse a vector from a string + + A string representation of a 3D vector, enclosed + in arrow brackets and separated by commas + + + + Calculate the rotation between two vectors + + Normalized directional vector (such as 1,0,0 for forward facing) + Normalized target vector + + + + Interpolates between two vectors using a cubic equation + + + + + Get a formatted string representation of the vector + + A string representation of the vector + + + + Get a string representation of the vector elements with up to three + decimal digits and separated by spaces only + + Raw string representation of the vector + + + + Cross product between two vectors + + + + A vector with a value of 0,0,0 + + + A vector with a value of 1,1,1 + + + A unit vector facing forward (X axis), value 1,0,0 + + + A unit vector facing left (Y axis), value 0,1,0 + + + A unit vector facing up (Z axis), value 0,0,1 + + + + Identifier code for primitive types + + + + None + + + A Primitive + + + A Avatar + + + Linden grass + + + Linden tree + + + A primitive that acts as the source for a particle stream + + + A Linden tree + + + + Primary parameters for primitives such as Physics Enabled or Phantom + + + + Deprecated + + + Whether physics are enabled for this object + + + + + + + + + + + + + + + + + + + + + Whether this object contains an active touch script + + + + + + Whether this object can receive payments + + + Whether this object is phantom (no collisions) + + + + + + + + + + + + + + + Deprecated + + + + + + + + + + + + Deprecated + + + + + + + + + + + + + + + Server flag, will not be sent to clients. Specifies that + the object is destroyed when it touches a simulator edge + + + Server flag, will not be sent to clients. Specifies that + the object will be returned to the owner's inventory when it + touches a simulator edge + + + Server flag, will not be sent to clients. + + + Server flag, will not be sent to client. Specifies that + the object is hovering/flying + + + + + + + + + + + + + + + + Sound flags for sounds attached to primitives + + + + + + + + + + + + + + + + + + + + + + + + + + Material type for a primitive + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Used in a helper function to roughly determine prim shape + + + + + Extra parameters for primitives, these flags are for features that have + been added after the original ObjectFlags that has all eight bits + reserved already + + + + Whether this object has flexible parameters + + + Whether this object has light parameters + + + Whether this object is a sculpted prim + + - - + + + + + + + + + + - Return a hash code for this UUID, used by .NET for hash tables + - An integer composed of all the UUID bytes XORed together - + + + + + + + + + + + + + + + + + + + + + + + + + - Comparison function + - An object to compare to this UUID - True if the object is a UUID and both UUIDs are equal - + + + + + + + + + + + + + + + + + + + + + + + + + + + + - Comparison function + - UUID to compare to - True if the UUIDs are equal, otherwise false - + + + + + + + + + + + + + + + + + + + + + + + + Attachment points for objects on avatar bodies + + + Both InventoryObject and InventoryAttachment types can be attached + + + + Right hand if object was not previously attached + + + Chest + + + Skull + + + Left shoulder + + + Right shoulder + + + Left hand + + + Right hand + + + Left foot + + + Right foot + + + Spine + + + Pelvis + + + Mouth + + + Chin + + + Left ear + + + Right ear + + + Left eyeball + + + Right eyeball + + + Nose + + + Right upper arm + + + Right forearm + + + Left upper arm + + + Left forearm + + + Right hip + + + Right upper leg + + + Right lower leg + + + Left hip + + + Left upper leg + + + Left lower leg + + + Stomach + + + Left pectoral + + + Right pectoral + + + HUD Center position 2 + + + HUD Top-right + + + HUD Top + + + HUD Top-left + + + HUD Center + + + HUD Bottom-left + + + HUD Bottom + + + HUD Bottom-right + + - Get a hyphenated string representation of this UUID + Tree foliage types - A string representation of this UUID, lowercase and - with hyphens - 11f8aa9c-b071-4242-836b-13b7abe0d489 - + + Pine1 tree + + + Oak tree + + + Tropical Bush1 + + + Palm1 tree + + + Dogwood tree + + + Tropical Bush2 + + + Palm2 tree + + + Cypress1 tree + + + Cypress2 tree + + + Pine2 tree + + + Plumeria + + + Winter pinetree1 + + + Winter Aspen tree + + + Winter pinetree2 + + + Eucalyptus tree + + + Fern + + + Eelgrass + + + Sea Sword + + + Kelp1 plant + + + Beach grass + + + Kelp2 plant + + - Equals operator + Grass foliage types - First UUID for comparison - Second UUID for comparison - True if the UUIDs are byte for byte equal, otherwise false - + + + + + + + + + + + + + + + + + + + - Not equals operator + Action associated with clicking on an object - First UUID for comparison - Second UUID for comparison - True if the UUIDs are not equal, otherwise true - + + Touch object + + + Sit on object + + + Purchase object or contents + + + Pay the object + + + Open task inventory + + + Play parcel media + + + Open parcel media + + - XOR operator + A two-dimensional vector with floating-point values - First UUID - Second UUID - A UUID that is a XOR combination of the two input UUIDs - + + X value + + + Y value + + - String typecasting operator + Test if this vector is equal to another vector, within a given + tolerance range - A UUID in string form. Case insensitive, - hyphenated or non-hyphenated - A UUID built from the string representation + Vector to test against + The acceptable magnitude of difference + between the two vectors + True if the magnitude of difference between the two vectors + is less than the given tolerance, otherwise false - - An UUID with a value of all zeroes + + + Test if this vector is composed of all finite numbers + + + + + IComparable.CompareTo implementation + + + + + Builds a vector from a byte array + + Byte array containing two four-byte floats + Beginning position in the byte array + + + + Returns the raw bytes for this vector + + An eight-byte array containing X and Y + + + + Writes the raw bytes for this vector to a byte array + + Destination byte array + Position in the destination array to start + writing. Must be at least 8 bytes before the end of the array + + + + Parse a vector from a string + + A string representation of a 2D vector, enclosed + in arrow brackets and separated by commas + + + + Interpolates between two vectors using a cubic equation + + + + + Get a formatted string representation of the vector + + A string representation of the vector + + + + Get a string representation of the vector elements with up to three + decimal digits and separated by spaces only + + Raw string representation of the vector + + + A vector with a value of 0,0 + + + A vector with a value of 1,1 + + + A vector with a value of 1,0 + + + A vector with a value of 0,1 diff --git a/bin/OpenMetaverseTypes.dll b/bin/OpenMetaverseTypes.dll index 6c6440ea5b..cab014d534 100644 Binary files a/bin/OpenMetaverseTypes.dll and b/bin/OpenMetaverseTypes.dll differ diff --git a/bin/OpenSim.ini.example b/bin/OpenSim.ini.example index 5dcc601481..988831fd4a 100644 --- a/bin/OpenSim.ini.example +++ b/bin/OpenSim.ini.example @@ -1,1302 +1,681 @@ +;; A note on the format of this file +;; +;; All leading white space is ignored, but preserved. +;; +;; Double semicolons denote a text comment +;; +;; ;# denotes a configuration directive description +;; formatted as: +;; {option} {depends on} {question to ask} {choices} default value +;; Any text comments following the declaration, up to the next blank line. +;; will be copied to the generated file. +;; A * in the choices list will allow an empty entry.\ +;; An empty question will set the default if the dependencies are +;; satisfied. +;; +;; ; denotes a commented out option. Uncomment it to actvate it +;; and change it to the desired value +;; Any options added to OpenSim.ini.exmaple must be commented out, +;; and their value must represent the default. + [Startup] - ; Set this to true if you want to log crashes to disk - ; this can be useful when submitting bug reports. - save_crashes = false + ;# {save_crashes} {} {Save crashes to disk?} {true false} false + ;; Set this to true if you want to log crashes to disk + ;; this can be useful when submitting bug reports. + ; save_crashes = false - ; Directory to save crashes to if above is enabled - ; (default is /opensimdir/crashes/*.txt or C:\opensim\crashes\*.txt) - crash_dir = "crashes" + ;# {crash_dir} {save_crashes:true} {Directory to save crashes to?} {} crashes + ;; Directory to save crashes to if above is enabled + ;; (default is /opensimdir/crashes/*.txt or C:\opensim\crashes\*.txt) + ; crash_dir = "crashes" - ; Place to create a PID file + ;# {PIDFile} {} {Path to PID file?} {} + ;; Place to create a PID file ; PIDFile = "/tmp/my.pid" - ; Http proxy support for llHTTPRequest and dynamic texture loading - ; Set HttpProxy to the URL for your proxy server if you would like - ; to proxy llHTTPRequests through a firewall - ; HttpProxy = "http://proxy.com" - ; Set HttpProxyExceptions to a list of regular expressions for - ; URLs that you don't want going through the proxy such as servers - ; inside your firewall, separate patterns with a ';' - ; HttpProxyExceptions = ".mydomain.com;localhost" - - startup_console_commands_file = "startup_commands.txt" - shutdown_console_commands_file = "shutdown_commands.txt" - - ; To run a script every few minutes, set the script filename here - ; timer_Script = "filename" - - ; ## - ; ## SYSTEM - ; ## - - ; Sets the method that OpenSim will use to fire asynchronous - ; events. Valid values are UnsafeQueueUserWorkItem, - ; QueueUserWorkItem, BeginInvoke, SmartThreadPool, and Thread. - ; SmartThreadPool is reported to work well on Mono/Linux, but - ; UnsafeQueueUserWorkItem has been benchmarked with better - ; performance on .NET/Windows - async_call_method = SmartThreadPool - - ; Max threads to allocate on the FireAndForget thread pool - ; when running with the SmartThreadPool option above - MaxPoolThreads = 15 - - ; ## - ; ## CLIENTS - ; ## - - ; Enables EventQueueGet Service. - EventQueue = true - - ; Set this to the DLL containing the client stack to use. - clientstack_plugin="OpenSim.Region.ClientStack.LindenUDP.dll" - - ; ## - ; ## REGIONS - ; ## - - ; Determine where OpenSimulator looks for the files which tell it which regions to server - ; Defaults to "filesystem" if this setting isn't present - region_info_source = "filesystem" + ;; Determine where OpenSimulator looks for the files which tell it + ;; which regions to server + ;; Defaults to "filesystem" if this setting isn't present + ; region_info_source = "filesystem" ; region_info_source = "web" - ; Determines where the region XML files are stored if you are loading these from the filesystem. - ; Defaults to bin/Regions in your OpenSimulator installation directory + ;; Determines where the region XML files are stored if you are loading + ;; these from the filesystem. + ;; Defaults to bin/Regions in your OpenSimulator installation directory ; regionload_regionsdir="C:\somewhere\xmlfiles\" - ; Determines the page from which regions xml is retrieved if you are loading these from the web - ; The XML here has the same format as it does on the filesystem (including the tag), - ; except that everything is also enclosed in a tag. + ;; Determines the page from which regions xml is retrieved if you are + ;; loading these from the web. + ;; The XML here has the same format as it does on the filesystem + ;; (including the tag), except that everything is also enclosed + ;; in a tag. ; regionload_webserver_url = "http://example.com/regions.xml"; - ; Draw objects on maptile. This step might take a long time if you've got a large number of - ; objects, so you can turn it off here if you'd like. - DrawPrimOnMapTile = true - ; Use terrain texture for maptiles if true, use shaded green if false - TextureOnMapTile = false + ;# {TextureOnMapTile} {} {Use terrain textures for map tiles?} {true false} false + ;; Use terrain texture for maptiles if true, use shaded green if false + ; TextureOnMapTile = false - ; Maximum total size, and maximum size where a prim can be physical - NonPhysicalPrimMax = 256 - PhysicalPrimMax = 10 ; (I think this was moved to the Regions.ini!) - ClampPrimSize = false + ;# {DrawPrimOnMapTile} {} {Draw prim shapes on map tiles?} {true false} false + ;; Draw objects on maptile. This step might take a long time if you've + ;; got a large number of objects, so you can turn it off here if you'd like. + ; DrawPrimOnMapTile = true - ; Allow scripts to cross region boundaries. These are recompiled on the new region. - AllowScriptCrossing = false + ;# {NonPhysicalPrimMax} {} {Maximum size of nonphysical prims?} {} 256 + ;; Maximum size for non-physical prims + ; NonPhysicalPrimMax = 256 - ; Allow compiled script binary code to cross region boundaries. - ; If you set this to "true", any region that can teleport to you can - ; inject ARBITRARY BINARY CODE into your system. Use at your own risk. - ; YOU HAVE BEEN WARNED!!! - TrustBinaries = false + ;# {PhysicalPrimMax} {} {Maximum size of physical prims?} {} 10 + ;; Maximum size where a prim can be physical + ; PhysicalPrimMax = 10 - ; Combine all contiguous regions into one large megaregion - ; Order your regions from South to North, West to East in your regions.ini and then set this to true - ; Warning! Don't use this with regions that have existing content!, This will likely break them - CombineContiguousRegions = false + ;; Prevent the creation, import and rez of prims that exceed the + ;; maximum size. + ; ClampPrimSize = false - ; If you have only one region in an instance, or to avoid the many bugs - ; that you can trigger in modules by restarting a region, set this to - ; true to make the entire instance exit instead of restarting the region. - ; This is meant to be used on systems where some external system like - ; Monit will restart any instance that exits, thereby making the shutdown - ; into a restart. - ;InworldRestartShutsDown = false + ;# {AllowScriptCrossing} {} {Allow scripts to cross into this region} {true false} false + ;; Allow scripts to cross region boundaries. These are recompiled on the + ;; new region. + ; AllowScriptCrossing = false - ; ## - ; ## PRIM STORAGE - ; ## + ;# {TrustBinaries} {AllowScriptCrossing:true} {Accept compiled binary script code? (DANGEROUS!)} {true false} false + ;; Allow compiled script binary code to cross region boundaries. + ;; If you set this to "true", any region that can teleport to you can + ;; inject ARBITRARY BINARY CODE into your system. Use at your own risk. + ;; YOU HAVE BEEN WARNED!!! + ; TrustBinaries = false - ; *** Prim Storage - only leave one storage_plugin uncommented *** - ; --- Null stores nothing - effectively disabling persistence: - ;storage_plugin = "OpenSim.Data.Null.dll" + ;# {CombineContiguousRegions} {} {Create megaregions where possible? (Do not use with existing content!)} {true false} false + ;; Combine all contiguous regions into one large megaregion + ;; Order your regions from South to North, West to East in your regions.ini + ;; and then set this to true + ;; Warning! Don't use this with regions that have existing content!, + ;; This will likely break them + ; CombineContiguousRegions = false - ; --- To use sqlite as region storage: - ; - ; PLEASE NOTE: Unfortunately, the current SQLite database plugin (necessary to use SQLite with Mono on Linux) is - ; not compatible with the sqlite3 library installed on Mac OSX. If you're using Mono 2.4 you can still use the old sqlite - ; library by uncommenting the SQLiteLegacy.dll storage plugin (and commenting out SQLite.dll). Unfortunately, the older library - ; will not work with Mono 2.6 on Mac OSX so you will either need to replace the OSX sqlite3 system library or use MySQL instead - ; - ; You will also need to do the same thing in config-include/StandaloneCommon.ini if you are running in standalone mode - storage_plugin = "OpenSim.Data.SQLite.dll" - ;storage_plugin = "OpenSim.Data.SQLiteLegacy.dll" - storage_connection_string="URI=file:OpenSim.db,version=3"; + ;; If you have only one region in an instance, or to avoid the many bugs + ;; that you can trigger in modules by restarting a region, set this to + ;; true to make the entire instance exit instead of restarting the region. + ;; This is meant to be used on systems where some external system like + ;; Monit will restart any instance that exits, thereby making the shutdown + ;; into a restart. + ; InworldRestartShutsDown = false - ; --- To use MySQL storage, supply your own connection string (this is only an example): - ; note that the supplied account needs create privilegies if you want it to auto-create needed tables. - ; - ; -->>> There are multiple connection strings defined in several places. Check it carefully! - ; - ; storage_plugin="OpenSim.Data.MySQL.dll" - ; storage_connection_string="Data Source=localhost;Database=opensim;User ID=opensim;Password=*****;Old Guids=true;"; - ; If you want to use a different database/server for estate data, then - ; uncomment and change this connect string. Defaults to the above if not set - ; estate_connection_string="Data Source=localhost;Database=opensim;User ID=opensim;Password=*****;"; + ;; Persistence of changed objects happens during regular sweeps. The + ;; following control that behaviour to prevent frequently changing objects + ;; from heavily loading the region data store. + ;; If both of these values are set to zero then persistence of all changed + ;; objects will happen on every sweep. - ; Persistence of changed objects happens during regular sweeps. The following control that behaviour to - ; prevent frequently changing objects from heavily loading the region data store. - ; If both of these values are set to zero then persistence of all changed objects will happen on every sweep. - ; - ; Objects will be considered for persistance in the next sweep when they have not changed for this number of seconds - MinimumTimeBeforePersistenceConsidered = 60 - ; Objects will always be considered for persistance in the next sweep if the first change occurred this number of seconds ago - MaximumTimeBeforePersistenceConsidered = 600 + ;; Objects will be considered for persistance in the next sweep when they + ;; have not changed for this number of seconds. + ; MinimumTimeBeforePersistenceConsidered = 60 - ; Should avatars in neighbor sims see objects in this sim? - see_into_this_sim_from_neighbor = true + ;; Objects will always be considered for persistance in the next sweep + ;; if the first change occurred this number of seconds ago. + ; MaximumTimeBeforePersistenceConsidered = 600 - ; ## - ; ## PHYSICS - ; ## + ;; Should avatars in neighbor sims see objects in this sim? + ; see_into_this_sim_from_neighbor = true - ; if you would like to allow prims to be physical and move by physics with the physical checkbox in the client set this to true. - physical_prim = true + ;# {physical_prim} {} {Allow prims to be physical?} {true false} true + ;; if you would like to allow prims to be physical and move by physics + ;; with the physical checkbox in the client set this to true. + ; physical_prim = true - ; Select a mesher here. - ; - ; Meshmerizer properly handles complex prims by using triangle meshes. - ; Note that only the ODE physics engine currently deals with meshed prims in a satisfactory way - ; - ; ZeroMesher is faster but leaves the physics engine to model the mesh using the basic shapes that it supports - ; Usually this is only a box + ;; Select a mesher here. + ;; + ;; Meshmerizer properly handles complex prims by using triangle meshes. + ;; Note that only the ODE physics engine currently deals with meshed + ;; prims in a satisfactory way. - meshing = Meshmerizer - ;meshing = ZeroMesher + ;; ZeroMesher is faster but leaves the physics engine to model the mesh + ;; using the basic shapes that it supports. + ;; Usually this is only a box. + ; meshing = Meshmerizer + ; meshing = ZeroMesher - ; Choose one of the physics engines below - ; OpenDynamicsEngine is by some distance the most developed physics engine - ; basicphysics effectively does not model physics at all, making all objects phantom + ;; Choose one of the physics engines below + ;; OpenDynamicsEngine is by some distance the most developed physics engine + ;; basicphysics effectively does not model physics at all, making all + ;; objects phantom + ; physics = OpenDynamicsEngine + ; physics = basicphysics + ; physics = POS + ; physics = modified_BulletX - physics = OpenDynamicsEngine - ;physics = basicphysics - ;physics = POS - ;physics = modified_BulletX + ;# {permissionmodules} {} {Permission modules to use (may specify multiple modules, separated by space} {} DefaultPermissionsModule + ;; Permission modules to use, separated by space. + ; permissionmodules = "DefaultPermissionsModule" - ; ## - ; ## PERMISSIONS - ; ## + ;# {serverside_object_permissions} {permissionmodules:DefaultPermissionsModule} {Activate permission handling by the sim?} {true false} true + ;; These are the parameters for the default permissions module + ;; + ;; If set to false, then, in theory, the server never carries out + ;; permission checks (allowing anybody to copy + ;; any item, etc. This may not yet be implemented uniformally. + ;; If set to true, then all permissions checks are carried out + ;; Default is false + ; serverside_object_permissions = false - ;permissionmodules = "DefaultPermissionsModule" + ;; This allows users with a UserLevel of 200 or more to assume god + ;; powers in the regions in this simulator. + ; allow_grid_gods = false - ; If set to false, then, in theory, the server never carries out permission checks (allowing anybody to copy - ; any item, etc. This may not yet be implemented uniformally. - ; If set to true, then all permissions checks are carried out - ; Default is false - serverside_object_permissions = false + ;; This allows some control over permissions + ;; please note that this still doesn't duplicate SL, and is not intended to + ; region_owner_is_god = true + ; region_manager_is_god = false + ; parcel_owner_is_god = true - allow_grid_gods = false + ;; Default script engine to use. Currently, we only have XEngine + ; DefaultScriptEngine = "XEngine" - ; This allows somne control over permissions - ; please note that this still doesn't duplicate SL, and is not intended to - ;region_owner_is_god = true - ;region_manager_is_god = false - ;parcel_owner_is_god = true + ;; Map tile options. You can choose to generate no map tiles at all, + ;; generate normal maptiles, or nominate an uploaded texture to + ;; be the map tile + ; GenerateMaptiles = "true" - ; Control user types that are allowed to create new scripts - ; Only enforced if serviceside_object_permissions is true - ; - ; Current possible values are - ; all - anyone can create scripts (subject to normal permissions) - ; gods - only administrators can create scripts (as long as allow_grid_gods is true) - ; Default value is all - ; allowed_script_creators = all + ;; If desired, a running region can update the map tiles periodically + ;; to reflect building activity. This names no sense of you don't have + ;; prims on maptiles. Value is in seconds. + ; MaptileRefresh = 0 - ; Control user types that are allowed to edit (save) scripts - ; Only enforced if serviceside_object_permissions is true - ; - ; Current possible values are - ; all - anyone can edit scripts (subject to normal permissions) - ; gods - only administrators can edit scripts (as long as allow_grid_gods is true) - ; Default value is all - ; allowed_script_editors = all + ;; If not generating maptiles, use this static texture asset ID + ; MaptileStaticUUID = "00000000-0000-0000-0000-000000000000" - ; ## - ; ## SCRIPT ENGINE - ; ## - - DefaultScriptEngine = "XEngine" - - ; ## - ; ## WORLD MAP - ; ## - - ;WorldMapModule = "WorldMap" - ;MapImageModule = "MapImageModule" - - ; ## - ; ## EMAIL MODULE - ; ## - - ;emailmodule = DefaultEmailModule - - ; ## - ; ## ANIMATIONS - ; ## - - ; If enabled, enableFlySlow will change the primary fly state to - ; FLYSLOW, and the "always run" state will be the regular fly. - - enableflyslow = false - - ; PreJump is an additional animation state, but it probably - ; won't look right until the physics engine supports it - ; (i.e delays takeoff for a moment) - - ; This is commented so it will come on automatically once it's - ; supported. - - ; enableprejump = true - - ; Simulator Stats URI - ; Enable JSON simulator data by setting a URI name (case sensitive) - ; Stats_URI = "jsonSimStats" - - ; Make OpenSim start all regions woth logins disabled. They will need - ; to be enabled from the console if this is set - ; StartDisabled = false - - ; Image decoding. Use CSJ2K for layer boundary decoding if true, - ; OpenJPEG if false - ; UseCSJ2K = true + ;# {emailmodule} {} {Provide llEmail and llGetNextEmail functionality? (requires SMTP server)} {true false} false + ;; The email module requires some configuration. It needs an SMTP + ;; server to send mail through. + ; emailmodule = DefaultEmailModule [SMTP] - enabled=false + ;; The SMTP server enabled the email module to send email to external + ;; destinations. - ;enabled=true - ;internal_object_host=lsl.opensim.local - ;host_domain_header_from=127.0.0.1 - ;SMTP_SERVER_HOSTNAME=127.0.0.1 - ;SMTP_SERVER_PORT=25 - ;SMTP_SERVER_LOGIN=foo - ;SMTP_SERVER_PASSWORD=bar + ;# {enabled} {[Startup]emailmodule:DefaultEmailModule} {Enable SMTP service?} {true false} true + ;; Enable sending email via SMTP + ; enabled = false + + ;# {internal_object_host} {[Startup]emailmodule:DefaultEmailModule enabled:true} {Host name to treat as internal (object to object) email?} {} lsl.opensim.local + ; internal_object_host = lsl.opensim.local + + ;# {host_domain_header_from} {[Startup]emailmodule:DefaultEmailModule enabled:true} {From address to use in the sent email header?} {} 127.0.0.1 + ; host_domain_header_from = "127.0.0.1" + + ;# {SMTP_SERVER_HOSTNAME} {[Startup]emailmodule:DefaultEmailModule enabled:true} {SMTP server name?} {} 127.0.0.1 + ; SMTP_SERVER_HOSTNAME = "127.0.0.1" + + ;# {SMTP_SERVER_PORT} {[Startup]emailmodule:DefaultEmailModule enabled:true} {SMTP server name?} {SMTP server port?} {} 25 + ; SMTP_SERVER_PORT = 25 + + ;# {SMTP_SERVER_LOGIN} {[Startup]emailmodule:DefaultEmailModule enabled:true} {SMTP server user name?} {} + ; SMTP_SERVER_LOGIN = "" + + ;# {SMTP_SERVER_PASSWORD} {[Startup]emailmodule:DefaultEmailModule enabled:true} {SMTP server password} {} + ; SMTP_SERVER_PASSWORD = "" [Network] - ConsoleUser = "Test" - ConsolePass = "secret" - http_listener_port = 9000 - console_port = 0 + ;; Configure the remote console user here. This will not actually be used + ;; unless you use -console=rest at startup. + ; ConsoleUser = "Test" + ; ConsolePass = "secret" + ; console_port = 0 - ; ssl config: Experimental! The auto https config only really works definately on windows XP now - ; you need a Cert Request/Signed pair installed in the MY store with the CN specified below - ; you can use https on other platforms, but you'll need to configure the httpapi yourself for now - http_listener_ssl = false ; Also create a SSL server - http_listener_cn = "localhost" ; Use the cert with the common name - http_listener_sslport = 9001 ; Use this port for SSL connections - http_listener_ssl_cert = "" ; Currently unused, but will be used for OSHttpServer + ;# {http_listener_port} {} {TCP Port for this simulator to listen on? (This must be unique to the simulator!)} {} 9000 + ;; Simulator HTTP port. This is not the region port, but the port the + ;; entire simulator listens on. This port uses the TCP protocol, while + ;; the region ports use UDP. + ; http_listener_port = 9000 - ; Hostname to use in llRequestURL/llRequestSecureURL - ; if not defined - default machine name is being used - ; (on Windows this mean NETBIOS name - useably only inside local network) - ; ExternalHostNameForLSL=127.0.0.1 + ;# {ExternalHostNameForLSL} {} {Hostname to use for HTTP-IN URLs. This should be reachable from the internet.} {} + ;; Hostname to use in llRequestURL/llRequestSecureURL + ;; if not defined - default machine name is being used + ;; (on Windows this mean NETBIOS name - useably only inside local network) + ; ExternalHostNameForLSL = "127.0.0.1" - ; What is reported as the "X-Secondlife-Shard" - ; Defaults to the user server url if not set - ; The old default is "OpenSim", set here fro compatibility + ;# {shard} {} {Name to use for X-Secondlife-Shard header? (press enter if unsure)} {} OpenSim + ;; What is reported as the "X-Secondlife-Shard" + ;; Defaults to the user server url if not set + ;; The old default is "OpenSim", set here for compatibility + ;; The below is not commented for compatibility. shard = "OpenSim" - ; What is reported as the "User-Agent" when using llHTTPRequest - ; Defaults to not sent if not set here. See the notes section in the wiki at - ; http://wiki.secondlife.com/wiki/LlHTTPRequest for comments on adding - ; " (Mozilla Compatible)" to the text where there are problems with a web server - ;user_agent = "OpenSim LSL (Mozilla Compatible)" - + ;# {user_agent} {} {User agent to report to web servers?} {} OpenSim LSL (Mozilla Compatible) + ;; What is reported as the "User-Agent" when using llHTTPRequest + ;; Defaults to not sent if not set here. See the notes section in the wiki + ;; at http://wiki.secondlife.com/wiki/LlHTTPRequest for comments on adding + ;; " (Mozilla Compatible)" to the text where there are problems with a web server + ; user_agent = "OpenSim LSL (Mozilla Compatible)" [ClientStack.LindenUDP] - ; Set this to true to process incoming packets asynchronously. Networking is - ; already separated from packet handling with a queue, so this will only - ; affect whether networking internals such as packet decoding and - ; acknowledgement accounting are done synchronously or asynchronously - ; - ;async_packet_handling = false + ;; See OpensSimDefaults.ini for the throttle options. You can copy the + ;; relevant sections and override them here. + ;; DO NOT MODIFY OpenSimDefaults.ini, as your changes would be lost + ;; with the next update! - ; The client socket receive buffer size determines how many - ; incoming requests we can process; the default on .NET is 8192 - ; which is about 2 4k-sized UDP datagrams. On mono this is - ; whatever the underlying operating system has as default; for - ; example, ubuntu 8.04 or SLES11 have about 111k, which is about - ; 27 4k-sized UDP datagrams (on linux platforms you can [as root] - ; do "sysctl net.core.rmem_default" to find out what your system - ; uses a default socket receive buffer size. - ; - ; client_socket_rcvbuf_size allows you to specify the receive - ; buffer size LLUDPServer should use. NOTE: this will be limited - ; by the system's settings for the maximum client receive buffer - ; size (on linux systems you can set that with "sysctl -w - ; net.core.rmem_max=X") - ; - ;client_socket_rcvbuf_size = 8388608 - - ; Maximum outbound bytes per second for a single scene. This can be used to - ; throttle total outbound UDP traffic for a simulator. The default value is - ; 0, meaning no throttling at the scene level. The example given here is - ; 20 megabits - ; - ;scene_throttle_max_bps = 2621440 - - ; Maximum bits per second to send to any single client. This will override - ; the user's viewer preference settings. The default value is 0, meaning no - ; aggregate throttling on clients (only per-category throttling). The - ; example given here is 1.5 megabits - ; - ;client_throttle_max_bps = 196608 - - ; Per-client bytes per second rates for the various throttle categories. - ; These are default values that will be overriden by clients - ; - ;resend_default = 12500 - ;land_default = 1000 - ;wind_default = 1000 - ;cloud_default = 1000 - ;task_default = 1000 - ;texture_default = 1000 - ;asset_default = 1000 - ;state_default = 1000 - - ; Per-client maximum burst rates in bytes per second for the various - ; throttle categories. These are default values that will be overriden by - ; clients - ; - ;resend_limit = 18750 - ;land_limit = 29750 - ;wind_limit = 18750 - ;cloud_limit = 18750 - ;task_limit = 18750 - ;texture_limit = 55750 - ;asset_limit = 27500 - ;state_limit = 37000 - - ; Configures how ObjectUpdates are aggregated. These numbers - ; do not literally mean how many updates will be put in each - ; packet that goes over the wire, as packets are - ; automatically split on a 1400 byte boundary. These control - ; the balance between responsiveness of interest list updates - ; and total throughput. Higher numbers will ensure more full- - ; sized packets and faster sending of data, but more delay in - ; updating interest lists - ; - ;PrimTerseUpdatesPerPacket = 25 - ;AvatarTerseUpdatesPerPacket = 10 - ;PrimFullUpdatesPerPacket = 100 - - ; TextureSendLimit determines how many packets will be put on - ; the outgoing queue each cycle. Like the settings above, this - ; is a balance between responsiveness to priority updates and - ; total throughput. Higher numbers will give a better - ; throughput at the cost of reduced responsiveness to client - ; priority changes or transfer aborts - ; - ;TextureSendLimit = 20 + ;# {DisableFacelights} {} {Stop facelights from working?} {true false} false + ;; Quash and remove any light properties from attachments not on the + ;; hands. This allows flashlights and lanterns to function, but kills + ;; silly vanity "Facelights" dead. Sorry, head mounted miner's lamps + ;; will also be affected. + ;; This is especially important in artistic builds that depend on lights + ;; on the build for their appearance, since facelights will cause the + ;; building's lights to possibly not be rendered. + ; DisableFacelights = "false" [Chat] - ; Controls whether the chat module is enabled. Default is true. - enabled = true; + ;# {whisper_distance} {} {Distance at which a whisper is heard, in meters?} {} 10 + ;; Distance in meters that whispers should travel. Default is 10m + ; whisper_distance = 10 - ; Distance in meters that whispers should travel. Default is 10m - whisper_distance = 10 + ;# {say_distance} {} {Distance at which normal chat is heard, in meters? (SL uses 20 here)} {} 30 + ;; Distance in meters that ordinary chat should travel. Default is 30m + ; say_distance = 30 - ; Distance in meters that ordinary chat should travel. Default is 30m - say_distance = 30 - - ; Distance in meters that shouts should travel. Default is 100m - shout_distance = 100 + ;# {shout_distance} {Distance at which a shout is heard, in meters?} {} 100 + ;; Distance in meters that shouts should travel. Default is 100m + ; shout_distance = 100 [Messaging] - ; Control which region module is used for instant messaging. - ; Default is InstantMessageModule (this is the name of the core IM module as well as the setting) - InstantMessageModule = InstantMessageModule - ; MessageTransferModule = MessageTransferModule + ;# {OfflineMessageModule} {} {Module to use for offline message storage} {OfflineMessageModule *} + ;; Module to handle offline messaging. The core module requires an external + ;; web service to do this. See OpenSim wiki. ; OfflineMessageModule = OfflineMessageModule + + ;# {OfflineMessageURL} {OfflineMessageModule:OfflineMessageModule} {URL of offline messaging service} {} + ;; URL of web service for offline message storage ; OfflineMessageURL = http://yourserver/Offline.php + + ;# {MuteListModule} {OfflineMessageModule:OfflineMessageModule} {} {} MuteListModule + ;; Mute list handler (not yet implemented). MUST BE SET to allow offline + ;; messages to work ; MuteListModule = MuteListModule + + ;# {MuteListURL} {OfflineMessageModule:OfflineMessageModule} {} {} http://yourserver/Mute.php + ;; URL of the web service that serves mute lists. Not currently used, but + ;; must be set to allow offline messaging to work. ; MuteListURL = http://yourserver/Mute.php - ; Control whether group messages are forwarded to offline users. Default is true. + ;; Control whether group messages are forwarded to offline users. + ;; Default is true. + ;; This applies to the core groups module (Flotsam) only. ; ForwardOfflineGroupMessages = true [ODEPhysicsSettings] - ;## - ;## World Settings - ;## + ;# {mesh_sculpted_prim} {[Startup]physics:OpenDynamicsEngine} {Mesh sculpties so they collide as they look?} {true false} true + ;; Do we want to mesh sculpted prim to collide like they look? + ; mesh_sculpted_prim = true - ;Gravity. Feel like falling up? change world_gravityz to 9.8 instead of -9.8. m/s - world_gravityx = 0 - world_gravityy = 0 - world_gravityz = -9.8 - - ; World Step size. (warning these are dangerous. Changing these will probably cause your scene to explode dramatically) - ; reference: fps = (0.09375/ODE_STEPSIZE) * 1000; - world_stepsize = 0.020 - world_internal_steps_without_collisions = 10 - - ;World Space settings. Affects memory consumption vs Collider CPU time for avatar and physical prim - world_hashspace_size_low = -4 - world_hashSpace_size_high = 128 - - ;Dynamic space settings Affects memory consumption vs Collider CPU time for static prim - meters_in_small_space = 29.9 - small_hashspace_size_low = -4 - small_hashspace_size_high = 66 - - ; ## - ; ## Contact properties. (the stuff that happens when things come in contact with each other) - ; ## - - ; surface layer around geometries other geometries can sink into before generating a contact - world_contact_surface_layer = 0.001 - - ; Filtering collisions helps keep things stable physics wise, but sometimes - ; it can be overzealous. If you notice bouncing, chances are it's that. - filter_collisions = false - - ; Non Moving Terrain Contact (avatar isn't moving) - nm_terraincontact_friction = 255.0 - nm_terraincontact_bounce = 0.1 - nm_terraincontact_erp = 0.1025 - - ; Moving Terrain Contact (avatar is moving) - m_terraincontact_friction = 75.0 - m_terraincontact_bounce = 0.05 - m_terrainContact_erp = 0.05025 - - ; Moving Avatar to object Contact - m_avatarobjectcontact_friction = 75.0 - m_avatarobjectcontact_bounce = 0.1 - - ; Object to Object Contact and Non-Moving Avatar to object - objectcontact_friction = 250.0 - objectcontact_bounce = 0.2 - - ; ## - ; ## Avatar Control - ; ## - - ; PID Controller Settings. These affect the math that causes the avatar to reach the - ; desired velocity - ; See http://en.wikipedia.org/wiki/PID_controller - - av_pid_derivative_linux = 2200.0 - av_pid_proportional_linux = 900.0; - - av_pid_derivative_win = 2200.0 - av_pid_proportional_win = 900.0; - - ;girth of the avatar. Adds radius to the height also - av_capsule_radius = 0.37 - - ; Max force permissible to use to keep the avatar standing up straight - av_capsule_standup_tensor_win = 550000 - av_capsule_standup_tensor_linux = 550000 - - ; specifies if the capsule should be tilted (=true; old compatibility mode) - ; or straight up-and-down (=false; better and more consistent physics behavior) - av_capsule_tilted = false - - ; used to calculate mass of avatar. - ; float AVvolume = (float) (Math.PI*Math.Pow(CAPSULE_RADIUS, 2)*CAPSULE_LENGTH); - ; av_density * AVvolume; - av_density = 80 - - ; use this value to cut 52% of the height the sim gives us - av_height_fudge_factor = 0.52 - - ; Movement. Smaller is faster. - - ; speed of movement with Always Run off - av_movement_divisor_walk = 1.3 - - ; speed of movement with Always Run on - av_movement_divisor_run = 0.8 - - ; When the avatar flies, it will be moved up by this amount off the ground (in meters) - minimum_ground_flight_offset = 3.0 - - ; ## - ; ## Object options - ; ## - - ; used in the mass calculation. - geometry_default_density = 10.000006836 - - ; amount of ODE steps where object is non moving for ODE to automatically put it to sleep - body_frames_auto_disable = 20 - - ; used to control llMove2Target - body_pid_derivative = 35 - body_pid_gain = 25 - - ; maximum number of contact points to generate per collision - contacts_per_collision = 80 - - ; amount of time a geom/body will try to cross a region border before it gets disabled - geom_crossing_failures_before_outofbounds = 5 - - ; start throttling the object updates if object comes in contact with 3 or more other objects - geom_contactpoints_start_throttling = 3 - - ; send 1 update for every x updates below when throttled - geom_updates_before_throttled_update = 15 - - ; Used for llSetStatus. How rigid the object rotation is held on the axis specified - body_motor_joint_maxforce_tensor_linux = 5 - body_motor_joint_maxforce_tensor_win = 5 - - ; Maximum mass an object can be before it is clamped - maximum_mass_object = 10000.01 - - ; ## - ; ## Sculpted Prim settings - ; ## - - ; Do we want to mesh sculpted prim to collide like they look? - mesh_sculpted_prim = true - - ; number^2 non-physical level of detail of the sculpt texture. 32x32 - 1024 verticies - mesh_lod = 32 - - ; number^2 physical level of detail of the sculpt texture. 16x16 - 256 verticies - mesh_physical_lod = 16 - - ; ## - ; ## Physics logging settings - logfiles are saved to *.DIF files - ; ## - - ; default is false - ;physics_logging = true - ;; every n simulation iterations, the physics snapshot file is updated - ;physics_logging_interval = 50 - ;; append to existing physics logfile, or overwrite existing logfiles? - ;physics_logging_append_existing_logfile = true - - ; ## - ; ## Joint support - ; ## - - ; if you would like physics joints to be enabled through a special naming convention in the client, set this to true. - ; (see NINJA Physics documentation, http://opensimulator.org/wiki/NINJA_Physics) - ; default is false - ;use_NINJA_physics_joints = true - - ; ## - ; ## additional meshing options - ; ## - - ; physical collision mesh proxies are normally created for complex prim shapes, and collisions for simple boxes and - ; spheres are computed algorithmically. If you would rather have mesh proxies for simple prims, you can set this to - ; true. Note that this will increase memory usage and region startup time. Default is false. - ;force_simple_prim_meshing = true + ;# {use_NINJA_physics_joints} {[Startup]physics:OpenDynamicsEngine} {Use jointed (NINJA) physics?} {true false} false + ;; If you would like physics joints to be enabled through a special naming + ;; convention in the client, set this to true. + ;; (see NINJA Physics, http://opensimulator.org/wiki/NINJA_Physics) + ; use_NINJA_physics_joints = false [RemoteAdmin] - enabled = false + ;; This is the remote admin module, which uses XMLRPC requests to + ;; manage regions from a web interface. - ; Set this to a nonzero value to have remote admin use a different port - port = 0 + ;# {enabled} {} {Enable the remote admin interface?} {true false} false + ; enabled = false - ; This password is required to make any XMLRPC call (should be set as the "password" parameter) - access_password = unknown + ;# {port} {enabled:true} {Port to use for the remote admin interface? (0 = default)} {} 0 + ;; Set this to a nonzero value to have remote admin use a different port + ; port = 0 - ; set this variable to true if you want the create_region XmlRpc - ; call to unconditionally enable voice on all parcels for a newly - ; created region [default: false] - create_region_enable_voice = false + ;# {access_password} {enabled:true} {Password for the remote admin interface} {} + ;; This password is required to make any XMLRPC call (should be set as + ;; the "password" parameter) + ; access_password = "" - ; set this variable to false if you want the create_region XmlRpc - ; call to create all regions as private per default (can be - ; overridden in the XmlRpc call) [default: true] - create_region_public = false + ;# {create_region_enable_voice} {enabled:true} {Enable voice for newly created regions?} {true false} false + ;; set this variable to true if you want the create_region XmlRpc + ;; call to unconditionally enable voice on all parcels for a newly + ;; created region [default: false] + ; create_region_enable_voice = false - ; the create_region XmlRpc call uses region_file_template to generate - ; the file name of newly create regions (if they are created - ; persistent). the parameter available are: - ; {0} - X location - ; {1} - Y location - ; {2} - region UUID - ; {3} - region port - ; {4} - region name with " ", ":", "/" mapped to "_" - region_file_template = "{0}x{1}-{2}.xml" + ;# {create_region_public} {enabled:true} {Make newly created regions public?} {true false} false + ;; set this variable to false if you want the create_region XmlRpc + ;; call to create all regions as private per default (can be + ;; overridden in the XmlRpc call) [default: true] + ; create_region_public = false - ; we can limit the number of regions that XmlRpcCreateRegion will - ; allow by setting this to a positive, non-0 number: as long as the - ; number of regions is below region_limits, XmlRpcCreateRegion will - ; succeed. setting region_limit to 0 disables the check. - ; default is 0 - ;region_limit = 0 + ;# {enabled_methods} {enabled:true} {List of methods to allow, separated by |} {} all + ;; enable only those methods you deem to be appropriate using a | delimited + ;; whitelist. + ;; For example: + ;; enabled_methods = admin_broadcast|admin_save_oar|admin_save_xml + ;; if this parameter is not specified but enabled = true, all methods + ;; will be available + ; enabled_methods = all - ; enable only those methods you deem to be appropriate using a | delimited whitelist - ; for example, enabled_methods = admin_broadcast|admin_region_query|admin_save_oar|admin_save_xml - ; if this parameter is not specified but enabled = true, all methods will be available - enabled_methods = all + ;; specify the default appearance for an avatar created through the remote + ;; admin interface + ;; This will only take effect is the file specified by the + ;; default_appearance setting below exists + ; default_male = Default Male + ; default_female = Default Female - ; specify the default appearance for an avatar created through the remote admin interface - ; This will only take effect is the file specified by the default_appearance setting below exists - ;default_male = Default Male - ;default_female = Default Female - - ; update appearance copies inventory items and wearables of default avatars. if this value is false - ; (default), just worn assets are copied to the Clothes folder; if true, all Clothes and Bodyparts - ; subfolders are copied. the receiver will wear the same items the default avatar did wear. - ;copy_folders = false - - ; path to default appearance XML file that specifies the look of the default avatars - ;default_appearance = default_appearance.xml - -[RestPlugins] - ; Change this to true to enable REST Plugins. This must be true if you wish to use - ; REST Region or REST Asset and Inventory Plugins - enabled = false - god_key = SECRET - prefix = /admin - - -[RestRegionPlugin] - ; Change this to true to enable the REST Region Plugin - enabled = false - - -[RestHandler] - ; Change this to true to enable the REST Asset and Inventory Plugin - enabled = false - authenticate = true - secured = true - extended-escape = true - realm = OpenSim REST - dump-asset = false - path-fill = true - dump-line-size = 32 - flush-on-error = true - - -; Uncomment the following for IRC bridge -; experimental, so if it breaks... keep both parts... yada yada -; also, not good error detection when it fails -;[IRC] - ;enabled = true ; you need to set this otherwise it won't connect - ;server = name.of.irc.server.on.the.net - ;; user password - only use this if the server requires one - ;password = mypass - ;nick = OpenSimBotNameProbablyMakeThisShorter - ;channel = #the_irc_channel_you_want_to_connect_to - ;user = "USER OpenSimBot 8 * :I'm an OpenSim to IRC bot" - ;port = 6667 - ;; channel to listen for configuration commands - ;commands_enabled = false - ;command_channel = 2777 - ;report_clients = true - ;; relay private chat connections - ;; relay_private_channels = true: will relay IRC chat from/to private in-world channels - ;; relay_private_channel_out -- channel to send messages out to the IRC bridge - ;; relay_private_channel_in -- channel to receive message from the IRC bridge - ;; relay_chat = false: IRC bridge will not relay normal chat - ;; access_password -- simple security device - ;; - ;; so, to just relay chat from an IRC channel to in-world region and vice versa: - ;; - ;; relay_private_channels = false - ;; relay_chat = true - ;; - ;; to relay chat only to/from private in-world channels: - ;; - ;; relay_chat = false - ;; relay_private_channels = true - ;; relay_private_channel_in = 2226 - ;; relay_private_channel_out = 2225 - ;; - ;; in this example, all chat coming in from IRC will be send out via - ;; in-world channel 2226, and all chat from in-world channel 2225 will - ;; be relayed to the IRC channel. - ;; - ;relay_private_channels = false - ;relay_private_channel_in = 2226 - ;relay_private_channel_out = 2225 - ;relay_chat = true - ;access_password = foobar - - ;;fallback_region = name of "default" region - ;;MSGformat fields : 0=botnick, 1=user, 2=region, 3=message - ;; must start with "PRIVMSG {0} : " or irc server will get upset - ;;for : : - ;;msgformat = "PRIVMSG {0} :<{1} in {2}>: {3}" - ;;for : - : - ;msgformat = "PRIVMSG {0} : {3} - {1} of {2}" - ;;for : - from : - ;;msgformat = "PRIVMSG {0} : {3} - from {1}" - - ;; exclude_list allows you to stop the IRC connector from announcing the - ;;arrival and departure of certain users. For example: admins, bots. - - ;exclude_list=User 1,User 2,User 3 - - -;[CMS] - ;enabled = true - ;channel = 345 - - -; Uncomment the following to control the progression of daytime -; in the Sim. The defaults are what is shown below -;[Sun] - ; number of wall clock hours for an opensim day. 24.0 would mean realtime - ;day_length = 4 - ; Year length in days - ;year_length = 60 - ; Day to Night Ratio - ;day_night_offset = 0.45 - ; send a Sun update every update_interval # of frames. A lower number will - ; make for smoother sun transition at the cost of network - ;update_interval = 100 + ;; Update appearance copies inventory items and wearables of default + ;; avatars. if this value is false, just worn assets are copied to the + ;; Clothes folder; if true, all Clothes and Bodyparts subfolders are copied. + ;; The receiver will wear the same items the default avatar did wear. + ; copy_folders = false + ;; Path to default appearance XML file that specifies the look of the + ;; default avatars + ; default_appearance = default_appearance.xml [Wind] - ; Enables the wind module. Default is true - enabled = true + ;# {enabled} {} {Enable wind module?} {true false} true + ;; Enables the wind module. Default is true + ;enabled = true - ; How often should wind be updated, as a function of world frames. Approximately 50 frames a second + ;# {wind_update_rate} {enabled:true} {Wind update rate in frames?} {} 150 + ;; How often should wind be updated, as a function of world frames. + ;; Approximately 50 frames a second wind_update_rate = 150 - ; The Default Wind Plugin to load - wind_plugin = SimpleRandomWind + ;; The Default Wind Plugin to load + ; wind_plugin = SimpleRandomWind - ; These settings are specific to the ConfigurableWind plugin - ; To use ConfigurableWind as the default, simply change wind_plugin to ConfigurableWind and uncomment the following. - ; avg_strength = 5.0 + ;; These settings are specific to the ConfigurableWind plugin + ;; To use ConfigurableWind as the default, simply change wind_plugin + ;; to ConfigurableWind and uncomment the following. + ; avg_strength = 5.0 ; avg_direction = 0.0 - ; var_strength = 0.0 + ; var_strength = 0.0 ; var_direction = 0.0 - ; rate_change = 1.0 + ; rate_change = 1.0 - ; This setting is specific to the SimpleRandomWind plugin - ; Adjusts wind strength. 0.0 = no wind, 1.0 = normal wind. Default is 1.0 - strength = 1.0 - - -[Cloud] - ; Enable this to generate classic particle clouds above the sim. - ; default is disabled - turn it on here - enabled = false - - ; Density of cloud cover 0.0 to 1.0 Defult 0.5 - density = 0.5 - - ; update interval for the cloud cover data returned by llCloud(). - ; default is 1000 - cloud_update_rate = 1000 + ;# {strength} {enabled:true wind_plugin:SimpleRandomWind} {Wind strength?} {} 1.0 + ;; This setting is specific to the SimpleRandomWind plugin + ;; Adjusts wind strength. 0.0 = no wind, 1.0 = normal wind. Default is 1.0 + ; strength = 1.0 [LightShare] - - ; This enables the transmission of Windlight scenes to supporting clients, such as the Meta7 viewer. - ; It has no ill effect on viewers which do not support server-side windlight settings. - ; Currently we only have support for MySQL databases. - enable_windlight = false; - -[Trees] - ; Enable this to allow the tree module to manage your sim trees, including growing, reproducing and dying - ; default is false - active_trees = false - - ; Density of tree population - tree_density = 1000.0 - - -[VectorRender] - - ; the font to use for rendering text (default: Arial) - ; font_name = "Arial" - - -[LL-Functions] - ; Set the following to true to allow administrator owned scripts to execute console commands - ; currently unused - ; AllowosConsoleCommand=false - - AllowGodFunctions = false - - ; Maximum number of llListen events we allow per script - ; Set this to 0 to have no limit imposed. - max_listens_per_script = 64 - + ;# {enable_windlight} {} {Enable LightShare technology?} {true false} false + ;; This enables the transmission of Windlight scenes to supporting clients, + ;; such as the Meta7 viewer. + ;; It has no ill effect on viewers which do not support server-side + ;; windlight settings. + ;; Currently we only have support for MySQL databases. + ; enable_windlight = false; [DataSnapshot] - ; The following set of configs pertains to search. - ; Set index_sims to true to enable search engines to index your searchable data - ; If false, no data will be exposed, DataSnapshot module will be off, and you can ignore the rest of these search-related configs - ; default is false - index_sims = false + ;# {index_sims} {} {Enable data snapshotting (search)?} {true false} false + ;; The following set of configs pertains to search. + ;; Set index_sims to true to enable search engines to index your + ;; searchable data. + ;; If false, no data will be exposed, DataSnapshot module will be off, + ;; and you can ignore the rest of these search-related configs. + ; index_sims = false - ; The variable data_exposure controls what the regions expose: - ; minimum: exposes only things explicitly marked for search - ; all: exposes everything - data_exposure = minimum - ; If search is on, change this to your grid name; will be ignored for standalones - gridname = "OSGrid" + ;# {data_exposure} {index_sims:true} {How much data should be exposed?} {minimum all} minimum + ;; The variable data_exposure controls what the regions expose: + ;; minimum: exposes only things explicitly marked for search + ;; all: exposes everything + ; data_exposure = minimum - ; Period between data snapshots, in seconds. 20 minutes, for starters, so that you see the initial changes fast. - ; Later, you may want to increase this to 3600 (1 hour) or more - default_snapshot_period = 1200 + ;# {gridname} {index_sims:true} {Enter the name fo your grid} {} OSGrid + ;; If search is on, change this to your grid name; will be ignored for + ;; standalones + ; gridname = "OSGrid" - ; This will be created in bin, if it doesn't exist already. It will hold the data snapshots. - snapshot_cache_directory = "DataSnapshot" + ;# {default_snapshot_period} {index_sims:true} {Period between data snapshots?} {} 1200 + ;; Period between data snapshots, in seconds. 20 minutes, for starters, + ;; so that you see the initial changes fast. + ;; Later, you may want to increase this to 3600 (1 hour) or more + ; default_snapshot_period = 1200 - ; This semicolon-separated string serves to notify specific data services about the existence - ; of this sim. Uncomment if you want to index your data with this and/or other search providers. - ;data_services="http://metaverseink.com/cgi-bin/register.py" + ;; This will be created in bin, if it doesn't exist already. It will hold + ;; the data snapshots. + ; snapshot_cache_directory = "DataSnapshot" + + ;# {data_services} {index_sims:true} {Data service URLs to register with?} {} http://metaverseink.com/cgi-bin/register.py + ; This semicolon-separated string serves to notify specific data services + ; about the existence of this sim. Uncomment if you want to index your + ; data with this and/or other search providers. + ; data_services="http://metaverseink.com/cgi-bin/register.py" [Economy] - ; These economy values get used in the BetaGridLikeMoneyModule. - This module is for demonstration only - + ;; The economy module is not enabled by default and there is no easy, + ;; menu controlled way to do this. To enabled this module, insert + ;; economymodule = BetaGridLikeMoneyModule + ;; into the startup section (at the top of this file). + ;; Then configure the options below as needed. - ; Enables selling things for $0 - SellEnabled = "false" + ;; Enables selling things for $0 + ; SellEnabled = "false" - ; 45000 is the highest value that the sim could possibly report because of protocol constraints - ObjectCapacity = 45000 - - ; Money Unit fee to upload textures, animations etc - PriceUpload = 0 - - ; Money Unit fee to create groups - PriceGroupCreate = 0 - - ; We don't really know what the rest of these values do. These get sent to the client - ; These taken from Agni at a Public Telehub. Change at your own risk. - ObjectCount = 0 - PriceEnergyUnit = 100 - PriceObjectClaim = 10 - PricePublicObjectDecay = 4 - PricePublicObjectDelete = 4 - PriceParcelClaim = 1 - PriceParcelClaimFactor = 1 - - PriceRentLight = 5 - TeleportMinPrice = 2 - TeleportPriceExponent = 2 - EnergyEfficiency = 1 - PriceObjectRent = 1 - PriceObjectScaleFactor = 10 - PriceParcelRent = 1 - - -[SVN] - Enabled = false - Directory = SVNmodule\repo - URL = "svn://your.repo.here/" - Username = "user" - Password = "password" - ImportOnStartup = false - Autosave = false - AutoSavePeriod = 15 ; Number of minutes between autosave backups + ;; Money Unit fee to upload textures, animations etc + ; PriceUpload = 0 + ;; Money Unit fee to create groups + ; PriceGroupCreate = 0 [XEngine] - ; Enable this engine in this OpenSim instance - Enabled = true + ;# {Enabled} {} {Enable the XEngine scripting engine?} {true false} true + ;; Enable this engine in this OpenSim instance + ; Enabled = true - ; How many threads to keep alive even if nothing is happening - MinThreads = 2 + ;; How many threads to keep alive even if nothing is happening + ; MinThreads = 2 - ; How many threads to start at maximum load - MaxThreads = 100 + ;; How many threads to start at maximum load + ; MaxThreads = 100 - ; Time a thread must be idle (in seconds) before it dies - IdleTimeout = 60 + ;; Time a thread must be idle (in seconds) before it dies + ; IdleTimeout = 60 - ; Thread priority ("Lowest", "BelowNormal", "Normal", "AboveNormal", "Highest") - Priority = "BelowNormal" + ;# {Priority} {Enabled:true} {Priority for script engine threads?} {Lowest BelowNormal Normal AboveNormal Highest} BelowNormal + ;; Thread priority ("Lowest", "BelowNormal", "Normal", "AboveNormal", + ;; "Highest") + ; Priority = "BelowNormal" - ; Maximum number of events to queue for a script (excluding timers) - MaxScriptEventQueue = 300 + ;; Maximum number of events to queue for a script (excluding timers) + ; MaxScriptEventQueue = 300 - ; Stack size per thread created - ThreadStackSize = 262144 + ;; Stack size per thread created + ; ThreadStackSize = 262144 - ; Set this to true (the default) to load each script into a separate - ; AppDomain. Setting this to false will load all script assemblies into the - ; current AppDomain, which will reduce the per-script overhead at the - ; expense of reduced security and the inability to garbage collect the - ; script assemblies - AppDomainLoading = true + ;; Set this to true (the default) to load each script into a separate + ;; AppDomain. Setting this to false will load all script assemblies into the + ;; current AppDomain, which will reduce the per-script overhead at the + ;; expense of reduced security and the inability to garbage collect the + ;; script assemblies + ; AppDomainLoading = true - ; Rate to poll for asynchronous command replies (ms) - ; currently unused - ;AsyncLLCommandLoopms = 50 + ;# {DefaultCompileLanguage} {Enabled:true} {Default script language?} {lsl vb cs} lsl + ;; Default language for scripts + ; DefaultCompileLanguage = "lsl" - ; Save the source of all compiled scripts - WriteScriptSourceToDebugFile = false + ;# {AllowedCompilers} {Enabled:true} {Languages to allow (comma separated)?} {} lsl + ;; List of allowed languages (lsl,vb,cs) + ;; AllowedCompilers=lsl,cs,js,vb. + ;; *warning*, non lsl languages have access to static methods such as + ;; System.IO.File. Enable at your own risk. + ; AllowedCompilers = "lsl" - ; Default language for scripts - DefaultCompileLanguage = lsl + ;; Compile debug info (line numbers) into the script assemblies + ; CompileWithDebugInformation = true - ; List of allowed languages (lsl,vb,js,cs) - ; AllowedCompilers=lsl,cs,js,vb. - ; *warning*, non lsl languages have access to static methods such as System.IO.File. Enable at your own risk. - AllowedCompilers=lsl + ;; Allow the user of mod* functions. This allows a script to pass messages + ;; to a region module via the modSendCommand() function + ;; Default is false + ; AllowMODFunctions = false - ; Compile debug info (line numbers) into the script assemblies - CompileWithDebugInformation = true + ;# {AllowOSFunctions} {Enabled:true} {Allow OSFunctions? (DANGEROUS!)} {true false} false + ;; Allow the use of os* functions (some are dangerous) + ; AllowOSFunctions = false - ; Allow the user of mod* functions. This allows a script to pass messages - ; to a region module via the modSendCommand() function - ; Default is false - AllowMODFunctions = false - - ; Allow the use of os* functions (some are dangerous) - AllowOSFunctions = false - + ;# {AllowLightShareFunctions} {Enabled:true [LightShare]enable_windlight:true} {Allow LightShare functions?} {true false} true ; Allow the user of LightShare functions - AllowLightShareFunctions = false + ; AllowLightShareFunctions = false - ; Threat level to allow, one of None, VeryLow, Low, Moderate, High, VeryHigh, Severe + ;# {OSFunctionThreatLevel} {Enabled:true AllowOSFunctions:true} {OSFunction threat level? (DANGEROUS!)} {None VeryLow Low Moderate High VeryHigh Severe} VeryLow + ;; Threat level to allow, one of None, VeryLow, Low, Moderate, High, + ;; VeryHigh, Severe OSFunctionThreatLevel = VeryLow - ; Interval (s) between background save of script states - SaveInterval = 120 + ;; Time a script can spend in an event handler before it is interrupted + ; EventLimit = 30 - ; Interval (s) between maintenance runs (0 = disable) - MaintenanceInterval = 10 + ;; If a script overruns it's event limit, kill the script? + ; KillTimedOutScripts = false - ; Time a script can spend in an event handler before it is interrupted - EventLimit = 30 + ;; Sets the multiplier for the scripting delays + ; ScriptDelayFactor = 1.0 - ; If a script overruns it's event limit, kill the script? - KillTimedOutScripts = false + ;; The factor the 10 m distances llimits are multiplied by + ; ScriptDistanceLimitFactor = 1.0 - ; Sets the multiplier for the scripting delays - ScriptDelayFactor = 1.0 - - ; The factor the 10 m distances llimits are multiplied by - ScriptDistanceLimitFactor = 1.0 - - ; Maximum length of notecard line read - ; Increasing this to large values potentially opens - ; up the system to malicious scripters + ;; Maximum length of notecard line read + ;; Increasing this to large values potentially opens + ;; up the system to malicious scripters ; NotecardLineReadCharsMax = 255 - ; Sensor settings - SensorMaxRange = 96.0 - SensorMaxResults = 16 + ;; Sensor settings + ; SensorMaxRange = 96.0 + ; SensorMaxResults = 16 - ; OS Functions enable/disable - ; For each function, you can add one line, as shown - ; The default for all functions allows them if below threat level - - ; true allows the use of the function unconditionally - ; Allow_osSetRegionWaterHeight = true - - ; false disables the function completely - ; Allow_osSetRegionWaterHeight = false - - ; Comma separated list of UUIDS allows the function for that list of UUIDS - ; Allow_osSetRegionWaterHeight = 888760cb-a3cf-43ac-8ea4-8732fd3ee2bb - - ; You can also use script creators as the uuid - ; Creators_osSetRegionWaterHeight = , ... - - ; If both Allow_ and Creators_ are given, effective permissions - ; are the union of the two. - - ; Allow for llCreateLink and llBreakLink to work without asking for permission - ; only enable this in a trusted environment otherwise you may be subject to hijacking - ; AutomaticLinkPermission = false - - ; Disable underground movement of prims (default true); set to - ; false to allow script controlled underground positioning of - ; prims + ;; Disable underground movement of prims (default true); set to + ;; false to allow script controlled underground positioning of + ;; prims ; DisableUndergroundMovement = true - -[OpenGridProtocol] - ;These are the settings for the Open Grid Protocol.. the Agent Domain, Region Domain, you know.. - ;On/true or Off/false - ogp_enabled=false - - ;Name Prefix/suffix when using OGP - ogp_firstname_prefix="" - ogp_lastname_suffix="_EXTERNAL" - - -[Concierge] - ; Enable concierge module - ; Default is false - enabled = false - - ; name of the concierge - whoami = "jeeves" - - ; password for updating the welcome message templates via XmlRpc - password = SECRET - - ; regex specifying for which regions concierge service is desired; if - ; empty, then for all - regions = "^MeetingSpace-" - - ; for each region that matches the regions regexp you can provide - ; (optionally) a welcome template using format substitution: - ; {0} is replaced with the name of the avatar entering the region - ; {1} is replaced with the name of the region - ; {2} is replaced with the name of the concierge (whoami variable above) - - welcomes = /path/to/welcome/template/directory - - ; Concierge can send attendee lists to an event broker whenever an - ; avatar enters or leaves a concierged region. the URL is subject - ; to format substitution: - ; {0} is replaced with the region's name - ; {1} is replaced with the region's UUID - broker = "http://broker.place.com/{1}" - - -[RegionReady] - ; Enable this module to get notified once all items and scripts in the region have been completely loaded and compiled - ; default is false - enabled = false - - ; Channel on which to signal region readiness through a message - ; formatted as follows: "{server_startup|oar_file_load},{0|1},n,[oar error]" - ; - the first field indicating whether this is an initial server startup - ; - the second field is a number indicating whether the OAR file loaded ok (1 == ok, 0 == error) - ; - the third field is a number indicating how many scripts failed to compile - ; - "oar error" if supplied, provides the error message from the OAR load - channel_notify = -800 - + ;; Path to script engine assemblies + ;; Default is ./bin/ScriptEngines + ; ScriptEnginesPath = "ScriptEngines" [MRM] - ; Enables the Mini Region Modules Script Engine. - ; default is false - Enabled = false + ;; Enables the Mini Region Modules Script Engine. + ;; default is false + ; Enabled = false - ; Runs MRM in a Security Sandbox - ; WARNING: DISABLING IS A SECURITY RISK. - Sandboxed = true + ;; Runs MRM in a Security Sandbox + ;; WARNING: DISABLING IS A SECURITY RISK. + ; Sandboxed = true - ; The level sandbox to use, adjust at your OWN RISK. - ; Valid values are: - ; * FullTrust - ; * SkipVerification - ; * Execution - ; * Nothing - ; * LocalIntranet - ; * Internet - ; * Everything - SandboxLevel = "Internet" + ;; The level sandbox to use, adjust at your OWN RISK. + ;; Valid values are: + ;; * FullTrust + ;; * SkipVerification + ;; * Execution + ;; * Nothing + ;; * LocalIntranet + ;; * Internet + ;; * Everything + ; SandboxLevel = "Internet" - ; Only allow Region Owners to run MRMs - ; May represent a security risk if you disable this. - OwnerOnly = true - -[Hypergrid] - ; Keep it false for now. Making it true requires the use of a special client in order to access inventory - safemode = false - -[VivoxVoice] - ; The VivoxVoice module will allow you to provide voice on your - ; region(s). It uses the same voice technology as the LL grid and - ; works with recent LL clients (we have tested 1.22.9.110075, so - ; anything later ought to be fine as well). - ; - ; For this to work you need to obtain an admin account from Vivox - ; that allows you to create voice accounts and region channels. - - enabled = false - - ; vivox voice server - vivox_server = www.foobar.vivox.com - - ; vivox SIP URI - vivox_sip_uri = foobar.vivox.com - - ; vivox admin user name - vivox_admin_user = DeepThroat - - ; vivox admin password - vivox_admin_password = VoiceG4te - - ; channel type: "channel" or "positional" - ; - positional: spatial sound (default) - ; - channel: normal "conference call", no spatial sound - ;vivox_channel_type = positional - - ; channel characteristics (unless you know what you are doing, i'd - ; leave them as they are --- now you WILL muck around with them, - ; huh? sigh) - - ; channel distance model: - ; 0 - no attenuation - ; 1 - inverse distance attenuation - ; 2 - linear attenuation (default) - ; 3 - exponential attenuation - ;vivox_channel_distance_model = 2 - - ; channel mode: - ; - "open" (default) - ; - "lecture" - ; - "presentation" - ; - "auditorium" - ;vivox_channel_mode = "open" - - ; channel roll off: rate of attenuation - ; - a value between 1.0 and 4.0, default is 2.0 - ;vivox_channel_roll_off = 2.0 - - ; channel max range: distance at which channel is silent - ; - a value between 0 and 160, default is 80 - ;vivox_channel_max_range = 80 - - ; channel clamping distance: distance before attenuation applies - ; - a value between 0 and 160, default is 10 - ;vivox_channel_clamping_distance = 10 + ;; Only allow Region Owners to run MRMs + ;; May represent a security risk if you disable this. + ; OwnerOnly = true [FreeSwitchVoice] - ; In order for this to work you need a functioning freeswitch pbx set - ; up. Configuration for that will be posted in the wiki soon. - enabled = false - ;FreeSwitch server is going to contact us and ask us all - ;sorts of things. - freeswitch_server_user = freeswitch - freeswitch_server_pass = password - freeswitch_api_prefix = /api - ; this is the IP of your sim - freeswitch_service_server = ip.address.of.your.sim - ;freeswitch_service_port = 80 - ; this should be the same port the region listens on - freeswitch_service_port = 9000 - freeswitch_realm = ip.address.of.freeswitch.server - freeswitch_sip_proxy = ip.address.of.freeswitch.server:5060 - freeswitch_attempt_stun = false - freeswitch_stun_server = ip.address.of.freeswitch.server - freeswitch_echo_server = ip.address.of.freeswitch.server - freeswitch_echo_port = 50505 - freeswitch_well_known_ip = ip.address.of.freeswitch.server + ;; In order for this to work you need a functioning FreeSWITCH PBX set up. + ;; Configuration details at http://opensimulator.org/wiki/Freeswitch_Module + ; Enabled = false - ;Type the address of your http server here, hostname is allowed. This is provided so you can specify a hostname - ;This is used by client for account verification. By default, it's the same as the freeswitch service server. + ;; You need to load a local service for a standalone, and a remote service + ;; for a grid region. Use one of the lines below, as appropriate + ; LocalServiceModule = OpenSim.Services.FreeswitchService.dll:FreeswitchService + ; LocalServiceModule = OpenSim.Services.Connectors.dll:RemoteFreeswitchConnector - ;opensim_well_known_http_address = Address_Of_your_SIM_HTTP_Server_Hostname_Allowed + ;; If using a remote module, specify the server URL + ; FreeswitchServiceURL = http://my.grid.server:8003/fsapi - freeswitch_default_timeout = 5000 - freeswitch_subscribe_retry = 120 - ; freeswitch_password_reset_url = +[FreeswitchService] + ;; !!!!!!!!!!!!!!!!!!!!!!!!!!! + ;; !!!!!!STANDALONE ONLY!!!!!! + ;; !!!!!!!!!!!!!!!!!!!!!!!!!!! + ;; IP of your FS server + ;ServerAddress = 85.25.142.92 + ;; All other options are - well - optional + ; Realm = "127.0.0.1" + ; SIPProxy = "127.0.0.1:5060" + ; EchoServer = "127.0.0.1" + ; EchoPort = 50505 + ; AttemptSTUN = "false" + ; DefaultTimeout = 5000 + ; Context = "default" + ; UserName = "freeswitch" + ; Password = "password" [Groups] - Enabled = false + ;# {Enabled} {} {Enable groups?} {true false} false + ;; Enables the groups module + ; Enabled = false - ; This is the current groups stub in Region.CoreModules.Avatar.Groups. All the other settings below only really - ; apply to the Flotsam/SimianGrid GroupsModule - Module = Default - - ; This module can use a PHP XmlRpc server from the Flotsam project at http://code.google.com/p/flotsam/ - ; or from the SimianGrid project at http://code.google.com/p/openmetaverse - ;Module = GroupsModule - - ; Enable Group Notices - ;NoticesEnabled = true - - ; This makes the Groups modules very chatty on the console. - DebugEnabled = false - - ; Specify which messaging module to use for groups messaging and if it's enabled - ;MessagingModule = GroupsMessagingModule - ;MessagingEnabled = true - - ; Service connectors to the Groups Service. Select one depending on whether you're using a Flotsam XmlRpc backend or a SimianGrid backend - - ; SimianGrid Service for Groups - ;ServicesConnectorModule = SimianGroupsServicesConnector - ;GroupsServerURI = http://mygridserver.com:82/Grid/ - - ; Flotsam XmlRpc Service for Groups - ;ServicesConnectorModule = XmlRpcGroupsServicesConnector - ;GroupsServerURI = http://yourxmlrpcserver.com/xmlrpc.php - - ; XmlRpc Security settings. These must match those set on your backend groups service. - ;XmlRpcServiceReadKey = 1234 - ;XmlRpcServiceWriteKey = 1234 - - ; Disables HTTP Keep-Alive for XmlRpcGroupsServicesConnector HTTP Requests, - ; this is a work around fora problem discovered on some Windows based region servers. - ; Only disable keep alive if you see a large number (dozens) of the following Exceptions: - ; System.Net.WebException: The request was aborted: The request was canceled. - ; XmlRpcDisableKeepAlive = false + ;# {Module} {Enabled:true} {Groups module to use? (Use GroupsModule to use Flotsam/Simian)} {} Default + ;; This is the current groups stub in Region.CoreModules.Avatar.Groups. + ;; All the other settings below only really apply to the Flotsam/SimianGrid + ;; GroupsModule. + ;; This module can use a PHP XmlRpc server from the Flotsam project at + ;; http://code.google.com/p/flotsam/ + ;; or from the SimianGrid project at http://code.google.com/p/openmetaverse + ; Module = Default -[PacketPool] - ; Enables the experimental packet pool. Yes, we've been here before. - ;RecyclePackets = true; - ;RecycleDataBlocks = true; + ;; Service connectors to the Groups Service. Select one depending on + ;; whether you're using a Flotsam XmlRpc backend or a SimianGrid backend + ;# {ServicesConnectorModule} {Module:GroupsModule} {Service connector to use for groups?} {XmlRpcGroupsServicesConnector SimianGroupsServicesConnector} XmlRpcGroupsServicesConnector + ;; The service connector to use for the GroupsModule + ; ServicesConnectorModule = SimianGroupsServicesConnector + + ;# {GroupsServerURI} {Module:GroupsModule} {Groups Server URI?} {} + ;; URI for the groups services + ; GroupsServerURI = "" + + ;# {NoticesEnabled} {Module:GroupsModule} {Enable group notices?} {true false} true + ;; Enable Group Notices + ; NoticesEnabled = true + + ;; This makes the Groups modules very chatty on the console. + ; DebugEnabled = false + + ;; Specify which messaging module to use for groups messaging and if it's + ;; enabled + ; MessagingModule = GroupsMessagingModule + ; MessagingEnabled = true + + ;; XmlRpc Security settings. These must match those set on your backend + ;; groups service. + ; XmlRpcServiceReadKey = 1234 + ; XmlRpcServiceWriteKey = 1234 [InterestManagement] - ; This section controls how state updates are prioritized for each client - ; Valid values are Time, Distance, SimpleAngularDistance, and FrontBack - UpdatePrioritizationScheme = FrontBack - ReprioritizationEnabled = true - ReprioritizationInterval = 2000.0 - RootReprioritizationDistance = 10.0 - ChildReprioritizationDistance = 20.0 + ;# {UpdatePrioritizationScheme} {} {Update prioritization scheme?} {BestAvatarResponsiveness Time Distance SimpleAngularDistance FrontBack} BestAvatarResponsiveness + ;; This section controls how state updates are prioritized for each client + ;; Valid values are BestAvatarResponsiveness, Time, Distance, + ;; SimpleAngularDistance, FrontBack + ; UpdatePrioritizationScheme = BestAvatarResponsiveness +[MediaOnAPrim] + ;# {Enabled} {} {Enable Media-on-a-Prim (MOAP)} {true false} true + ;; Enable media on a prim facilities + ; Enabled = true; -[WebStats] -; View region statistics via a web page -; See http://opensimulator.org/wiki/FAQ#Region_Statistics_on_a_Web_Page -; Use a web browser and type in the "Login URI" + "/SStats/" -; For example- http://127.0.0.1:9000/SStats/ -; enabled=false - - -;; -;; These are defaults that are overwritten below in [Architecture]. -;; These defaults allow OpenSim to work out of the box with -;; zero configuration -;; -[AssetService] - DefaultAssetLoader = "OpenSim.Framework.AssetLoader.Filesystem.dll" - AssetLoaderArgs = "assets/AssetSets.xml" - - ; Disable this to prevent the default asset set from being inserted into the - ; asset store each time the region starts - AssetLoaderEnabled = true - -[GridService] - ;; default standalone, overridable in StandaloneCommon.ini - StorageProvider = "OpenSim.Data.Null.dll:NullRegionData" - - ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; - ;; The following is the configuration section for the new style services - ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; [Architecture] - ; Choose exactly one and only one of the architectures below. - - Include-Standalone = "config-include/Standalone.ini" - ;Include-HGStandalone = "config-include/StandaloneHypergrid.ini" - ;Include-Grid = "config-include/Grid.ini" - ;Include-HGGrid = "config-include/GridHypergrid.ini" - ;Include-SimianGrid = "config-include/SimianGrid.ini" - - ; Then choose - ; config-include/StandaloneCommon.ini.example (if you're in standlone) OR - ; config-include/GridCommon.ini.example (if you're connected to a grid) - ; Copy to your own .ini there (without .example extension) and edit it - ; to customize your data - - - ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; - ;; The below pulls in optional module config files - ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -[Modules] - Include-modules = "addon-modules/*/config/*.ini" - -[XMLRPC] - ; ## - ; ## Scripting XMLRPC mapper - ; ## - - ; If enabled, this will post an event, "xmlrpc_uri(string)" to the - ; script concurrently with the first remote_data event. - ; This will contain the fully qualified URI an external site needs - ; to use to send XMLRPC requests to that script - - ;XmlRpcRouterModule = "XmlRpcRouterModule" - ;XmlRpcPort = 20800 + ;# {Include-Architecture} {} {Choose one of the following architectures} {config-include/Standalone.ini config-include/StandaloneHypergrid.ini config-include/Grid.ini config-include/GridHypergrid.ini config-include/SimianGrid.ini config-include/HyperSimianGrid.ini} config-include/Standalone.ini + ;; Choose one of these architecture includes: + ;; Include-Architecture = "config-include/Standalone.ini" + ;; Include-Architecture = "config-include/StandaloneHypergrid.ini" + ;; Include-Architecture = "config-include/Grid.ini" + ;; Include-Architecture = "config-include/GridHypergrid.ini" + ;; Include-Architecture = "config-include/SimianGrid.ini" + ;; Include-Architecture = "config-include/HyperSimianGrid.ini" + ; Include-Architecture = "config-include/Standalone.ini" + ;; Then choose + ;; config-include/StandaloneCommon.ini.example (if you're in standlone) OR + ;; config-include/GridCommon.ini.example (if you're connected to a grid) + ;; Copy to your own .ini there (without .example extension) and edit it + ;; to customize your data diff --git a/bin/OpenSimDefaults.ini b/bin/OpenSimDefaults.ini new file mode 100644 index 0000000000..f98689b613 --- /dev/null +++ b/bin/OpenSimDefaults.ini @@ -0,0 +1,1306 @@ +[Startup] + ; Set this to true if you want to log crashes to disk + ; this can be useful when submitting bug reports. + save_crashes = false + + ; Directory to save crashes to if above is enabled + ; (default is /opensimdir/crashes/*.txt or C:\opensim\crashes\*.txt) + crash_dir = "crashes" + + ; Place to create a PID file + ; PIDFile = "/tmp/my.pid" + + ; Http proxy support for llHTTPRequest and dynamic texture loading + ; Set HttpProxy to the URL for your proxy server if you would like + ; to proxy llHTTPRequests through a firewall + ; HttpProxy = "http://proxy.com" + ; Set HttpProxyExceptions to a list of regular expressions for + ; URLs that you don't want going through the proxy such as servers + ; inside your firewall, separate patterns with a ';' + ; HttpProxyExceptions = ".mydomain.com;localhost" + + startup_console_commands_file = "startup_commands.txt" + shutdown_console_commands_file = "shutdown_commands.txt" + + ; To run a script every few minutes, set the script filename here + ; timer_Script = "filename" + + ; ## + ; ## SYSTEM + ; ## + + ; Sets the method that OpenSim will use to fire asynchronous + ; events. Valid values are UnsafeQueueUserWorkItem, + ; QueueUserWorkItem, BeginInvoke, SmartThreadPool, and Thread. + ; SmartThreadPool is reported to work well on Mono/Linux, but + ; UnsafeQueueUserWorkItem has been benchmarked with better + ; performance on .NET/Windows + async_call_method = SmartThreadPool + + ; Max threads to allocate on the FireAndForget thread pool + ; when running with the SmartThreadPool option above + MaxPoolThreads = 15 + + ; ## + ; ## CLIENTS + ; ## + + ; Enables EventQueueGet Service. + EventQueue = true + + ; Set this to the DLL containing the client stack to use. + clientstack_plugin="OpenSim.Region.ClientStack.LindenUDP.dll" + + ; ## + ; ## REGIONS + ; ## + + ; Determine where OpenSimulator looks for the files which tell it which regions to server + ; Defaults to "filesystem" if this setting isn't present + region_info_source = "filesystem" + ; region_info_source = "web" + + ; Determines where the region XML files are stored if you are loading these from the filesystem. + ; Defaults to bin/Regions in your OpenSimulator installation directory + ; regionload_regionsdir="C:\somewhere\xmlfiles\" + + ; Determines the page from which regions xml is retrieved if you are loading these from the web + ; The XML here has the same format as it does on the filesystem (including the tag), + ; except that everything is also enclosed in a tag. + ; regionload_webserver_url = "http://example.com/regions.xml"; + + ; Draw objects on maptile. This step might take a long time if you've got a large number of + ; objects, so you can turn it off here if you'd like. + DrawPrimOnMapTile = true + ; Use terrain texture for maptiles if true, use shaded green if false + TextureOnMapTile = false + + ; Maximum total size, and maximum size where a prim can be physical + NonPhysicalPrimMax = 256 + PhysicalPrimMax = 10 ; (I think this was moved to the Regions.ini!) + ClampPrimSize = false + + ; Allow scripts to cross region boundaries. These are recompiled on the new region. + AllowScriptCrossing = false + + ; Allow compiled script binary code to cross region boundaries. + ; If you set this to "true", any region that can teleport to you can + ; inject ARBITRARY BINARY CODE into your system. Use at your own risk. + ; YOU HAVE BEEN WARNED!!! + TrustBinaries = false + + ; Combine all contiguous regions into one large megaregion + ; Order your regions from South to North, West to East in your regions.ini and then set this to true + ; Warning! Don't use this with regions that have existing content!, This will likely break them + CombineContiguousRegions = false + + ; If you have only one region in an instance, or to avoid the many bugs + ; that you can trigger in modules by restarting a region, set this to + ; true to make the entire instance exit instead of restarting the region. + ; This is meant to be used on systems where some external system like + ; Monit will restart any instance that exits, thereby making the shutdown + ; into a restart. + ;InworldRestartShutsDown = false + + ; ## + ; ## PRIM STORAGE + ; ## + + ; Persistence of changed objects happens during regular sweeps. The following control that behaviour to + ; prevent frequently changing objects from heavily loading the region data store. + ; If both of these values are set to zero then persistence of all changed objects will happen on every sweep. + ; + ; Objects will be considered for persistance in the next sweep when they have not changed for this number of seconds + MinimumTimeBeforePersistenceConsidered = 60 + ; Objects will always be considered for persistance in the next sweep if the first change occurred this number of seconds ago + MaximumTimeBeforePersistenceConsidered = 600 + + ; Should avatars in neighbor sims see objects in this sim? + see_into_this_sim_from_neighbor = true + + ; ## + ; ## PHYSICS + ; ## + + ; if you would like to allow prims to be physical and move by physics with the physical checkbox in the client set this to true. + physical_prim = true + + ; Select a mesher here. + ; + ; Meshmerizer properly handles complex prims by using triangle meshes. + ; Note that only the ODE physics engine currently deals with meshed prims in a satisfactory way + ; + ; ZeroMesher is faster but leaves the physics engine to model the mesh using the basic shapes that it supports + ; Usually this is only a box + + meshing = Meshmerizer + ;meshing = ZeroMesher + + ; Path to decoded sculpty maps + ; Defaults to "j2kDecodeCache + ;DecodedSculptMapPath = "j2kDecodeCache" + + ; if you use Meshmerizer and want sculpt map collisions, setting this to + ; to true will store decoded sculpt maps in a special folder in your bin + ; folder, which can reduce startup times by reducing asset requests. Some + ; versions of mono dont work well when reading the cache files, so set this + ; to false if you have compatibility problems. + ;CacheSculptMaps = true + + ; if you use Meshmerizer and want collisions for meshies, setting this to true + ; will cause OpenSim to attempt to decode meshies assets, extract the physics + ; mesh, and use it for collisions. This is currently experimental code and enabling + ; it may cause unexpected physics problems. + ;UseMeshiesPhysicsMesh = false + + ; Choose one of the physics engines below + ; OpenDynamicsEngine is by some distance the most developed physics engine + ; basicphysics effectively does not model physics at all, making all objects phantom + + physics = OpenDynamicsEngine + ;physics = basicphysics + ;physics = POS + ;physics = modified_BulletX + + ; ## + ; ## PERMISSIONS + ; ## + + ;permissionmodules = "DefaultPermissionsModule" + + ; If set to false, then, in theory, the server never carries out permission checks (allowing anybody to copy + ; any item, etc. This may not yet be implemented uniformally. + ; If set to true, then all permissions checks are carried out + ; Default is false + serverside_object_permissions = false + + allow_grid_gods = false + + ; This allows somne control over permissions + ; please note that this still doesn't duplicate SL, and is not intended to + ;region_owner_is_god = true + ;region_manager_is_god = false + ;parcel_owner_is_god = true + + ; Control user types that are allowed to create new scripts + ; Only enforced if serviceside_object_permissions is true + ; + ; Current possible values are + ; all - anyone can create scripts (subject to normal permissions) + ; gods - only administrators can create scripts (as long as allow_grid_gods is true) + ; Default value is all + ; allowed_script_creators = all + + ; Control user types that are allowed to edit (save) scripts + ; Only enforced if serviceside_object_permissions is true + ; + ; Current possible values are + ; all - anyone can edit scripts (subject to normal permissions) + ; gods - only administrators can edit scripts (as long as allow_grid_gods is true) + ; Default value is all + ; allowed_script_editors = all + + ; ## + ; ## SCRIPT ENGINE + ; ## + + DefaultScriptEngine = "XEngine" + + ; ## + ; ## WORLD MAP + ; ## + + ;WorldMapModule = "WorldMap" + ;MapImageModule = "MapImageModule" + ; Set to false to not generate any maptiles + ;GenerateMaptiles = "true" + ; Refresh (in seconds) the map tile periodically + ;MaptileRefresh = 0 + ; If not generating maptiles, use this static texture asset ID + ;MaptileStaticUUID = "00000000-0000-0000-0000-000000000000" + + ; ## + ; ## EMAIL MODULE + ; ## + + ;emailmodule = DefaultEmailModule + + ; ## + ; ## ANIMATIONS + ; ## + + ; If enabled, enableFlySlow will change the primary fly state to + ; FLYSLOW, and the "always run" state will be the regular fly. + + enableflyslow = false + + ; PreJump is an additional animation state, but it probably + ; won't look right until the physics engine supports it + ; (i.e delays takeoff for a moment) + + ; This is commented so it will come on automatically once it's + ; supported. + + ; enableprejump = true + + ; Simulator Stats URI + ; Enable JSON simulator data by setting a URI name (case sensitive) + ; Stats_URI = "jsonSimStats" + + ; Make OpenSim start all regions woth logins disabled. They will need + ; to be enabled from the console if this is set + ; StartDisabled = false + + ; Image decoding. Use CSJ2K for layer boundary decoding if true, + ; OpenJPEG if false + ; UseCSJ2K = true + + ; Persist avatar baked textures + ; Persisting baked textures can speed up login and region border + ; crossings especially with large numbers of users, though it + ; will store potentially large numbers of textures in your asset + ; database + PersistBakedTextures = false + + ; Control the delay before appearance is sent to other avatars and + ; saved in the avatar service. Attempts to limit the impact caused + ; by the very chatty dialog that sets appearance when an avatar + ; logs in or teleports into a region; values are in seconds + DelayBeforeAppearanceSave = 5 + DelayBeforeAppearanceSend = 2 + +[SMTP] + enabled=false + + ;enabled=true + ;internal_object_host=lsl.opensim.local + ;host_domain_header_from=127.0.0.1 + ;SMTP_SERVER_HOSTNAME=127.0.0.1 + ;SMTP_SERVER_PORT=25 + ;SMTP_SERVER_LOGIN=foo + ;SMTP_SERVER_PASSWORD=bar + +[Network] + ConsoleUser = "Test" + ConsolePass = "secret" + http_listener_port = 9000 + console_port = 0 + + ; ssl config: Experimental! The auto https config only really works definately on windows XP now + ; you need a Cert Request/Signed pair installed in the MY store with the CN specified below + ; you can use https on other platforms, but you'll need to configure the httpapi yourself for now + http_listener_ssl = false ; Also create a SSL server + http_listener_cn = "localhost" ; Use the cert with the common name + http_listener_sslport = 9001 ; Use this port for SSL connections + http_listener_ssl_cert = "" ; Currently unused, but will be used for OSHttpServer + + ; Hostname to use in llRequestURL/llRequestSecureURL + ; if not defined - default machine name is being used + ; (on Windows this mean NETBIOS name - useably only inside local network) + ; ExternalHostNameForLSL=127.0.0.1 + + ; What is reported as the "X-Secondlife-Shard" + ; Defaults to the user server url if not set + ; The old default is "OpenSim", set here for compatibility + shard = "OpenSim" + + ; What is reported as the "User-Agent" when using llHTTPRequest + ; Defaults to not sent if not set here. See the notes section in the wiki at + ; http://wiki.secondlife.com/wiki/LlHTTPRequest for comments on adding + ; " (Mozilla Compatible)" to the text where there are problems with a web server + ;user_agent = "OpenSim LSL (Mozilla Compatible)" + +[XMLRPC] + ; ## + ; ## Scripting XMLRPC mapper + ; ## + + ; If enabled, this will post an event, "xmlrpc_uri(string)" to the + ; script concurrently with the first remote_data event. + ; This will contain the fully qualified URI an external site needs + ; to use to send XMLRPC requests to that script + + ;XmlRpcRouterModule = "XmlRpcRouterModule" + ;XmlRpcPort = 20800 + +[ClientStack.LindenUDP] + ; Set this to true to process incoming packets asynchronously. Networking is + ; already separated from packet handling with a queue, so this will only + ; affect whether networking internals such as packet decoding and + ; acknowledgement accounting are done synchronously or asynchronously + ; Default is true. + ; + ;async_packet_handling = true + + ; The client socket receive buffer size determines how many + ; incoming requests we can process; the default on .NET is 8192 + ; which is about 2 4k-sized UDP datagrams. On mono this is + ; whatever the underlying operating system has as default; for + ; example, ubuntu 8.04 or SLES11 have about 111k, which is about + ; 27 4k-sized UDP datagrams (on linux platforms you can [as root] + ; do "sysctl net.core.rmem_default" to find out what your system + ; uses a default socket receive buffer size. + ; + ; client_socket_rcvbuf_size allows you to specify the receive + ; buffer size LLUDPServer should use. NOTE: this will be limited + ; by the system's settings for the maximum client receive buffer + ; size (on linux systems you can set that with "sysctl -w + ; net.core.rmem_max=X") + ; + ;client_socket_rcvbuf_size = 8388608 + + ; Maximum outbound bytes per second for a single scene. This can be used to + ; throttle total outbound UDP traffic for a simulator. The default value is + ; 0, meaning no throttling at the scene level. The example given here is + ; 20 megabits + ; + ;scene_throttle_max_bps = 2621440 + + ; Maximum bits per second to send to any single client. This will override + ; the user's viewer preference settings. The default value is 0, meaning no + ; aggregate throttling on clients (only per-category throttling). The + ; example given here is 1.5 megabits + ; + ;client_throttle_max_bps = 196608 + + ; Per-client bytes per second rates for the various throttle categories. + ; These are default values that will be overriden by clients + ; + ;resend_default = 12500 + ;land_default = 1000 + ;wind_default = 1000 + ;cloud_default = 1000 + ;task_default = 1000 + ;texture_default = 1000 + ;asset_default = 1000 + ;state_default = 1000 + + ; Per-client maximum burst rates in bytes per second for the various + ; throttle categories. These are default values that will be overriden by + ; clients + ; + ;resend_limit = 18750 + ;land_limit = 29750 + ;wind_limit = 18750 + ;cloud_limit = 18750 + ;task_limit = 18750 + ;texture_limit = 55750 + ;asset_limit = 27500 + ;state_limit = 37000 + + ; Configures how ObjectUpdates are aggregated. These numbers + ; do not literally mean how many updates will be put in each + ; packet that goes over the wire, as packets are + ; automatically split on a 1400 byte boundary. These control + ; the balance between responsiveness of interest list updates + ; and total throughput. Higher numbers will ensure more full- + ; sized packets and faster sending of data, but more delay in + ; updating interest lists + ; + ;PrimTerseUpdatesPerPacket = 25 + ;AvatarTerseUpdatesPerPacket = 10 + ;PrimFullUpdatesPerPacket = 100 + + ; TextureSendLimit determines how many packets will be put on + ; the outgoing queue each cycle. Like the settings above, this + ; is a balance between responsiveness to priority updates and + ; total throughput. Higher numbers will give a better + ; throughput at the cost of reduced responsiveness to client + ; priority changes or transfer aborts + ; + ;TextureSendLimit = 20 + + ; Quash and remove any light properties from attachments not on the + ; hands. This allows flashlights and lanterns to function, but kills + ; silly vanity "Facelights" dead. Sorry, head mounted miner's lamps + ; will also be affected. + ; + ;DisableFacelights = "false" + +[Chat] + ; Controls whether the chat module is enabled. Default is true. + enabled = true; + + ; Distance in meters that whispers should travel. Default is 10m + whisper_distance = 10 + + ; Distance in meters that ordinary chat should travel. Default is 30m + say_distance = 30 + + ; Distance in meters that shouts should travel. Default is 100m + shout_distance = 100 + + +[Messaging] + ; Control which region module is used for instant messaging. + ; Default is InstantMessageModule (this is the name of the core IM module as well as the setting) + InstantMessageModule = InstantMessageModule + ; MessageTransferModule = MessageTransferModule + ; OfflineMessageModule = OfflineMessageModule + ; OfflineMessageURL = http://yourserver/Offline.php + ; MuteListModule = MuteListModule + ; MuteListURL = http://yourserver/Mute.php + + ; Control whether group messages are forwarded to offline users. Default is true. + ; ForwardOfflineGroupMessages = true + + +[ODEPhysicsSettings] + ;## + ;## World Settings + ;## + + ;Gravity. Feel like falling up? change world_gravityz to 9.8 instead of -9.8. m/s + world_gravityx = 0 + world_gravityy = 0 + world_gravityz = -9.8 + + ; World Step size. (warning these are dangerous. Changing these will probably cause your scene to explode dramatically) + ; reference: fps = (0.09375/ODE_STEPSIZE) * 1000; + world_stepsize = 0.020 + world_internal_steps_without_collisions = 10 + + ;World Space settings. Affects memory consumption vs Collider CPU time for avatar and physical prim + world_hashspace_size_low = -4 + world_hashSpace_size_high = 128 + + ;Dynamic space settings Affects memory consumption vs Collider CPU time for static prim + meters_in_small_space = 29.9 + small_hashspace_size_low = -4 + small_hashspace_size_high = 66 + + ; ## + ; ## Contact properties. (the stuff that happens when things come in contact with each other) + ; ## + + ; surface layer around geometries other geometries can sink into before generating a contact + world_contact_surface_layer = 0.001 + + ; Filtering collisions helps keep things stable physics wise, but sometimes + ; it can be overzealous. If you notice bouncing, chances are it's that. + filter_collisions = false + + ; Non Moving Terrain Contact (avatar isn't moving) + nm_terraincontact_friction = 255.0 + nm_terraincontact_bounce = 0.1 + nm_terraincontact_erp = 0.1025 + + ; Moving Terrain Contact (avatar is moving) + m_terraincontact_friction = 75.0 + m_terraincontact_bounce = 0.05 + m_terrainContact_erp = 0.05025 + + ; Moving Avatar to object Contact + m_avatarobjectcontact_friction = 75.0 + m_avatarobjectcontact_bounce = 0.1 + + ; Object to Object Contact and Non-Moving Avatar to object + objectcontact_friction = 250.0 + objectcontact_bounce = 0.2 + + ; ## + ; ## Avatar Control + ; ## + + ; PID Controller Settings. These affect the math that causes the avatar to reach the + ; desired velocity + ; See http://en.wikipedia.org/wiki/PID_controller + + av_pid_derivative_linux = 2200.0 + av_pid_proportional_linux = 900.0; + + av_pid_derivative_win = 2200.0 + av_pid_proportional_win = 900.0; + + ;girth of the avatar. Adds radius to the height also + av_capsule_radius = 0.37 + + ; Max force permissible to use to keep the avatar standing up straight + av_capsule_standup_tensor_win = 550000 + av_capsule_standup_tensor_linux = 550000 + + ; specifies if the capsule should be tilted (=true; old compatibility mode) + ; or straight up-and-down (=false; better and more consistent physics behavior) + av_capsule_tilted = false + + ; used to calculate mass of avatar. + ; float AVvolume = (float) (Math.PI*Math.Pow(CAPSULE_RADIUS, 2)*CAPSULE_LENGTH); + ; av_density * AVvolume; + av_density = 80 + + ; use this value to cut 52% of the height the sim gives us + av_height_fudge_factor = 0.52 + + ; Movement. Smaller is faster. + + ; speed of movement with Always Run off + av_movement_divisor_walk = 1.3 + + ; speed of movement with Always Run on + av_movement_divisor_run = 0.8 + + ; When the avatar flies, it will be moved up by this amount off the ground (in meters) + minimum_ground_flight_offset = 3.0 + + ; ## + ; ## Object options + ; ## + + ; used in the mass calculation. + geometry_default_density = 10.000006836 + + ; amount of ODE steps where object is non moving for ODE to automatically put it to sleep + body_frames_auto_disable = 20 + + ; used to control llMove2Target + body_pid_derivative = 35 + body_pid_gain = 25 + + ; maximum number of contact points to generate per collision + contacts_per_collision = 80 + + ; amount of time a geom/body will try to cross a region border before it gets disabled + geom_crossing_failures_before_outofbounds = 5 + + ; start throttling the object updates if object comes in contact with 3 or more other objects + geom_contactpoints_start_throttling = 3 + + ; send 1 update for every x updates below when throttled + geom_updates_before_throttled_update = 15 + + ; Used for llSetStatus. How rigid the object rotation is held on the axis specified + body_motor_joint_maxforce_tensor_linux = 5 + body_motor_joint_maxforce_tensor_win = 5 + + ; Maximum mass an object can be before it is clamped + maximum_mass_object = 10000.01 + + ; ## + ; ## Sculpted Prim settings + ; ## + + ; Do we want to mesh sculpted prim to collide like they look? + mesh_sculpted_prim = true + + ; number^2 non-physical level of detail of the sculpt texture. 32x32 - 1024 verticies + mesh_lod = 32 + + ; number^2 physical level of detail of the sculpt texture. 16x16 - 256 verticies + mesh_physical_lod = 16 + + ; ## + ; ## Physics logging settings - logfiles are saved to *.DIF files + ; ## + + ; default is false + ;physics_logging = true + ;; every n simulation iterations, the physics snapshot file is updated + ;physics_logging_interval = 50 + ;; append to existing physics logfile, or overwrite existing logfiles? + ;physics_logging_append_existing_logfile = true + + ; ## + ; ## Joint support + ; ## + + ; if you would like physics joints to be enabled through a special naming convention in the client, set this to true. + ; (see NINJA Physics documentation, http://opensimulator.org/wiki/NINJA_Physics) + ; default is false + ;use_NINJA_physics_joints = true + + ; ## + ; ## additional meshing options + ; ## + + ; physical collision mesh proxies are normally created for complex prim shapes, and collisions for simple boxes and + ; spheres are computed algorithmically. If you would rather have mesh proxies for simple prims, you can set this to + ; true. Note that this will increase memory usage and region startup time. Default is false. + ;force_simple_prim_meshing = true + + +[RemoteAdmin] + enabled = false + + ; Set this to a nonzero value to have remote admin use a different port + port = 0 + + ; Set this to the ip address that you want the admin server to bind to + bind_ip_address = "0.0.0.0" + + ; This password is required to make any XMLRPC call (should be set as the "password" parameter) + access_password = unknown + + ; set this variable to true if you want the create_region XmlRpc + ; call to unconditionally enable voice on all parcels for a newly + ; created region [default: false] + create_region_enable_voice = false + + ; set this variable to false if you want the create_region XmlRpc + ; call to create all regions as private per default (can be + ; overridden in the XmlRpc call) [default: true] + create_region_public = false + + ; the create_region XmlRpc call uses region_file_template to generate + ; the file name of newly create regions (if they are created + ; persistent). the parameter available are: + ; {0} - X location + ; {1} - Y location + ; {2} - region UUID + ; {3} - region port + ; {4} - region name with " ", ":", "/" mapped to "_" + region_file_template = "{0}x{1}-{2}.ini" + + ; we can limit the number of regions that XmlRpcCreateRegion will + ; allow by setting this to a positive, non-0 number: as long as the + ; number of regions is below region_limits, XmlRpcCreateRegion will + ; succeed. setting region_limit to 0 disables the check. + ; default is 0 + ;region_limit = 0 + + ; enable only those methods you deem to be appropriate using a | delimited whitelist + ; for example, enabled_methods = admin_broadcast|admin_region_query|admin_save_oar|admin_save_xml + ; if this parameter is not specified but enabled = true, all methods will be available + enabled_methods = all + + ; specify the default appearance for an avatar created through the remote admin interface + ; This will only take effect is the file specified by the default_appearance setting below exists + ;default_male = Default Male + ;default_female = Default Female + + ; update appearance copies inventory items and wearables of default avatars. if this value is false + ; (default), just worn assets are copied to the Clothes folder; if true, all Clothes and Bodyparts + ; subfolders are copied. the receiver will wear the same items the default avatar did wear. + ;copy_folders = false + + ; path to default appearance XML file that specifies the look of the default avatars + ;default_appearance = default_appearance.xml + +[RestPlugins] + ; Change this to true to enable REST Plugins. This must be true if you wish to use + ; REST Region or REST Asset and Inventory Plugins + enabled = false + god_key = SECRET + prefix = /admin + + +[RestRegionPlugin] + ; Change this to true to enable the REST Region Plugin + enabled = false + + +[RestHandler] + ; Change this to true to enable the REST Asset and Inventory Plugin + enabled = false + authenticate = true + secured = true + extended-escape = true + realm = OpenSim REST + dump-asset = false + path-fill = true + dump-line-size = 32 + flush-on-error = true + + +; Uncomment the following for IRC bridge +; experimental, so if it breaks... keep both parts... yada yada +; also, not good error detection when it fails +;[IRC] + ;enabled = true ; you need to set this otherwise it won't connect + ;server = name.of.irc.server.on.the.net + ;; user password - only use this if the server requires one + ;password = mypass + ;nick = OpenSimBotNameProbablyMakeThisShorter + ;channel = #the_irc_channel_you_want_to_connect_to + ;user = "USER OpenSimBot 8 * :I'm an OpenSim to IRC bot" + ;port = 6667 + ;; channel to listen for configuration commands + ;commands_enabled = false + ;command_channel = 2777 + ;report_clients = true + ;; relay private chat connections + ;; relay_private_channels = true: will relay IRC chat from/to private in-world channels + ;; relay_private_channel_out -- channel to send messages out to the IRC bridge + ;; relay_private_channel_in -- channel to receive message from the IRC bridge + ;; relay_chat = false: IRC bridge will not relay normal chat + ;; access_password -- simple security device + ;; + ;; so, to just relay chat from an IRC channel to in-world region and vice versa: + ;; + ;; relay_private_channels = false + ;; relay_chat = true + ;; + ;; to relay chat only to/from private in-world channels: + ;; + ;; relay_chat = false + ;; relay_private_channels = true + ;; relay_private_channel_in = 2226 + ;; relay_private_channel_out = 2225 + ;; + ;; in this example, all chat coming in from IRC will be send out via + ;; in-world channel 2226, and all chat from in-world channel 2225 will + ;; be relayed to the IRC channel. + ;; + ;relay_private_channels = false + ;relay_private_channel_in = 2226 + ;relay_private_channel_out = 2225 + ;relay_chat = true + ;access_password = foobar + + ;;fallback_region = name of "default" region + ;;MSGformat fields : 0=botnick, 1=user, 2=region, 3=message + ;; must start with "PRIVMSG {0} : " or irc server will get upset + ;;for : : + ;;msgformat = "PRIVMSG {0} :<{1} in {2}>: {3}" + ;;for : - : + ;msgformat = "PRIVMSG {0} : {3} - {1} of {2}" + ;;for : - from : + ;;msgformat = "PRIVMSG {0} : {3} - from {1}" + + ;; exclude_list allows you to stop the IRC connector from announcing the + ;;arrival and departure of certain users. For example: admins, bots. + + ;exclude_list=User 1,User 2,User 3 + + +;[CMS] + ;enabled = true + ;channel = 345 + + +; Uncomment the following to control the progression of daytime +; in the Sim. The defaults are what is shown below +;[Sun] + ; number of wall clock hours for an opensim day. 24.0 would mean realtime + ;day_length = 4 + ; Year length in days + ;year_length = 60 + ; Day to Night Ratio + ;day_night_offset = 0.45 + ; send a Sun update every update_interval # of frames. A lower number will + ; make for smoother sun transition at the cost of network + ;update_interval = 100 + + +[Wind] + ; Enables the wind module. Default is true + enabled = true + + ; How often should wind be updated, as a function of world frames. Approximately 50 frames a second + wind_update_rate = 150 + + ; The Default Wind Plugin to load + wind_plugin = SimpleRandomWind + + ; These settings are specific to the ConfigurableWind plugin + ; To use ConfigurableWind as the default, simply change wind_plugin to ConfigurableWind and uncomment the following. + ; avg_strength = 5.0 + ; avg_direction = 0.0 + ; var_strength = 0.0 + ; var_direction = 0.0 + ; rate_change = 1.0 + + ; This setting is specific to the SimpleRandomWind plugin + ; Adjusts wind strength. 0.0 = no wind, 1.0 = normal wind. Default is 1.0 + strength = 1.0 + + +[Cloud] + ; Enable this to generate classic particle clouds above the sim. + ; default is disabled - turn it on here + enabled = false + + ; Density of cloud cover 0.0 to 1.0 Defult 0.5 + density = 0.5 + + ; update interval for the cloud cover data returned by llCloud(). + ; default is 1000 + cloud_update_rate = 1000 + +[LightShare] + + ; This enables the transmission of Windlight scenes to supporting clients, such as the Meta7 viewer. + ; It has no ill effect on viewers which do not support server-side windlight settings. + ; Currently we only have support for MySQL databases. + enable_windlight = false; + +[Trees] + ; Enable this to allow the tree module to manage your sim trees, including growing, reproducing and dying + ; default is false + active_trees = false + + ; Density of tree population + tree_density = 1000.0 + + +[VectorRender] + + ; the font to use for rendering text (default: Arial) + ; font_name = "Arial" + + +[LL-Functions] + ; Set the following to true to allow administrator owned scripts to execute console commands + ; currently unused + ; AllowosConsoleCommand=false + + AllowGodFunctions = false + + ; Maximum number of llListen events we allow per script + ; Set this to 0 to have no limit imposed. + max_listens_per_script = 64 + + +[DataSnapshot] + ; The following set of configs pertains to search. + ; Set index_sims to true to enable search engines to index your searchable data + ; If false, no data will be exposed, DataSnapshot module will be off, and you can ignore the rest of these search-related configs + ; default is false + index_sims = false + + ; The variable data_exposure controls what the regions expose: + ; minimum: exposes only things explicitly marked for search + ; all: exposes everything + data_exposure = minimum + + ; If search is on, change this to your grid name; will be ignored for standalones + gridname = "OSGrid" + + ; Period between data snapshots, in seconds. 20 minutes, for starters, so that you see the initial changes fast. + ; Later, you may want to increase this to 3600 (1 hour) or more + default_snapshot_period = 1200 + + ; This will be created in bin, if it doesn't exist already. It will hold the data snapshots. + snapshot_cache_directory = "DataSnapshot" + + ; This semicolon-separated string serves to notify specific data services about the existence + ; of this sim. Uncomment if you want to index your data with this and/or other search providers. + ;data_services="http://metaverseink.com/cgi-bin/register.py" + + +[Economy] + ; These economy values get used in the BetaGridLikeMoneyModule. - This module is for demonstration only - + + ; Enables selling things for $0 + SellEnabled = "false" + + ; Money Unit fee to upload textures, animations etc + PriceUpload = 0 + + ; Money Unit fee to create groups + PriceGroupCreate = 0 + + ; We don't really know what the rest of these values do. These get sent to the client + ; These taken from Agni at a Public Telehub. Change at your own risk. + ObjectCount = 0 + PriceEnergyUnit = 100 + PriceObjectClaim = 10 + PricePublicObjectDecay = 4 + PricePublicObjectDelete = 4 + PriceParcelClaim = 1 + PriceParcelClaimFactor = 1 + + PriceRentLight = 5 + TeleportMinPrice = 2 + TeleportPriceExponent = 2 + EnergyEfficiency = 1 + PriceObjectRent = 1 + PriceObjectScaleFactor = 10 + PriceParcelRent = 1 + + +[SVN] + Enabled = false + Directory = SVNmodule\repo + URL = "svn://your.repo.here/" + Username = "user" + Password = "password" + ImportOnStartup = false + Autosave = false + AutoSavePeriod = 15 ; Number of minutes between autosave backups + + +[XEngine] + ; Enable this engine in this OpenSim instance + Enabled = true + + ; How many threads to keep alive even if nothing is happening + MinThreads = 2 + + ; How many threads to start at maximum load + MaxThreads = 100 + + ; Time a thread must be idle (in seconds) before it dies + IdleTimeout = 60 + + ; Thread priority ("Lowest", "BelowNormal", "Normal", "AboveNormal", "Highest") + Priority = "BelowNormal" + + ; Maximum number of events to queue for a script (excluding timers) + MaxScriptEventQueue = 300 + + ; Stack size per thread created + ThreadStackSize = 262144 + + ; Set this to true (the default) to load each script into a separate + ; AppDomain. Setting this to false will load all script assemblies into the + ; current AppDomain, which will reduce the per-script overhead at the + ; expense of reduced security and the inability to garbage collect the + ; script assemblies + AppDomainLoading = true + + ; Rate to poll for asynchronous command replies (ms) + ; currently unused + ;AsyncLLCommandLoopms = 50 + + ; Save the source of all compiled scripts + WriteScriptSourceToDebugFile = false + + ; Default language for scripts + DefaultCompileLanguage = lsl + + ; List of allowed languages (lsl,vb,js,cs) + ; AllowedCompilers=lsl,cs,js,vb. + ; *warning*, non lsl languages have access to static methods such as System.IO.File. Enable at your own risk. + AllowedCompilers=lsl + + ; Compile debug info (line numbers) into the script assemblies + CompileWithDebugInformation = true + + ; Allow the user of mod* functions. This allows a script to pass messages + ; to a region module via the modSendCommand() function + ; Default is false + AllowMODFunctions = false + + ; Allow the use of os* functions (some are dangerous) + AllowOSFunctions = false + + ; Allow the user of LightShare functions + AllowLightShareFunctions = false + + ; Threat level to allow, one of None, VeryLow, Low, Moderate, High, VeryHigh, Severe + OSFunctionThreatLevel = VeryLow + + ; Interval (s) between background save of script states + SaveInterval = 120 + + ; Interval (s) between maintenance runs (0 = disable) + MaintenanceInterval = 10 + + ; Time a script can spend in an event handler before it is interrupted + EventLimit = 30 + + ; If a script overruns it's event limit, kill the script? + KillTimedOutScripts = false + + ; Sets the multiplier for the scripting delays + ScriptDelayFactor = 1.0 + + ; The factor the 10 m distances llimits are multiplied by + ScriptDistanceLimitFactor = 1.0 + + ; Maximum length of notecard line read + ; Increasing this to large values potentially opens + ; up the system to malicious scripters + ; NotecardLineReadCharsMax = 255 + + ; Sensor settings + SensorMaxRange = 96.0 + SensorMaxResults = 16 + + ; OS Functions enable/disable + ; For each function, you can add one line, as shown + ; The default for all functions allows them if below threat level + + ; true allows the use of the function unconditionally + ; Allow_osSetRegionWaterHeight = true + + ; false disables the function completely + ; Allow_osSetRegionWaterHeight = false + + ; Comma separated list of UUIDS allows the function for that list of UUIDS + ; Allow_osSetRegionWaterHeight = 888760cb-a3cf-43ac-8ea4-8732fd3ee2bb + + ; You can also use script creators as the uuid + ; Creators_osSetRegionWaterHeight = , ... + + ; If both Allow_ and Creators_ are given, effective permissions + ; are the union of the two. + + ; Allow for llCreateLink and llBreakLink to work without asking for permission + ; only enable this in a trusted environment otherwise you may be subject to hijacking + ; AutomaticLinkPermission = false + + ; Disable underground movement of prims (default true); set to + ; false to allow script controlled underground positioning of + ; prims + ; DisableUndergroundMovement = true + + ;; Path to script assemblies + ; ScriptEnginesPath = "ScriptEngines" + +[OpenGridProtocol] + ;These are the settings for the Open Grid Protocol.. the Agent Domain, Region Domain, you know.. + ;On/true or Off/false + ogp_enabled=false + + ;Name Prefix/suffix when using OGP + ogp_firstname_prefix="" + ogp_lastname_suffix="_EXTERNAL" + + +[Concierge] + ; Enable concierge module + ; Default is false + enabled = false + + ; name of the concierge + whoami = "jeeves" + + ; password for updating the welcome message templates via XmlRpc + password = SECRET + + ; regex specifying for which regions concierge service is desired; if + ; empty, then for all + regions = "^MeetingSpace-" + + ; for each region that matches the regions regexp you can provide + ; (optionally) a welcome template using format substitution: + ; {0} is replaced with the name of the avatar entering the region + ; {1} is replaced with the name of the region + ; {2} is replaced with the name of the concierge (whoami variable above) + + welcomes = /path/to/welcome/template/directory + + ; Concierge can send attendee lists to an event broker whenever an + ; avatar enters or leaves a concierged region. the URL is subject + ; to format substitution: + ; {0} is replaced with the region's name + ; {1} is replaced with the region's UUID + broker = "http://broker.place.com/{1}" + + +[RegionReady] + ; Enable this module to get notified once all items and scripts in the region have been completely loaded and compiled + ; default is false + enabled = false + + ; Channel on which to signal region readiness through a message + ; formatted as follows: "{server_startup|oar_file_load},{0|1},n,[oar error]" + ; - the first field indicating whether this is an initial server startup + ; - the second field is a number indicating whether the OAR file loaded ok (1 == ok, 0 == error) + ; - the third field is a number indicating how many scripts failed to compile + ; - "oar error" if supplied, provides the error message from the OAR load + channel_notify = -800 + + +[MRM] + ; Enables the Mini Region Modules Script Engine. + ; default is false + Enabled = false + + ; Runs MRM in a Security Sandbox + ; WARNING: DISABLING IS A SECURITY RISK. + Sandboxed = true + + ; The level sandbox to use, adjust at your OWN RISK. + ; Valid values are: + ; * FullTrust + ; * SkipVerification + ; * Execution + ; * Nothing + ; * LocalIntranet + ; * Internet + ; * Everything + SandboxLevel = "Internet" + + ; Only allow Region Owners to run MRMs + ; May represent a security risk if you disable this. + OwnerOnly = true + +[Hypergrid] + ; Keep it false for now. Making it true requires the use of a special client in order to access inventory + safemode = false + +[VivoxVoice] + ; The VivoxVoice module will allow you to provide voice on your + ; region(s). It uses the same voice technology as the LL grid and + ; works with recent LL clients (we have tested 1.22.9.110075, so + ; anything later ought to be fine as well). + ; + ; For this to work you need to obtain an admin account from Vivox + ; that allows you to create voice accounts and region channels. + + enabled = false + + ; vivox voice server + vivox_server = www.foobar.vivox.com + + ; vivox SIP URI + vivox_sip_uri = foobar.vivox.com + + ; vivox admin user name + vivox_admin_user = DeepThroat + + ; vivox admin password + vivox_admin_password = VoiceG4te + + ; channel type: "channel" or "positional" + ; - positional: spatial sound (default) + ; - channel: normal "conference call", no spatial sound + ;vivox_channel_type = positional + + ; channel characteristics (unless you know what you are doing, i'd + ; leave them as they are --- now you WILL muck around with them, + ; huh? sigh) + + ; channel distance model: + ; 0 - no attenuation + ; 1 - inverse distance attenuation + ; 2 - linear attenuation (default) + ; 3 - exponential attenuation + ;vivox_channel_distance_model = 2 + + ; channel mode: + ; - "open" (default) + ; - "lecture" + ; - "presentation" + ; - "auditorium" + ;vivox_channel_mode = "open" + + ; channel roll off: rate of attenuation + ; - a value between 1.0 and 4.0, default is 2.0 + ;vivox_channel_roll_off = 2.0 + + ; channel max range: distance at which channel is silent + ; - a value between 0 and 160, default is 80 + ;vivox_channel_max_range = 80 + + ; channel clamping distance: distance before attenuation applies + ; - a value between 0 and 160, default is 10 + ;vivox_channel_clamping_distance = 10 + +[FreeSwitchVoice] + ; In order for this to work you need a functioning FreeSWITCH PBX set up. + ; Configuration details at http://opensimulator.org/wiki/Freeswitch_Module + enabled = false + ; FreeSWITCH server is going to contact us and ask us all sorts of things + freeswitch_server_user = freeswitch + freeswitch_server_pass = password + freeswitch_api_prefix = /api + ; external IP address of your OpenSim voice enabled region + ; note: all regions running on same OpenSim.exe will be enabled + freeswitch_service_server = ip.address.of.your.sim + ; this should be the same port the region listens on + freeswitch_service_port = 9000 + freeswitch_realm = ip.address.of.freeswitch.server + freeswitch_sip_proxy = ip.address.of.freeswitch.server:5060 + ; STUN = Simple Traversal of UDP through NATs + ; See http://wiki.freeswitch.org/wiki/NAT_Traversal + ; stun.freeswitch.org is not guaranteed to be running so use it in production at your own risk + freeswitch_attempt_stun = false + freeswitch_stun_server = ip.address.of.stun.server + freeswitch_echo_server = ip.address.of.freeswitch.server + freeswitch_echo_port = 50505 + freeswitch_well_known_ip = ip.address.of.freeswitch.server + ; + ; Type the address of your http server here, hostname is allowed. This is provided so you can specify a hostname + ; This is used by client for account verification. By default, it's the same as the freeswitch service server. + ; + ; opensim_well_known_http_address = Address_Of_Your_SIM_HTTP_Server_Hostname_Allowed + ; + freeswitch_default_timeout = 5000 + freeswitch_subscribe_retry = 120 + ; freeswitch_password_reset_url = + +[Groups] + Enabled = false + + ; This is the current groups stub in Region.CoreModules.Avatar.Groups. All the other settings below only really + ; apply to the Flotsam/SimianGrid GroupsModule + Module = Default + + ; This module can use a PHP XmlRpc server from the Flotsam project at http://code.google.com/p/flotsam/ + ; or from the SimianGrid project at http://code.google.com/p/openmetaverse + ;Module = GroupsModule + + ; Enable Group Notices + ;NoticesEnabled = true + + ; This makes the Groups modules very chatty on the console. + DebugEnabled = false + + ; Specify which messaging module to use for groups messaging and if it's enabled + ;MessagingModule = GroupsMessagingModule + ;MessagingEnabled = true + + ; Service connectors to the Groups Service. Select one depending on whether you're using a Flotsam XmlRpc backend or a SimianGrid backend + + ; SimianGrid Service for Groups + ;ServicesConnectorModule = SimianGroupsServicesConnector + ;GroupsServerURI = http://mygridserver.com:82/Grid/ + + ; Flotsam XmlRpc Service for Groups + ;ServicesConnectorModule = XmlRpcGroupsServicesConnector + ;GroupsServerURI = http://yourxmlrpcserver.com/xmlrpc.php + + ; XmlRpc Security settings. These must match those set on your backend groups service. + ;XmlRpcServiceReadKey = 1234 + ;XmlRpcServiceWriteKey = 1234 + + ; Disables HTTP Keep-Alive for XmlRpcGroupsServicesConnector HTTP Requests, + ; this is a work around fora problem discovered on some Windows based region servers. + ; Only disable keep alive if you see a large number (dozens) of the following Exceptions: + ; System.Net.WebException: The request was aborted: The request was canceled. + ; XmlRpcDisableKeepAlive = false + + +[PacketPool] + ; Enables the experimental packet pool. Yes, we've been here before. + ;RecyclePackets = true; + ;RecycleDataBlocks = true; + + +[InterestManagement] + ; This section controls how state updates are prioritized for each client + ; Valid values are BestAvatarResponsiveness, Time, Distance, + ; SimpleAngularDistance, and FrontBack + UpdatePrioritizationScheme = BestAvatarResponsiveness + ReprioritizationEnabled = true + ReprioritizationInterval = 2000.0 + RootReprioritizationDistance = 10.0 + ChildReprioritizationDistance = 20.0 + + +[WebStats] +; View region statistics via a web page +; See http://opensimulator.org/wiki/FAQ#Region_Statistics_on_a_Web_Page +; Use a web browser and type in the "Login URI" + "/SStats/" +; For example- http://127.0.0.1:9000/SStats/ +; enabled=false + + +[MediaOnAPrim] + ; Enable media on a prim facilities + Enabled = true; + + +;; +;; These are defaults that are overwritten below in [Architecture]. +;; These defaults allow OpenSim to work out of the box with +;; zero configuration +;; +[AssetService] + DefaultAssetLoader = "OpenSim.Framework.AssetLoader.Filesystem.dll" + AssetLoaderArgs = "assets/AssetSets.xml" + + ; Disable this to prevent the default asset set from being inserted into the + ; asset store each time the region starts + AssetLoaderEnabled = true + +[GridService] + ;; default standalone, overridable in StandaloneCommon.ini + StorageProvider = "OpenSim.Data.Null.dll:NullRegionData" + +[Modules] + Include-modules = "addon-modules/*/config/*.ini" + diff --git a/bin/Prebuild.exe b/bin/Prebuild.exe index eb4c224ac5..d79227c6da 100755 Binary files a/bin/Prebuild.exe and b/bin/Prebuild.exe differ diff --git a/bin/PrimMesher.dll b/bin/PrimMesher.dll new file mode 100644 index 0000000000..249e91c0a5 Binary files /dev/null and b/bin/PrimMesher.dll differ diff --git a/bin/Robust.HG.ini.example b/bin/Robust.HG.ini.example index 0cf9ab1431..e1627c0534 100644 --- a/bin/Robust.HG.ini.example +++ b/bin/Robust.HG.ini.example @@ -1,17 +1,27 @@ -;; Configurations for enabling HG1.5 -;; -;; Run -;; $ Robust.exe -inifile Robust.HG.ini - -;; HG1.5 handlers are: OpenSim.Server.Handlers.dll:GatekeeperService -;; OpenSim.Server.Handlers.dll:UserAgentService -;; Additional OpenSim.Server.Handlers.dll:AssetServiceConnector and -;; OpenSim.Server.Handlers.dll:XInventoryInConnector -;; are started in port 8002, outside the firewall -;; +; * Run +; * $ Robust.exe -inifile Robust.HG.ini +; * +; * Configurations for enabling HG1.5 +; * +; * HG1.5 handlers are: OpenSim.Server.Handlers.dll:GatekeeperService +; * OpenSim.Server.Handlers.dll:UserAgentService +; * Additional OpenSim.Server.Handlers.dll:AssetServiceConnector and +; * OpenSim.Server.Handlers.dll:XInventoryInConnector +; * are started in port 8002, outside the firewall +; * +; * The startup section lists all the connectors to start up in this server +; * instance. This may be only one, or it may be the entire server suite. +; * Multiple connectors should be separated by commas. +; * +; * These are the IN connectors the server uses, the in connectors +; * read this config file and load the needed service and database connectors +; * +; * The full syntax of a connector string is: +; * [[@]/][:] +; * [Startup] -ServiceConnectors = "8003/OpenSim.Server.Handlers.dll:AssetServiceConnector,8003/OpenSim.Server.Handlers.dll:XInventoryInConnector,8002/OpenSim.Server.Handlers.dll:FreeswitchServerConnector,8003/OpenSim.Server.Handlers.dll:GridServiceConnector,8002/OpenSim.Server.Handlers.dll:GridInfoServerInConnector,8003/OpenSim.Server.Handlers.dll:AuthenticationServiceConnector,8002/OpenSim.Server.Handlers.dll:OpenIdServerConnector,8003/OpenSim.Server.Handlers.dll:AvatarServiceConnector,8002/OpenSim.Server.Handlers.dll:LLLoginServiceInConnector,8003/OpenSim.Server.Handlers.dll:PresenceServiceConnector,8003/OpenSim.Server.Handlers.dll:UserAccountServiceConnector,8003/OpenSim.Server.Handlers.dll:GridUserServiceConnector,8003/OpenSim.Server.Handlers.dll:FriendsServiceConnector,8002/OpenSim.Server.Handlers.dll:GatekeeperServiceInConnector,8002/OpenSim.Server.Handlers.dll:UserAgentServerConnector,HGInventoryService@8002/OpenSim.Server.Handlers.dll:XInventoryInConnector,8002/OpenSim.Server.Handlers.dll:AssetServiceConnector" +ServiceConnectors = "8003/OpenSim.Server.Handlers.dll:AssetServiceConnector,8003/OpenSim.Server.Handlers.dll:XInventoryInConnector,8002/OpenSim.Server.Handlers.dll:FreeswitchServerConnector,8003/OpenSim.Server.Handlers.dll:GridServiceConnector,8002/OpenSim.Server.Handlers.dll:GridInfoServerInConnector,8003/OpenSim.Server.Handlers.dll:AuthenticationServiceConnector,8002/OpenSim.Server.Handlers.dll:OpenIdServerConnector,8003/OpenSim.Server.Handlers.dll:AvatarServiceConnector,8002/OpenSim.Server.Handlers.dll:LLLoginServiceInConnector,8003/OpenSim.Server.Handlers.dll:PresenceServiceConnector,8003/OpenSim.Server.Handlers.dll:UserAccountServiceConnector,8003/OpenSim.Server.Handlers.dll:GridUserServiceConnector,8003/OpenSim.Server.Handlers.dll:FriendsServiceConnector,8002/OpenSim.Server.Handlers.dll:GatekeeperServiceInConnector,8002/OpenSim.Server.Handlers.dll:UserAgentServerConnector,HGInventoryService@8002/OpenSim.Server.Handlers.dll:XInventoryInConnector,8002/OpenSim.Server.Handlers.dll:AssetServiceConnector,8002/OpenSim.Server.Handlers.dll:HeloServiceInConnector" ; * This is common for all services, it's the network setup for the entire ; * server instance, if none if specified above @@ -52,8 +62,12 @@ ServiceConnectors = "8003/OpenSim.Server.Handlers.dll:AssetServiceConnector,8003 ; * [GridService] LocalServiceModule = "OpenSim.Services.GridService.dll:GridService" - Realm = "regions" + ; Realm = "regions" ; AllowDuplicateNames = "True" + + ;; Perform distance check for the creation of a linked region + ; Check4096 = "True" + ;; Next, we can specify properties of regions, including default and fallback regions ;; The syntax is: Region_ = "" ;; or: Region_ = "" @@ -68,12 +82,13 @@ ServiceConnectors = "8003/OpenSim.Server.Handlers.dll:AssetServiceConnector,8003 ; * This is the new style authentication service. Currently, only MySQL ; * is implemented. "Realm" is the table that is used for user lookup. -; * By setting it to "users", you can use the old style users table -; * as an authentication source. +; * It defaults to "useraccounts", which uses the new style. +; * Realm = "users" will use the legacy tables as an authentication source ; * [AuthenticationService] ; for the server connector LocalServiceModule = "OpenSim.Services.AuthenticationService.dll:PasswordAuthenticationService" + ; Realm = "useraccounts" [OpenIdService] ; for the server connector @@ -87,7 +102,9 @@ ServiceConnectors = "8003/OpenSim.Server.Handlers.dll:AssetServiceConnector,8003 [UserAccountService] ; for the server connector LocalServiceModule = "OpenSim.Services.UserAccountService.dll:UserAccountService" - ;; These are for creating new accounts by the service + ; Realm = "useraccounts" + + ; These are for creating new accounts by the service AuthenticationService = "OpenSim.Services.AuthenticationService.dll:PasswordAuthenticationService" PresenceService = "OpenSim.Services.PresenceService.dll:PresenceService" GridService = "OpenSim.Services.GridService.dll:GridService" @@ -132,6 +149,9 @@ ServiceConnectors = "8003/OpenSim.Server.Handlers.dll:AssetServiceConnector,8003 WelcomeMessage = "Welcome, Avatar!" AllowRemoteSetLoginLevel = "false" + ; If you run this login server behind a proxy, set this to true + ; HasProxy = true + ; Defaults for the users, if none is specified in the useraccounts table entry (ServiceURLs) ; CHANGE THIS HomeURI = "http://127.0.0.1:8002" @@ -159,32 +179,25 @@ ServiceConnectors = "8003/OpenSim.Server.Handlers.dll:AssetServiceConnector,8003 ; login page: optional: if it exists it will be used to tell the client to use ; this as splash page - ; currently unused ;welcome = http://127.0.0.1/welcome ; helper uri: optional: if it exists if will be used to tell the client to use ; this for all economy related things - ; currently unused ;economy = http://127.0.0.1:9000/ ; web page of grid: optional: page providing further information about your grid - ; currently unused ;about = http://127.0.0.1/about/ ; account creation: optional: page providing further information about obtaining ; a user account on your grid - ; currently unused ;register = http://127.0.0.1/register ; help: optional: page providing further assistance for users of your grid - ; currently unused ;help = http://127.0.0.1/help ; password help: optional: page providing password assistance for users of your grid - ; currently unused ;password = http://127.0.0.1/password - [GatekeeperService] LocalServiceModule = "OpenSim.Services.HypergridService.dll:GatekeeperService" ;; for the service @@ -198,22 +211,34 @@ ServiceConnectors = "8003/OpenSim.Server.Handlers.dll:AssetServiceConnector,8003 ; CHANGE THIS ExternalName = "http://127.0.0.1:8002" - ; Does this grid allow incoming links to any region in it? - ; If false, HG TPs happen only to the Default regions specified in [GridService] section - AllowTeleportsToAnyRegion = true + ; Does this grid allow incoming links to any region in it? + ; If false, HG TPs happen only to the Default regions specified in [GridService] section + AllowTeleportsToAnyRegion = true + + ; If you run this gatekeeper server behind a proxy, set this to true + ; HasProxy = true + [UserAgentService] LocalServiceModule = "OpenSim.Services.HypergridService.dll:UserAgentService" ;; for the service GridUserService = "OpenSim.Services.UserAccountService.dll:GridUserService" GridService = "OpenSim.Services.GridService.dll:GridService" + GatekeeperService = "OpenSim.Services.HypergridService.dll:GatekeeperService" + + ; If you run this user agent server behind a proxy, set this to true + ; HasProxy = true -;; The interface that local users get when they are in other grids. -;; This restricts the inventory operations while in other grids. -;; Still not completely safe, especially if users perform inventory operations -;; while in those grids. The more the user accesses his/her inventory, the more -;; those simulators will know about the user's inventory. + ;; If you separate the UserAgentService from the LoginService, set this to + ;; the IP address of the machine where your LoginService is + ;LoginServerIP = "127.0.0.1" + +; * The interface that local users get when they are in other grids. +; * This restricts the inventory operations while in other grids. +; * Still not completely safe, especially if users perform inventory operations +; * while in those grids. The more the user accesses his/her inventory, the more +; * those simulators will know about the user's inventory. +; * [HGInventoryService] ; For the InventoryServiceInConnector - LocalServiceModule = "OpenSim.Services.InventoryService.dll:HGInventoryService" - + LocalServiceModule = "OpenSim.Services.InventoryService.dll:HGInventoryService" diff --git a/bin/Robust.exe.config b/bin/Robust.exe.config index c2d93c0449..4914f55cb2 100644 --- a/bin/Robust.exe.config +++ b/bin/Robust.exe.config @@ -17,7 +17,7 @@ - + diff --git a/bin/Robust.ini.example b/bin/Robust.ini.example index 96dfc01add..b12e05b398 100644 --- a/bin/Robust.ini.example +++ b/bin/Robust.ini.example @@ -1,16 +1,18 @@ +; * Run +; * $ Robust.exe -inifile Robust.ini +; * + ; * The startup section lists all the connectors to start up in this server ; * instance. This may be only one, or it may be the entire server suite. -; * Multiple connectors should be seaprated by commas. -; * The startup section lists all the connectors to start up in this server -; * instance. This may be only one, or it may be the entire server suite. -; * Multiple connectors should be seaprated by commas. +; * Multiple connectors should be separated by commas. ; * ; * These are the IN connectors the server uses, the in connectors ; * read this config file and load the needed service and database connectors ; * +; * The full syntax of a connector string is: +; * [[@]/][:] ; * [Startup] - ServiceConnectors = "8003/OpenSim.Server.Handlers.dll:AssetServiceConnector,8003/OpenSim.Server.Handlers.dll:XInventoryInConnector,8002/OpenSim.Server.Handlers.dll:FreeswitchServerConnector,8003/OpenSim.Server.Handlers.dll:GridServiceConnector,8002/OpenSim.Server.Handlers.dll:GridInfoServerInConnector,8003/OpenSim.Server.Handlers.dll:AuthenticationServiceConnector,8002/OpenSim.Server.Handlers.dll:OpenIdServerConnector,8003/OpenSim.Server.Handlers.dll:AvatarServiceConnector,8002/OpenSim.Server.Handlers.dll:LLLoginServiceInConnector,8003/OpenSim.Server.Handlers.dll:PresenceServiceConnector,8003/OpenSim.Server.Handlers.dll:UserAccountServiceConnector,8003/OpenSim.Server.Handlers.dll:GridUserServiceConnector,8003/OpenSim.Server.Handlers.dll:FriendsServiceConnector" ; * This is common for all services, it's the network setup for the entire @@ -30,7 +32,6 @@ ServiceConnectors = "8003/OpenSim.Server.Handlers.dll:AssetServiceConnector,8003 StorageProvider = "OpenSim.Data.MySQL.dll" ConnectionString = "Data Source=localhost;Database=opensim;User ID=opensim;Password=*****;Old Guids=true;" - ; * As an example, the below configuration precisely mimicks the legacy ; * asset server. It is read by the asset IN connector (defined above) ; * and it then loads the OUT connector (a local database module). That, @@ -54,24 +55,38 @@ ServiceConnectors = "8003/OpenSim.Server.Handlers.dll:AssetServiceConnector,8003 ; * [GridService] LocalServiceModule = "OpenSim.Services.GridService.dll:GridService" - Realm = "regions" + ; Realm = "regions" ; AllowDuplicateNames = "True" + ;; Next, we can specify properties of regions, including default and fallback regions ;; The syntax is: Region_ = "" ;; or: Region_ = "" ;; where can be DefaultRegion, FallbackRegion, NoDirectLogin, Persistent, LockedOut,Reservation,NoMove,Authenticate - ;; For example: + ;; For example: ; Region_Welcome_Area = "DefaultRegion, FallbackRegion" ; (replace spaces with underscore) ; * This is the configuration for the freeswitch server in grid mode [FreeswitchService] LocalServiceModule = "OpenSim.Services.FreeswitchService.dll:FreeswitchService" + ;; IP of your FS server + ; ServerAddress = 127.0.0.1 + + ;; All other options are - well - optional + ; Realm = "127.0.0.1" + ; SIPProxy = "127.0.0.1:5060" + ; EchoServer = "127.0.0.1" + ; EchoPort = 50505 + ; AttemptSTUN = "false" + ; DefaultTimeout = 5000 + ; Context = "default" + ; UserName = "freeswitch" + ; Password = "password" ; * This is the new style authentication service. Currently, only MySQL ; * is implemented. "Realm" is the table that is used for user lookup. -; * By setting it to "users", you can use the old style users table -; * as an authentication source. +; * It defaults to "users", which uses the legacy tables as an +; * authentication source. ; * [AuthenticationService] ; for the server connector @@ -81,16 +96,18 @@ ServiceConnectors = "8003/OpenSim.Server.Handlers.dll:AssetServiceConnector,8003 ; for the server connector AuthenticationServiceModule = "OpenSim.Services.AuthenticationService.dll:PasswordAuthenticationService" UserAccountServiceModule = "OpenSim.Services.UserAccountService.dll:UserAccountService" - -; * This is the new style user service. -; * "Realm" is the table that is used for user lookup. -; * It defaults to "users", which uses the legacy tables + +; * This is the new style authentication service. Currently, only MySQL +; * is implemented. "Realm" is the table that is used for user lookup. +; * It defaults to "useraccounts", which uses the new style. +; * Realm = "users" will use the legacy tables as an authentication source ; * [UserAccountService] ; for the server connector LocalServiceModule = "OpenSim.Services.UserAccountService.dll:UserAccountService" ; Realm = "useraccounts" - ;; These are for creating new accounts by the service + + ; These are for creating new accounts by the service AuthenticationService = "OpenSim.Services.AuthenticationService.dll:PasswordAuthenticationService" PresenceService = "OpenSim.Services.PresenceService.dll:PresenceService" GridService = "OpenSim.Services.GridService.dll:GridService" @@ -103,6 +120,9 @@ ServiceConnectors = "8003/OpenSim.Server.Handlers.dll:AssetServiceConnector,8003 [PresenceService] ; for the server connector LocalServiceModule = "OpenSim.Services.PresenceService.dll:PresenceService" + ; Set this to true to allow the use of advanced web services and multiple + ; bots using one account + AllowDuplicatePresences = false; [AvatarService] ; for the server connector @@ -137,6 +157,8 @@ ServiceConnectors = "8003/OpenSim.Server.Handlers.dll:AssetServiceConnector,8003 ; For snowglobe's web map ; MapTileURL = ""; + ; If you run this login server behind a proxy, set this to true + ; HasProxy = true [GridInfoService] ; These settings are used to return information on a get_grid_info call. @@ -158,27 +180,21 @@ ServiceConnectors = "8003/OpenSim.Server.Handlers.dll:AssetServiceConnector,8003 ; login page: optional: if it exists it will be used to tell the client to use ; this as splash page - ; currently unused ;welcome = http://127.0.0.1/welcome ; helper uri: optional: if it exists if will be used to tell the client to use ; this for all economy related things - ; currently unused ;economy = http://127.0.0.1:9000/ ; web page of grid: optional: page providing further information about your grid - ; currently unused ;about = http://127.0.0.1/about/ ; account creation: optional: page providing further information about obtaining ; a user account on your grid - ; currently unused ;register = http://127.0.0.1/register ; help: optional: page providing further assistance for users of your grid - ; currently unused ;help = http://127.0.0.1/help ; password help: optional: page providing password assistance for users of your grid - ; currently unused ;password = http://127.0.0.1/password diff --git a/bin/Warp3D.dll b/bin/Warp3D.dll new file mode 100644 index 0000000000..8781a82bab Binary files /dev/null and b/bin/Warp3D.dll differ diff --git a/bin/assets/TexturesAssetSet/0187babf-6c0d-5891-ebed-4ecab1426683.j2c b/bin/assets/TexturesAssetSet/0187babf-6c0d-5891-ebed-4ecab1426683.j2c new file mode 100644 index 0000000000..0e63168bd7 Binary files /dev/null and b/bin/assets/TexturesAssetSet/0187babf-6c0d-5891-ebed-4ecab1426683.j2c differ diff --git a/bin/assets/TexturesAssetSet/058c75c0-a0d5-f2f8-43f3-e9699a89c2fc.j2c b/bin/assets/TexturesAssetSet/058c75c0-a0d5-f2f8-43f3-e9699a89c2fc.j2c new file mode 100644 index 0000000000..e351995de6 Binary files /dev/null and b/bin/assets/TexturesAssetSet/058c75c0-a0d5-f2f8-43f3-e9699a89c2fc.j2c differ diff --git a/bin/assets/TexturesAssetSet/073c9723-540c-5449-cdd4-0e87fdc159e3.j2c b/bin/assets/TexturesAssetSet/073c9723-540c-5449-cdd4-0e87fdc159e3.j2c new file mode 100644 index 0000000000..7cae5cbf14 Binary files /dev/null and b/bin/assets/TexturesAssetSet/073c9723-540c-5449-cdd4-0e87fdc159e3.j2c differ diff --git a/bin/assets/TexturesAssetSet/10d2a01a-0818-84b9-4b96-c2eb63256519.j2c b/bin/assets/TexturesAssetSet/10d2a01a-0818-84b9-4b96-c2eb63256519.j2c new file mode 100644 index 0000000000..a6e213a266 Binary files /dev/null and b/bin/assets/TexturesAssetSet/10d2a01a-0818-84b9-4b96-c2eb63256519.j2c differ diff --git a/bin/assets/TexturesAssetSet/18fb888b-e8f1-dce7-7da7-321d651ea6b0.j2c b/bin/assets/TexturesAssetSet/18fb888b-e8f1-dce7-7da7-321d651ea6b0.j2c new file mode 100644 index 0000000000..a10153010b Binary files /dev/null and b/bin/assets/TexturesAssetSet/18fb888b-e8f1-dce7-7da7-321d651ea6b0.j2c differ diff --git a/bin/assets/TexturesAssetSet/2a4880b6-b7a3-690a-2049-bfbe38eafb9f.j2c b/bin/assets/TexturesAssetSet/2a4880b6-b7a3-690a-2049-bfbe38eafb9f.j2c new file mode 100644 index 0000000000..5361a56f35 Binary files /dev/null and b/bin/assets/TexturesAssetSet/2a4880b6-b7a3-690a-2049-bfbe38eafb9f.j2c differ diff --git a/bin/assets/TexturesAssetSet/2caf1179-7861-6ff3-4b7d-46e17780bdfa.j2c b/bin/assets/TexturesAssetSet/2caf1179-7861-6ff3-4b7d-46e17780bdfa.j2c new file mode 100644 index 0000000000..675bdb4399 Binary files /dev/null and b/bin/assets/TexturesAssetSet/2caf1179-7861-6ff3-4b7d-46e17780bdfa.j2c differ diff --git a/bin/assets/TexturesAssetSet/2d784476-d0db-9979-0cff-9408745a7cf3.j2c b/bin/assets/TexturesAssetSet/2d784476-d0db-9979-0cff-9408745a7cf3.j2c new file mode 100644 index 0000000000..0bc1a4fb5d Binary files /dev/null and b/bin/assets/TexturesAssetSet/2d784476-d0db-9979-0cff-9408745a7cf3.j2c differ diff --git a/bin/assets/TexturesAssetSet/30047cec-269d-408e-0c30-b2603b887268.j2c b/bin/assets/TexturesAssetSet/30047cec-269d-408e-0c30-b2603b887268.j2c new file mode 100644 index 0000000000..3a32fcbb9c Binary files /dev/null and b/bin/assets/TexturesAssetSet/30047cec-269d-408e-0c30-b2603b887268.j2c differ diff --git a/bin/assets/TexturesAssetSet/4726f13e-bd07-f2fb-feb0-bfa2ac58ab61.j2c b/bin/assets/TexturesAssetSet/4726f13e-bd07-f2fb-feb0-bfa2ac58ab61.j2c new file mode 100644 index 0000000000..46eb2da8cf Binary files /dev/null and b/bin/assets/TexturesAssetSet/4726f13e-bd07-f2fb-feb0-bfa2ac58ab61.j2c differ diff --git a/bin/assets/TexturesAssetSet/5894e2e7-ab8d-edfa-e61c-18cf16854ba3.j2c b/bin/assets/TexturesAssetSet/5894e2e7-ab8d-edfa-e61c-18cf16854ba3.j2c new file mode 100644 index 0000000000..34f69c238f Binary files /dev/null and b/bin/assets/TexturesAssetSet/5894e2e7-ab8d-edfa-e61c-18cf16854ba3.j2c differ diff --git a/bin/assets/TexturesAssetSet/5bc11cd6-2f40-071e-a8da-0903394204f9.j2c b/bin/assets/TexturesAssetSet/5bc11cd6-2f40-071e-a8da-0903394204f9.j2c new file mode 100644 index 0000000000..9ac79088d0 Binary files /dev/null and b/bin/assets/TexturesAssetSet/5bc11cd6-2f40-071e-a8da-0903394204f9.j2c differ diff --git a/bin/assets/TexturesAssetSet/64367bd1-697e-b3e6-0b65-3f862a577366.j2c b/bin/assets/TexturesAssetSet/64367bd1-697e-b3e6-0b65-3f862a577366.j2c new file mode 100644 index 0000000000..1650c7866f Binary files /dev/null and b/bin/assets/TexturesAssetSet/64367bd1-697e-b3e6-0b65-3f862a577366.j2c differ diff --git a/bin/assets/TexturesAssetSet/67931331-0c02-4876-1255-28770896c6a2.j2c b/bin/assets/TexturesAssetSet/67931331-0c02-4876-1255-28770896c6a2.j2c new file mode 100644 index 0000000000..3f63493528 Binary files /dev/null and b/bin/assets/TexturesAssetSet/67931331-0c02-4876-1255-28770896c6a2.j2c differ diff --git a/bin/assets/TexturesAssetSet/6c4727b8-ac79-ba44-3b81-f9aa887b47eb.j2c b/bin/assets/TexturesAssetSet/6c4727b8-ac79-ba44-3b81-f9aa887b47eb.j2c new file mode 100644 index 0000000000..adff7dc062 Binary files /dev/null and b/bin/assets/TexturesAssetSet/6c4727b8-ac79-ba44-3b81-f9aa887b47eb.j2c differ diff --git a/bin/assets/TexturesAssetSet/6c9fa78a-1c69-2168-325b-3e03ffa348ce.j2c b/bin/assets/TexturesAssetSet/6c9fa78a-1c69-2168-325b-3e03ffa348ce.j2c new file mode 100644 index 0000000000..e657b96179 Binary files /dev/null and b/bin/assets/TexturesAssetSet/6c9fa78a-1c69-2168-325b-3e03ffa348ce.j2c differ diff --git a/bin/assets/TexturesAssetSet/6de37e4e-7029-61f5-54b8-f5e63f983f58.j2c b/bin/assets/TexturesAssetSet/6de37e4e-7029-61f5-54b8-f5e63f983f58.j2c new file mode 100644 index 0000000000..434ba49d6a Binary files /dev/null and b/bin/assets/TexturesAssetSet/6de37e4e-7029-61f5-54b8-f5e63f983f58.j2c differ diff --git a/bin/assets/TexturesAssetSet/735198cf-6ea0-2550-e222-21d3c6a341ae.j2c b/bin/assets/TexturesAssetSet/735198cf-6ea0-2550-e222-21d3c6a341ae.j2c new file mode 100644 index 0000000000..baedd892cb Binary files /dev/null and b/bin/assets/TexturesAssetSet/735198cf-6ea0-2550-e222-21d3c6a341ae.j2c differ diff --git a/bin/assets/TexturesAssetSet/79504bf5-c3ec-0763-6563-d843de66d0a1.j2c b/bin/assets/TexturesAssetSet/79504bf5-c3ec-0763-6563-d843de66d0a1.j2c new file mode 100644 index 0000000000..134574e48b Binary files /dev/null and b/bin/assets/TexturesAssetSet/79504bf5-c3ec-0763-6563-d843de66d0a1.j2c differ diff --git a/bin/assets/TexturesAssetSet/7a2b3a4a-53c2-53ac-5716-aac7d743c020.j2c b/bin/assets/TexturesAssetSet/7a2b3a4a-53c2-53ac-5716-aac7d743c020.j2c new file mode 100644 index 0000000000..ca37c78258 Binary files /dev/null and b/bin/assets/TexturesAssetSet/7a2b3a4a-53c2-53ac-5716-aac7d743c020.j2c differ diff --git a/bin/assets/TexturesAssetSet/7c0cf89b-44b1-1ce2-dd74-07102a98ac2a.j2c b/bin/assets/TexturesAssetSet/7c0cf89b-44b1-1ce2-dd74-07102a98ac2a.j2c new file mode 100644 index 0000000000..5d556d961a Binary files /dev/null and b/bin/assets/TexturesAssetSet/7c0cf89b-44b1-1ce2-dd74-07102a98ac2a.j2c differ diff --git a/bin/assets/TexturesAssetSet/822ded49-9a6c-f61c-cb89-6df54f42cdf4.j2c b/bin/assets/TexturesAssetSet/822ded49-9a6c-f61c-cb89-6df54f42cdf4.j2c new file mode 100644 index 0000000000..a650bcd474 Binary files /dev/null and b/bin/assets/TexturesAssetSet/822ded49-9a6c-f61c-cb89-6df54f42cdf4.j2c differ diff --git a/bin/assets/TexturesAssetSet/83b77fc6-10b4-63ec-4de7-f40629f238c5.j2c b/bin/assets/TexturesAssetSet/83b77fc6-10b4-63ec-4de7-f40629f238c5.j2c new file mode 100644 index 0000000000..e7771e4c4e Binary files /dev/null and b/bin/assets/TexturesAssetSet/83b77fc6-10b4-63ec-4de7-f40629f238c5.j2c differ diff --git a/bin/assets/TexturesAssetSet/8872f2b8-31db-42d8-580a-b3e4a91262de.j2c b/bin/assets/TexturesAssetSet/8872f2b8-31db-42d8-580a-b3e4a91262de.j2c new file mode 100644 index 0000000000..350b638bb4 Binary files /dev/null and b/bin/assets/TexturesAssetSet/8872f2b8-31db-42d8-580a-b3e4a91262de.j2c differ diff --git a/bin/assets/TexturesAssetSet/8a515889-eac9-fb55-8eba-d2dc09eb32c8.j2c b/bin/assets/TexturesAssetSet/8a515889-eac9-fb55-8eba-d2dc09eb32c8.j2c new file mode 100644 index 0000000000..70821f2637 Binary files /dev/null and b/bin/assets/TexturesAssetSet/8a515889-eac9-fb55-8eba-d2dc09eb32c8.j2c differ diff --git a/bin/assets/TexturesAssetSet/8f458549-173b-23ff-d4ff-bfaa5ea2371b.j2c b/bin/assets/TexturesAssetSet/8f458549-173b-23ff-d4ff-bfaa5ea2371b.j2c new file mode 100644 index 0000000000..881929410c Binary files /dev/null and b/bin/assets/TexturesAssetSet/8f458549-173b-23ff-d4ff-bfaa5ea2371b.j2c differ diff --git a/bin/assets/TexturesAssetSet/92e66e00-f56f-598a-7997-048aa64cde18.j2c b/bin/assets/TexturesAssetSet/92e66e00-f56f-598a-7997-048aa64cde18.j2c new file mode 100644 index 0000000000..287555fc3e Binary files /dev/null and b/bin/assets/TexturesAssetSet/92e66e00-f56f-598a-7997-048aa64cde18.j2c differ diff --git a/bin/assets/TexturesAssetSet/96b4de31-f4fa-337d-ec78-451e3609769e.j2c b/bin/assets/TexturesAssetSet/96b4de31-f4fa-337d-ec78-451e3609769e.j2c new file mode 100644 index 0000000000..4453ecb760 Binary files /dev/null and b/bin/assets/TexturesAssetSet/96b4de31-f4fa-337d-ec78-451e3609769e.j2c differ diff --git a/bin/assets/TexturesAssetSet/99bd60a2-3250-efc9-2e39-2fbcadefbecc.j2c b/bin/assets/TexturesAssetSet/99bd60a2-3250-efc9-2e39-2fbcadefbecc.j2c new file mode 100644 index 0000000000..c965530c0c Binary files /dev/null and b/bin/assets/TexturesAssetSet/99bd60a2-3250-efc9-2e39-2fbcadefbecc.j2c differ diff --git a/bin/assets/TexturesAssetSet/9deab416-9c63-78d6-d558-9a156f12044c.j2c b/bin/assets/TexturesAssetSet/9deab416-9c63-78d6-d558-9a156f12044c.j2c new file mode 100644 index 0000000000..f4e4cba341 Binary files /dev/null and b/bin/assets/TexturesAssetSet/9deab416-9c63-78d6-d558-9a156f12044c.j2c differ diff --git a/bin/assets/TexturesAssetSet/TexturesAssetSet.xml b/bin/assets/TexturesAssetSet/TexturesAssetSet.xml index 1d7f2a469c..5484ee237f 100644 --- a/bin/assets/TexturesAssetSet/TexturesAssetSet.xml +++ b/bin/assets/TexturesAssetSet/TexturesAssetSet.xml @@ -1,4 +1,10 @@ +
+ + + + +
@@ -414,4 +420,320 @@
+ +
+ + + + +
+ +
+ + + + +
+ +
+ + + + +
+ +
+ + + + +
+ +
+ + + + +
+ +
+ + + + +
+ +
+ + + + +
+ +
+ + + + +
+ +
+ + + + +
+ +
+ + + + +
+ +
+ + + + +
+ +
+ + + + +
+ +
+ + + + +
+ +
+ + + + +
+ +
+ + + + +
+ +
+ + + + +
+ +
+ + + + +
+ +
+ + + + +
+ +
+ + + + +
+ +
+ + + + +
+ +
+ + + + +
+ +
+ + + + +
+ +
+ + + + +
+ +
+ + + + +
+ +
+ + + + +
+ +
+ + + + +
+ +
+ + + + +
+ +
+ + + + +
+ +
+ + + + +
+ +
+ + + + +
+ +
+ + + + +
+ +
+ + + + +
+ +
+ + + + +
+ +
+ + + + +
+ +
+ + + + +
+ +
+ + + + +
+ +
+ + + + +
+ +
+ + + + +
+ +
+ + + + +
+ +
+ + + + +
+ +
+ + + + +
+ +
+ + + + +
+ +
+ + + + +
+ + +
+ + + + +
+ +
+ + + + +
diff --git a/bin/assets/TexturesAssetSet/a6162133-724b-54df-a12f-51cd070ad6f3.j2c b/bin/assets/TexturesAssetSet/a6162133-724b-54df-a12f-51cd070ad6f3.j2c new file mode 100644 index 0000000000..9d93153bc5 Binary files /dev/null and b/bin/assets/TexturesAssetSet/a6162133-724b-54df-a12f-51cd070ad6f3.j2c differ diff --git a/bin/assets/TexturesAssetSet/a85ac674-cb75-4af6-9499-df7c5aaf7a28.j2c b/bin/assets/TexturesAssetSet/a85ac674-cb75-4af6-9499-df7c5aaf7a28.j2c new file mode 100644 index 0000000000..aa222571d5 Binary files /dev/null and b/bin/assets/TexturesAssetSet/a85ac674-cb75-4af6-9499-df7c5aaf7a28.j2c differ diff --git a/bin/assets/TexturesAssetSet/ae874d1a-93ef-54fb-5fd3-eb0cb156afc0.j2c b/bin/assets/TexturesAssetSet/ae874d1a-93ef-54fb-5fd3-eb0cb156afc0.j2c new file mode 100644 index 0000000000..61711d2bf2 Binary files /dev/null and b/bin/assets/TexturesAssetSet/ae874d1a-93ef-54fb-5fd3-eb0cb156afc0.j2c differ diff --git a/bin/assets/TexturesAssetSet/b8eed5f0-64b7-6e12-b67f-43fa8e773440.j2c b/bin/assets/TexturesAssetSet/b8eed5f0-64b7-6e12-b67f-43fa8e773440.j2c new file mode 100644 index 0000000000..f1e7a96611 Binary files /dev/null and b/bin/assets/TexturesAssetSet/b8eed5f0-64b7-6e12-b67f-43fa8e773440.j2c differ diff --git a/bin/assets/TexturesAssetSet/ca4e8c27-473c-eb1c-2f5d-50ee3f07d85c.j2c b/bin/assets/TexturesAssetSet/ca4e8c27-473c-eb1c-2f5d-50ee3f07d85c.j2c new file mode 100644 index 0000000000..927af80074 Binary files /dev/null and b/bin/assets/TexturesAssetSet/ca4e8c27-473c-eb1c-2f5d-50ee3f07d85c.j2c differ diff --git a/bin/assets/TexturesAssetSet/cdd9a9fc-6d0b-f90d-8416-c72b6019bca8.j2c b/bin/assets/TexturesAssetSet/cdd9a9fc-6d0b-f90d-8416-c72b6019bca8.j2c new file mode 100644 index 0000000000..d6e52c2066 Binary files /dev/null and b/bin/assets/TexturesAssetSet/cdd9a9fc-6d0b-f90d-8416-c72b6019bca8.j2c differ diff --git a/bin/assets/TexturesAssetSet/d21e44ca-ff1c-a96e-b2ef-c0753426b7d9.j2c b/bin/assets/TexturesAssetSet/d21e44ca-ff1c-a96e-b2ef-c0753426b7d9.j2c new file mode 100644 index 0000000000..909f9f972d Binary files /dev/null and b/bin/assets/TexturesAssetSet/d21e44ca-ff1c-a96e-b2ef-c0753426b7d9.j2c differ diff --git a/bin/assets/TexturesAssetSet/d691a01c-13b7-578d-57c0-5caef0b4e7e1.j2c b/bin/assets/TexturesAssetSet/d691a01c-13b7-578d-57c0-5caef0b4e7e1.j2c new file mode 100644 index 0000000000..493a097123 Binary files /dev/null and b/bin/assets/TexturesAssetSet/d691a01c-13b7-578d-57c0-5caef0b4e7e1.j2c differ diff --git a/bin/assets/TexturesAssetSet/d9258671-868f-7511-c321-7baef9e948a4.j2c b/bin/assets/TexturesAssetSet/d9258671-868f-7511-c321-7baef9e948a4.j2c new file mode 100644 index 0000000000..d343f63d76 Binary files /dev/null and b/bin/assets/TexturesAssetSet/d9258671-868f-7511-c321-7baef9e948a4.j2c differ diff --git a/bin/assets/TexturesAssetSet/db9d39ec-a896-c287-1ced-64566217021e.j2c b/bin/assets/TexturesAssetSet/db9d39ec-a896-c287-1ced-64566217021e.j2c new file mode 100644 index 0000000000..c11984bf63 Binary files /dev/null and b/bin/assets/TexturesAssetSet/db9d39ec-a896-c287-1ced-64566217021e.j2c differ diff --git a/bin/assets/TexturesAssetSet/default_alpha.jp2 b/bin/assets/TexturesAssetSet/default_alpha.jp2 new file mode 100644 index 0000000000..af73c1ed01 Binary files /dev/null and b/bin/assets/TexturesAssetSet/default_alpha.jp2 differ diff --git a/bin/assets/TexturesAssetSet/e569711a-27c2-aad4-9246-0c910239a179.j2c b/bin/assets/TexturesAssetSet/e569711a-27c2-aad4-9246-0c910239a179.j2c new file mode 100644 index 0000000000..9be14d4756 Binary files /dev/null and b/bin/assets/TexturesAssetSet/e569711a-27c2-aad4-9246-0c910239a179.j2c differ diff --git a/bin/assets/TexturesAssetSet/f2d7b6f6-4200-1e9a-fd5b-96459e950f94.j2c b/bin/assets/TexturesAssetSet/f2d7b6f6-4200-1e9a-fd5b-96459e950f94.j2c new file mode 100644 index 0000000000..cb8a0cbd9c Binary files /dev/null and b/bin/assets/TexturesAssetSet/f2d7b6f6-4200-1e9a-fd5b-96459e950f94.j2c differ diff --git a/bin/assets/TexturesAssetSet/fb2ae204-3fd1-df33-594f-c9f882830e66.j2c b/bin/assets/TexturesAssetSet/fb2ae204-3fd1-df33-594f-c9f882830e66.j2c new file mode 100644 index 0000000000..2db8517045 Binary files /dev/null and b/bin/assets/TexturesAssetSet/fb2ae204-3fd1-df33-594f-c9f882830e66.j2c differ diff --git a/bin/assets/TexturesAssetSet/licenses.txt b/bin/assets/TexturesAssetSet/licenses.txt index 5d34424791..f34d26f89e 100644 --- a/bin/assets/TexturesAssetSet/licenses.txt +++ b/bin/assets/TexturesAssetSet/licenses.txt @@ -35,3 +35,25 @@ A few of the wood textures were created by me using Wood Workshop. These I donat The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + +6. From Second Life(TM) Viewer Artwork. Copyright (C) 2008 Linden Research, Inc. + +Linden Research, Inc. ("Linden Lab") licenses the Second Life viewer +artwork and other works in the files distributed with this Notice under +the Creative Commons Attribution-Share Alike 3.0 License, available at +http://creativecommons.org/licenses/by- sa/3.0/legalcode. For the license +summary, see http://creativecommons.org/licenses/by-sa/3.0/. + +Notwithstanding the foregoing, all of Linden Lab's trademarks, including +but not limited to the Second Life brand name and Second Life Eye-in-Hand +logo, are subject to our trademark policy at +http://secondlife.com/corporate/trademark/. + +If you distribute any copies or adaptations of the Second Life viewer +artwork or any other works in these files, you must include this Notice +and clearly identify any changes made to the original works. Include +this Notice and information where copyright notices are usually included, +for example, after your own copyright notice acknowledging your use of +the Second Life viewer artwork, in a text file distributed with your +program, in your application's About window, or on a credits page for +your work. diff --git a/bin/config-include/CenomeCache.ini.example b/bin/config-include/CenomeCache.ini.example index c7c901b125..8ef4e03bdc 100644 --- a/bin/config-include/CenomeCache.ini.example +++ b/bin/config-include/CenomeCache.ini.example @@ -2,12 +2,12 @@ ;; ;; Options for CenmoeAssetCache ;; - + ; 256 MB (default: 134217728) MaxSize = 268435456 - + ; How many assets it is possible to store cache (default: 4096) MaxCount = 16384 - + ; Expiration time - 1 hour (default: 30 minutes) ExpirationTime = 60 diff --git a/bin/config-include/FlotsamCache.ini.example b/bin/config-include/FlotsamCache.ini.example index b50d7ec946..026dee718d 100644 --- a/bin/config-include/FlotsamCache.ini.example +++ b/bin/config-include/FlotsamCache.ini.example @@ -2,7 +2,7 @@ ;; ;; Options for FlotsamAssetCache ;; - + ; cache directory can be shared by multiple instances CacheDirectory = ./assetcache ; Other examples: @@ -34,9 +34,9 @@ ; How often {in hours} should the disk be checked for expired filed ; Specify 0 to disable expiration checking FileCleanupTimer = .166 ;roughly every 10 minutes - - ; If WAIT_ON_INPROGRESS_REQUESTS has been defined then this specifies how - ; long (in miliseconds) to block a request thread while trying to complete + + ; If WAIT_ON_INPROGRESS_REQUESTS has been defined then this specifies how + ; long (in miliseconds) to block a request thread while trying to complete ; an existing write to disk. ; WaitOnInprogressTimeout = 3000 @@ -50,10 +50,10 @@ ; Warning level for cache directory size ;CacheWarnAt = 30000 - - ; Perform a deep scan of all assets within all regions, looking for all assets - ; present or referenced. Mark all assets found that are already present in the - ; cache, and request all assets that are found that are not already cached (this - ; will cause those assets to be cached) - ; - ; DeepScanBeforePurge = false + + ; Perform a deep scan of all assets within all regions, looking for all assets + ; present or referenced. Mark all assets found that are already present in the + ; cache, and request all assets that are found that are not already cached (this + ; will cause those assets to be cached) + ; + ; DeepScanBeforePurge = false diff --git a/bin/config-include/Grid.ini b/bin/config-include/Grid.ini index 9a75f19845..5624a380d3 100644 --- a/bin/config-include/Grid.ini +++ b/bin/config-include/Grid.ini @@ -14,19 +14,24 @@ AvatarServices = "RemoteAvatarServicesConnector" NeighbourServices = "RemoteNeighbourServicesConnector" AuthenticationServices = "RemoteAuthenticationServicesConnector" - AuthorizationServices = "RemoteAuthorizationServicesConnector" PresenceServices = "RemotePresenceServicesConnector" UserAccountServices = "RemoteUserAccountServicesConnector" GridUserServices = "RemoteGridUserServicesConnector" SimulationServices = "RemoteSimulationConnectorModule" EntityTransferModule = "BasicEntityTransferModule" InventoryAccessModule = "BasicInventoryAccessModule" + LandServices = "RemoteLandServicesConnector" LandServiceInConnector = true NeighbourServiceInConnector = true SimulationServiceInConnector = true LibraryModule = true +[SimulationDataStore] + LocalServiceModule = "OpenSim.Services.Connectors.dll:SimulationDataService" + +[EstateDataStore] + LocalServiceModule = "OpenSim.Services.Connectors.dll:EstateDataService" [GridService] LocalServiceModule = "OpenSim.Services.GridService.dll:GridService" diff --git a/bin/config-include/GridCommon.ini.example b/bin/config-include/GridCommon.ini.example index a19591bfaa..cb771b8d52 100644 --- a/bin/config-include/GridCommon.ini.example +++ b/bin/config-include/GridCommon.ini.example @@ -1,3 +1,24 @@ +[DatabaseService] + ; + ; ### Choose the DB + ; + + ; SQLite + Include-Storage = "config-include/storage/SQLiteStandalone.ini"; + + ; Unfortunately the current SQLite database plugin is not compatible with Mac OSX. You can still use the older + ; legacy sqlite library if you are using Mono 2.4. Please see the notes in OpenSim.ini (search for sqlite) + ; for more details + ;Include-Storage = "config-include/storage/SQLiteLegacyStandalone.ini"; + + ; MySql + ; Uncomment these lines if you want to use mysql storage + ; Change the connection string to your db details + ;StorageProvider = "OpenSim.Data.MySQL.dll" + ;ConnectionString = "Data Source=localhost;Database=opensim;User ID=opensim;Password=***;" + ; Uncomment this line if you are using MySQL and want to use a different database for estates + ;EstateConnectionString = "Data Source=localhost;Database=opensim;User ID=opensim;Password=***;" + [AssetService] DefaultAssetLoader = "OpenSim.Framework.AssetLoader.Filesystem.dll" @@ -60,15 +81,18 @@ [Modules] ;; Choose 0 or 1 cache modules, and the corresponding config file, if it exists. ;; Copy the config .example file into your own .ini file and change configs there - + AssetCaching = "FlotsamAssetCache" Include-FlotsamCache = "config-include/FlotsamCache.ini" ;AssetCaching = "CenomeMemoryAssetCache" ;Include-CenomeCache = "config-include/CenomeCache.ini" - + ;AssetCaching = "GlynnTuckerAssetCache" ;; Optionally, the port for the LLProxyLoginModule module can be changed - + ;Setup_LLProxyLoginModule = "9090/" + + ;; Authorization is not on by default, as it depends on external php + ;AuthorizationServices = "RemoteAuthorizationServicesConnector" diff --git a/bin/config-include/GridHypergrid.ini b/bin/config-include/GridHypergrid.ini index ab29018084..409b2a9760 100644 --- a/bin/config-include/GridHypergrid.ini +++ b/bin/config-include/GridHypergrid.ini @@ -17,19 +17,25 @@ AvatarServices = "RemoteAvatarServicesConnector" NeighbourServices = "RemoteNeighbourServicesConnector" AuthenticationServices = "RemoteAuthenticationServicesConnector" - AuthorizationServices = "RemoteAuthorizationServicesConnector" PresenceServices = "RemotePresenceServicesConnector" UserAccountServices = "RemoteUserAccountServicesConnector" GridUserServices = "RemoteGridUserServicesConnector" SimulationServices = "RemoteSimulationConnectorModule" EntityTransferModule = "HGEntityTransferModule" InventoryAccessModule = "HGInventoryAccessModule" + LandServices = "RemoteLandServicesConnector" LandServiceInConnector = true NeighbourServiceInConnector = true SimulationServiceInConnector = true LibraryModule = true +[SimulationDataStore] + LocalServiceModule = "OpenSim.Services.Connectors.dll:SimulationDataService" + +[EstateDataStore] + LocalServiceModule = "OpenSim.Services.Connectors.dll:EstateDataService" + [AssetService] LocalGridAssetService = "OpenSim.Services.Connectors.dll:AssetServicesConnector" HypergridAssetService = "OpenSim.Services.Connectors.dll:HGAssetServiceConnector" diff --git a/bin/config-include/HyperSimianGrid.ini b/bin/config-include/HyperSimianGrid.ini new file mode 100644 index 0000000000..29b51deacd --- /dev/null +++ b/bin/config-include/HyperSimianGrid.ini @@ -0,0 +1,83 @@ +;; +;; Please don't change this file. +;; All optional settings are in GridCommon.ini.example, +;; which you can copy and change. +;; + +;; +;; In GridCommon.ini, these are the URLs you would use if SimianGrid is +;; installed at http://www.mygrid.com/Grid/ +;; +; AssetServerURI = "http://www.mygrid.com/Grid/?id=" +; InventoryServerURI = "http://www.mygrid.com/Grid/" +; AvatarServerURI = "http://www.mygrid.com/Grid/" +; PresenceServerURI = "http://www.mygrid.com/Grid/" +; UserAccountServerURI = "http://www.mygrid.com/Grid/" +; AuthenticationServerURI = "http://www.mygrid.com/Grid/" +; FriendsServerURI = "http://www.mygrid.com/Grid/" +; GroupsServerURI = "http://www.mygrid.com/Grid/" + +[Includes] + Include-Common = "config-include/GridCommon.ini" + +[Modules] + GridServices = "SimianGridServiceConnector" + PresenceServices = "SimianPresenceServiceConnector" + UserAccountServices = "SimianUserAccountServiceConnector" + AuthenticationServices = "SimianAuthenticationServiceConnector" + AssetServices = "HGAssetBroker" + InventoryServices = "HGInventoryBroker" + AvatarServices = "SimianAvatarServiceConnector" + + NeighbourServices = "RemoteNeighbourServicesConnector" + SimulationServices = "RemoteSimulationConnectorModule" + EntityTransferModule = "HGEntityTransferModule" + InventoryAccessModule = "HGInventoryAccessModule" + + LandServiceInConnector = true + NeighbourServiceInConnector = true + SimulationServiceInConnector = true + LibraryModule = false + + AssetCaching = "FlotsamAssetCache" + +[SimulationDataStore] + LocalServiceModule = "OpenSim.Services.Connectors.dll:SimulationDataService" + +[EstateDataStore] + LocalServiceModule = "OpenSim.Services.Connectors.dll:EstateDataService" + +[Friends] + Connector = "OpenSim.Services.Connectors.dll:SimianFriendsServiceConnector" + +[GridService] + LocalServiceModule = "OpenSim.Services.GridService.dll:GridService" + StorageProvider = "OpenSim.Data.Null.dll:NullRegionData" + + AllowHypergridMapSearch = true + +[LibraryService] + LocalServiceModule = "OpenSim.Services.InventoryService.dll:LibraryService" + LibraryName = "OpenSim Library" + DefaultLibrary = "./inventory/Libraries.xml" + +[AssetService] + DefaultAssetLoader = "OpenSim.Framework.AssetLoader.Filesystem.dll" + LocalGridAssetService = "OpenSim.Services.Connectors.dll:SimianAssetServiceConnector" + HypergridAssetService = "OpenSim.Services.Connectors.dll:HGAssetServiceConnector" + AssetLoaderArgs = "assets/AssetSets.xml" + +[InventoryService] + LocalGridInventoryService = "OpenSim.Services.Connectors.dll:SimianInventoryServiceConnector" + +[Groups] + Enabled = true + Module = GroupsModule + DebugEnabled = false + NoticesEnabled = true + MessagingModule = GroupsMessagingModule + MessagingEnabled = true + ServicesConnectorModule = SimianGroupsServicesConnector + +[Profiles] + Module = "SimianProfiles" diff --git a/bin/config-include/Standalone.ini b/bin/config-include/Standalone.ini index 6b7dc50b7f..6355d09041 100644 --- a/bin/config-include/Standalone.ini +++ b/bin/config-include/Standalone.ini @@ -17,9 +17,16 @@ AvatarServices = "LocalAvatarServicesConnector" EntityTransferModule = "BasicEntityTransferModule" InventoryAccessModule = "BasicInventoryAccessModule" - - LibraryModule = true - LLLoginServiceInConnector = true + + LibraryModule = true + LLLoginServiceInConnector = true + GridInfoServiceInConnector = true + +[SimulationDataStore] + LocalServiceModule = "OpenSim.Services.Connectors.dll:SimulationDataService" + +[EstateDataStore] + LocalServiceModule = "OpenSim.Services.Connectors.dll:EstateDataService" [AssetService] LocalServiceModule = "OpenSim.Services.AssetService.dll:AssetService" @@ -28,9 +35,9 @@ LocalServiceModule = "OpenSim.Services.InventoryService.dll:XInventoryService" [LibraryService] - LocalServiceModule = "OpenSim.Services.InventoryService.dll:LibraryService" - LibraryName = "OpenSim Library" - DefaultLibrary = "./inventory/Libraries.xml" + LocalServiceModule = "OpenSim.Services.InventoryService.dll:LibraryService" + LibraryName = "OpenSim Library" + DefaultLibrary = "./inventory/Libraries.xml" [AvatarService] LocalServiceModule = "OpenSim.Services.AvatarService.dll:AvatarService" @@ -71,7 +78,7 @@ [LoginService] LocalServiceModule = "OpenSim.Services.LLLoginService.dll:LLLoginService" UserAccountService = "OpenSim.Services.UserAccountService.dll:UserAccountService" - GridUserService = "OpenSim.Services.UserAccountService.dll:GridUserService" + GridUserService = "OpenSim.Services.UserAccountService.dll:GridUserService" AuthenticationService = "OpenSim.Services.AuthenticationService.dll:PasswordAuthenticationService" InventoryService = "OpenSim.Services.InventoryService.dll:XInventoryService" PresenceService = "OpenSim.Services.PresenceService.dll:PresenceService" @@ -81,7 +88,6 @@ WelcomeMessage = "Welcome, Avatar!" - ;; This should always be the very last thing on this file [Includes] Include-Common = "config-include/StandaloneCommon.ini" diff --git a/bin/config-include/StandaloneCommon.ini.example b/bin/config-include/StandaloneCommon.ini.example index de8677f111..1fcf043ea2 100644 --- a/bin/config-include/StandaloneCommon.ini.example +++ b/bin/config-include/StandaloneCommon.ini.example @@ -13,11 +13,13 @@ ; for more details ;Include-Storage = "config-include/storage/SQLiteLegacyStandalone.ini"; - ; MySql - ; Uncomment these lines if you want to use mysql storage + ; MySql + ; Uncomment these lines if you want to use mysql storage ; Change the connection string to your db details ;StorageProvider = "OpenSim.Data.MySQL.dll" ;ConnectionString = "Data Source=localhost;Database=opensim;User ID=opensim;Password=***;Old Guids=true;" + ; Uncomment this line if you are using MySQL and want to use a different database for estates + ;EstateConnectionString = "Data Source=localhost;Database=opensim;User ID=opensim;Password=***;Old Guids=true;" [AssetService] DefaultAssetLoader = "OpenSim.Framework.AssetLoader.Filesystem.dll" @@ -26,9 +28,9 @@ [Modules] ;; Choose 0 or 1 cache modules, and the corresponding config file, if it exists. ;; Copy the config .example file into your own .ini file and change configs there - + ;AssetCaching = "GlynnTuckerAssetCache" - + ;AssetCaching = "FlotsamAssetCache" ;Include-FlotsamCache = "config-include/FlotsamCache.ini" @@ -38,15 +40,21 @@ ;; Enable this to use Freeswitch on a standalone ;FreeswitchServiceInConnector = True + ;; Authorization is not on by default, as it depends on external php + ;AuthorizationServices = "LocalAuthorizationServicesConnector" + [FreeswitchService] ;; Configuration for the freeswitch service goes here LocalServiceModule = "OpenSim.Services.FreeswitchService.dll:FreeswitchService" [GridService] ;; For in-memory region storage (default) - StorageProvider = "OpenSim.Data.Null.dll:NullRegionData" + StorageProvider = "OpenSim.Data.Null.dll:NullRegionData" ;;--- For MySql region storage (alternative) - ;StorageProvider = "OpenSim.Data.MySQL.dll:MySqlRegionData" + ;StorageProvider = "OpenSim.Data.MySQL.dll:MySqlRegionData" + + ;; With hypergrid, perform distance check for the creation of a linked region + ; Check4096 = true ;; Next, we can specify properties of regions, including default and fallback regions ;; The syntax is: Region_ = "" @@ -57,7 +65,7 @@ [LibraryModule] ; Set this if you want to change the name of the OpenSim Library ;LibraryName = "My World's Library" - + [LoginService] WelcomeMessage = "Welcome, Avatar!" @@ -69,7 +77,51 @@ [GatekeeperService] ExternalName = "http://127.0.0.1:9000" - ; Does this grid allow incoming links to any region in it? - ; If false, HG TPs happen only to the Default regions specified in [GridService] section - AllowTeleportsToAnyRegion = true + ; Does this grid allow incoming links to any region in it? + ; If false, HG TPs happen only to the Default regions specified in [GridService] section + AllowTeleportsToAnyRegion = true +[GridInfoService] + ; These settings are used to return information on a get_grid_info call. + ; Client launcher scripts and third-party clients make use of this to + ; autoconfigure the client and to provide a nice user experience. If you + ; want to facilitate that, you should configure the settings here according + ; to your grid or standalone setup. + ; + ; See http://opensimulator.org/wiki/GridInfo + + ; login uri: for grid this is the login server URI + login = http://127.0.0.1:9000/ + + ; long grid name: the long name of your grid + gridname = "the lost continent of hippo" + + ; short grid name: the short name of your grid + gridnick = "hippogrid" + + ; login page: optional: if it exists it will be used to tell the client to use + ; this as splash page + ; currently unused + ;welcome = http://127.0.0.1/welcome + + ; helper uri: optional: if it exists if will be used to tell the client to use + ; this for all economy related things + ; currently unused + ;economy = http://127.0.0.1:9000/ + + ; web page of grid: optional: page providing further information about your grid + ; currently unused + ;about = http://127.0.0.1/about/ + + ; account creation: optional: page providing further information about obtaining + ; a user account on your grid + ; currently unused + ;register = http://127.0.0.1/register + + ; help: optional: page providing further assistance for users of your grid + ; currently unused + ;help = http://127.0.0.1/help + + ; password help: optional: page providing password assistance for users of your grid + ; currently unused + ;password = http://127.0.0.1/password diff --git a/bin/config-include/StandaloneHypergrid.ini b/bin/config-include/StandaloneHypergrid.ini index e87270d7e8..f164d33e1e 100644 --- a/bin/config-include/StandaloneHypergrid.ini +++ b/bin/config-include/StandaloneHypergrid.ini @@ -27,9 +27,16 @@ NeighbourServiceInConnector = true LibraryModule = true LLLoginServiceInConnector = true + GridInfoServiceInConnector = true AuthenticationServiceInConnector = true SimulationServiceInConnector = true +[SimulationDataStore] + LocalServiceModule = "OpenSim.Services.Connectors.dll:SimulationDataService" + +[EstateDataStore] + LocalServiceModule = "OpenSim.Services.Connectors.dll:EstateDataService" + [AssetService] LocalServiceModule = "OpenSim.Services.AssetService.dll:AssetService" @@ -114,6 +121,8 @@ ;; for the service GridUserService = "OpenSim.Services.UserAccountService.dll:GridUserService" GridService = "OpenSim.Services.GridService.dll:GridService" + GatekeeperService = "OpenSim.Services.HypergridService.dll:GatekeeperService" + ;; The interface that local users get when they are in other grids ;; This greatly restricts the inventory operations while in other grids diff --git a/bin/config-include/storage/SQLiteLegacyStandalone.ini b/bin/config-include/storage/SQLiteLegacyStandalone.ini index 1d4dd29d60..ffe9a70ca8 100644 --- a/bin/config-include/storage/SQLiteLegacyStandalone.ini +++ b/bin/config-include/storage/SQLiteLegacyStandalone.ini @@ -2,6 +2,10 @@ [DatabaseService] StorageProvider = "OpenSim.Data.SQLiteLegacy.dll" + ConnectionString = "URI=file:OpenSim.db,version=3,UseUTF16Encoding=True" + +[AssetService] + ConnectionString = "URI=file:Asset.db,version=3" [AvatarService] ConnectionString = "URI=file:avatars.db,version=3" diff --git a/bin/config-include/storage/SQLiteStandalone.ini b/bin/config-include/storage/SQLiteStandalone.ini index fe814d7022..c1de71aa21 100644 --- a/bin/config-include/storage/SQLiteStandalone.ini +++ b/bin/config-include/storage/SQLiteStandalone.ini @@ -2,6 +2,10 @@ [DatabaseService] StorageProvider = "OpenSim.Data.SQLite.dll" + ConnectionString = "URI=file:OpenSim.db,version=3,UseUTF16Encoding=True" + +[AssetService] + ConnectionString = "URI=file:Asset.db,version=3" [InventoryService] ;ConnectionString = "URI=file:inventory.db,version=3" diff --git a/bin/zlib.net.dll b/bin/zlib.net.dll new file mode 100644 index 0000000000..9d156547f3 Binary files /dev/null and b/bin/zlib.net.dll differ diff --git a/prebuild.xml b/prebuild.xml index c23770502b..007a5e2e45 100644 --- a/prebuild.xml +++ b/prebuild.xml @@ -1,6 +1,6 @@ - - - + + + TRACE;DEBUG @@ -9,7 +9,7 @@ false 4 false - + bin true true @@ -24,7 +24,7 @@ false 4 false - + bin false true @@ -71,23 +71,23 @@ - - - - - + + + + + - + - - - - - - + + + + + + @@ -108,10 +108,10 @@ - - + + - + @@ -158,17 +158,17 @@ - - - - - + + + + + - - - - + + + + @@ -190,9 +190,9 @@ ../../../bin/ - - - + + + @@ -216,9 +216,9 @@ ../../../bin/ - - - + + + @@ -242,16 +242,16 @@ - - - + + + - - + + - + @@ -270,8 +270,8 @@ ../../../../bin/ - - + + @@ -295,13 +295,13 @@ ../../../../bin/ - - + + - + @@ -324,9 +324,9 @@ - - - + + + @@ -347,12 +347,12 @@ ../../../../bin/ - - + + - - + + @@ -373,11 +373,11 @@ ../../../../bin/ - - + + - + @@ -403,11 +403,11 @@ - - - - - + + + + + @@ -429,13 +429,13 @@ ../../../../bin/ - - + + - - - + + + @@ -457,9 +457,9 @@ ../../../../bin/ - - - + + + @@ -481,8 +481,8 @@ ../../../../bin/ - - + + @@ -504,12 +504,12 @@ ../../../../bin/ - - - + + + - + @@ -530,13 +530,13 @@ ../../../../bin/ - - + + - - + + @@ -559,14 +559,14 @@ ../../../../bin/ - - + + - - - + + + @@ -588,14 +588,16 @@ ../../../../bin/ - - - - + + + + + - + + @@ -616,14 +618,14 @@ ../../../../bin/ - - + + - - - + + + @@ -644,14 +646,14 @@ ../../../bin/ - - - + + + - - + + @@ -680,16 +682,17 @@ - + + - - + + - + @@ -711,26 +714,26 @@ - + - - + + - - - - + + + + - + @@ -753,14 +756,14 @@ - - - + + + - + @@ -768,16 +771,16 @@ - + - - - - + + + + - + @@ -803,13 +806,13 @@ - - + + - - + + @@ -830,13 +833,13 @@ ../../../bin/ - - + + - - + + @@ -858,16 +861,16 @@ ../../../bin/ - - + + - - + + @@ -889,16 +892,16 @@ ../../../bin/ - - + + - - + + @@ -919,22 +922,25 @@ ../../../bin/ + - - - - + + + + - - - - + + + + + + @@ -955,8 +961,8 @@ ../../../bin/ - - + + @@ -964,8 +970,8 @@ - - + + @@ -986,8 +992,8 @@ ../../../bin/ - - + + @@ -995,8 +1001,8 @@ - - + + @@ -1017,8 +1023,9 @@ ../../../bin/ - - + + + @@ -1026,8 +1033,8 @@ - - + + @@ -1048,8 +1055,8 @@ ../../../bin/ - - + + @@ -1057,8 +1064,8 @@ - - + + @@ -1079,9 +1086,10 @@ ../../../bin/ + - - + + @@ -1090,8 +1098,8 @@ - - + + @@ -1112,8 +1120,8 @@ ../../../bin/ - - + + @@ -1121,8 +1129,8 @@ - - + + @@ -1143,8 +1151,8 @@ ../../../bin/ - - + + @@ -1152,8 +1160,8 @@ - - + + @@ -1175,8 +1183,8 @@ ../../../bin/ - - + + @@ -1185,8 +1193,8 @@ - - + + @@ -1208,6 +1216,7 @@ ../../../bin/ + @@ -1216,11 +1225,11 @@ - - - - - + + + + + @@ -1242,8 +1251,8 @@ ../../../bin/ - - + + @@ -1252,8 +1261,8 @@ - - + + @@ -1277,23 +1286,23 @@ - - - + + + - + - - - - + + + + - + @@ -1314,20 +1323,20 @@ ../../bin/ - - - + + + - - + + - + @@ -1347,19 +1356,19 @@ ../../bin/ - - - + + + - - + + - + @@ -1368,11 +1377,13 @@ ../../../bin/ + true ../../../bin/ + true @@ -1380,23 +1391,25 @@ + - - - - - + + + + + + - - - - - - - + + + + + + + @@ -1404,51 +1417,27 @@ - + - + - - - + + + - + - + - - + - + - - - - ../../../../../../bin/Terrain/ - - - - - ../../../../../../bin/Terrain/ - - - - ../../../../../../bin/ - - - - - - - - - - @@ -1466,40 +1455,40 @@ - - - - + + + + - - - + + + - - - - - - + + + + + + - + - - - + + + - + - + @@ -1518,26 +1507,26 @@ ../../../bin/ - - + + - - - + + + - - - + + + - + - - + + @@ -1556,7 +1545,7 @@ ../../../bin/ - + @@ -1567,9 +1556,9 @@ - - - + + + @@ -1593,9 +1582,9 @@ - - - + + + @@ -1606,12 +1595,12 @@ - - - - - - + + + + + + @@ -1635,11 +1624,11 @@ - + - + @@ -1662,10 +1651,10 @@ ../../../bin/ - - - - + + + + @@ -1677,9 +1666,10 @@ - - - + + + + @@ -1699,11 +1689,11 @@ ../../../bin/ - + - - + + @@ -1713,11 +1703,11 @@ - + - + @@ -1734,8 +1724,8 @@ ../../../bin/ - - + + @@ -1743,11 +1733,11 @@ - + - + @@ -1764,14 +1754,14 @@ ../../../bin/ - + - - - - - + + + + + @@ -1782,17 +1772,16 @@ - + - + - + ../../../bin/ @@ -1805,12 +1794,12 @@ ../../../bin/ - + - - - + + + @@ -1820,15 +1809,14 @@ - + - + ../../../../bin/ @@ -1841,12 +1829,12 @@ ../../../../bin/ - + - - - + + + @@ -1857,16 +1845,15 @@ - + - + - + ../../../../bin/ @@ -1879,14 +1866,14 @@ ../../../../bin/ - + - - - - + + + + @@ -1898,11 +1885,11 @@ - + - + @@ -1935,11 +1922,11 @@ - - - - - + + + + + @@ -1959,13 +1946,13 @@ ../../../../bin/ - - + + - - + + @@ -1987,17 +1974,17 @@ ../../../bin/ - - + + - - + + - + @@ -2005,38 +1992,6 @@ - - - - ../../../bin/ - - - - - ../../../bin/ - - - - ../../../bin/ - - - - - - - - - - - - - - - - - - - @@ -2051,8 +2006,8 @@ ../../../bin/ - - + + @@ -2061,8 +2016,8 @@ - - + + @@ -2082,26 +2037,26 @@ ../../../bin/ - - + + - - + + - + - + - + @@ -2127,21 +2082,21 @@ - - - + + + - - + + - - + + - - - + + + @@ -2166,16 +2121,16 @@ - - - - + + + + - - - + + + @@ -2195,25 +2150,25 @@ - + - - - - - + + + + + - - + + - - - + + + @@ -2238,19 +2193,22 @@ - - + + + + + - - + + - - + + - - - + + + @@ -2273,18 +2231,18 @@ - - + + - - + + - - - - + + + + @@ -2311,18 +2269,18 @@ - - + + - - + + - - - - + + + + @@ -2346,17 +2304,17 @@ - - + + - + - - - - + + + + @@ -2380,22 +2338,22 @@ - - - + + + - - - + + + - - - - + + + + @@ -2416,20 +2374,20 @@ ../../../../../bin/ - - + + - - - - - - + + + + + + - + @@ -2451,22 +2409,22 @@ - - + + - - + + - - - - + + + + @@ -2490,27 +2448,27 @@ - - - + + + - - + + - - - + + + - + - + @@ -2535,32 +2493,32 @@ - - - + + + - - - + + + - + - + - - - + + + - + @@ -2581,12 +2539,12 @@ ../../../bin/ - - + + - - + + @@ -2607,13 +2565,13 @@ ../../../bin/ - - + + - - + + @@ -2635,8 +2593,8 @@ ../../../bin/ - - + + @@ -2658,13 +2616,13 @@ ../../bin/ - - + + - - + + @@ -2686,13 +2644,13 @@ ../../../../bin/ - - + + - - - - + + + + @@ -2713,13 +2671,13 @@ ../../../../bin/ - - + + - - - - + + + + @@ -2740,13 +2698,13 @@ ../../../../bin/ - - + + - - - - + + + + @@ -2772,11 +2730,11 @@ - - - - - + + + + + @@ -2794,6 +2752,28 @@ + + + + ../../bin/ + + + + + ../../bin/ + + + + ../../bin/ + + + + + + + + + @@ -2812,27 +2792,27 @@ - - + + - - - - + + + + - - + + - + @@ -2853,16 +2833,16 @@ - - - - + + + + - - + + @@ -2882,16 +2862,16 @@ ../../../../bin/ - - - + + + - - + + @@ -2919,9 +2899,9 @@ - - - + + + @@ -2943,10 +2923,11 @@ ../../../bin/ + - - + + @@ -2962,15 +2943,15 @@ - - + + - + - - - + + + - - - - - - - - + + + + + + + + @@ -3008,8 +2989,8 @@ - - + + @@ -3025,15 +3006,15 @@ - - + + - + - - - + + + - + @@ -3063,11 +3044,11 @@ ../../../../../bin/ - - - - - + + + + + @@ -3104,12 +3085,12 @@ - - - + + + - + - - - + + + @@ -3144,14 +3125,14 @@ ../../../../bin/ - - + + - - - + + + @@ -3162,58 +3143,4 @@ - - - - - DEBUG;TRACE - false - bin/Debug - true - 1595 - - - - - TRACE - bin/Release - true - false - 1595 - - - - - - - DEBUG;TRACE - false - ..\..\bin\ - true - Prebuild.snk - 1595 - - - - - TRACE - ..\..\bin\ - true - false - Prebuild.snk - 1595 - - - ../../bin/ - - - - - - - - - - - diff --git a/runprebuild.sh b/runprebuild.sh index 3e1417aaa6..b3b5c9d1d3 100755 --- a/runprebuild.sh +++ b/runprebuild.sh @@ -1,7 +1,4 @@ #!/bin/sh mono bin/Prebuild.exe /target nant -# needed until we break up OpenSim.exe -perl -pi -e 's{OpenSim.dll}{OpenSim.exe}' OpenSim/ApplicationPlugins/LoadRegions/OpenSim.ApplicationPlugins.LoadRegions.dll.build -mono bin/Prebuild.exe /target monodev mono bin/Prebuild.exe /target vs2008