Update svn properties, clean up formatting, refactor out duplicate hard-coded port numbers.

0.6.0-stable
Jeff Ames 2008-06-13 00:21:53 +00:00
parent 1451d6fb9a
commit 64f01ade04
11 changed files with 74 additions and 94 deletions

View File

@ -129,9 +129,12 @@ namespace OpenSim.Data
cmd.CommandText = kvp.Value; cmd.CommandText = kvp.Value;
cmd.ExecuteNonQuery(); cmd.ExecuteNonQuery();
if (version == 0) { if (version == 0)
{
InsertVersion(_type, newversion); InsertVersion(_type, newversion);
} else { }
else
{
UpdateVersion(_type, newversion); UpdateVersion(_type, newversion);
} }
version = newversion; version = newversion;
@ -149,7 +152,7 @@ namespace OpenSim.Data
if (m.Success) if (m.Success)
{ {
int MigrationVersion = int.Parse(m.Groups[1].ToString()); int MigrationVersion = int.Parse(m.Groups[1].ToString());
if ( MigrationVersion > max ) if (MigrationVersion > max)
max = MigrationVersion; max = MigrationVersion;
} }
} }
@ -160,9 +163,12 @@ namespace OpenSim.Data
{ {
get { return FindVersion(_type); } get { return FindVersion(_type); }
set { set {
if (Version < 1) { if (Version < 1)
{
InsertVersion(_type, value); InsertVersion(_type, value);
} else { }
else
{
UpdateVersion(_type, value); UpdateVersion(_type, value);
} }
} }
@ -172,7 +178,8 @@ namespace OpenSim.Data
{ {
int version = 0; int version = 0;
DbCommand cmd = _conn.CreateCommand(); DbCommand cmd = _conn.CreateCommand();
try { try
{
cmd.CommandText = "select version from migrations where name='" + type + "' limit 1"; cmd.CommandText = "select version from migrations where name='" + type + "' limit 1";
using (IDataReader reader = cmd.ExecuteReader()) using (IDataReader reader = cmd.ExecuteReader())
{ {
@ -182,7 +189,9 @@ namespace OpenSim.Data
} }
reader.Close(); reader.Close();
} }
} catch { }
catch
{
// Something went wrong, so we're version 0 // Something went wrong, so we're version 0
} }
return version; return version;

View File

@ -132,7 +132,7 @@ namespace OpenSim.Data.MySQL
// if there are no tables, get out of here and let // if there are no tables, get out of here and let
// migrations do their job // migrations do their job
if( if (
tableList["inventoryfolders"] == null && tableList["inventoryfolders"] == null &&
tableList["inventoryitems"] == null tableList["inventoryitems"] == null
) )

View File

@ -138,7 +138,7 @@ namespace OpenSim.Data.MySQL
// if there are no tables, get out of here and let // if there are no tables, get out of here and let
// migrations do their job // migrations do their job
if( if (
tableList[m_agentsTableName] == null && tableList[m_agentsTableName] == null &&
tableList[m_usersTableName] == null && tableList[m_usersTableName] == null &&
tableList[m_userFriendsTableName] == null && tableList[m_userFriendsTableName] == null &&

View File

@ -63,7 +63,7 @@ namespace OpenSim.Framework
configMember.addConfigurationOption("default_user_server", configMember.addConfigurationOption("default_user_server",
ConfigurationOption.ConfigurationTypes.TYPE_STRING_NOT_EMPTY, ConfigurationOption.ConfigurationTypes.TYPE_STRING_NOT_EMPTY,
"Default User Server URI", "Default User Server URI",
"http://127.0.0.1:8002" + "/", false); "http://127.0.0.1:" + UserConfig.DefaultHttpPort.ToString() + "/", false);
configMember.addConfigurationOption("user_send_key", ConfigurationOption.ConfigurationTypes.TYPE_STRING, configMember.addConfigurationOption("user_send_key", ConfigurationOption.ConfigurationTypes.TYPE_STRING,
"Key to send to user server", "null", false); "Key to send to user server", "null", false);
configMember.addConfigurationOption("user_recv_key", ConfigurationOption.ConfigurationTypes.TYPE_STRING, configMember.addConfigurationOption("user_recv_key", ConfigurationOption.ConfigurationTypes.TYPE_STRING,
@ -71,7 +71,7 @@ namespace OpenSim.Framework
configMember.addConfigurationOption("default_grid_server", configMember.addConfigurationOption("default_grid_server",
ConfigurationOption.ConfigurationTypes.TYPE_STRING_NOT_EMPTY, ConfigurationOption.ConfigurationTypes.TYPE_STRING_NOT_EMPTY,
"Default Grid Server URI", "Default Grid Server URI",
"http://127.0.0.1:8001/", false); "http://127.0.0.1:" + GridConfig.DefaultHttpPort.ToString() + "/", false);
configMember.addConfigurationOption("grid_send_key", ConfigurationOption.ConfigurationTypes.TYPE_STRING, configMember.addConfigurationOption("grid_send_key", ConfigurationOption.ConfigurationTypes.TYPE_STRING,
"Key to send to grid server", "null", false); "Key to send to grid server", "null", false);
configMember.addConfigurationOption("grid_recv_key", ConfigurationOption.ConfigurationTypes.TYPE_STRING, configMember.addConfigurationOption("grid_recv_key", ConfigurationOption.ConfigurationTypes.TYPE_STRING,

View File

@ -47,14 +47,14 @@ namespace OpenSim.Framework.Servers
/// server. /// server.
/// </summary> /// </summary>
private Timer m_periodicLogStatsTimer = new Timer(60 * 60 * 1000); private Timer m_periodicLogStatsTimer = new Timer(60 * 60 * 1000);
protected ConsoleBase m_console; protected ConsoleBase m_console;
/// <summary> /// <summary>
/// Time at which this server was started /// Time at which this server was started
/// </summary> /// </summary>
protected DateTime m_startuptime; protected DateTime m_startuptime;
/// <summary> /// <summary>
/// Record the initial startup directory for info purposes /// Record the initial startup directory for info purposes
/// </summary> /// </summary>
@ -80,11 +80,11 @@ namespace OpenSim.Framework.Servers
{ {
m_startuptime = DateTime.Now; m_startuptime = DateTime.Now;
m_version = VersionInfo.Version; m_version = VersionInfo.Version;
m_periodicLogStatsTimer.Elapsed += new ElapsedEventHandler(LogStats); m_periodicLogStatsTimer.Elapsed += new ElapsedEventHandler(LogStats);
m_periodicLogStatsTimer.Enabled = true; m_periodicLogStatsTimer.Enabled = true;
} }
/// <summary> /// <summary>
/// Print statistics to the logfile, if they are active /// Print statistics to the logfile, if they are active
/// </summary> /// </summary>
@ -93,7 +93,7 @@ namespace OpenSim.Framework.Servers
if (m_stats != null) if (m_stats != null)
{ {
m_log.Info(m_stats.Report()); m_log.Info(m_stats.Report());
} }
} }
/// <summary> /// <summary>
@ -131,10 +131,10 @@ namespace OpenSim.Framework.Servers
Notice("quit - equivalent to shutdown."); Notice("quit - equivalent to shutdown.");
Notice("show info - show server information (e.g. startup path)."); Notice("show info - show server information (e.g. startup path).");
if (m_stats != null) if (m_stats != null)
Notice("show stats - show statistical information for this server"); Notice("show stats - show statistical information for this server");
Notice("show uptime - show server startup time and uptime."); Notice("show uptime - show server startup time and uptime.");
Notice("show version - show server version."); Notice("show version - show server version.");
Notice("shutdown - shutdown the server.\n"); Notice("shutdown - shutdown the server.\n");
@ -165,9 +165,9 @@ namespace OpenSim.Framework.Servers
{ {
case "info": case "info":
Notice("Version: " + m_version ); Notice("Version: " + m_version );
Notice("Startup directory: " + m_startupDirectory); Notice("Startup directory: " + m_startupDirectory);
break; break;
case "stats": case "stats":
if (m_stats != null) if (m_stats != null)
{ {
@ -255,7 +255,7 @@ namespace OpenSim.Framework.Servers
{ {
OSString = Util.ReadEtcIssue(); OSString = Util.ReadEtcIssue();
} }
if (OSString.Length > 45) if (OSString.Length > 45)
{ {
OSString = OSString.Substring(0, 45); OSString = OSString.Substring(0, 45);

View File

@ -193,8 +193,8 @@ namespace OpenSim.Region.Environment.Scenes
/// <param name="xmlData"></param> /// <param name="xmlData"></param>
protected static void CreatePrimFromXml2(Scene scene, string xmlData) protected static void CreatePrimFromXml2(Scene scene, string xmlData)
{ {
SceneObjectGroup obj = new SceneObjectGroup(xmlData); SceneObjectGroup obj = new SceneObjectGroup(xmlData);
LLVector3 receivedVelocity = obj.RootPart.Velocity; LLVector3 receivedVelocity = obj.RootPart.Velocity;
//System.Console.WriteLine(obj.RootPart.Velocity.ToString()); //System.Console.WriteLine(obj.RootPart.Velocity.ToString());
scene.AddSceneObjectFromStorage(obj); scene.AddSceneObjectFromStorage(obj);

View File

@ -136,7 +136,7 @@ namespace OpenSim.Region.Environment.Modules.World.WorldMap
{ {
bool lookup = false; bool lookup = false;
lock(cachedMapBlocks) lock (cachedMapBlocks)
{ {
if (cachedMapBlocks.Count > 0 && ((cachedTime + 1800) > Util.UnixTimeSinceEpoch())) if (cachedMapBlocks.Count > 0 && ((cachedTime + 1800) > Util.UnixTimeSinceEpoch()))
{ {
@ -157,7 +157,7 @@ namespace OpenSim.Region.Environment.Modules.World.WorldMap
mapBlocks = m_scene.CommsManager.GridService.RequestNeighbourMapBlocks((int)m_scene.RegionInfo.RegionLocX - 8, (int)m_scene.RegionInfo.RegionLocY - 8, (int)m_scene.RegionInfo.RegionLocX + 8, (int)m_scene.RegionInfo.RegionLocY + 8); mapBlocks = m_scene.CommsManager.GridService.RequestNeighbourMapBlocks((int)m_scene.RegionInfo.RegionLocX - 8, (int)m_scene.RegionInfo.RegionLocY - 8, (int)m_scene.RegionInfo.RegionLocX + 8, (int)m_scene.RegionInfo.RegionLocY + 8);
avatarPresence.ControllingClient.SendMapBlock(mapBlocks); avatarPresence.ControllingClient.SendMapBlock(mapBlocks);
lock(cachedMapBlocks) lock (cachedMapBlocks)
cachedMapBlocks = mapBlocks; cachedMapBlocks = mapBlocks;
cachedTime = Util.UnixTimeSinceEpoch(); cachedTime = Util.UnixTimeSinceEpoch();
@ -236,4 +236,4 @@ namespace OpenSim.Region.Environment.Modules.World.WorldMap
remoteClient.SendMapBlock(mapBlocks); remoteClient.SendMapBlock(mapBlocks);
} }
} }
} }

View File

@ -193,7 +193,7 @@ namespace OpenSim.Region.Environment.Scenes
{ {
sceneObject.RegionHandle = m_regInfo.RegionHandle; sceneObject.RegionHandle = m_regInfo.RegionHandle;
sceneObject.SetScene(m_parentScene); sceneObject.SetScene(m_parentScene);
foreach (SceneObjectPart part in sceneObject.Children.Values) foreach (SceneObjectPart part in sceneObject.Children.Values)
{ {
part.LocalId = m_parentScene.PrimIDAllocate(); part.LocalId = m_parentScene.PrimIDAllocate();
@ -209,7 +209,7 @@ namespace OpenSim.Region.Environment.Scenes
/// </summary> /// </summary>
/// <param name="sceneObject"></param> /// <param name="sceneObject"></param>
/// <param name="attachToBackup"> /// <param name="attachToBackup">
/// If true, the object is made persistent into the scene. /// If true, the object is made persistent into the scene.
/// If false, the object will not persist over server restarts /// If false, the object will not persist over server restarts
/// </param> /// </param>
/// <returns>true if the object was added, false if an object with the same uuid was already in the scene /// <returns>true if the object was added, false if an object with the same uuid was already in the scene
@ -223,9 +223,9 @@ namespace OpenSim.Region.Environment.Scenes
// QuadTree.AddSceneObject(sceneObject); // QuadTree.AddSceneObject(sceneObject);
Entities.Add(sceneObject.UUID, sceneObject); Entities.Add(sceneObject.UUID, sceneObject);
m_numPrim += sceneObject.Children.Count; m_numPrim += sceneObject.Children.Count;
if (attachToBackup) if (attachToBackup)
sceneObject.AttachToBackup(); sceneObject.AttachToBackup();
return true; return true;
} }

View File

@ -998,7 +998,7 @@ namespace OpenSim.Region.Environment.Scenes
// Cannot create a map for a nonexistant heightmap yet. // Cannot create a map for a nonexistant heightmap yet.
if (Heightmap == null) if (Heightmap == null)
return; return;
if (terrain == null) if (terrain == null)
{ {
int tc = System.Environment.TickCount; int tc = System.Environment.TickCount;
@ -1122,12 +1122,9 @@ namespace OpenSim.Region.Environment.Scenes
mapbmp.SetPixel(x, (256 - y) - 1, black); mapbmp.SetPixel(x, (256 - y) - 1, black);
} }
} }
} }
//} //}
//tc = System.Environment.TickCount - tc; //tc = System.Environment.TickCount - tc;
//m_log.Info("[MAPTILE]: Completed One row in " + tc + " ms"); //m_log.Info("[MAPTILE]: Completed One row in " + tc + " ms");
} }
@ -1135,7 +1132,6 @@ namespace OpenSim.Region.Environment.Scenes
bool drawPrimVolume = true; bool drawPrimVolume = true;
try try
{ {
IConfig startupConfig = m_config.Configs["Startup"]; IConfig startupConfig = m_config.Configs["Startup"];
@ -1145,7 +1141,6 @@ namespace OpenSim.Region.Environment.Scenes
{ {
m_log.Warn("Failed to load StarupConfg"); m_log.Warn("Failed to load StarupConfg");
} }
if (drawPrimVolume) if (drawPrimVolume)
{ {
@ -1168,8 +1163,8 @@ namespace OpenSim.Region.Environment.Scenes
// Draw if the object is at least 1 meter wide in any direction // Draw if the object is at least 1 meter wide in any direction
if (part.Scale.X > 1f || part.Scale.Y > 1f || part.Scale.Z > 1f) if (part.Scale.X > 1f || part.Scale.Y > 1f || part.Scale.Z > 1f)
{ {
// Try to get the RGBA of the default texture entry.. // Try to get the RGBA of the default texture entry..
// //
try try
{ {
LLColor texcolor = part.Shape.Textures.DefaultTexture.RGBA; LLColor texcolor = part.Shape.Textures.DefaultTexture.RGBA;
@ -1177,9 +1172,7 @@ namespace OpenSim.Region.Environment.Scenes
int colorg = 255 - (int)(texcolor.G * 255f); int colorg = 255 - (int)(texcolor.G * 255f);
int colorb = 255 - (int)(texcolor.B * 255f); int colorb = 255 - (int)(texcolor.B * 255f);
if (colorr == 255 && colorg == 255 && colorb == 255) if (!(colorr == 255 && colorg == 255 && colorb == 255))
{ }
else
{ {
//Try to set the map spot color //Try to set the map spot color
try try
@ -1248,10 +1241,9 @@ namespace OpenSim.Region.Environment.Scenes
|| mapdrawendY > 255) || mapdrawendY > 255)
continue; continue;
int wy = 0; int wy = 0;
bool breakYN = false; // If we run into an error drawing, break out of the bool breakYN = false; // If we run into an error drawing, break out of the
// loop so we don't lag to death on error handling // loop so we don't lag to death on error handling
for (int wx = mapdrawstartX; wx < mapdrawendX; wx++) for (int wx = mapdrawstartX; wx < mapdrawendX; wx++)
{ {
@ -1274,7 +1266,7 @@ namespace OpenSim.Region.Environment.Scenes
if (breakYN) if (breakYN)
break; break;
} }
} // Object is within 256m Z of terrain } // Object is within 256m Z of terrain
} // object is at least a meter wide } // object is at least a meter wide
} // loop over group children } // loop over group children
@ -1304,7 +1296,6 @@ namespace OpenSim.Region.Environment.Scenes
asset.Type = 0; asset.Type = 0;
asset.Temporary = temporary; asset.Temporary = temporary;
AssetCache.AddAsset(asset); AssetCache.AddAsset(asset);
} }
else else
{ {
@ -1322,7 +1313,6 @@ namespace OpenSim.Region.Environment.Scenes
AssetCache.AddAsset(asset); AssetCache.AddAsset(asset);
} }
} }
} }
#endregion #endregion
@ -1442,10 +1432,8 @@ namespace OpenSim.Region.Environment.Scenes
// Un-offset the prim (it gets offset later by the consumer method) // Un-offset the prim (it gets offset later by the consumer method)
pos.Z -= 0.25F; pos.Z -= 0.25F;
} }
return pos; return pos;
} }
else else
@ -1523,7 +1511,7 @@ namespace OpenSim.Region.Environment.Scenes
// case... other tree types // case... other tree types
// tree.Scale = new LLVector3(?, ?, ?); // tree.Scale = new LLVector3(?, ?, ?);
// break; // break;
default: default:
tree.Scale = new LLVector3(4, 4, 4); tree.Scale = new LLVector3(4, 4, 4);
break; break;
@ -1557,7 +1545,7 @@ namespace OpenSim.Region.Environment.Scenes
/// </summary> /// </summary>
/// <param name="sceneObject"></param> /// <param name="sceneObject"></param>
/// <param name="attachToBackup"> /// <param name="attachToBackup">
/// If true, the object is made persistent into the scene. /// If true, the object is made persistent into the scene.
/// If false, the object will not persist over server restarts /// If false, the object will not persist over server restarts
/// </param> /// </param>
public void AddSceneObject(SceneObjectGroup sceneObject, bool attachToBackup) public void AddSceneObject(SceneObjectGroup sceneObject, bool attachToBackup)
@ -1889,11 +1877,9 @@ namespace OpenSim.Region.Environment.Scenes
client.OnObjectDuplicateOnRay += doObjectDuplicateOnRay; client.OnObjectDuplicateOnRay += doObjectDuplicateOnRay;
client.OnUpdatePrimFlags += m_innerScene.UpdatePrimFlags; client.OnUpdatePrimFlags += m_innerScene.UpdatePrimFlags;
client.OnRequestObjectPropertiesFamily += m_innerScene.RequestObjectPropertiesFamily; client.OnRequestObjectPropertiesFamily += m_innerScene.RequestObjectPropertiesFamily;
client.OnRequestGodlikePowers += handleRequestGodlikePowers; client.OnRequestGodlikePowers += handleRequestGodlikePowers;
client.OnGodKickUser += HandleGodlikeKickUser; client.OnGodKickUser += HandleGodlikeKickUser;
client.OnObjectPermissions += HandleObjectPermissionsUpdate; client.OnObjectPermissions += HandleObjectPermissionsUpdate;
client.OnCreateNewInventoryItem += CreateNewInventoryItem; client.OnCreateNewInventoryItem += CreateNewInventoryItem;
client.OnCreateNewInventoryFolder += CommsManager.UserProfileCacheService.HandleCreateInventoryFolder; client.OnCreateNewInventoryFolder += CommsManager.UserProfileCacheService.HandleCreateInventoryFolder;
client.OnUpdateInventoryFolder += CommsManager.UserProfileCacheService.HandleUpdateInventoryFolder; client.OnUpdateInventoryFolder += CommsManager.UserProfileCacheService.HandleUpdateInventoryFolder;
@ -1907,29 +1893,23 @@ namespace OpenSim.Region.Environment.Scenes
client.OnRemoveInventoryItem += RemoveInventoryItem; client.OnRemoveInventoryItem += RemoveInventoryItem;
client.OnRemoveInventoryFolder += RemoveInventoryFolder; client.OnRemoveInventoryFolder += RemoveInventoryFolder;
client.OnRezScript += RezScript; client.OnRezScript += RezScript;
client.OnRequestTaskInventory += RequestTaskInventory; client.OnRequestTaskInventory += RequestTaskInventory;
client.OnRemoveTaskItem += RemoveTaskInventory; client.OnRemoveTaskItem += RemoveTaskInventory;
client.OnUpdateTaskInventory += UpdateTaskInventory; client.OnUpdateTaskInventory += UpdateTaskInventory;
client.OnMoveTaskItem += MoveTaskInventoryItem; client.OnMoveTaskItem += MoveTaskInventoryItem;
client.OnGrabObject += ProcessObjectGrab; client.OnGrabObject += ProcessObjectGrab;
client.OnDeGrabObject += ProcessObjectDeGrab; client.OnDeGrabObject += ProcessObjectDeGrab;
client.OnMoneyTransferRequest += ProcessMoneyTransferRequest; client.OnMoneyTransferRequest += ProcessMoneyTransferRequest;
client.OnParcelBuy += ProcessParcelBuy; client.OnParcelBuy += ProcessParcelBuy;
client.OnAvatarPickerRequest += ProcessAvatarPickerRequest; client.OnAvatarPickerRequest += ProcessAvatarPickerRequest;
client.OnPacketStats += AddPacketStats; client.OnPacketStats += AddPacketStats;
client.OnObjectIncludeInSearch += m_innerScene.MakeObjectSearchable; client.OnObjectIncludeInSearch += m_innerScene.MakeObjectSearchable;
client.OnTeleportHomeRequest += TeleportClientHome; client.OnTeleportHomeRequest += TeleportClientHome;
client.OnSetStartLocationRequest += SetHomeRezPoint; client.OnSetStartLocationRequest += SetHomeRezPoint;
client.OnUndo += m_innerScene.HandleUndo; client.OnUndo += m_innerScene.HandleUndo;
client.OnObjectGroupRequest += m_innerScene.HandleObjectGroupUpdate; client.OnObjectGroupRequest += m_innerScene.HandleObjectGroupUpdate;
client.OnParcelReturnObjectsRequest += LandChannel.ReturnObjectsInParcel; client.OnParcelReturnObjectsRequest += LandChannel.ReturnObjectsInParcel;
client.OnScriptReset += ProcessScriptReset; client.OnScriptReset += ProcessScriptReset;
// EventManager.TriggerOnNewClient(client); // EventManager.TriggerOnNewClient(client);
} }
@ -1947,8 +1927,8 @@ namespace OpenSim.Region.Environment.Scenes
} }
public void doObjectDuplicateOnRay(uint localID, uint dupeFlags, LLUUID AgentID, LLUUID GroupID, public void doObjectDuplicateOnRay(uint localID, uint dupeFlags, LLUUID AgentID, LLUUID GroupID,
LLUUID RayTargetObj, LLVector3 RayEnd, LLVector3 RayStart, LLUUID RayTargetObj, LLVector3 RayEnd, LLVector3 RayStart,
bool BypassRaycast, bool RayEndIsIntersection, bool CopyCenters, bool CopyRotates) bool BypassRaycast, bool RayEndIsIntersection, bool CopyCenters, bool CopyRotates)
{ {
LLVector3 pos; LLVector3 pos;
const bool frontFacesOnly = true; const bool frontFacesOnly = true;
@ -1958,7 +1938,6 @@ namespace OpenSim.Region.Environment.Scenes
if (target != null && target2 != null) if (target != null && target2 != null)
{ {
LLVector3 direction = LLVector3.Norm(RayEnd - RayStart); LLVector3 direction = LLVector3.Norm(RayEnd - RayStart);
Vector3 AXOrigin = new Vector3(RayStart.X, RayStart.Y, RayStart.Z); Vector3 AXOrigin = new Vector3(RayStart.X, RayStart.Y, RayStart.Z);
Vector3 AXdirection = new Vector3(direction.X, direction.Y, direction.Z); Vector3 AXdirection = new Vector3(direction.X, direction.Y, direction.Z);
@ -1991,10 +1970,9 @@ namespace OpenSim.Region.Environment.Scenes
ScaleOffset = Math.Abs(ScaleOffset); ScaleOffset = Math.Abs(ScaleOffset);
LLVector3 intersectionpoint = new LLVector3(ei.ipoint.x, ei.ipoint.y, ei.ipoint.z); LLVector3 intersectionpoint = new LLVector3(ei.ipoint.x, ei.ipoint.y, ei.ipoint.z);
LLVector3 normal = new LLVector3(ei.normal.x, ei.normal.y, ei.normal.z); LLVector3 normal = new LLVector3(ei.normal.x, ei.normal.y, ei.normal.z);
LLVector3 offset = (normal * (ScaleOffset / 2f)); LLVector3 offset = normal * (ScaleOffset / 2f);
pos = (intersectionpoint + offset); pos = intersectionpoint + offset;
// stick in offset format from the original prim // stick in offset format from the original prim
pos = pos - target.ParentGroup.AbsolutePosition; pos = pos - target.ParentGroup.AbsolutePosition;
if (CopyRotates) if (CopyRotates)

View File

@ -418,7 +418,7 @@ namespace OpenSim.Region.Environment.Scenes
RegisterToEvents(); RegisterToEvents();
SetDirectionVectors(); SetDirectionVectors();
} }
public ScenePresence(IClientAPI client, Scene world, RegionInfo reginfo, byte[] visualParams, public ScenePresence(IClientAPI client, Scene world, RegionInfo reginfo, byte[] visualParams,
@ -481,8 +481,6 @@ namespace OpenSim.Region.Environment.Scenes
// } // }
} }
public uint GenerateClientFlags(LLUUID ObjectID) public uint GenerateClientFlags(LLUUID ObjectID)
{ {
return m_scene.ExternalChecks.ExternalChecksGenerateClientFlags(m_uuid, ObjectID); return m_scene.ExternalChecks.ExternalChecksGenerateClientFlags(m_uuid, ObjectID);
@ -590,27 +588,27 @@ namespace OpenSim.Region.Environment.Scenes
// m_log.DebugFormat( // m_log.DebugFormat(
// "[SCENE PRESENCE]: Upgrading child agent {0}, {1} to a root agent in {2} at pos {3}", // "[SCENE PRESENCE]: Upgrading child agent {0}, {1} to a root agent in {2} at pos {3}",
// Name, UUID, m_scene.RegionInfo.RegionName, pos); // Name, UUID, m_scene.RegionInfo.RegionName, pos);
if (pos.X < 0 || pos.X > Constants.RegionSize || pos.Y < 0 || pos.Y > Constants.RegionSize || pos.Z < 0) if (pos.X < 0 || pos.X > Constants.RegionSize || pos.Y < 0 || pos.Y > Constants.RegionSize || pos.Z < 0)
{ {
LLVector3 emergencyPos = new LLVector3(128, 128, 128); LLVector3 emergencyPos = new LLVector3(128, 128, 128);
m_log.WarnFormat( m_log.WarnFormat(
"[SCENE PRESENCE]: MakeRootAgent() was given an illegal position of {0} for avatar {1}, {2}. Substituting {3}", "[SCENE PRESENCE]: MakeRootAgent() was given an illegal position of {0} for avatar {1}, {2}. Substituting {3}",
pos, Name, UUID, emergencyPos); pos, Name, UUID, emergencyPos);
pos = emergencyPos; pos = emergencyPos;
} }
m_isChildAgent = false; m_isChildAgent = false;
float localAVHeight = 1.56f; float localAVHeight = 1.56f;
if (m_avHeight != 127.0f) if (m_avHeight != 127.0f)
{ {
localAVHeight = m_avHeight; localAVHeight = m_avHeight;
} }
float posZLimit = (float)m_scene.GetLandHeight((int)pos.X, (int)pos.Y); float posZLimit = (float)m_scene.GetLandHeight((int)pos.X, (int)pos.Y);
float newPosZ = posZLimit + localAVHeight; float newPosZ = posZLimit + localAVHeight;
if (posZLimit >= (pos.Z - (localAVHeight / 2)) && !(Single.IsInfinity(newPosZ) || Single.IsNaN(newPosZ))) if (posZLimit >= (pos.Z - (localAVHeight / 2)) && !(Single.IsInfinity(newPosZ) || Single.IsNaN(newPosZ)))
{ {
@ -789,7 +787,7 @@ namespace OpenSim.Region.Environment.Scenes
// Must check for standing up even when PhysicsActor is null, // Must check for standing up even when PhysicsActor is null,
// since sitting currently removes avatar from physical scene // since sitting currently removes avatar from physical scene
//m_log.Debug("agentPos:" + AbsolutePosition.ToString()); //m_log.Debug("agentPos:" + AbsolutePosition.ToString());
// This is irritating. Really. // This is irritating. Really.
if (!AbsolutePosition.IsFinite()) if (!AbsolutePosition.IsFinite())
{ {
@ -969,8 +967,6 @@ namespace OpenSim.Region.Environment.Scenes
} }
} }
m_scene.EventManager.TriggerOnClientMovement(this); m_scene.EventManager.TriggerOnClientMovement(this);
m_scene.AddAgentTime(System.Environment.TickCount - m_perfMonMS); m_scene.AddAgentTime(System.Environment.TickCount - m_perfMonMS);
@ -1006,7 +1002,6 @@ namespace OpenSim.Region.Environment.Scenes
//m_log.Debug("[AUTOPILOT]: " + Util.GetDistanceTo(AbsolutePosition, m_autoPilotTarget).ToString()); //m_log.Debug("[AUTOPILOT]: " + Util.GetDistanceTo(AbsolutePosition, m_autoPilotTarget).ToString());
if (Util.GetDistanceTo(AbsolutePosition, m_autoPilotTarget) <= 1.5) if (Util.GetDistanceTo(AbsolutePosition, m_autoPilotTarget) <= 1.5)
{ {
if (m_sitAtAutoTarget) if (m_sitAtAutoTarget)
{ {
SceneObjectPart part = m_scene.GetSceneObjectPart(m_requestedSitTargetUUID); SceneObjectPart part = m_scene.GetSceneObjectPart(m_requestedSitTargetUUID);
@ -2140,7 +2135,6 @@ namespace OpenSim.Region.Environment.Scenes
m_log.Info("[CLIENT]: Couldn't save attachments. :("); m_log.Info("[CLIENT]: Couldn't save attachments. :(");
} }
m_attachments.Clear(); m_attachments.Clear();
} }
} }
lock (m_knownPrimUUID) lock (m_knownPrimUUID)
@ -2204,7 +2198,6 @@ namespace OpenSim.Region.Environment.Scenes
m_attachmentsTransported = true; m_attachmentsTransported = true;
lock (m_attachments) lock (m_attachments)
{ {
foreach (SceneObjectGroup gobj in m_attachments) foreach (SceneObjectGroup gobj in m_attachments)
{ {
// If the prim group is null then something must have happened to it! // If the prim group is null then something must have happened to it!

View File

@ -112,7 +112,7 @@ namespace OpenSim.Region.ScriptEngine.XEngine
public void llSay(int channelID, string text) public void llSay(int channelID, string text)
{ {
m_host.AddScriptLPS(1); m_host.AddScriptLPS(1);
if (text.Length > 1023) if (text.Length > 1023)
text = text.Substring(0, 1023); text = text.Substring(0, 1023);
@ -176,7 +176,7 @@ namespace OpenSim.Region.ScriptEngine.XEngine
/// <summary> /// <summary>
/// accepts a valid LLUUID, -or- a name of an inventory item. /// accepts a valid LLUUID, -or- a name of an inventory item.
/// Returns a valid LLUUID or LLUUID.Zero if key invalid and item not found /// Returns a valid LLUUID or LLUUID.Zero if key invalid and item not found
/// in prim inventory. /// in prim inventory.
/// </summary> /// </summary>
@ -430,7 +430,7 @@ namespace OpenSim.Region.ScriptEngine.XEngine
public void llWhisper(int channelID, string text) public void llWhisper(int channelID, string text)
{ {
m_host.AddScriptLPS(1); m_host.AddScriptLPS(1);
if (text.Length > 1023) if (text.Length > 1023)
text = text.Substring(0, 1023); text = text.Substring(0, 1023);
@ -444,7 +444,7 @@ namespace OpenSim.Region.ScriptEngine.XEngine
public void llShout(int channelID, string text) public void llShout(int channelID, string text)
{ {
m_host.AddScriptLPS(1); m_host.AddScriptLPS(1);
if (text.Length > 1023) if (text.Length > 1023)
text = text.Substring(0, 1023); text = text.Substring(0, 1023);
@ -920,7 +920,7 @@ namespace OpenSim.Region.ScriptEngine.XEngine
} }
} }
private void SetFlexi(SceneObjectPart part, bool flexi, int softness, float gravity, float friction, private void SetFlexi(SceneObjectPart part, bool flexi, int softness, float gravity, float friction,
float wind, float tension, LSL_Types.Vector3 Force) float wind, float tension, LSL_Types.Vector3 Force)
{ {
if (part == null) if (part == null)
@ -933,7 +933,7 @@ namespace OpenSim.Region.ScriptEngine.XEngine
{ {
needs_fakedelete = true; needs_fakedelete = true;
} }
part.Shape.FlexiEntry = true; // this setting flexi true isn't working, but the below parameters do part.Shape.FlexiEntry = true; // this setting flexi true isn't working, but the below parameters do
// work once the prim is already flexi // work once the prim is already flexi
part.Shape.FlexiSoftness = softness; part.Shape.FlexiSoftness = softness;
part.Shape.FlexiGravity = gravity; part.Shape.FlexiGravity = gravity;
@ -1482,7 +1482,7 @@ namespace OpenSim.Region.ScriptEngine.XEngine
m_host.Sound = LLUUID.Zero; m_host.Sound = LLUUID.Zero;
m_host.SoundGain = 0; m_host.SoundGain = 0;
m_host.SoundFlags = 0; m_host.SoundFlags = 0;
m_host.SoundRadius = 0; m_host.SoundRadius = 0;
m_host.ScheduleFullUpdate(); m_host.ScheduleFullUpdate();
m_host.SendFullUpdateToAllClients(); m_host.SendFullUpdateToAllClients();
@ -4542,7 +4542,7 @@ namespace OpenSim.Region.ScriptEngine.XEngine
v=new LSL_Types.Vector3(rules.Data[idx++].ToString()); v=new LSL_Types.Vector3(rules.Data[idx++].ToString());
SetScale(part, v); SetScale(part, v);
break; break;
case 8: // PRIM_ROTATION case 8: // PRIM_ROTATION
if (remain < 1) if (remain < 1)
@ -4605,7 +4605,7 @@ namespace OpenSim.Region.ScriptEngine.XEngine
float intensity = (float)Convert.ToDouble(rules.Data[idx++]); float intensity = (float)Convert.ToDouble(rules.Data[idx++]);
float radius = (float)Convert.ToDouble(rules.Data[idx++]); float radius = (float)Convert.ToDouble(rules.Data[idx++]);
float falloff = (float)Convert.ToDouble(rules.Data[idx++]); float falloff = (float)Convert.ToDouble(rules.Data[idx++]);
SetPointLight(part, (light == 1), lightcolor, intensity, radius, falloff); SetPointLight(part, (light == 1), lightcolor, intensity, radius, falloff);
break; break;
@ -5514,7 +5514,7 @@ namespace OpenSim.Region.ScriptEngine.XEngine
IConfigSource config = new IniConfigSource(Application.iniFilePath); IConfigSource config = new IniConfigSource(Application.iniFilePath);
if (config.Configs["XEngine"] == null) if (config.Configs["XEngine"] == null)
config.AddConfig("XEngine"); config.AddConfig("XEngine");
if (config.Configs["XEngine"].GetBoolean("AllowGodFunctions", false)) if (config.Configs["XEngine"].GetBoolean("AllowGodFunctions", false))
{ {
if (World.ExternalChecks.ExternalChecksCanRunConsoleCommand(m_host.OwnerID)) if (World.ExternalChecks.ExternalChecksCanRunConsoleCommand(m_host.OwnerID))
@ -5576,7 +5576,7 @@ namespace OpenSim.Region.ScriptEngine.XEngine
{ {
m_host.AddScriptLPS(1); m_host.AddScriptLPS(1);
NotImplemented("llSetInventoryPermMask"); NotImplemented("llSetInventoryPermMask");
} }
public string llGetInventoryCreator(string item) public string llGetInventoryCreator(string item)
{ {
@ -6451,7 +6451,7 @@ namespace OpenSim.Region.ScriptEngine.XEngine
private static Dictionary<LLUUID, Notecard> m_Notecards = private static Dictionary<LLUUID, Notecard> m_Notecards =
new Dictionary<LLUUID, Notecard>(); new Dictionary<LLUUID, Notecard>();
public static void Cache(LLUUID assetID, string text) public static void Cache(LLUUID assetID, string text)
{ {
CacheCheck(); CacheCheck();
@ -6523,7 +6523,7 @@ namespace OpenSim.Region.ScriptEngine.XEngine
count += ln.Length + 1; count += ln.Length + 1;
idx++; idx++;
} }
return output.ToArray(); return output.ToArray();
} }
break; break;