Merge branch 'master' into v3_support

0.7.4.1
BlueWall 2012-03-02 15:02:09 -05:00
commit 6fc350725d
28 changed files with 276 additions and 318 deletions

View File

@ -8,6 +8,24 @@
<copy file="bin/OpenSim.ini.example" tofile="bin/OpenSim.ini"/> <copy file="bin/OpenSim.ini.example" tofile="bin/OpenSim.ini"/>
<copy file="bin/config-include/StandaloneCommon.ini.example" tofile="bin/config-include/StandaloneCommon.ini"/> <copy file="bin/config-include/StandaloneCommon.ini.example" tofile="bin/config-include/StandaloneCommon.ini"/>
<copy file="bin/config-include/FlotsamCache.ini.example" tofile="bin/config-include/FlotsamCache.ini"/> <copy file="bin/config-include/FlotsamCache.ini.example" tofile="bin/config-include/FlotsamCache.ini"/>
<!-- delete files generated by runprebuild.sh which had to be run in order to generate the build file for this target-->
<delete>
<fileset basedir="OpenSim">
<include name="**/*.build"/>
<include name="**/*.csproj*"/>
<include name="**/*.dll.build"/>
<include name="**/*.pidb"/>
<exclude name="Tools/OpenSim.32BitLaunch/**"/>
<exclude name="Tools/Robust.32BitLaunch/**"/>
<exclude name="Tools/LaunchSLClient/**"/>
</fileset>
</delete>
<delete>
<fileset>
<include name="OpenSim.build"/>
<include name="OpenSim.sln"/>
</fileset>
</delete>
</target> </target>
<property name="distbindir" value="distbin" /> <property name="distbindir" value="distbin" />

View File

@ -1367,7 +1367,7 @@ VALUES
newSettings.TerrainRaiseLimit = Convert.ToDouble(row["terrain_raise_limit"]); newSettings.TerrainRaiseLimit = Convert.ToDouble(row["terrain_raise_limit"]);
newSettings.TerrainLowerLimit = Convert.ToDouble(row["terrain_lower_limit"]); newSettings.TerrainLowerLimit = Convert.ToDouble(row["terrain_lower_limit"]);
newSettings.UseEstateSun = Convert.ToBoolean(row["use_estate_sun"]); newSettings.UseEstateSun = Convert.ToBoolean(row["use_estate_sun"]);
newSettings.Sandbox = Convert.ToBoolean(row["sandbox"]); newSettings.Sandbox = Convert.ToBoolean(row["Sandbox"]);
newSettings.FixedSun = Convert.ToBoolean(row["fixed_sun"]); newSettings.FixedSun = Convert.ToBoolean(row["fixed_sun"]);
newSettings.SunPosition = Convert.ToDouble(row["sun_position"]); newSettings.SunPosition = Convert.ToDouble(row["sun_position"]);
newSettings.SunVector = new Vector3( newSettings.SunVector = new Vector3(
@ -1782,7 +1782,7 @@ VALUES
parameters.Add(_Database.CreateParameter("terrain_raise_limit", settings.TerrainRaiseLimit)); parameters.Add(_Database.CreateParameter("terrain_raise_limit", settings.TerrainRaiseLimit));
parameters.Add(_Database.CreateParameter("terrain_lower_limit", settings.TerrainLowerLimit)); parameters.Add(_Database.CreateParameter("terrain_lower_limit", settings.TerrainLowerLimit));
parameters.Add(_Database.CreateParameter("use_estate_sun", settings.UseEstateSun)); parameters.Add(_Database.CreateParameter("use_estate_sun", settings.UseEstateSun));
parameters.Add(_Database.CreateParameter("sandbox", settings.Sandbox)); parameters.Add(_Database.CreateParameter("Sandbox", settings.Sandbox));
parameters.Add(_Database.CreateParameter("fixed_sun", settings.FixedSun)); parameters.Add(_Database.CreateParameter("fixed_sun", settings.FixedSun));
parameters.Add(_Database.CreateParameter("sun_position", settings.SunPosition)); parameters.Add(_Database.CreateParameter("sun_position", settings.SunPosition));
parameters.Add(_Database.CreateParameter("sunvectorx", settings.SunVector.X)); parameters.Add(_Database.CreateParameter("sunvectorx", settings.SunVector.X));

View File

@ -1283,7 +1283,7 @@ namespace OpenSim.Data.MySQL
newSettings.TerrainRaiseLimit = Convert.ToDouble(row["terrain_raise_limit"]); newSettings.TerrainRaiseLimit = Convert.ToDouble(row["terrain_raise_limit"]);
newSettings.TerrainLowerLimit = Convert.ToDouble(row["terrain_lower_limit"]); newSettings.TerrainLowerLimit = Convert.ToDouble(row["terrain_lower_limit"]);
newSettings.UseEstateSun = Convert.ToBoolean(row["use_estate_sun"]); newSettings.UseEstateSun = Convert.ToBoolean(row["use_estate_sun"]);
newSettings.Sandbox = Convert.ToBoolean(row["sandbox"]); newSettings.Sandbox = Convert.ToBoolean(row["Sandbox"]);
newSettings.SunVector = new Vector3 ( newSettings.SunVector = new Vector3 (
Convert.ToSingle(row["sunvectorx"]), Convert.ToSingle(row["sunvectorx"]),
Convert.ToSingle(row["sunvectory"]), Convert.ToSingle(row["sunvectory"]),

View File

@ -2157,7 +2157,7 @@ namespace OpenSim.Data.SQLite
row["terrain_raise_limit"] = settings.TerrainRaiseLimit; row["terrain_raise_limit"] = settings.TerrainRaiseLimit;
row["terrain_lower_limit"] = settings.TerrainLowerLimit; row["terrain_lower_limit"] = settings.TerrainLowerLimit;
row["use_estate_sun"] = settings.UseEstateSun; row["use_estate_sun"] = settings.UseEstateSun;
row["Sandbox"] = settings.Sandbox; // database uses upper case S for sandbox row["sandbox"] = settings.Sandbox; // unlike other database modules, sqlite uses a lower case s for sandbox!
row["sunvectorx"] = settings.SunVector.X; row["sunvectorx"] = settings.SunVector.X;
row["sunvectory"] = settings.SunVector.Y; row["sunvectory"] = settings.SunVector.Y;
row["sunvectorz"] = settings.SunVector.Z; row["sunvectorz"] = settings.SunVector.Z;

View File

@ -29,6 +29,7 @@ using System;
using System.Threading; using System.Threading;
using System.Collections.Generic; using System.Collections.Generic;
using System.Text; using System.Text;
using System.Xml;
namespace OpenSim.Framework.Console namespace OpenSim.Framework.Console
{ {
@ -37,28 +38,42 @@ namespace OpenSim.Framework.Console
/// Don't use this except for Unit Testing or you're in for a world of hurt when the /// Don't use this except for Unit Testing or you're in for a world of hurt when the
/// sim gets to ReadLine /// sim gets to ReadLine
/// </summary> /// </summary>
public class MockConsole : CommandConsole public class MockConsole : ICommandConsole
{
public MockConsole(string defaultPrompt) : base(defaultPrompt)
{
}
public override void Output(string text)
{
}
public override void Output(string text, string level)
{ {
private MockCommands m_commands = new MockCommands();
public ICommands Commands { get { return m_commands; } }
public void Prompt() {}
public void RunCommand(string cmd) {}
public string ReadLine(string p, bool isCommand, bool e) { return ""; }
public object ConsoleScene { get { return null; } }
public void Output(string text, string level) {}
public void Output(string text) {}
public void OutputFormat(string format, params object[] components) {}
public string CmdPrompt(string p) { return ""; }
public string CmdPrompt(string p, string def) { return ""; }
public string CmdPrompt(string p, List<char> excludedCharacters) { return ""; }
public string CmdPrompt(string p, string def, List<char> excludedCharacters) { return ""; }
public string CmdPrompt(string prompt, string defaultresponse, List<string> options) { return ""; }
public string PasswdPrompt(string p) { return ""; }
} }
public override string ReadLine(string p, bool isCommand, bool e) public class MockCommands : ICommands
{ {
//Thread.CurrentThread.Join(1000); public void FromXml(XmlElement root, CommandDelegate fn) {}
return string.Empty; public List<string> GetHelp(string[] cmd) { return null; }
} public void AddCommand(string module, bool shared, string command, string help, string longhelp, CommandDelegate fn) {}
public override void UnlockOutput() public void AddCommand(string module, bool shared, string command, string help, string longhelp, string descriptivehelp, CommandDelegate fn) {}
{ public string[] FindNextOption(string[] cmd, bool term) { return null; }
} public string[] Resolve(string[] cmd) { return null; }
public override void LockOutput() public XmlElement GetXml(XmlDocument doc) { return null; }
{
}
} }
} }

View File

@ -29,7 +29,7 @@ namespace OpenSim
{ {
public class VersionInfo public class VersionInfo
{ {
private const string VERSION_NUMBER = "0.7.3"; private const string VERSION_NUMBER = "0.7.4";
private const Flavour VERSION_FLAVOUR = Flavour.Dev; private const Flavour VERSION_FLAVOUR = Flavour.Dev;
public enum Flavour public enum Flavour

View File

@ -63,77 +63,7 @@ namespace OpenSim.Framework
// a "long" call for warning & debugging purposes // a "long" call for warning & debugging purposes
public const int LongCallTime = 500; public const int LongCallTime = 500;
// /// <summary> #region JSONRequest
// /// Send LLSD to an HTTP client in application/llsd+json form
// /// </summary>
// /// <param name="response">HTTP response to send the data in</param>
// /// <param name="body">LLSD to send to the client</param>
// public static void SendJSONResponse(OSHttpResponse response, OSDMap body)
// {
// byte[] responseData = Encoding.UTF8.GetBytes(OSDParser.SerializeJsonString(body));
//
// response.ContentEncoding = Encoding.UTF8;
// response.ContentLength = responseData.Length;
// response.ContentType = "application/llsd+json";
// response.Body.Write(responseData, 0, responseData.Length);
// }
//
// /// <summary>
// /// Send LLSD to an HTTP client in application/llsd+xml form
// /// </summary>
// /// <param name="response">HTTP response to send the data in</param>
// /// <param name="body">LLSD to send to the client</param>
// public static void SendXMLResponse(OSHttpResponse response, OSDMap body)
// {
// byte[] responseData = OSDParser.SerializeLLSDXmlBytes(body);
//
// response.ContentEncoding = Encoding.UTF8;
// response.ContentLength = responseData.Length;
// response.ContentType = "application/llsd+xml";
// response.Body.Write(responseData, 0, responseData.Length);
// }
/// <summary>
/// Make a GET or GET-like request to a web service that returns LLSD
/// or JSON data
/// </summary>
public static OSDMap ServiceRequest(string url, string httpVerb)
{
string errorMessage;
try
{
HttpWebRequest request = (HttpWebRequest)HttpWebRequest.Create(url);
request.Method = httpVerb;
using (WebResponse response = request.GetResponse())
{
using (Stream responseStream = response.GetResponseStream())
{
try
{
string responseStr = responseStream.GetStreamString();
OSD responseOSD = OSDParser.Deserialize(responseStr);
if (responseOSD.Type == OSDType.Map)
return (OSDMap)responseOSD;
else
errorMessage = "Response format was invalid.";
}
catch
{
errorMessage = "Failed to parse the response.";
}
}
}
}
catch (Exception ex)
{
m_log.Warn(httpVerb + " on URL " + url + " failed: " + ex.Message);
errorMessage = ex.Message;
}
return new OSDMap { { "Message", OSD.FromString("Service request failed. " + errorMessage) } };
}
/// <summary> /// <summary>
/// PUT JSON-encoded data to a web service that returns LLSD or /// PUT JSON-encoded data to a web service that returns LLSD or
@ -303,6 +233,10 @@ namespace OpenSim.Framework
return result; return result;
} }
#endregion JSONRequest
#region FormRequest
/// <summary> /// <summary>
/// POST URL-encoded form data to a web service that returns LLSD or /// POST URL-encoded form data to a web service that returns LLSD or
/// JSON data /// JSON data
@ -398,6 +332,8 @@ namespace OpenSim.Framework
return result; return result;
} }
#endregion FormRequest
#region Uri #region Uri
/// <summary> /// <summary>

View File

@ -150,7 +150,16 @@ namespace OpenSim.Region.CoreModules.Avatar.Profile
string skillsText = String.Empty; string skillsText = String.Empty;
string languages = String.Empty; string languages = String.Empty;
Byte[] charterMember = Utils.StringToBytes("Avatar"); UserAccount account = m_Scenes[0].UserAccountService.GetUserAccount(m_Scenes[0].RegionInfo.ScopeID, avatarID);
string name = "Avatar";
int created = 0;
if (account != null)
{
name = account.FirstName + " " + account.LastName;
created = account.Created;
}
Byte[] charterMember = Utils.StringToBytes(name);
profileUrl = "No profile data"; profileUrl = "No profile data";
aboutText = string.Empty; aboutText = string.Empty;
@ -160,7 +169,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Profile
partner = UUID.Zero; partner = UUID.Zero;
remoteClient.SendAvatarProperties(avatarID, aboutText, remoteClient.SendAvatarProperties(avatarID, aboutText,
Util.ToDateTime(0).ToString( Util.ToDateTime(created).ToString(
"M/d/yyyy", CultureInfo.InvariantCulture), "M/d/yyyy", CultureInfo.InvariantCulture),
charterMember, firstLifeAboutText, charterMember, firstLifeAboutText,
(uint)(0 & 0xff), (uint)(0 & 0xff),

View File

@ -117,7 +117,7 @@ namespace OpenSim.Region.CoreModules.Framework.InventoryAccess
string userAssetServer = string.Empty; string userAssetServer = string.Empty;
if (IsForeignUser(avatarID, out userAssetServer) && userAssetServer != string.Empty && m_OutboundPermission) if (IsForeignUser(avatarID, out userAssetServer) && userAssetServer != string.Empty && m_OutboundPermission)
{ {
Util.FireAndForget(delegate { m_assMapper.Post(assetID, avatarID, userAssetServer); }); m_assMapper.Post(assetID, avatarID, userAssetServer);
} }
} }

View File

@ -1476,11 +1476,11 @@ namespace OpenSim.Region.CoreModules.World.WorldMap
if (!landForSale) if (!landForSale)
{ {
m_log.DebugFormat("[WORLD MAP]: Region {0} has no parcels for sale, not geenrating overlay", m_scene.RegionInfo.RegionName); m_log.DebugFormat("[WORLD MAP]: Region {0} has no parcels for sale, not generating overlay", m_scene.RegionInfo.RegionName);
return null; return null;
} }
m_log.DebugFormat("[WORLD MAP]: Region {0} has parcels for sale, genrating overlay", m_scene.RegionInfo.RegionName); m_log.DebugFormat("[WORLD MAP]: Region {0} has parcels for sale, generating overlay", m_scene.RegionInfo.RegionName);
for (int x = 0 ; x < 64 ; x++) for (int x = 0 ; x < 64 ; x++)
{ {

View File

@ -343,13 +343,7 @@ namespace OpenSim.Region.Framework.Scenes
/// </summary> /// </summary>
protected Vector3 m_lastCameraPosition; protected Vector3 m_lastCameraPosition;
protected Vector3 m_CameraPosition; public Vector3 CameraPosition { get; set; }
public Vector3 CameraPosition
{
get { return m_CameraPosition; }
private set { m_CameraPosition = value; }
}
public Quaternion CameraRotation public Quaternion CameraRotation
{ {
@ -359,28 +353,9 @@ namespace OpenSim.Region.Framework.Scenes
// Use these three vectors to figure out what the agent is looking at // Use these three vectors to figure out what the agent is looking at
// Convert it to a Matrix and/or Quaternion // Convert it to a Matrix and/or Quaternion
// //
protected Vector3 m_CameraAtAxis; public Vector3 CameraAtAxis { get; set; }
protected Vector3 m_CameraLeftAxis; public Vector3 CameraLeftAxis { get; set; }
protected Vector3 m_CameraUpAxis; public Vector3 CameraUpAxis { get; set; }
public Vector3 CameraAtAxis
{
get { return m_CameraAtAxis; }
private set { m_CameraAtAxis = value; }
}
public Vector3 CameraLeftAxis
{
get { return m_CameraLeftAxis; }
private set { m_CameraLeftAxis = value; }
}
public Vector3 CameraUpAxis
{
get { return m_CameraUpAxis; }
private set { m_CameraUpAxis = value; }
}
public Vector3 Lookat public Vector3 Lookat
{ {
@ -396,33 +371,15 @@ namespace OpenSim.Region.Framework.Scenes
} }
#endregion #endregion
public readonly string Firstname; public string Firstname { get; private set; }
public readonly string Lastname; public string Lastname { get; private set; }
private string m_grouptitle; public string Grouptitle { get; set; }
public string Grouptitle
{
get { return m_grouptitle; }
set { m_grouptitle = value; }
}
// Agent's Draw distance. // Agent's Draw distance.
protected float m_DrawDistance; public float DrawDistance { get; set; }
public float DrawDistance public bool AllowMovement { get; set; }
{
get { return m_DrawDistance; }
private set { m_DrawDistance = value; }
}
protected bool m_allowMovement = true;
public bool AllowMovement
{
get { return m_allowMovement; }
set { m_allowMovement = value; }
}
private bool m_setAlwaysRun; private bool m_setAlwaysRun;
@ -449,13 +406,7 @@ namespace OpenSim.Region.Framework.Scenes
} }
} }
private byte m_state; public byte State { get; set; }
public byte State
{
get { return m_state; }
set { m_state = value; }
}
private AgentManager.ControlFlags m_AgentControlFlags; private AgentManager.ControlFlags m_AgentControlFlags;
@ -465,29 +416,14 @@ namespace OpenSim.Region.Framework.Scenes
set { m_AgentControlFlags = (AgentManager.ControlFlags)value; } set { m_AgentControlFlags = (AgentManager.ControlFlags)value; }
} }
/// <summary> public IClientAPI ControllingClient { get; set; }
/// This works out to be the ClientView object associated with this avatar, or it's client connection manager
/// </summary>
private IClientAPI m_controllingClient;
public IClientAPI ControllingClient
{
get { return m_controllingClient; }
private set { m_controllingClient = value; }
}
public IClientCore ClientView public IClientCore ClientView
{ {
get { return (IClientCore) m_controllingClient; } get { return (IClientCore)ControllingClient; }
} }
protected Vector3 m_parentPosition; public Vector3 ParentPosition { get; set; }
public Vector3 ParentPosition
{
get { return m_parentPosition; }
set { m_parentPosition = value; }
}
/// <summary> /// <summary>
/// Position of this avatar relative to the region the avatar is in /// Position of this avatar relative to the region the avatar is in
@ -747,7 +683,7 @@ namespace OpenSim.Region.Framework.Scenes
IClientAPI client, Scene world, AvatarAppearance appearance, PresenceType type) IClientAPI client, Scene world, AvatarAppearance appearance, PresenceType type)
{ {
AttachmentsSyncLock = new Object(); AttachmentsSyncLock = new Object();
AllowMovement = true;
IsChildAgent = true; IsChildAgent = true;
m_sendCourseLocationsMethod = SendCoarseLocationsDefault; m_sendCourseLocationsMethod = SendCoarseLocationsDefault;
Animator = new ScenePresenceAnimator(this); Animator = new ScenePresenceAnimator(this);
@ -826,17 +762,17 @@ namespace OpenSim.Region.Framework.Scenes
private Vector3[] GetWalkDirectionVectors() private Vector3[] GetWalkDirectionVectors()
{ {
Vector3[] vector = new Vector3[11]; Vector3[] vector = new Vector3[11];
vector[0] = new Vector3(m_CameraUpAxis.Z, 0f, -m_CameraAtAxis.Z); //FORWARD vector[0] = new Vector3(CameraUpAxis.Z, 0f, -CameraAtAxis.Z); //FORWARD
vector[1] = new Vector3(-m_CameraUpAxis.Z, 0f, m_CameraAtAxis.Z); //BACK vector[1] = new Vector3(-CameraUpAxis.Z, 0f, CameraAtAxis.Z); //BACK
vector[2] = Vector3.UnitY; //LEFT vector[2] = Vector3.UnitY; //LEFT
vector[3] = -Vector3.UnitY; //RIGHT vector[3] = -Vector3.UnitY; //RIGHT
vector[4] = new Vector3(m_CameraAtAxis.Z, 0f, m_CameraUpAxis.Z); //UP vector[4] = new Vector3(CameraAtAxis.Z, 0f, CameraUpAxis.Z); //UP
vector[5] = new Vector3(-m_CameraAtAxis.Z, 0f, -m_CameraUpAxis.Z); //DOWN vector[5] = new Vector3(-CameraAtAxis.Z, 0f, -CameraUpAxis.Z); //DOWN
vector[6] = new Vector3(m_CameraUpAxis.Z, 0f, -m_CameraAtAxis.Z); //FORWARD_NUDGE vector[6] = new Vector3(CameraUpAxis.Z, 0f, -CameraAtAxis.Z); //FORWARD_NUDGE
vector[7] = new Vector3(-m_CameraUpAxis.Z, 0f, m_CameraAtAxis.Z); //BACK_NUDGE vector[7] = new Vector3(-CameraUpAxis.Z, 0f, CameraAtAxis.Z); //BACK_NUDGE
vector[8] = Vector3.UnitY; //LEFT_NUDGE vector[8] = Vector3.UnitY; //LEFT_NUDGE
vector[9] = -Vector3.UnitY; //RIGHT_NUDGE vector[9] = -Vector3.UnitY; //RIGHT_NUDGE
vector[10] = new Vector3(-m_CameraAtAxis.Z, 0f, -m_CameraUpAxis.Z); //DOWN_NUDGE vector[10] = new Vector3(-CameraAtAxis.Z, 0f, -CameraUpAxis.Z); //DOWN_NUDGE
return vector; return vector;
} }
@ -1333,7 +1269,7 @@ namespace OpenSim.Region.Framework.Scenes
// Convert it to a Matrix and/or Quaternion // Convert it to a Matrix and/or Quaternion
CameraAtAxis = agentData.CameraAtAxis; CameraAtAxis = agentData.CameraAtAxis;
CameraLeftAxis = agentData.CameraLeftAxis; CameraLeftAxis = agentData.CameraLeftAxis;
m_CameraUpAxis = agentData.CameraUpAxis; CameraUpAxis = agentData.CameraUpAxis;
// The Agent's Draw distance setting // The Agent's Draw distance setting
// When we get to the point of re-computing neighbors everytime this // When we get to the point of re-computing neighbors everytime this
@ -1345,7 +1281,7 @@ namespace OpenSim.Region.Framework.Scenes
// Check if Client has camera in 'follow cam' or 'build' mode. // Check if Client has camera in 'follow cam' or 'build' mode.
Vector3 camdif = (Vector3.One * Rotation - Vector3.One * CameraRotation); Vector3 camdif = (Vector3.One * Rotation - Vector3.One * CameraRotation);
m_followCamAuto = ((m_CameraUpAxis.Z > 0.959f && m_CameraUpAxis.Z < 0.98f) m_followCamAuto = ((CameraUpAxis.Z > 0.959f && CameraUpAxis.Z < 0.98f)
&& (Math.Abs(camdif.X) < 0.4f && Math.Abs(camdif.Y) < 0.4f)) ? true : false; && (Math.Abs(camdif.X) < 0.4f && Math.Abs(camdif.Y) < 0.4f)) ? true : false;
m_mouseLook = (flags & AgentManager.ControlFlags.AGENT_CONTROL_MOUSELOOK) != 0; m_mouseLook = (flags & AgentManager.ControlFlags.AGENT_CONTROL_MOUSELOOK) != 0;
@ -3078,7 +3014,7 @@ namespace OpenSim.Region.Framework.Scenes
cAgent.Center = CameraPosition; cAgent.Center = CameraPosition;
cAgent.AtAxis = CameraAtAxis; cAgent.AtAxis = CameraAtAxis;
cAgent.LeftAxis = CameraLeftAxis; cAgent.LeftAxis = CameraLeftAxis;
cAgent.UpAxis = m_CameraUpAxis; cAgent.UpAxis = CameraUpAxis;
cAgent.Far = DrawDistance; cAgent.Far = DrawDistance;
@ -3164,7 +3100,7 @@ namespace OpenSim.Region.Framework.Scenes
CameraPosition = cAgent.Center; CameraPosition = cAgent.Center;
CameraAtAxis = cAgent.AtAxis; CameraAtAxis = cAgent.AtAxis;
CameraLeftAxis = cAgent.LeftAxis; CameraLeftAxis = cAgent.LeftAxis;
m_CameraUpAxis = cAgent.UpAxis; CameraUpAxis = cAgent.UpAxis;
// When we get to the point of re-computing neighbors everytime this // When we get to the point of re-computing neighbors everytime this
// changes, then start using the agent's drawdistance rather than the // changes, then start using the agent's drawdistance rather than the

View File

@ -65,8 +65,7 @@ namespace OpenSim.Region.Framework.Tests
// Create an object embedded inside the first // Create an object embedded inside the first
UUID taskSceneObjectItemId = UUID.Parse("00000000-0000-0000-0000-100000000000"); UUID taskSceneObjectItemId = UUID.Parse("00000000-0000-0000-0000-100000000000");
TaskInventoryItem taskSceneObjectItem TaskInventoryHelpers.AddSceneObject(scene, sop1, "tso", taskSceneObjectItemId, user1.PrincipalID);
= TaskInventoryHelpers.AddSceneObject(scene, sop1, "tso", taskSceneObjectItemId, user1.PrincipalID);
TaskInventoryItem addedItem = sop1.Inventory.GetInventoryItem(taskSceneObjectItemId); TaskInventoryItem addedItem = sop1.Inventory.GetInventoryItem(taskSceneObjectItemId);
Assert.That(addedItem.ItemID, Is.EqualTo(taskSceneObjectItemId)); Assert.That(addedItem.ItemID, Is.EqualTo(taskSceneObjectItemId));

View File

@ -4039,7 +4039,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
Vector3 av3 = new Vector3(Util.Clip((float)color.x, 0.0f, 1.0f), Vector3 av3 = new Vector3(Util.Clip((float)color.x, 0.0f, 1.0f),
Util.Clip((float)color.y, 0.0f, 1.0f), Util.Clip((float)color.y, 0.0f, 1.0f),
Util.Clip((float)color.z, 0.0f, 1.0f)); Util.Clip((float)color.z, 0.0f, 1.0f));
m_host.SetText(text.Length > 254 ? text.Remove(255) : text, av3, Util.Clip((float)alpha, 0.0f, 1.0f)); m_host.SetText(text.Length > 254 ? text.Remove(254) : text, av3, Util.Clip((float)alpha, 0.0f, 1.0f));
//m_host.ParentGroup.HasGroupChanged = true; //m_host.ParentGroup.HasGroupChanged = true;
//m_host.ParentGroup.ScheduleGroupForFullUpdate(); //m_host.ParentGroup.ScheduleGroupForFullUpdate();
} }

View File

@ -2160,6 +2160,31 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
return result; return result;
} }
public LSL_String osReplaceString(string src, string pattern, string replace, int count, int start)
{
CheckThreatLevel(ThreatLevel.High, "osReplaceString");
m_host.AddScriptLPS(1);
// Normalize indices (if negative).
// After normlaization they may still be
// negative, but that is now relative to
// the start, rather than the end, of the
// sequence.
if (start < 0)
{
start = src.Length + start;
}
if (start < 0 || start >= src.Length)
{
return src;
}
// Find matches beginning at start position
Regex matcher = new Regex(pattern);
return matcher.Replace(src,replace,count,start);
}
public string osLoadedCreationDate() public string osLoadedCreationDate()
{ {
CheckThreatLevel(ThreatLevel.Low, "osLoadedCreationDate"); CheckThreatLevel(ThreatLevel.Low, "osLoadedCreationDate");

View File

@ -156,13 +156,13 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api.Plugins
} }
public void CheckSenseRepeaterEvents() public void CheckSenseRepeaterEvents()
{
lock (SenseRepeatListLock)
{ {
// Nothing to do here? // Nothing to do here?
if (SenseRepeaters.Count == 0) if (SenseRepeaters.Count == 0)
return; return;
lock (SenseRepeatListLock)
{
// Go through all timers // Go through all timers
foreach (SenseRepeatClass ts in SenseRepeaters) foreach (SenseRepeatClass ts in SenseRepeaters)
{ {
@ -635,7 +635,9 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api.Plugins
ts.next = ts.next =
DateTime.Now.ToUniversalTime().AddSeconds(ts.interval); DateTime.Now.ToUniversalTime().AddSeconds(ts.interval);
lock (SenseRepeatListLock)
SenseRepeaters.Add(ts); SenseRepeaters.Add(ts);
idx += 6; idx += 6;
} }
} }

View File

@ -165,6 +165,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api.Interfaces
LSL_String osFormatString(string str, LSL_List strings); LSL_String osFormatString(string str, LSL_List strings);
LSL_List osMatchString(string src, string pattern, int start); LSL_List osMatchString(string src, string pattern, int start);
LSL_String osReplaceString(string src, string pattern, string replace, int count, int start);
// Information about data loaded into the region // Information about data loaded into the region
string osLoadedCreationDate(); string osLoadedCreationDate();

View File

@ -472,6 +472,12 @@ namespace OpenSim.Region.ScriptEngine.Shared.ScriptBase
return m_OSSL_Functions.osMatchString(src, pattern, start); return m_OSSL_Functions.osMatchString(src, pattern, start);
} }
public LSL_String osReplaceString(string src, string pattern, string replace, int count, int start)
{
return m_OSSL_Functions.osReplaceString(src,pattern,replace,count,start);
}
// Information about data loaded into the region // Information about data loaded into the region
public string osLoadedCreationDate() public string osLoadedCreationDate()
{ {

View File

@ -224,14 +224,12 @@ namespace OpenSim.Region.UserStatistics
concurrencyCounter--; concurrencyCounter--;
response_code = 200; response_code = 200;
} }
else else
{ {
strOut = MainServer.Instance.GetHTTP404(""); strOut = MainServer.Instance.GetHTTP404("");
} }
responsedata["int_response_code"] = response_code; responsedata["int_response_code"] = response_code;
responsedata["content_type"] = contenttype; responsedata["content_type"] = contenttype;
responsedata["keepalive"] = false; responsedata["keepalive"] = false;
@ -247,8 +245,8 @@ namespace OpenSim.Region.UserStatistics
// TODO: FIXME: implement stats migrations // TODO: FIXME: implement stats migrations
const string SQL = @"SELECT * FROM migrations LIMIT 1"; const string SQL = @"SELECT * FROM migrations LIMIT 1";
SqliteCommand cmd = new SqliteCommand(SQL, db); using (SqliteCommand cmd = new SqliteCommand(SQL, db))
{
try try
{ {
cmd.ExecuteNonQuery(); cmd.ExecuteNonQuery();
@ -259,31 +257,32 @@ namespace OpenSim.Region.UserStatistics
} }
} }
} }
}
public void CreateTables(SqliteConnection db) public void CreateTables(SqliteConnection db)
{ {
SqliteCommand createcmd = new SqliteCommand(SQL_STATS_TABLE_CREATE, db); using (SqliteCommand createcmd = new SqliteCommand(SQL_STATS_TABLE_CREATE, db))
{
createcmd.ExecuteNonQuery(); createcmd.ExecuteNonQuery();
createcmd.CommandText = SQL_MIGRA_TABLE_CREATE; createcmd.CommandText = SQL_MIGRA_TABLE_CREATE;
createcmd.ExecuteNonQuery(); createcmd.ExecuteNonQuery();
} }
}
public virtual void PostInitialise() public virtual void PostInitialise()
{ {
if (!enabled) if (!enabled)
{
return; return;
}
AddHandlers(); AddHandlers();
} }
public virtual void Close() public virtual void Close()
{ {
if (!enabled) if (!enabled)
{
return; return;
}
dbConn.Close(); dbConn.Close();
dbConn.Dispose(); dbConn.Dispose();
m_sessions.Clear(); m_sessions.Clear();
@ -304,7 +303,8 @@ namespace OpenSim.Region.UserStatistics
public void OnRegisterCaps(UUID agentID, Caps caps) public void OnRegisterCaps(UUID agentID, Caps caps)
{ {
m_log.DebugFormat("[WEB STATS MODULE]: OnRegisterCaps: agentID {0} caps {1}", agentID, caps); // m_log.DebugFormat("[WEB STATS MODULE]: OnRegisterCaps: agentID {0} caps {1}", agentID, caps);
string capsPath = "/CAPS/VS/" + UUID.Random(); string capsPath = "/CAPS/VS/" + UUID.Random();
caps.RegisterHandler("ViewerStats", caps.RegisterHandler("ViewerStats",
new RestStreamHandler("POST", capsPath, new RestStreamHandler("POST", capsPath,
@ -318,7 +318,6 @@ namespace OpenSim.Region.UserStatistics
public void OnDeRegisterCaps(UUID agentID, Caps caps) public void OnDeRegisterCaps(UUID agentID, Caps caps)
{ {
} }
protected virtual void AddHandlers() protected virtual void AddHandlers()
@ -368,7 +367,6 @@ namespace OpenSim.Region.UserStatistics
public void OnMakeChildAgent(ScenePresence agent) public void OnMakeChildAgent(ScenePresence agent)
{ {
} }
public void OnClientClosed(UUID agentID, Scene scene) public void OnClientClosed(UUID agentID, Scene scene)
@ -430,6 +428,7 @@ namespace OpenSim.Region.UserStatistics
return scene.RegionInfo.RegionID; return scene.RegionInfo.RegionID;
} }
} }
return UUID.Zero; return UUID.Zero;
} }
@ -458,14 +457,14 @@ namespace OpenSim.Region.UserStatistics
UserSessionData usd; UserSessionData usd;
OSD message = OSDParser.DeserializeLLSDXml(request); OSD message = OSDParser.DeserializeLLSDXml(request);
OSDMap mmap; OSDMap mmap;
lock (m_sessions) lock (m_sessions)
{ {
if (agentID != UUID.Zero) if (agentID != UUID.Zero)
{ {
if (!m_sessions.ContainsKey(agentID)) if (!m_sessions.ContainsKey(agentID))
{ {
m_log.Warn("[WEB STATS MODULE]: no session for stat disclosure"); m_log.WarnFormat("[WEB STATS MODULE]: no session for stat disclosure for agent {0}", agentID);
return new UserSessionID(); return new UserSessionID();
} }
uid = m_sessions[agentID]; uid = m_sessions[agentID];
@ -585,8 +584,6 @@ namespace OpenSim.Region.UserStatistics
usd.n_out_kb = (float)net_out["kbytes"].AsReal(); usd.n_out_kb = (float)net_out["kbytes"].AsReal();
usd.n_out_pk = net_out["packets"].AsInteger(); usd.n_out_pk = net_out["packets"].AsInteger();
} }
} }
} }
@ -602,7 +599,8 @@ namespace OpenSim.Region.UserStatistics
lock (db) lock (db)
{ {
SqliteCommand updatecmd = new SqliteCommand(SQL_STATS_TABLE_UPDATE, db); using (SqliteCommand updatecmd = new SqliteCommand(SQL_STATS_TABLE_UPDATE, db))
{
updatecmd.Parameters.Add(new SqliteParameter(":session_id", uid.session_data.session_id.ToString())); updatecmd.Parameters.Add(new SqliteParameter(":session_id", uid.session_data.session_id.ToString()));
updatecmd.Parameters.Add(new SqliteParameter(":agent_id", uid.session_data.agent_id.ToString())); updatecmd.Parameters.Add(new SqliteParameter(":agent_id", uid.session_data.agent_id.ToString()));
updatecmd.Parameters.Add(new SqliteParameter(":region_id", uid.session_data.region_id.ToString())); updatecmd.Parameters.Add(new SqliteParameter(":region_id", uid.session_data.region_id.ToString()));
@ -658,27 +656,28 @@ namespace OpenSim.Region.UserStatistics
updatecmd.Parameters.Add(new SqliteParameter(":session_key", uid.session_data.session_id.ToString())); updatecmd.Parameters.Add(new SqliteParameter(":session_key", uid.session_data.session_id.ToString()));
updatecmd.Parameters.Add(new SqliteParameter(":agent_key", uid.session_data.agent_id.ToString())); updatecmd.Parameters.Add(new SqliteParameter(":agent_key", uid.session_data.agent_id.ToString()));
updatecmd.Parameters.Add(new SqliteParameter(":region_key", uid.session_data.region_id.ToString())); updatecmd.Parameters.Add(new SqliteParameter(":region_key", uid.session_data.region_id.ToString()));
// m_log.Debug("UPDATE");
// m_log.DebugFormat("[WEB STATS MODULE]: Database stats update for {0}", uid.session_data.agent_id);
int result = updatecmd.ExecuteNonQuery(); int result = updatecmd.ExecuteNonQuery();
if (result == 0) if (result == 0)
{ {
// m_log.Debug("INSERT"); // m_log.DebugFormat("[WEB STATS MODULE]: Database stats insert for {0}", uid.session_data.agent_id);
updatecmd.CommandText = SQL_STATS_TABLE_INSERT; updatecmd.CommandText = SQL_STATS_TABLE_INSERT;
try try
{ {
updatecmd.ExecuteNonQuery(); updatecmd.ExecuteNonQuery();
} }
catch (SqliteExecutionException) catch (Exception e)
{ {
m_log.Warn("[WEB STATS MODULE]: failed to write stats to storage Execution Exception"); m_log.WarnFormat(
"[WEB STATS MODULE]: failed to write stats for {0}, storage Execution Exception {1}{2}",
uid.session_data.agent_id, e.Message, e.StackTrace);
} }
catch (SqliteSyntaxException)
{
m_log.Warn("[WEB STATS MODULE]: failed to write stats to storage SQL Syntax Exception");
} }
} }
} }
} }

View File

@ -78,9 +78,9 @@ namespace OpenSim.Services.AuthenticationService
} }
else else
{ {
string hashed = Util.Md5Hash(Util.Md5Hash(password) + ":" + data.Data["passwordSalt"].ToString()); string hashed = Util.Md5Hash(password + ":" + data.Data["passwordSalt"].ToString());
// m_log.DebugFormat("[PASS AUTH]: got {0}; hashed = {1}; stored = {2}; passonly {3}", password, hashed, data.Data["passwordHash"].ToString(), hashed2); //m_log.DebugFormat("[PASS AUTH]: got {0}; hashed = {1}; stored = {2}", password, hashed, data.Data["passwordHash"].ToString());
if (data.Data["passwordHash"].ToString() == hashed) if (data.Data["passwordHash"].ToString() == hashed)
{ {

View File

@ -113,7 +113,7 @@ namespace OpenSim.Tests.Common
Console.WriteLine("Setting up test scene {0}", name); Console.WriteLine("Setting up test scene {0}", name);
// We must set up a console otherwise setup of some modules may fail // We must set up a console otherwise setup of some modules may fail
MainConsole.Instance = new MockConsole("TEST PROMPT"); MainConsole.Instance = new MockConsole();
RegionInfo regInfo = new RegionInfo(x, y, new IPEndPoint(IPAddress.Loopback, 9000), "127.0.0.1"); RegionInfo regInfo = new RegionInfo(x, y, new IPEndPoint(IPAddress.Loopback, 9000), "127.0.0.1");
regInfo.RegionName = name; regInfo.RegionName = name;

View File

@ -420,6 +420,8 @@ namespace pCampBot
public void Network_LoginProgress(object sender, LoginProgressEventArgs args) public void Network_LoginProgress(object sender, LoginProgressEventArgs args)
{ {
m_log.DebugFormat("[BOT]: Bot {0} {1} in Network_LoginProcess", Name, args.Status);
if (args.Status == LoginStatus.Success) if (args.Status == LoginStatus.Success)
{ {
if (OnConnected != null) if (OnConnected != null)
@ -431,10 +433,15 @@ namespace pCampBot
public void Network_SimConnected(object sender, SimConnectedEventArgs args) public void Network_SimConnected(object sender, SimConnectedEventArgs args)
{ {
m_log.DebugFormat(
"[BOT]: Bot {0} connected to {1} at {2}", Name, args.Simulator.Name, args.Simulator.IPEndPoint);
} }
public void Network_OnDisconnected(object sender, DisconnectedEventArgs args) public void Network_OnDisconnected(object sender, DisconnectedEventArgs args)
{ {
m_log.DebugFormat(
"[BOT]: Bot {0} disconnected reason {1}, message {2}", Name, args.Reason, args.Message);
// m_log.ErrorFormat("Fired Network_OnDisconnected"); // m_log.ErrorFormat("Fired Network_OnDisconnected");
// if ( // if (

View File

@ -266,7 +266,7 @@ namespace pCampBot
/// <returns></returns> /// <returns></returns>
protected CommandConsole CreateConsole() protected CommandConsole CreateConsole()
{ {
return new LocalConsole("Region"); return new LocalConsole("pCampbot");
} }
private void HandleShutdown(string module, string[] cmd) private void HandleShutdown(string module, string[] cmd)

View File

@ -56,6 +56,10 @@ namespace pCampBot
{ {
Help(); Help();
} }
else if (config.Get("firstname") == null || config.Get("lastname") == null || config.Get("password") == null)
{
Console.WriteLine("ERROR: You must supply a firstname, lastname and password for the bots.");
}
else else
{ {
int botcount = config.GetInt("botcount", 1); int botcount = config.GetInt("botcount", 1);

View File

@ -128,3 +128,4 @@ OpenSim, as well as how to report bugs, and participate in the OpenSim
project can always be found at http://opensimulator.org. project can always be found at http://opensimulator.org.
Thanks for trying OpenSim, we hope it is a pleasant experience. Thanks for trying OpenSim, we hope it is a pleasant experience.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.