Merge branch 'master' of ssh://opensimulator.org/var/git/opensim

iar_mods
Justin Clark-Casey (justincc) 2012-02-13 20:48:50 +00:00
commit 21393af631
11 changed files with 143 additions and 23 deletions

View File

@ -31,6 +31,7 @@ using System.Collections.Generic;
using System.Diagnostics; using System.Diagnostics;
using System.Reflection; using System.Reflection;
using System.Text; using System.Text;
using System.Text.RegularExpressions;
using System.Threading; using System.Threading;
using log4net; using log4net;
using OpenSim.Framework; using OpenSim.Framework;
@ -531,6 +532,11 @@ namespace OpenSim.Framework.Console
public class Parser public class Parser
{ {
// If an unquoted portion ends with an element matching this regex
// and the next element contains a space, then we have stripped
// embedded quotes that should not have been stripped
private static Regex optionRegex = new Regex("^--[a-zA-Z0-9-]+=$");
public static string[] Parse(string text) public static string[] Parse(string text)
{ {
List<string> result = new List<string>(); List<string> result = new List<string>();
@ -544,12 +550,40 @@ namespace OpenSim.Framework.Console
if (index % 2 == 0) if (index % 2 == 0)
{ {
string[] words = unquoted[index].Split(new char[] {' '}); string[] words = unquoted[index].Split(new char[] {' '});
bool option = false;
foreach (string w in words) foreach (string w in words)
{ {
if (w != String.Empty) if (w != String.Empty)
{
if (optionRegex.Match(w) == Match.Empty)
option = false;
else
option = true;
result.Add(w); result.Add(w);
} }
} }
// The last item matched the regex, put the quotes back
if (option)
{
// If the line ended with it, don't do anything
if (index < (unquoted.Length - 1))
{
// Get and remove the option name
string optionText = result[result.Count - 1];
result.RemoveAt(result.Count - 1);
// Add the quoted value back
optionText += "\"" + unquoted[index + 1] + "\"";
// Push the result into our return array
result.Add(optionText);
// Skip the already used value
index++;
}
}
}
else else
{ {
result.Add(unquoted[index]); result.Add(unquoted[index]);

View File

@ -625,7 +625,6 @@ namespace OpenSim.Framework
foreach (String s in allKeys) foreach (String s in allKeys)
{ {
string val = config.GetString(s);
SetOtherSetting(s, config.GetString(s)); SetOtherSetting(s, config.GetString(s));
} }
} }

View File

@ -1664,13 +1664,14 @@ namespace OpenSim.Framework
/// </summary> /// </summary>
public static void PrintCallStack() public static void PrintCallStack()
{ {
StackTrace stackTrace = new StackTrace(); // get call stack StackTrace stackTrace = new StackTrace(true); // get call stack
StackFrame[] stackFrames = stackTrace.GetFrames(); // get method calls (frames) StackFrame[] stackFrames = stackTrace.GetFrames(); // get method calls (frames)
// write call stack method names // write call stack method names
foreach (StackFrame stackFrame in stackFrames) foreach (StackFrame stackFrame in stackFrames)
{ {
m_log.Debug(stackFrame.GetMethod().DeclaringType + "." + stackFrame.GetMethod().Name); // write method name MethodBase mb = stackFrame.GetMethod();
m_log.DebugFormat("{0}.{1}:{2}", mb.DeclaringType, mb.Name, stackFrame.GetFileLineNumber()); // write method name
} }
} }

View File

@ -7625,6 +7625,13 @@ namespace OpenSim.Region.ClientStack.LindenUDP
} }
} }
} }
else
if (transfer.TransferInfo.SourceType == (int)SourceType.SimEstate)
{
//TransferRequestPacket does not include covenant uuid?
//get scene covenant uuid
taskID = m_scene.RegionInfo.RegionSettings.Covenant;
}
MakeAssetRequest(transfer, taskID); MakeAssetRequest(transfer, taskID);
@ -11985,6 +11992,11 @@ namespace OpenSim.Region.ClientStack.LindenUDP
{ {
requestID = new UUID(transferRequest.TransferInfo.Params, 80); requestID = new UUID(transferRequest.TransferInfo.Params, 80);
} }
else if (transferRequest.TransferInfo.SourceType == (int)SourceType.SimEstate)
{
requestID = taskID;
}
// m_log.DebugFormat("[CLIENT]: {0} requesting asset {1}", Name, requestID); // m_log.DebugFormat("[CLIENT]: {0} requesting asset {1}", Name, requestID);

View File

@ -546,12 +546,20 @@ namespace OpenSim.Region.CoreModules.Framework.InventoryAccess
return null; return null;
userID = remoteClient.AgentId; userID = remoteClient.AgentId;
// m_log.DebugFormat(
// "[INVENTORY ACCESS MODULE]: Target of {0} in CreateItemForObject() is {1} {2}",
// action, remoteClient.Name, userID);
} }
else else
{ {
// All returns / deletes go to the object owner // All returns / deletes go to the object owner
// //
userID = so.RootPart.OwnerID; userID = so.RootPart.OwnerID;
// m_log.DebugFormat(
// "[INVENTORY ACCESS MODULE]: Target of {0} in CreateItemForObject() is object owner {1}",
// action, userID);
} }
if (userID == UUID.Zero) // Can't proceed if (userID == UUID.Zero) // Can't proceed
@ -637,11 +645,11 @@ namespace OpenSim.Region.CoreModules.Framework.InventoryAccess
} }
// Override and put into where it came from, if it came // Override and put into where it came from, if it came
// from anywhere in inventory // from anywhere in inventory and the owner is taking it back.
// //
if (action == DeRezAction.Take || action == DeRezAction.TakeCopy) if (action == DeRezAction.Take || action == DeRezAction.TakeCopy)
{ {
if (so.RootPart.FromFolderID != UUID.Zero) if (so.RootPart.FromFolderID != UUID.Zero && userID == remoteClient.AgentId)
{ {
InventoryFolderBase f = new InventoryFolderBase(so.RootPart.FromFolderID, userID); InventoryFolderBase f = new InventoryFolderBase(so.RootPart.FromFolderID, userID);
folder = m_Scene.InventoryService.GetFolder(f); folder = m_Scene.InventoryService.GetFolder(f);

View File

@ -148,7 +148,8 @@ namespace OpenSim.Region.Framework.Scenes
x = m_inventoryDeletes.Dequeue(); x = m_inventoryDeletes.Dequeue();
m_log.DebugFormat( m_log.DebugFormat(
"[ASYNC DELETER]: Sending object to user's inventory, action {1}, count {2}, {0} item(s) remaining.", left, x.action, x.objectGroups.Count); "[ASYNC DELETER]: Sending object to user's inventory, action {1}, count {2}, {0} item(s) remaining.",
left, x.action, x.objectGroups.Count);
try try
{ {

View File

@ -291,13 +291,10 @@ namespace OpenSim.Region.Framework.Scenes
/// </summary> /// </summary>
public PhysicsActor PhysicsActor { get; private set; } public PhysicsActor PhysicsActor { get; private set; }
private byte m_movementflag; /// <summary>
/// Record user movement inputs.
public byte MovementFlag /// </summary>
{ public byte MovementFlag { get; private set; }
set { m_movementflag = value; }
get { return m_movementflag; }
}
private bool m_updateflag; private bool m_updateflag;

View File

@ -156,6 +156,22 @@ namespace OpenSim.Region.Physics.OdePlugin
internal UUID m_uuid { get; private set; } internal UUID m_uuid { get; private set; }
internal bool bad = false; internal bool bad = false;
/// <summary>
/// ODE Avatar.
/// </summary>
/// <param name="avName"></param>
/// <param name="parent_scene"></param>
/// <param name="pos"></param>
/// <param name="size"></param>
/// <param name="pid_d"></param>
/// <param name="pid_p"></param>
/// <param name="capsule_radius"></param>
/// <param name="tensor"></param>
/// <param name="density">
/// Only used right now to return information to LSL. Not actually used to set mass in ODE!
/// </param>
/// <param name="walk_divisor"></param>
/// <param name="rundivisor"></param>
public OdeCharacter( public OdeCharacter(
String avName, OdeScene parent_scene, Vector3 pos, Vector3 size, float pid_d, float pid_p, String avName, OdeScene parent_scene, Vector3 pos, Vector3 size, float pid_d, float pid_p,
float capsule_radius, float tensor, float density, float capsule_radius, float tensor, float density,
@ -786,6 +802,10 @@ namespace OpenSim.Region.Physics.OdePlugin
Vector3 vec = Vector3.Zero; Vector3 vec = Vector3.Zero;
d.Vector3 vel = d.BodyGetLinearVel(Body); d.Vector3 vel = d.BodyGetLinearVel(Body);
// m_log.DebugFormat(
// "[ODE CHARACTER]: Current velocity in Move() is <{0},{1},{2}>, target {3} for {4}",
// vel.X, vel.Y, vel.Z, _target_velocity, Name);
float movementdivisor = 1f; float movementdivisor = 1f;
if (!m_alwaysRun) if (!m_alwaysRun)
@ -884,12 +904,14 @@ namespace OpenSim.Region.Physics.OdePlugin
if (flying) if (flying)
{ {
// This also acts as anti-gravity so that we hover when flying rather than fall.
vec.Z = (_target_velocity.Z - vel.Z) * (PID_D); vec.Z = (_target_velocity.Z - vel.Z) * (PID_D);
} }
} }
if (flying) if (flying)
{ {
// Anti-gravity so that we hover when flying rather than fall.
vec.Z += ((-1 * _parent_scene.gravityz) * m_mass); vec.Z += ((-1 * _parent_scene.gravityz) * m_mass);
//Added for auto fly height. Kitto Flora //Added for auto fly height. Kitto Flora
@ -921,6 +943,25 @@ namespace OpenSim.Region.Physics.OdePlugin
return; return;
} }
d.Vector3 newVel = d.BodyGetLinearVel(Body);
if (newVel.X >= 256 || newVel.X <= 256 || newVel.Y >= 256 || newVel.Y <= 256 || newVel.Z >= 256 || newVel.Z <= 256)
{
// m_log.DebugFormat(
// "[ODE CHARACTER]: Limiting falling velocity from {0} to {1} for {2}", newVel.Z, -9.8, Name);
newVel.X = Util.Clamp<float>(newVel.X, -255f, 255f);
newVel.Y = Util.Clamp<float>(newVel.Y, -255f, 255f);
if (!flying)
newVel.Z
= Util.Clamp<float>(
newVel.Z, -_parent_scene.AvatarTerminalVelocity, _parent_scene.AvatarTerminalVelocity);
else
newVel.Z = Util.Clamp<float>(newVel.Z, -255f, 255f);
d.BodySetLinearVel(Body, newVel.X, newVel.Y, newVel.Z);
}
} }
/// <summary> /// <summary>

View File

@ -144,6 +144,8 @@ namespace OpenSim.Region.Physics.OdePlugin
public float gravityy = 0f; public float gravityy = 0f;
public float gravityz = -9.8f; public float gravityz = -9.8f;
public float AvatarTerminalVelocity { get; set; }
private float contactsurfacelayer = 0.001f; private float contactsurfacelayer = 0.001f;
private int worldHashspaceLow = -4; private int worldHashspaceLow = -4;
@ -459,6 +461,15 @@ namespace OpenSim.Region.Physics.OdePlugin
gravityy = physicsconfig.GetFloat("world_gravityy", 0f); gravityy = physicsconfig.GetFloat("world_gravityy", 0f);
gravityz = physicsconfig.GetFloat("world_gravityz", -9.8f); gravityz = physicsconfig.GetFloat("world_gravityz", -9.8f);
float avatarTerminalVelocity = physicsconfig.GetFloat("avatar_terminal_velocity", 54f);
AvatarTerminalVelocity = Util.Clamp<float>(avatarTerminalVelocity, 0, 255f);
if (AvatarTerminalVelocity != avatarTerminalVelocity)
{
m_log.WarnFormat(
"[ODE SCENE]: avatar_terminal_velocity of {0} is invalid. Clamping to {1}",
avatarTerminalVelocity, AvatarTerminalVelocity);
}
worldHashspaceLow = physicsconfig.GetInt("world_hashspace_size_low", -4); worldHashspaceLow = physicsconfig.GetInt("world_hashspace_size_low", -4);
worldHashspaceHigh = physicsconfig.GetInt("world_hashspace_size_high", 128); worldHashspaceHigh = physicsconfig.GetInt("world_hashspace_size_high", 128);

View File

@ -445,17 +445,28 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api.Plugins
Vector3 toRegionPos; Vector3 toRegionPos;
double dis; double dis;
Action<ScenePresence> senseEntity = new Action<ScenePresence>(delegate(ScenePresence presence) Action<ScenePresence> senseEntity = new Action<ScenePresence>(presence =>
{ {
if ((ts.type & NPC) == 0 if ((ts.type & NPC) == 0 && presence.PresenceType == PresenceType.Npc)
&& presence.PresenceType == PresenceType.Npc {
&& !npcModule.GetNPC(presence.UUID, presence.Scene).SenseAsAgent) INPC npcData = npcModule.GetNPC(presence.UUID, presence.Scene);
if (npcData == null || !npcData.SenseAsAgent)
return; return;
}
if ((ts.type & AGENT) == 0 if ((ts.type & AGENT) == 0)
&& (presence.PresenceType == PresenceType.User {
|| npcModule.GetNPC(presence.UUID, presence.Scene).SenseAsAgent)) if (presence.PresenceType == PresenceType.User)
{
return; return;
}
else
{
INPC npcData = npcModule.GetNPC(presence.UUID, presence.Scene);
if (npcData != null && npcData.SenseAsAgent)
return;
}
}
if (presence.IsDeleted || presence.IsChildAgent || presence.GodLevel > 0.0) if (presence.IsDeleted || presence.IsChildAgent || presence.GodLevel > 0.0)
return; return;

View File

@ -655,6 +655,11 @@
world_gravityy = 0 world_gravityy = 0
world_gravityz = -9.8 world_gravityz = -9.8
; Terminal velocity of a falling avatar
; This is the same http://en.wikipedia.org/wiki/Terminal_velocity#Examples
; Max value is 255, min value is 0
avatar_terminal_velocity = 54
; World Step size. (warning these are dangerous. Changing these will probably cause your scene to explode dramatically) ; World Step size. (warning these are dangerous. Changing these will probably cause your scene to explode dramatically)
; reference: fps = (0.089/ODE_STEPSIZE) * 1000; ; reference: fps = (0.089/ODE_STEPSIZE) * 1000;
world_stepsize = 0.0178 world_stepsize = 0.0178