Merge branch 'master' into careminster

Conflicts:
	OpenSim/Framework/Servers/VersionInfo.cs
	OpenSim/Region/CoreModules/World/WorldMap/WorldMapModule.cs
	OpenSim/Region/Framework/Scenes/ScenePresence.cs
avinationmerge
Melanie 2012-03-03 09:58:57 +00:00
commit 1f32730798
28 changed files with 275 additions and 322 deletions

View File

@ -8,6 +8,24 @@
<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/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>
<property name="distbindir" value="distbin" />

View File

@ -1367,7 +1367,7 @@ VALUES
newSettings.TerrainRaiseLimit = Convert.ToDouble(row["terrain_raise_limit"]);
newSettings.TerrainLowerLimit = Convert.ToDouble(row["terrain_lower_limit"]);
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.SunPosition = Convert.ToDouble(row["sun_position"]);
newSettings.SunVector = new Vector3(
@ -1782,7 +1782,7 @@ VALUES
parameters.Add(_Database.CreateParameter("terrain_raise_limit", settings.TerrainRaiseLimit));
parameters.Add(_Database.CreateParameter("terrain_lower_limit", settings.TerrainLowerLimit));
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("sun_position", settings.SunPosition));
parameters.Add(_Database.CreateParameter("sunvectorx", settings.SunVector.X));

View File

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

View File

@ -2157,7 +2157,7 @@ namespace OpenSim.Data.SQLite
row["terrain_raise_limit"] = settings.TerrainRaiseLimit;
row["terrain_lower_limit"] = settings.TerrainLowerLimit;
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["sunvectory"] = settings.SunVector.Y;
row["sunvectorz"] = settings.SunVector.Z;

View File

@ -29,6 +29,7 @@ using System;
using System.Threading;
using System.Collections.Generic;
using System.Text;
using System.Xml;
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
/// sim gets to ReadLine
/// </summary>
public class MockConsole : CommandConsole
{
public MockConsole(string defaultPrompt) : base(defaultPrompt)
{
}
public override void Output(string text)
{
}
public override void Output(string text, string level)
public class MockConsole : ICommandConsole
{
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);
return string.Empty;
}
public override void UnlockOutput()
{
}
public override void LockOutput()
{
}
public void FromXml(XmlElement root, CommandDelegate fn) {}
public List<string> GetHelp(string[] cmd) { return null; }
public void AddCommand(string module, bool shared, string command, string help, string longhelp, CommandDelegate fn) {}
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 XmlElement GetXml(XmlDocument doc) { return null; }
}
}

View File

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

View File

@ -63,77 +63,7 @@ namespace OpenSim.Framework
// a "long" call for warning & debugging purposes
public const int LongCallTime = 500;
// /// <summary>
// /// 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) } };
}
#region JSONRequest
/// <summary>
/// PUT JSON-encoded data to a web service that returns LLSD or
@ -304,6 +234,10 @@ namespace OpenSim.Framework
return result;
}
#endregion JSONRequest
#region FormRequest
/// <summary>
/// POST URL-encoded form data to a web service that returns LLSD or
/// JSON data
@ -399,6 +333,8 @@ namespace OpenSim.Framework
return result;
}
#endregion FormRequest
#region Uri
/// <summary>

View File

@ -150,7 +150,16 @@ namespace OpenSim.Region.CoreModules.Avatar.Profile
string skillsText = 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";
aboutText = string.Empty;
@ -160,7 +169,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Profile
partner = UUID.Zero;
remoteClient.SendAvatarProperties(avatarID, aboutText,
Util.ToDateTime(0).ToString(
Util.ToDateTime(created).ToString(
"M/d/yyyy", CultureInfo.InvariantCulture),
charterMember, firstLifeAboutText,
(uint)(0 & 0xff),

View File

@ -117,7 +117,7 @@ namespace OpenSim.Region.CoreModules.Framework.InventoryAccess
string userAssetServer = string.Empty;
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

@ -1511,11 +1511,11 @@ namespace OpenSim.Region.CoreModules.World.WorldMap
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;
}
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);
try
{

View File

@ -4330,16 +4330,11 @@ namespace OpenSim.Region.Framework.Scenes
public bool PipeEventsForScript(uint localID)
{
SceneObjectPart part = GetSceneObjectPart(localID);
if (part != null)
{
// Changed so that child prims of attachments return ScriptDanger for their parent, so that
// their scripts will actually run.
// -- Leaf, Tue Aug 12 14:17:05 EDT 2008
SceneObjectPart parent = part.ParentGroup.RootPart;
if (part.ParentGroup.IsAttachment)
return ScriptDanger(parent, parent.GetWorldPosition());
else
return ScriptDanger(part, part.GetWorldPosition());
}
else
{

View File

@ -349,13 +349,7 @@ namespace OpenSim.Region.Framework.Scenes
/// </summary>
protected Vector3 m_lastCameraPosition;
protected Vector3 m_CameraPosition;
public Vector3 CameraPosition
{
get { return m_CameraPosition; }
private set { m_CameraPosition = value; }
}
public Vector3 CameraPosition { get; set; }
public Quaternion CameraRotation
{
@ -365,28 +359,9 @@ namespace OpenSim.Region.Framework.Scenes
// Use these three vectors to figure out what the agent is looking at
// Convert it to a Matrix and/or Quaternion
//
protected Vector3 m_CameraAtAxis;
protected Vector3 m_CameraLeftAxis;
protected Vector3 m_CameraUpAxis;
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 CameraAtAxis { get; set; }
public Vector3 CameraLeftAxis { get; set; }
public Vector3 CameraUpAxis { get; set; }
public Vector3 Lookat
{
@ -402,33 +377,15 @@ namespace OpenSim.Region.Framework.Scenes
}
#endregion
public readonly string Firstname;
public readonly string Lastname;
public string Firstname { get; private set; }
public string Lastname { get; private set; }
private string m_grouptitle;
public string Grouptitle
{
get { return m_grouptitle; }
set { m_grouptitle = value; }
}
public string Grouptitle { get; set; }
// Agent's Draw distance.
protected float m_DrawDistance;
public float DrawDistance { get; set; }
public float DrawDistance
{
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; }
}
public bool AllowMovement { get; set; }
private bool m_setAlwaysRun;
@ -455,13 +412,7 @@ namespace OpenSim.Region.Framework.Scenes
}
}
private byte m_state;
public byte State
{
get { return m_state; }
set { m_state = value; }
}
public byte State { get; set; }
private AgentManager.ControlFlags m_AgentControlFlags;
@ -471,29 +422,14 @@ namespace OpenSim.Region.Framework.Scenes
set { m_AgentControlFlags = (AgentManager.ControlFlags)value; }
}
/// <summary>
/// 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 IClientAPI ControllingClient { get; set; }
public IClientCore ClientView
{
get { return (IClientCore) m_controllingClient; }
get { return (IClientCore)ControllingClient; }
}
protected Vector3 m_parentPosition;
public Vector3 ParentPosition
{
get { return m_parentPosition; }
set { m_parentPosition = value; }
}
public Vector3 ParentPosition { get; set; }
/// <summary>
/// Position of this avatar relative to the region the avatar is in
@ -760,7 +696,7 @@ namespace OpenSim.Region.Framework.Scenes
IClientAPI client, Scene world, AvatarAppearance appearance, PresenceType type)
{
AttachmentsSyncLock = new Object();
AllowMovement = true;
IsChildAgent = true;
m_sendCourseLocationsMethod = SendCoarseLocationsDefault;
Animator = new ScenePresenceAnimator(this);
@ -839,17 +775,17 @@ namespace OpenSim.Region.Framework.Scenes
private Vector3[] GetWalkDirectionVectors()
{
Vector3[] vector = new Vector3[11];
vector[0] = new Vector3(m_CameraUpAxis.Z, 0f, -m_CameraAtAxis.Z); //FORWARD
vector[1] = new Vector3(-m_CameraUpAxis.Z, 0f, m_CameraAtAxis.Z); //BACK
vector[0] = new Vector3(CameraUpAxis.Z, 0f, -CameraAtAxis.Z); //FORWARD
vector[1] = new Vector3(-CameraUpAxis.Z, 0f, CameraAtAxis.Z); //BACK
vector[2] = Vector3.UnitY; //LEFT
vector[3] = -Vector3.UnitY; //RIGHT
vector[4] = new Vector3(m_CameraAtAxis.Z, 0f, m_CameraUpAxis.Z); //UP
vector[5] = new Vector3(-m_CameraAtAxis.Z, 0f, -m_CameraUpAxis.Z); //DOWN
vector[6] = new Vector3(m_CameraUpAxis.Z, 0f, -m_CameraAtAxis.Z); //FORWARD_NUDGE
vector[7] = new Vector3(-m_CameraUpAxis.Z, 0f, m_CameraAtAxis.Z); //BACK_NUDGE
vector[4] = new Vector3(CameraAtAxis.Z, 0f, CameraUpAxis.Z); //UP
vector[5] = new Vector3(-CameraAtAxis.Z, 0f, -CameraUpAxis.Z); //DOWN
vector[6] = new Vector3(CameraUpAxis.Z, 0f, -CameraAtAxis.Z); //FORWARD_NUDGE
vector[7] = new Vector3(-CameraUpAxis.Z, 0f, CameraAtAxis.Z); //BACK_NUDGE
vector[8] = Vector3.UnitY; //LEFT_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;
}
@ -1380,7 +1316,7 @@ namespace OpenSim.Region.Framework.Scenes
// Convert it to a Matrix and/or Quaternion
CameraAtAxis = agentData.CameraAtAxis;
CameraLeftAxis = agentData.CameraLeftAxis;
m_CameraUpAxis = agentData.CameraUpAxis;
CameraUpAxis = agentData.CameraUpAxis;
// The Agent's Draw distance setting
// When we get to the point of re-computing neighbors everytime this
@ -1392,7 +1328,7 @@ namespace OpenSim.Region.Framework.Scenes
// Check if Client has camera in 'follow cam' or 'build' mode.
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;
m_mouseLook = (flags & AgentManager.ControlFlags.AGENT_CONTROL_MOUSELOOK) != 0;
@ -3158,7 +3094,7 @@ namespace OpenSim.Region.Framework.Scenes
cAgent.Center = CameraPosition;
cAgent.AtAxis = CameraAtAxis;
cAgent.LeftAxis = CameraLeftAxis;
cAgent.UpAxis = m_CameraUpAxis;
cAgent.UpAxis = CameraUpAxis;
cAgent.Far = DrawDistance;
@ -3247,7 +3183,7 @@ namespace OpenSim.Region.Framework.Scenes
CameraPosition = cAgent.Center;
CameraAtAxis = cAgent.AtAxis;
CameraLeftAxis = cAgent.LeftAxis;
m_CameraUpAxis = cAgent.UpAxis;
CameraUpAxis = cAgent.UpAxis;
ParentUUID = cAgent.ParentPart;
m_prevSitOffset = cAgent.SitOffset;

View File

@ -65,8 +65,7 @@ namespace OpenSim.Region.Framework.Tests
// Create an object embedded inside the first
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);
Assert.That(addedItem.ItemID, Is.EqualTo(taskSceneObjectItemId));

View File

@ -4450,7 +4450,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
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.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.ScheduleGroupForFullUpdate();
}

View File

@ -2169,6 +2169,31 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
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()
{
CheckThreatLevel(ThreatLevel.Low, "osLoadedCreationDate");

View File

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

View File

@ -165,6 +165,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api.Interfaces
LSL_String osFormatString(string str, LSL_List strings);
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
string osLoadedCreationDate();

View File

@ -472,6 +472,12 @@ namespace OpenSim.Region.ScriptEngine.Shared.ScriptBase
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
public string osLoadedCreationDate()
{

View File

@ -224,14 +224,12 @@ namespace OpenSim.Region.UserStatistics
concurrencyCounter--;
response_code = 200;
}
else
{
strOut = MainServer.Instance.GetHTTP404("");
}
responsedata["int_response_code"] = response_code;
responsedata["content_type"] = contenttype;
responsedata["keepalive"] = false;
@ -247,8 +245,8 @@ namespace OpenSim.Region.UserStatistics
// TODO: FIXME: implement stats migrations
const string SQL = @"SELECT * FROM migrations LIMIT 1";
SqliteCommand cmd = new SqliteCommand(SQL, db);
using (SqliteCommand cmd = new SqliteCommand(SQL, db))
{
try
{
cmd.ExecuteNonQuery();
@ -259,31 +257,32 @@ namespace OpenSim.Region.UserStatistics
}
}
}
}
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.CommandText = SQL_MIGRA_TABLE_CREATE;
createcmd.ExecuteNonQuery();
}
}
public virtual void PostInitialise()
{
if (!enabled)
{
return;
}
AddHandlers();
}
public virtual void Close()
{
if (!enabled)
{
return;
}
dbConn.Close();
dbConn.Dispose();
m_sessions.Clear();
@ -304,7 +303,8 @@ namespace OpenSim.Region.UserStatistics
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();
caps.RegisterHandler("ViewerStats",
new RestStreamHandler("POST", capsPath,
@ -318,7 +318,6 @@ namespace OpenSim.Region.UserStatistics
public void OnDeRegisterCaps(UUID agentID, Caps caps)
{
}
protected virtual void AddHandlers()
@ -368,7 +367,6 @@ namespace OpenSim.Region.UserStatistics
public void OnMakeChildAgent(ScenePresence agent)
{
}
public void OnClientClosed(UUID agentID, Scene scene)
@ -430,6 +428,7 @@ namespace OpenSim.Region.UserStatistics
return scene.RegionInfo.RegionID;
}
}
return UUID.Zero;
}
@ -458,14 +457,14 @@ namespace OpenSim.Region.UserStatistics
UserSessionData usd;
OSD message = OSDParser.DeserializeLLSDXml(request);
OSDMap mmap;
lock (m_sessions)
{
if (agentID != UUID.Zero)
{
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();
}
uid = m_sessions[agentID];
@ -585,8 +584,6 @@ namespace OpenSim.Region.UserStatistics
usd.n_out_kb = (float)net_out["kbytes"].AsReal();
usd.n_out_pk = net_out["packets"].AsInteger();
}
}
}
@ -602,7 +599,8 @@ namespace OpenSim.Region.UserStatistics
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(":agent_id", uid.session_data.agent_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(":agent_key", uid.session_data.agent_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();
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;
try
{
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

@ -113,7 +113,7 @@ namespace OpenSim.Tests.Common
Console.WriteLine("Setting up test scene {0}", name);
// 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");
regInfo.RegionName = name;

View File

@ -420,6 +420,8 @@ namespace pCampBot
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 (OnConnected != null)
@ -431,10 +433,15 @@ namespace pCampBot
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)
{
m_log.DebugFormat(
"[BOT]: Bot {0} disconnected reason {1}, message {2}", Name, args.Reason, args.Message);
// m_log.ErrorFormat("Fired Network_OnDisconnected");
// if (

View File

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

View File

@ -56,6 +56,10 @@ namespace pCampBot
{
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
{
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.
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.